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7Ds8B,MAAO0oH,WACPpnE,UAAYjvD,GAAM,GAAGA,IAAI63D,MAEvBguF,EAAUD,EAAe,OACzBE,EAAUF,EAAe,KACzB1f,EAAK0f,EAAe,MACpBxf,EAAKwf,EAAe,MACpBzf,EAAKyf,EAAe,MACpBG,EAAqBj0K,OAAO6Z,OAAO7Z,OAAO6Z,OAAO,GAAIm6J,GAAU,CAAEn4I,MAAQ3N,GAAM8lJ,EAAQn4I,MAAM3N,GAAK,IAAKivD,UAAYjvD,GAAM8lJ,EAAQ72F,UAAc,IAAJjvD,M,2LCZjJ,MAAM8hF,EAAQ,CAAClmG,EAAKid,IAASmH,GAAMnkB,KAAKgd,IAAIhd,KAAKD,IAAIokB,EAAGnH,GAAMjd,GACxDoqK,EAAYhmJ,GAAOA,EAAI,EAAItK,OAAOsK,EAAEs6C,QAAQ,IAAMt6C,EAClDimJ,EAAa,uBACbC,EAAa,gHACbC,EAAmB,oGACzB,SAASC,EAASpmJ,GACd,MAAoB,kBAANA,K","sources":["webpack://_N_E/../src/utils/errors.ts","webpack://_N_E/../src/utils/common.ts","webpack://_N_E/../src/utils/plugins.ts","webpack://_N_E/../src/core/scope.ts","webpack://_N_E/../src/core/finalize.ts","webpack://_N_E/../src/core/proxy.ts","webpack://_N_E/../src/core/immerClass.ts","webpack://_N_E/../src/core/current.ts","webpack://_N_E/../src/plugins/es5.ts","webpack://_N_E/../src/immer.ts","webpack://_N_E/../src/utils/env.ts","webpack://_N_E/../../node_modules/redux-thunk/es/index.js","webpack://_N_E/../src/devtoolsExtension.ts","webpack://_N_E/../src/isPlainObject.ts","webpack://_N_E/../src/utils.ts","webpack://_N_E/../src/getDefaultMiddleware.ts","webpack://_N_E/../src/configureStore.ts","webpack://_N_E/../src/createAction.ts","webpack://_N_E/../src/mapBuilders.ts","webpack://_N_E/../src/createSlice.ts","webpack://_N_E/../src/createReducer.ts","webpack://_N_E/../src/nanoid.ts","webpack://_N_E/../src/listenerMiddleware/utils.ts","webpack://_N_E/../src/listenerMiddleware/exceptions.ts","webpack://_N_E/../src/listenerMiddleware/task.ts","webpack://_N_E/../src/listenerMiddleware/index.ts","webpack://_N_E/../src/index.ts","webpack://_N_E/../history.ts","webpack://_N_E/../utils.ts","webpack://_N_E/../router.ts","webpack://_N_E/../../node_modules/base64-js/index.js","webpack://_N_E/../../node_modules/buffer/index.js","webpack://_N_E/../../node_modules/detect-node/browser.js","webpack://_N_E/../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack://_N_E/../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","webpack://_N_E/../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","webpack://_N_E/../../node_modules/ieee754/index.js","webpack://_N_E/../../node_modules/isarray/index.js","webpack://_N_E/../../libs/apiservice/src/lib/api/interface/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/interface/mediaDiff.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/auth.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/auth.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/db/index.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/settings.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/env.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/log.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/mediaDiff.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/mediaDiff.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/media.download.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/media.util.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/mediaVTS.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/mediaVTS.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/siteData.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/impl/siteData.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/api/private/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/interface/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/auth.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/auth.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/media.download.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/media.util.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/media.filter.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/media.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/media.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/userState.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/impl/userState.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/private/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/schema.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/1.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/ScreenOrientationDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/2.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/3.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/4.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/5.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/6.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/versions.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/migration/index.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/private/isEntity.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/private/apply.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/private/mapping.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/private/create.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BackgroundModeDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BackgroundModeDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BackgroundModeDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconSensitivityDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconSensitivityDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconSensitivityDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/CountryDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/CountryDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/CountryDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/DeviceAccountDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/DeviceAccountDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanTourDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanTourDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanTranslationDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanTranslationDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontAlignmentDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontAlignmentDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontAlignmentDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontFamilyDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontFamilyDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontFamilyDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontSizeUnitDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontSizeUnitDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontSizeUnitDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontStyleDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontStyleDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontStyleDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/LanguageDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/LanguageDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/LanguageDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/Legacy_FloorPlanDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MediumDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MediumDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemKeywordDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemKeywordDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemTranslationDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemTranslationDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/PinTypeDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/PinTypeDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/PinTypeDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/RoleDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/RoleDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/ScreenOrientationDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/ScreenOrientationDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectKeywordDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectKeywordDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectOnFloorPlanDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectOnFloorPlanDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTranslationDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTranslationDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTypeDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTypeDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTypeDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteSupportedLanguageDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteSupportedLanguageDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/StyleDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/StyleDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourMenuItemDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourMenuItemDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourRelatedSiteObjectDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourRelatedSiteObjectDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourStatusDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourStatusDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourStatusDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourSubTypeDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourSubTypeDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourSupportedLanguageDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourSupportedLanguageDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTranslationDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTranslationDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTypeDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTypeDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTypeDto.private.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/UserDto.link.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/UserDto.map.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/UserDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/util/instantiator.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BackgroundModeDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/BeaconSensitivityDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/CountryDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/DeviceAccountDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanTourDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FloorPlanTranslationDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontFamilyDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontStyleDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontSizeUnitDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/FontAlignmentDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/LanguageDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MediumDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemKeywordDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/MenuItemTranslationDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/PinTypeDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/RoleDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/ScreenOrientationDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectOnFloorPlanDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectKeywordDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTranslationDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteObjectTypeDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/SiteSupportedLanguageDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/StyleDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourMenuItemDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourRelatedSiteObjectDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourStatusDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourSubTypeDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTranslationDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourTypeDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/TourSupportedLanguageDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/impl/Legacy_FloorPlanDto.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/impl/table.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/impl/db.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/impl/instantiator.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/impl/instantiator.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/private/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/delete.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/delete.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/download.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/download.bind.ts","webpack://_N_E/../../node_modules/fast-json-patch/module/helpers.mjs","webpack://_N_E/../../node_modules/fast-json-patch/module/core.mjs","webpack://_N_E/../../node_modules/fast-json-patch/module/duplex.mjs","webpack://_N_E/../../node_modules/fast-json-patch/index.mjs","webpack://_N_E/../../libs/apiservice/src/lib/jobs/private/patch/apply.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/private/patch/storage.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/private/patch/index.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/updateSite/dbupdate.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/updateSite/patchMap.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/updateSite/util.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/updateSite/updateSite.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/updateSite/updateSite.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/impl/index.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/private/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/util/instantiator.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/private/db.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/session.serialize.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/session.build.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/session.cache.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/session.callback.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/session.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/session.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/private/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/impl/cache.util.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/impl/cache.source.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/impl/cache.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/impl/cache.bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/private/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/controller/interface/userstate.ts","webpack://_N_E/../../libs/apiservice/src/lib/db/interface/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/jobs/interface/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/model/interface/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/util/array.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/util/languages.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/util/promise.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/util/tours.ts","webpack://_N_E/../../libs/apiservice/src/lib/private/util/index.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/interface/bind.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/sessionHooks.ts","webpack://_N_E/../../libs/apiservice/src/lib/session/impl/modelHooks.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/mediumType.ts","webpack://_N_E/../../libs/apiservice/src/lib/util/interface/bind.ts","webpack://_N_E/../../libs/app-common/src/lib/analytics/CookieView.style.ts","webpack://_N_E/../../libs/app-common/src/lib/analytics/CookieView.tsx","webpack://_N_E/../../libs/app-common/src/lib/analytics/settings.ts","webpack://_N_E/../../libs/app-common/src/lib/analytics/util.ts","webpack://_N_E/../../libs/app-common/src/lib/analytics/Analytics.tsx","webpack://_N_E/../../libs/app-common/src/lib/history/action.ts","webpack://_N_E/../../libs/app-common/src/lib/history/private.ts","webpack://_N_E/../../libs/app-common/src/lib/history/interface.ts","webpack://_N_E/../../libs/app-common/src/lib/history/tracking.ts","webpack://_N_E/../../libs/app-common/src/lib/history/bind.ts","webpack://_N_E/../../libs/app-common/src/lib/router/private.ts","webpack://_N_E/../../libs/app-common/src/lib/router/router.ts","webpack://_N_E/../../libs/app-common/src/lib/router/bind.ts","webpack://_N_E/../../libs/app-common/src/lib/router/interface.ts","webpack://_N_E/../../libs/app-common/src/lib/bind.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/state/constants.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/state/reducers.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/state/slice.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/state/store.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/state/actions.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/state/index.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/AppIconView.tsx","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/InstallBannerView.style.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/SubHeadingView.tsx","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/InstallBannerView.tsx","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/MainView.style.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/MainView.tsx","webpack://_N_E/../../libs/app-common/src/lib/a2hs/bind.tsx","webpack://_N_E/../../libs/app-common/src/lib/a2hs/util/hook.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/interface.ts","webpack://_N_E/../../libs/app-common/src/lib/a2hs/private.ts","webpack://_N_E/../../libs/appstate/src/lib/interface.ts","webpack://_N_E/../../libs/appstate/src/lib/middleware/effect.ts","webpack://_N_E/../../libs/appstate/src/lib/middleware/interceptor.ts","webpack://_N_E/../../libs/appstate/src/lib/middleware/logger.ts","webpack://_N_E/../../libs/appstate/src/lib/middleware/builder.ts","webpack://_N_E/../../libs/appstate/src/lib/middleware/binder.ts","webpack://_N_E/../../libs/appstate/src/lib/reducer/register.ts","webpack://_N_E/../../libs/appstate/src/lib/reducer/binder.ts","webpack://_N_E/../../libs/appstate/src/lib/render/StoreRender.tsx","webpack://_N_E/../../libs/appstate/src/lib/render/binder.ts","webpack://_N_E/../../libs/appstate/src/lib/store/store.ts","webpack://_N_E/../../libs/appstate/src/lib/store/binder.ts","webpack://_N_E/../../libs/appstate/src/lib/private/bind.ts","webpack://_N_E/../../libs/di/src/lib/private/env.ts","webpack://_N_E/../../libs/di/src/lib/private/settings.ts","webpack://_N_E/../../libs/di/src/lib/private/log.ts","webpack://_N_E/../../libs/di/src/lib/private/globalStorage.ts","webpack://_N_E/../../libs/di/src/lib/private/index.ts","webpack://_N_E/../../libs/di/src/lib/impl/binder.ts","webpack://_N_E/../../libs/di/src/lib/impl/binderListings.ts","webpack://_N_E/../../libs/di/src/lib/impl/container.ts","webpack://_N_E/../../libs/di/src/lib/impl/binderRegistry.ts","webpack://_N_E/../../libs/di/src/lib/impl/globalContainerRegistry.ts","webpack://_N_E/../../libs/di/src/lib/util/creation.ts","webpack://_N_E/../../libs/ui-common/src/lib/alert/PopUpView.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/alert/PopUpView.tsx","webpack://_N_E/../../libs/ui-common/src/lib/alert/Toast.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/alert/Toast.tsx","webpack://_N_E/../../libs/ui-common/src/lib/button/HighlightableButton.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/button/HighlightableButton.tsx","webpack://_N_E/../../libs/ui-common/src/lib/button/ToggleSwitch.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/button/ToggleSwitch.tsx","webpack://_N_E/../../libs/ui-common/src/lib/hoc/withScrollRestore.store.ts","webpack://_N_E/../../libs/ui-common/src/lib/hoc/withScrollRestore.tsx","webpack://_N_E/../../libs/ui-common/src/lib/hooks/useIsOnline.ts","webpack://_N_E/../../libs/ui-common/src/lib/hooks/useWindowSize.ts","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconExclamation.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconInfo.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconPlay.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconQuestionMark.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconTick.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconAppleShare.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconChevronLeft.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconChevronRight.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconCross.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconDot.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconHamburger.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconMapMarker.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconMinus.tsx","webpack://_N_E/../../libs/ui-common/src/lib/icon/IconPlus.tsx","webpack://_N_E/../../libs/ui-common/src/lib/misc/AwaitOnlineRender.tsx","webpack://_N_E/../../libs/ui-common/src/lib/misc/DelayedRender.tsx","webpack://_N_E/../../libs/ui-common/src/lib/misc/DimOverlay.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/misc/DimOverlay.tsx","webpack://_N_E/../../libs/ui-common/src/lib/misc/Image.interface.ts","webpack://_N_E/../../libs/ui-common/src/lib/misc/Image.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/private/log.ts","webpack://_N_E/../../libs/ui-common/src/lib/misc/Image.tsx","webpack://_N_E/../../libs/ui-common/src/lib/misc/SuspenseWrapper.tsx","webpack://_N_E/../node_modules/tslib/tslib.es6.js","webpack://_N_E/../src/utils/calculations.utils.ts","webpack://_N_E/../src/utils/callback.utils.ts","webpack://_N_E/../src/core/animations/animations.constants.ts","webpack://_N_E/../src/core/animations/animations.utils.ts","webpack://_N_E/../src/core/bounds/bounds.utils.ts","webpack://_N_E/../src/core/zoom/zoom.utils.ts","webpack://_N_E/../src/core/pan/panning.utils.ts","webpack://_N_E/../src/core/pan/velocity.utils.ts","webpack://_N_E/../src/core/pan/velocity.logic.ts","webpack://_N_E/../src/core/pan/panning.logic.ts","webpack://_N_E/../src/core/zoom/zoom.logic.ts","webpack://_N_E/../src/constants/state.constants.ts","webpack://_N_E/../src/utils/state.utils.ts","webpack://_N_E/../src/core/handlers/handlers.utils.ts","webpack://_N_E/../src/core/handlers/handlers.logic.ts","webpack://_N_E/../src/utils/context.utils.ts","webpack://_N_E/../src/utils/event.utils.ts","webpack://_N_E/../src/utils/helpers.utils.ts","webpack://_N_E/../src/utils/styles.utils.ts","webpack://_N_E/../src/core/wheel/wheel.utils.ts","webpack://_N_E/../src/core/pinch/pinch.utils.ts","webpack://_N_E/../src/core/wheel/wheel.logic.ts","webpack://_N_E/../src/core/pinch/pinch.logic.ts","webpack://_N_E/../src/core/double-click/double-click.logic.ts","webpack://_N_E/../src/components/transform-context.tsx","webpack://_N_E/../src/components/transform-wrapper.tsx","webpack://_N_E/../node_modules/style-inject/dist/style-inject.es.js","webpack://_N_E/../src/components/transform-component.tsx","webpack://_N_E/../../libs/ui-common/src/lib/misc/ZoomPanPinch.tsx","webpack://_N_E/../../libs/ui-common/src/lib/nav/BackLink.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/nav/BackLink.tsx","webpack://_N_E/../../libs/ui-common/src/lib/pagination/PageControl.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/pagination/PageControl.tsx","webpack://_N_E/../../libs/ui-common/src/lib/private/env.ts","webpack://_N_E/../../libs/ui-common/src/lib/private/settings.ts","webpack://_N_E/../../libs/ui-common/src/lib/private/storage.ts","webpack://_N_E/../../libs/ui-common/src/lib/progress/BufferingWheel.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/progress/BufferingWheel.tsx","webpack://_N_E/../../libs/ui-common/src/lib/progress/Loading.tsx","webpack://_N_E/../../libs/ui-common/src/lib/progress/LoadingAnimationView.tsx","webpack://_N_E/../../libs/ui-common/src/lib/progress/ProgressBar.style.ts","webpack://_N_E/../../libs/ui-common/src/lib/progress/ProgressBar.tsx","webpack://_N_E/../../libs/ui-common/src/lib/transition/FadeTransition.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/common/byteSizeToDescription.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/common/loader.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/common/usePreviousPosition.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/state/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/state/reducer.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/state/slice.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/state/actions.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/state/store.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/state/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/util/dialog.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/util/translate.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/util/toast.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/util/onAccept.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/util/onDecline.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/util/session.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/views/ProgressBar.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/bind.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/delete-tour/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/state/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/util/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/util/message.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/state/reducers.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/state/slice.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/state/store.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/state/actions.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/state/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/views/RootView.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/bind.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/dialog/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/state/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/state/reducer.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/state/slice.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/state/actions.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/state/store.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/state/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/dialog.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/translate.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/media.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/quota.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/toast.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/onAccept.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/onDecline.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/util/session.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/views/ProgressBar.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/bind.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/download-language/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/state/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/state/reducer.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/state/slice.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/state/actions.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/state/store.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/state/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/dialog.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/quota.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/media.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/translate.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/toast.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/onAccept.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/onDecline.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/util/session.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/views/ProgressBar.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/bind.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/download-tour/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/ItemView.style.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/MarkerView.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/ItemView.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/MainView.style.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/MainView.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/languageselect/index.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/languageselect/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/state/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/state/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/util/events.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/util/translate.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/util/toast.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/bind.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/offline-alert/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/siteobject/index.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/siteobject/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/state/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/state/reducers.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/state/slice.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/state/actions.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/state/store.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/state/index.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/AllMessages.style.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/Toast.constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/util/conversion.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/Toast.style.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/Toast.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/Message.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/AllMessages.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/bind.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/util/constants.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/util/isShowing.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/tour/index.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/tour/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/tourselect/interface.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/tourselect/index.tsx","webpack://_N_E/../../libs/util/src/impl/log.if.ts","webpack://_N_E/../../libs/util/src/interface/browser.ts","webpack://_N_E/../../libs/util/src/interface/cache.ts","webpack://_N_E/../../libs/util/src/interface/config.ts","webpack://_N_E/../../libs/util/src/interface/env.ts","webpack://_N_E/../../libs/util/src/interface/featureQuery.ts","webpack://_N_E/../../libs/util/src/interface/fetch.ts","webpack://_N_E/../../libs/util/src/interface/overrides.ts","webpack://_N_E/../../libs/util/src/interface/kvStorage.ts","webpack://_N_E/../../libs/util/src/interface/log.ts","webpack://_N_E/../../libs/util/src/interface/mimeType.ts","webpack://_N_E/../../libs/util/src/interface/promise.ts","webpack://_N_E/../../libs/util/src/interface/query.ts","webpack://_N_E/../../libs/util/src/interface/translationStorage.ts","webpack://_N_E/../../libs/util/src/interface/zip.ts","webpack://_N_E/../../libs/util/src/impl/browser.ts","webpack://_N_E/../../libs/util/src/impl/browser.bind.ts","webpack://_N_E/../../libs/util/src/impl/cache.ts","webpack://_N_E/../../libs/util/src/impl/cache.bind.ts","webpack://_N_E/../../libs/util/src/impl/cachecontroller.ts","webpack://_N_E/../../libs/util/src/impl/cachecontroller.bind.ts","webpack://_N_E/../../libs/util/src/impl/env.ts","webpack://_N_E/../../libs/util/src/impl/env.bind.ts","webpack://_N_E/../../libs/util/src/impl/featureQuery.ts","webpack://_N_E/../../libs/util/src/impl/featureQuery.bind.ts","webpack://_N_E/../../libs/util/src/impl/fetch.bind.ts","webpack://_N_E/../../libs/util/src/impl/kvstorage.ts","webpack://_N_E/../../libs/util/src/impl/kvStorage.bind.ts","webpack://_N_E/../../libs/util/src/impl/log.ts","webpack://_N_E/../../libs/util/src/impl/log.bind.ts","webpack://_N_E/../../libs/util/src/impl/mimeType.ts","webpack://_N_E/../../libs/util/src/impl/mimeType.bind.ts","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/classPrivateFieldSet.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/classApplyDescriptorSet.js","webpack://_N_E/../../node_modules/p-times/node_modules/escape-string-regexp/index.js","webpack://_N_E/../../node_modules/p-times/node_modules/clean-stack/index.js","webpack://_N_E/../../node_modules/p-times/node_modules/aggregate-error/index.js","webpack://_N_E/../../node_modules/p-times/node_modules/indent-string/index.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/classPrivateFieldGet.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/classApplyDescriptorGet.js","webpack://_N_E/../../node_modules/p-times/node_modules/p-map/index.js","webpack://_N_E/../../node_modules/p-times/index.js","webpack://_N_E/../../node_modules/p-progress/index.js","webpack://_N_E/../../libs/util/src/impl/promise.ts","webpack://_N_E/../../libs/util/src/impl/promise.bind.ts","webpack://_N_E/../../libs/util/src/impl/querystring.ts","webpack://_N_E/../../libs/util/src/impl/querystring.bind.ts","webpack://_N_E/../../libs/util/src/impl/translationstorage.bind.ts","webpack://_N_E/../../libs/util/src/impl/zip.bind.ts","webpack://_N_E/../../libs/util/src/private/bind.ts","webpack://_N_E/../../libs/util/src/util/arrayBuffer.ts","webpack://_N_E/../../libs/util/src/util/buffer.ts","webpack://_N_E/../../libs/util/src/util/hook.ts","webpack://_N_E/../../libs/util/src/util/ReactUseStateWithUpdate.ts","webpack://_N_E/../../libs/util/src/util/function.ts","webpack://_N_E/../../libs/util/src/util/object.ts","webpack://_N_E/../../libs/util/src/util/string.ts","webpack://_N_E/../../libs/util/src/util/url.ts","webpack://_N_E/../../libs/util/src/util/math.ts","webpack://_N_E/../../libs/util/src/util/promise.ts","webpack://_N_E/../../libs/util/src/util/types.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/instantiator.ts","webpack://_N_E/../../libs/worker/src/lib/client/interface/controller.ts","webpack://_N_E/../../libs/worker/src/lib/client/interface/worker.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/dispatch.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/host.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/registration.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/rules.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/worker.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/controller.ts","webpack://_N_E/../../libs/worker/src/lib/client/impl/controller.bind.ts","webpack://_N_E/../../libs/worker/src/lib/client/bind.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/cacheFirst.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/cacheFirst.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/cacheOAuth.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/cacheOAuth.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/fetchToCache.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/fetchToCache.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/headerAppend.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/headerAppend.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/keepAlive.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/keepAlive.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/logDiagnostics.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/logDiagnostics.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/preCache.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/preCache.ts","webpack://_N_E/../../libs/worker/src/lib/message/interface/zipPathRelative.ts","webpack://_N_E/../../libs/worker/src/lib/message/impl/zipPathRelative.ts","webpack://_N_E/../../libs/worker/src/lib/message/util/instantiator.ts","webpack://_N_E/../../libs/worker/src/lib/message/util/instantiator.bind.ts","webpack://_N_E/../../libs/worker/src/lib/message/bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/cache.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/cache.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/callback.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/callback.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/callback.bind.ts","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/util.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/methods/native.js","webpack://_N_E/../../src/index.ts","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/options.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/methods/indexed-db.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/methods/localstorage.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/methods/simulate.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/method-chooser.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/broadcast-channel.js","webpack://_N_E/../../node_modules/unload/dist/es/browser.js","webpack://_N_E/../../node_modules/unload/dist/es/index.js","webpack://_N_E/../../node_modules/broadcast-channel/dist/esbrowser/leader-election.js","webpack://_N_E/../../libs/worker/src/lib/util/impl/channel.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/channel.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/log.if.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/fetch.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/fetch.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/log.console.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/log.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/log.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/regex.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/regex.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/requestJSON.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/requestJSON.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/responseJSON.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/responseJSON.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/settingsStorage.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/zip.ts","webpack://_N_E/../../libs/worker/src/lib/util/impl/zip.bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/bind.ts","webpack://_N_E/../../libs/worker/src/lib/bind.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/cache.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/channel.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/fetch.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/regex.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/requestSerializer.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/responseSerializer.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/settingsStorage.ts","webpack://_N_E/../../libs/worker/src/lib/util/interface/types.ts","webpack://_N_E/../../node_modules/next/head.js","webpack://_N_E/../../node_modules/next/link.js","webpack://_N_E/../../node_modules/process/browser.js","webpack://_N_E/../../node_modules/react-fast-compare/index.js","webpack://_N_E/../../node_modules/react-ga4/dist/format.js","webpack://_N_E/../../node_modules/react-ga4/dist/ga4.js","webpack://_N_E/../../node_modules/react-ga4/dist/gtag.js","webpack://_N_E/../../node_modules/react-ga4/dist/index.js","webpack://_N_E/../../node_modules/react-is/cjs/react-is.production.min.js","webpack://_N_E/../../node_modules/react-is/index.js","webpack://_N_E/../../node_modules/react-redux/es/components/Context.js","webpack://_N_E/../../node_modules/react-redux/es/utils/batch.js","webpack://_N_E/../../node_modules/react-redux/es/utils/Subscription.js","webpack://_N_E/../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","webpack://_N_E/../../node_modules/react-redux/es/components/Provider.js","webpack://_N_E/../../node_modules/react-redux/es/hooks/useReduxContext.js","webpack://_N_E/../../node_modules/react-redux/es/hooks/useDispatch.js","webpack://_N_E/../../node_modules/react-redux/es/hooks/useSelector.js","webpack://_N_E/../../node_modules/react-redux/es/index.js","webpack://_N_E/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://_N_E/../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","webpack://_N_E/../../node_modules/redux/es/redux.js","webpack://_N_E/../../node_modules/tslib/tslib.es6.js","webpack://_N_E/../../node_modules/unzipit/dist/unzipit.module.js","webpack://_N_E/../../libs/ui-workspace/src/lib/bind.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/launch/MainView.style.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/launch/index.tsx","webpack://_N_E/../../libs/ui-workspace/src/lib/common/LazyResolver.tsx","webpack://_N_E/../../node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs","webpack://_N_E/./src/components/AnalyticsWrapper.tsx","webpack://_N_E/./src/utils/config/api.ts","webpack://_N_E/../../libs/ui-workspace/src/lib/common/asset.ts","webpack://_N_E/./src/utils/config/asset.image.ts","webpack://_N_E/./src/utils/config/asset.ts","webpack://_N_E/./src/utils/config/cache.ts","webpack://_N_E/./src/utils/config/log.ts","webpack://_N_E/./src/utils/config/manifest.ts","webpack://_N_E/./src/utils/config/index.ts","webpack://_N_E/./src/utils/tourDataResolver.bind.ts","webpack://_N_E/./src/utils/bindables.ts","webpack://_N_E/./src/utils/bind.ts","webpack://_N_E/./src/components/ContainerProvider.tsx","webpack://_N_E/./src/private/env.ts","webpack://_N_E/./src/private/settings.ts","webpack://_N_E/./src/private/log.ts","webpack://_N_E/./src/pages/_app.tsx","webpack://_N_E/./src/utils/container.ts","webpack://_N_E/./src/utils/siteConfig.ts","webpack://_N_E/./src/utils/siteData.ts","webpack://_N_E/./src/utils/tourDataResolver.if.ts","webpack://_N_E/./src/utils/tourDataResolver.ts","webpack://_N_E/../../node_modules/next/dist/client/link.js","webpack://_N_E/../../node_modules/next/dist/client/use-intersection.js","webpack://_N_E/../../node_modules/next/dist/shared/lib/amp-context.js","webpack://_N_E/../../node_modules/next/dist/shared/lib/amp.js","webpack://_N_E/../../node_modules/next/dist/shared/lib/head.js","webpack://_N_E/../../node_modules/next/dist/shared/lib/side-effect.js","webpack://_N_E/?253d","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/InstallBannerView.module.css","webpack://_N_E/../../libs/app-common/src/lib/a2hs/views/MainView.module.css","webpack://_N_E/../../libs/app-common/src/lib/analytics/CookieView.module.css","webpack://_N_E/../../libs/ui-common/src/lib/alert/PopUpView.module.css","webpack://_N_E/../../libs/ui-common/src/lib/button/HighlightableButton.module.css","webpack://_N_E/../../libs/ui-common/src/lib/button/ToggleSwitch.module.css","webpack://_N_E/../../libs/ui-common/src/lib/misc/DimOverlay.module.css","webpack://_N_E/../../libs/ui-common/src/lib/misc/Image.module.css","webpack://_N_E/../../libs/ui-common/src/lib/misc/ZoomPanPinch.module.css","webpack://_N_E/../../libs/ui-common/src/lib/nav/BackLink.module.css","webpack://_N_E/../../libs/ui-common/src/lib/pagination/PageControl.module.css","webpack://_N_E/../../libs/ui-common/src/lib/progress/BufferingWheel.module.css","webpack://_N_E/../../libs/ui-common/src/lib/progress/ProgressBar.module.css","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/ItemView.module.css","webpack://_N_E/../../libs/ui-workspace/src/lib/floorplan/MainView.module.css","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/AllMessages.module.css","webpack://_N_E/../../libs/ui-workspace/src/lib/toast/views/Toast.module.css","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/classCallCheck.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/createClass.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/defineProperty.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/inherits.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/slicedToArray.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/nonIterableRest.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/iterableToArray.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/typeof.js","webpack://_N_E/../../node_modules/next/dist/compiled/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://_N_E/../../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/LazyContext.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/PresenceContext.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/definitions.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/clamp.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/utils/find-spring.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/generators/spring.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/progress.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/mix.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/color/utils.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/color/rgba.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/color/hex.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/color/hsla.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/hsla-to-rgba.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/mix-color.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/color/index.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/complex/index.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/pipe.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/mix-complex.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/inc.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/interpolate.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/easing/utils.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/easing/index.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/generators/keyframes.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/generators/decay.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/utils/elapsed.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/index.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/utils/velocity-per-second.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/time-conversion.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/easing/cubic-bezier.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/animation/utils/easing.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/complex/filter.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/animation/utils/transitions.mjs","webpack://_N_E/../../node_modules/popmotion/dist/es/animations/inertia.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/subscription-manager.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/array.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/value/index.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/types.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/setters.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/animation.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/animations.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/events/use-dom-event.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/gestures/utils/event-type.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/events/event-info.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/events/use-pointer-event.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/events/utils.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/gestures/use-hover-gesture.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/viewport/use-viewport.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/gestures.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/gestures/use-tap-gesture.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/gestures/use-focus-gesture.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/lifecycles.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/index.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/projection/utils/measure.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/visual-element.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/visual-element.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/features-animation.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/use-features.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/projection/node/id.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/VisualElementHandler.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/index.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/features/use-projection.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/use-props.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/config-motion.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/config-motion.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/motion-minimal.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/utils/render.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/html/utils/transform.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/render/utils/variants.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/is-browser.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/resolve-value.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/use-constant.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/use-force-update.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs","webpack://_N_E/../../node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs","webpack://_N_E/../../node_modules/framesync/dist/es/on-next-frame.mjs","webpack://_N_E/../../node_modules/framesync/dist/es/index.mjs","webpack://_N_E/../../node_modules/framesync/dist/es/create-render-step.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/numbers/index.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/numbers/units.mjs","webpack://_N_E/../../node_modules/style-value-types/dist/es/utils.mjs"],"sourcesContent":["const errors = {\n\t0: \"Illegal state\",\n\t1: \"Immer drafts cannot have computed properties\",\n\t2: \"This object has been frozen and should not be mutated\",\n\t3(data: any) {\n\t\treturn (\n\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\tdata\n\t\t)\n\t},\n\t4: \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t5: \"Immer forbids circular references\",\n\t6: \"The first or second argument to `produce` must be a function\",\n\t7: \"The third argument to `produce` must be a function or undefined\",\n\t8: \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t9: \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t10: \"The given draft is already finalized\",\n\t11: \"Object.defineProperty() cannot be used on an Immer draft\",\n\t12: \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t13: \"Immer only supports deleting array indices\",\n\t14: \"Immer only supports setting array indices and the 'length' property\",\n\t15(path: string) {\n\t\treturn \"Cannot apply patch, path doesn't resolve: \" + path\n\t},\n\t16: 'Sets cannot have \"replace\" patches.',\n\t17(op: string) {\n\t\treturn \"Unsupported patch operation: \" + op\n\t},\n\t18(plugin: string) {\n\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t},\n\t20: \"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available\",\n\t21(thing: string) {\n\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t},\n\t22(thing: string) {\n\t\treturn `'current' expects a draft, got: ${thing}`\n\t},\n\t23(thing: string) {\n\t\treturn `'original' expects a draft, got: ${thing}`\n\t},\n\t24: \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n} as const\n\nexport function die(error: keyof typeof errors, ...args: any[]): never {\n\tif (__DEV__) {\n\t\tconst e = errors[error]\n\t\tconst msg = !e\n\t\t\t? \"unknown error nr: \" + error\n\t\t\t: typeof e === \"function\"\n\t\t\t? e.apply(null, args as any)\n\t\t\t: e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}${\n\t\t\targs.length ? \" \" + args.map(s => `'${s}'`).join(\",\") : \"\"\n\t\t}. Find the full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\thasSet,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\thasMap,\n\tArchtype,\n\tdie\n} from \"../internal\"\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = Object.getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original(value: T): T | undefined\nexport function original(value: Drafted): any {\n\tif (!isDraft(value)) die(23, value)\n\treturn value[DRAFT_STATE].base_\n}\n\n/*#__PURE__*/\nexport const ownKeys: (target: AnyObject) => PropertyKey[] =\n\ttypeof Reflect !== \"undefined\" && Reflect.ownKeys\n\t\t? Reflect.ownKeys\n\t\t: typeof Object.getOwnPropertySymbols !== \"undefined\"\n\t\t? obj =>\n\t\t\t\tObject.getOwnPropertyNames(obj).concat(\n\t\t\t\t\tObject.getOwnPropertySymbols(obj) as any\n\t\t\t\t)\n\t\t: /* istanbul ignore next */ Object.getOwnPropertyNames\n\nexport const getOwnPropertyDescriptors =\n\tObject.getOwnPropertyDescriptors ||\n\tfunction getOwnPropertyDescriptors(target: any) {\n\t\t// Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n\t\tconst res: any = {}\n\t\townKeys(target).forEach(key => {\n\t\t\tres[key] = Object.getOwnPropertyDescriptor(target, key)\n\t\t})\n\t\treturn res\n\t}\n\nexport function each(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void,\n\tenumerableOnly?: boolean\n): void\nexport function each(obj: any, iter: any, enumerableOnly = false) {\n\tif (getArchtype(obj) === Archtype.Object) {\n\t\t;(enumerableOnly ? Object.keys : ownKeys)(obj).forEach(key => {\n\t\t\tif (!enumerableOnly || typeof key !== \"symbol\") iter(key, obj[key], obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): Archtype {\n\t/* istanbul ignore next */\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_ > 3\n\t\t\t? state.type_ - 4 // cause Object and Array map back from 4 and 5\n\t\t\t: (state.type_ as any) // others are the same\n\t\t: Array.isArray(thing)\n\t\t? Archtype.Array\n\t\t: isMap(thing)\n\t\t? Archtype.Map\n\t\t: isSet(thing)\n\t\t? Archtype.Set\n\t\t: Archtype.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === Archtype.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === Archtype.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === Archtype.Map) thing.set(propOrOldValue, value)\n\telse if (t === Archtype.Set) {\n\t\tthing.delete(propOrOldValue)\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn hasMap && target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn hasSet && target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any) {\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\tconst descriptors = getOwnPropertyDescriptors(base)\n\tdelete descriptors[DRAFT_STATE as any]\n\tlet keys = ownKeys(descriptors)\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key: any = keys[i]\n\t\tconst desc = descriptors[key]\n\t\tif (desc.writable === false) {\n\t\t\tdesc.writable = true\n\t\t\tdesc.configurable = true\n\t\t}\n\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t// with libraries that trap values, like mobx or vue\n\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\tif (desc.get || desc.set)\n\t\t\tdescriptors[key] = {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\tvalue: base[key]\n\t\t\t}\n\t}\n\treturn Object.create(Object.getPrototypeOf(base), descriptors)\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze(obj: T, deep?: boolean): T\nexport function freeze(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\tobj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections as any\n\t}\n\tObject.freeze(obj)\n\tif (deep) each(obj, (key, value) => freeze(value, true), true)\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\tif (obj == null || typeof obj !== \"object\") return true\n\t// See #600, IE dies on non-objects in Object.isFrozen\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tImmerScope,\n\tDrafted,\n\tAnyObject,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tProxyType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\trootState: ImmerState,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_(draft: T, patches: Patch[]): T\n\t}\n\tES5?: {\n\t\twillFinalizeES5_(scope: ImmerScope, result: any, isReplaced: boolean): void\n\t\tcreateES5Proxy_(\n\t\t\tbase: T,\n\t\t\tparent?: ImmerState\n\t\t): Drafted\n\t\thasChanges_(state: ES5ArrayState | ES5ObjectState): boolean\n\t}\n\tMapSet?: {\n\t\tproxyMap_(target: T, parent?: ImmerState): T\n\t\tproxySet_(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin(\n\tpluginKey: K\n): Exclude {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(18, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n\n/** ES5 Plugin */\n\ninterface ES5BaseState extends ImmerBaseState {\n\tassigned_: {[key: string]: any}\n\tparent_?: ImmerState\n\trevoked_: boolean\n}\n\nexport interface ES5ObjectState extends ES5BaseState {\n\ttype_: ProxyType.ES5Object\n\tdraft_: Drafted\n\tbase_: AnyObject\n\tcopy_: AnyObject | null\n}\n\nexport interface ES5ArrayState extends ES5BaseState {\n\ttype_: ProxyType.ES5Array\n\tdraft_: Drafted\n\tbase_: any\n\tcopy_: any\n}\n\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ProxyType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ProxyType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tProxyType,\n\tgetPlugin\n} from \"../internal\"\nimport {die} from \"../utils/errors\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\tif (__DEV__ && !currentScope) die(0)\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (\n\t\tstate.type_ === ProxyType.ProxyObject ||\n\t\tstate.type_ === ProxyType.ProxyArray\n\t)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tProxyType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen,\n\tshallowCopy\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (!scope.immer_.useProxies_)\n\t\tgetPlugin(\"ES5\").willFinalizeES5_(scope, result, isReplaced)\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE],\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(\n\t\t\tvalue,\n\t\t\t(key, childValue) =>\n\t\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path),\n\t\t\ttrue // See #590, don't recurse into non-enumerable of non drafted objects\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result =\n\t\t\t// For ES5, create a good copy from the draft first, with added keys and without deleted keys.\n\t\t\tstate.type_ === ProxyType.ES5Object || state.type_ === ProxyType.ES5Array\n\t\t\t\t? (state.copy_ = shallowCopy(state.draft_))\n\t\t\t\t: state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// Although the original test case doesn't seem valid anyway, so if this in the way we can turn the next line\n\t\t// back to each(result, ....)\n\t\teach(\n\t\t\tstate.type_ === ProxyType.Set ? new Set(result) : result,\n\t\t\t(key, childValue) =>\n\t\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath\n) {\n\tif (__DEV__ && childValue === targetObject) die(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ProxyType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\tif (!parentState || !parentState.scope_.parent_)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\tif (scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tProxyType\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ProxyType.ProxyObject\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ProxyType.ProxyArray\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ProxyType.ProxyArray : (ProxyType.ProxyObject as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nexport const objectTraps: ProxyHandler = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\n\t\tconst source = latest(state)\n\t\tif (!has(source, prop)) {\n\t\t\t// non-existing or non-own property...\n\t\t\treturn readPropFromProto(state, source, prop)\n\t\t}\n\t\tconst value = source[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\t\t// Check for existing draft in modified state.\n\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\tif (value === peek(state.base_, prop)) {\n\t\t\tprepareCopy(state)\n\t\t\treturn (state.copy_![prop as any] = createProxy(\n\t\t\t\tstate.scope_.immer_,\n\t\t\t\tvalue,\n\t\t\t\tstate\n\t\t\t))\n\t\t}\n\t\treturn value\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(\n\t\tstate: ProxyObjectState,\n\t\tprop: string /* strictly not, but helps TS */,\n\t\tvalue\n\t) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop)\n\t\tif (desc?.set) {\n\t\t\t// special case: if this write is captured by a setter, we have\n\t\t\t// to trigger it with the correct context\n\t\t\tdesc.set.call(state.draft_, value)\n\t\t\treturn true\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\t// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)\n\t\t\t// from setting an existing property with value undefined to undefined (which is not a change)\n\t\t\tconst current = peek(latest(state), prop)\n\t\t\t// special case, if we assigning the original value to a draft, we can ignore the assignment\n\t\t\tconst currentState: ProxyObjectState = current?.[DRAFT_STATE]\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_![prop] = value\n\t\t\t\tstate.assigned_[prop] = false\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (is(value, current) && (value !== undefined || has(state.base_, prop)))\n\t\t\t\treturn true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t}\n\n\t\tif (\n\t\t\tstate.copy_![prop] === value &&\n\t\t\t// special case: NaN\n\t\t\ttypeof value !== \"number\" &&\n\t\t\t// special case: handle new props with value 'undefined'\n\t\t\t(value !== undefined || prop in state.copy_)\n\t\t)\n\t\t\treturn true\n\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\tstate.assigned_[prop] = true\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\t// @ts-ignore\n\t\tif (state.copy_) delete state.copy_[prop]\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (!desc) return desc\n\t\treturn {\n\t\t\twritable: true,\n\t\t\tconfigurable: state.type_ !== ProxyType.ProxyArray || prop !== \"length\",\n\t\t\tenumerable: desc.enumerable,\n\t\t\tvalue: owner[prop]\n\t\t}\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn Object.getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (__DEV__ && isNaN(parseInt(prop as any))) die(13)\n\treturn objectTraps.deleteProperty!.call(this, state[0], prop)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (__DEV__ && prop !== \"length\" && isNaN(parseInt(prop as any))) die(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey) {\n\tconst state = draft[DRAFT_STATE]\n\tconst source = state ? latest(state) : draft\n\treturn source[prop]\n}\n\nfunction readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {\n\tconst desc = getDescriptorFromProto(source, prop)\n\treturn desc\n\t\t? `value` in desc\n\t\t\t? desc.value\n\t\t\t: // This is a very special case, if the prop is a getter defined by the\n\t\t\t // prototype, we should invoke it with the draft as context!\n\t\t\t desc.get?.call(state.draft_)\n\t\t: undefined\n}\n\nfunction getDescriptorFromProto(\n\tsource: any,\n\tprop: PropertyKey\n): PropertyDescriptor | undefined {\n\t// 'in' checks proto!\n\tif (!(prop in source)) return undefined\n\tlet proto = Object.getPrototypeOf(source)\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop)\n\t\tif (desc) return desc\n\t\tproto = Object.getPrototypeOf(proto)\n\t}\n\treturn undefined\n}\n\nexport function markChanged(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (state.parent_) {\n\t\t\tmarkChanged(state.parent_)\n\t\t}\n\t}\n}\n\nexport function prepareCopy(state: {base_: any; copy_: any}) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(state.base_)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tcreateProxyProxy,\n\tgetPlugin,\n\tdie,\n\thasProxies,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope,\n\tNOTHING,\n\tfreeze,\n\tcurrent\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport class Immer implements ProducersFns {\n\tuseProxies_: boolean = hasProxies\n\n\tautoFreeze_: boolean = true\n\n\tconstructor(config?: {useProxies?: boolean; autoFreeze?: boolean}) {\n\t\tif (typeof config?.useProxies === \"boolean\")\n\t\t\tthis.setUseProxies(config!.useProxies)\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce: IProduce = (base: any, recipe?: any, patchListener?: any) => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(this, base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tif (typeof Promise !== \"undefined\" && result instanceof Promise) {\n\t\t\t\treturn result.then(\n\t\t\t\t\tresult => {\n\t\t\t\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\t\t\t\treturn processResult(result, scope)\n\t\t\t\t\t},\n\t\t\t\t\terror => {\n\t\t\t\t\t\trevokeScope(scope)\n\t\t\t\t\t\tthrow error\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else if (!base || typeof base !== \"object\") {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === NOTHING) return undefined\n\t\t\tif (result === undefined) result = base\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\treturn result\n\t\t} else die(21, base)\n\t}\n\n\tproduceWithPatches: IProduceWithPatches = (\n\t\targ1: any,\n\t\targ2?: any,\n\t\targ3?: any\n\t): any => {\n\t\tif (typeof arg1 === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => arg1(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst nextState = this.produce(arg1, arg2, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\t\treturn [nextState, patches!, inversePatches!]\n\t}\n\n\tcreateDraft(base: T): Draft {\n\t\tif (!isDraftable(base)) die(8)\n\t\tif (isDraft(base)) base = current(base)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(this, base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft ? T : never {\n\t\tconst state: ImmerState = draft && (draft as any)[DRAFT_STATE]\n\t\tif (__DEV__) {\n\t\t\tif (!state || !state.isManual_) die(9)\n\t\t\tif (state.finalized_) die(10)\n\t\t}\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is enabled.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n\t * always faster than using ES5 proxies.\n\t *\n\t * By default, feature detection is used, so calling this is rarely necessary.\n\t */\n\tsetUseProxies(value: boolean) {\n\t\tif (value && !hasProxies) {\n\t\t\tdie(20)\n\t\t}\n\t\tthis.useProxies_ = value\n\t}\n\n\tapplyPatches(base: T, patches: Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}\n}\n\nexport function createProxy(\n\timmer: Immer,\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: immer.useProxies_\n\t\t? createProxyProxy(value, parent)\n\t\t: getPlugin(\"ES5\").createES5Proxy_(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n","import {\n\tdie,\n\tisDraft,\n\tshallowCopy,\n\teach,\n\tDRAFT_STATE,\n\tget,\n\tset,\n\tImmerState,\n\tisDraftable,\n\tArchtype,\n\tgetArchtype,\n\tgetPlugin\n} from \"../internal\"\n\n/** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */\nexport function current(value: T): T\nexport function current(value: any): any {\n\tif (!isDraft(value)) die(22, value)\n\treturn currentImpl(value)\n}\n\nfunction currentImpl(value: any): any {\n\tif (!isDraftable(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tconst archType = getArchtype(value)\n\tif (state) {\n\t\tif (\n\t\t\t!state.modified_ &&\n\t\t\t(state.type_ < 4 || !getPlugin(\"ES5\").hasChanges_(state as any))\n\t\t)\n\t\t\treturn state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = copyHelper(value, archType)\n\t\tstate.finalized_ = false\n\t} else {\n\t\tcopy = copyHelper(value, archType)\n\t}\n\n\teach(copy, (key, childValue) => {\n\t\tif (state && get(state.base_, key) === childValue) return // no need to copy or search in something that didn't change\n\t\tset(copy, key, currentImpl(childValue))\n\t})\n\t// In the future, we might consider freezing here, based on the current settings\n\treturn archType === Archtype.Set ? new Set(copy) : copy\n}\n\nfunction copyHelper(value: any, archType: number): any {\n\t// creates a shallow copy, even if it is a map or set\n\tswitch (archType) {\n\t\tcase Archtype.Map:\n\t\t\treturn new Map(value)\n\t\tcase Archtype.Set:\n\t\t\t// Set will be cloned as array temporarily, so that we can replace individual items\n\t\t\treturn Array.from(value)\n\t}\n\treturn shallowCopy(value)\n}\n","import {\n\tImmerState,\n\tDrafted,\n\tES5ArrayState,\n\tES5ObjectState,\n\teach,\n\thas,\n\tisDraft,\n\tlatest,\n\tDRAFT_STATE,\n\tis,\n\tloadPlugin,\n\tImmerScope,\n\tProxyType,\n\tgetCurrentScope,\n\tdie,\n\tmarkChanged,\n\tobjectTraps,\n\townKeys,\n\tgetOwnPropertyDescriptors\n} from \"../internal\"\n\ntype ES5State = ES5ArrayState | ES5ObjectState\n\nexport function enableES5() {\n\tfunction willFinalizeES5_(\n\t\tscope: ImmerScope,\n\t\tresult: any,\n\t\tisReplaced: boolean\n\t) {\n\t\tif (!isReplaced) {\n\t\t\tif (scope.patches_) {\n\t\t\t\tmarkChangesRecursively(scope.drafts_![0])\n\t\t\t}\n\t\t\t// This is faster when we don't care about which attributes changed.\n\t\t\tmarkChangesSweep(scope.drafts_)\n\t\t}\n\t\t// When a child draft is returned, look for changes.\n\t\telse if (\n\t\t\tisDraft(result) &&\n\t\t\t(result[DRAFT_STATE] as ES5State).scope_ === scope\n\t\t) {\n\t\t\tmarkChangesSweep(scope.drafts_)\n\t\t}\n\t}\n\n\tfunction createES5Draft(isArray: boolean, base: any) {\n\t\tif (isArray) {\n\t\t\tconst draft = new Array(base.length)\n\t\t\tfor (let i = 0; i < base.length; i++)\n\t\t\t\tObject.defineProperty(draft, \"\" + i, proxyProperty(i, true))\n\t\t\treturn draft\n\t\t} else {\n\t\t\tconst descriptors = getOwnPropertyDescriptors(base)\n\t\t\tdelete descriptors[DRAFT_STATE as any]\n\t\t\tconst keys = ownKeys(descriptors)\n\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\tconst key: any = keys[i]\n\t\t\t\tdescriptors[key] = proxyProperty(\n\t\t\t\t\tkey,\n\t\t\t\t\tisArray || !!descriptors[key].enumerable\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn Object.create(Object.getPrototypeOf(base), descriptors)\n\t\t}\n\t}\n\n\tfunction createES5Proxy_(\n\t\tbase: T,\n\t\tparent?: ImmerState\n\t): Drafted {\n\t\tconst isArray = Array.isArray(base)\n\t\tconst draft = createES5Draft(isArray, base)\n\n\t\tconst state: ES5ObjectState | ES5ArrayState = {\n\t\t\ttype_: isArray ? ProxyType.ES5Array : (ProxyType.ES5Object as any),\n\t\t\tscope_: parent ? parent.scope_ : getCurrentScope(),\n\t\t\tmodified_: false,\n\t\t\tfinalized_: false,\n\t\t\tassigned_: {},\n\t\t\tparent_: parent,\n\t\t\t// base is the object we are drafting\n\t\t\tbase_: base,\n\t\t\t// draft is the draft object itself, that traps all reads and reads from either the base (if unmodified) or copy (if modified)\n\t\t\tdraft_: draft,\n\t\t\tcopy_: null,\n\t\t\trevoked_: false,\n\t\t\tisManual_: false\n\t\t}\n\n\t\tObject.defineProperty(draft, DRAFT_STATE, {\n\t\t\tvalue: state,\n\t\t\t// enumerable: false <- the default\n\t\t\twritable: true\n\t\t})\n\t\treturn draft\n\t}\n\n\t// property descriptors are recycled to make sure we don't create a get and set closure per property,\n\t// but share them all instead\n\tconst descriptors: {[prop: string]: PropertyDescriptor} = {}\n\n\tfunction proxyProperty(\n\t\tprop: string | number,\n\t\tenumerable: boolean\n\t): PropertyDescriptor {\n\t\tlet desc = descriptors[prop]\n\t\tif (desc) {\n\t\t\tdesc.enumerable = enumerable\n\t\t} else {\n\t\t\tdescriptors[prop] = desc = {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable,\n\t\t\t\tget(this: any) {\n\t\t\t\t\tconst state = this[DRAFT_STATE]\n\t\t\t\t\tif (__DEV__) assertUnrevoked(state)\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn objectTraps.get(state, prop)\n\t\t\t\t},\n\t\t\t\tset(this: any, value) {\n\t\t\t\t\tconst state = this[DRAFT_STATE]\n\t\t\t\t\tif (__DEV__) assertUnrevoked(state)\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tobjectTraps.set(state, prop, value)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn desc\n\t}\n\n\t// This looks expensive, but only proxies are visited, and only objects without known changes are scanned.\n\tfunction markChangesSweep(drafts: Drafted[]) {\n\t\t// The natural order of drafts in the `scope` array is based on when they\n\t\t// were accessed. By processing drafts in reverse natural order, we have a\n\t\t// better chance of processing leaf nodes first. When a leaf node is known to\n\t\t// have changed, we can avoid any traversal of its ancestor nodes.\n\t\tfor (let i = drafts.length - 1; i >= 0; i--) {\n\t\t\tconst state: ES5State = drafts[i][DRAFT_STATE]\n\t\t\tif (!state.modified_) {\n\t\t\t\tswitch (state.type_) {\n\t\t\t\t\tcase ProxyType.ES5Array:\n\t\t\t\t\t\tif (hasArrayChanges(state)) markChanged(state)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase ProxyType.ES5Object:\n\t\t\t\t\t\tif (hasObjectChanges(state)) markChanged(state)\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction markChangesRecursively(object: any) {\n\t\tif (!object || typeof object !== \"object\") return\n\t\tconst state: ES5State | undefined = object[DRAFT_STATE]\n\t\tif (!state) return\n\t\tconst {base_, draft_, assigned_, type_} = state\n\t\tif (type_ === ProxyType.ES5Object) {\n\t\t\t// Look for added keys.\n\t\t\t// probably there is a faster way to detect changes, as sweep + recurse seems to do some\n\t\t\t// unnecessary work.\n\t\t\t// also: probably we can store the information we detect here, to speed up tree finalization!\n\t\t\teach(draft_, key => {\n\t\t\t\tif ((key as any) === DRAFT_STATE) return\n\t\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\t\tif ((base_ as any)[key] === undefined && !has(base_, key)) {\n\t\t\t\t\tassigned_[key] = true\n\t\t\t\t\tmarkChanged(state)\n\t\t\t\t} else if (!assigned_[key]) {\n\t\t\t\t\t// Only untouched properties trigger recursion.\n\t\t\t\t\tmarkChangesRecursively(draft_[key])\n\t\t\t\t}\n\t\t\t})\n\t\t\t// Look for removed keys.\n\t\t\teach(base_, key => {\n\t\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\t\tif (draft_[key] === undefined && !has(draft_, key)) {\n\t\t\t\t\tassigned_[key] = false\n\t\t\t\t\tmarkChanged(state)\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (type_ === ProxyType.ES5Array) {\n\t\t\tif (hasArrayChanges(state as ES5ArrayState)) {\n\t\t\t\tmarkChanged(state)\n\t\t\t\tassigned_.length = true\n\t\t\t}\n\n\t\t\tif (draft_.length < base_.length) {\n\t\t\t\tfor (let i = draft_.length; i < base_.length; i++) assigned_[i] = false\n\t\t\t} else {\n\t\t\t\tfor (let i = base_.length; i < draft_.length; i++) assigned_[i] = true\n\t\t\t}\n\n\t\t\t// Minimum count is enough, the other parts has been processed.\n\t\t\tconst min = Math.min(draft_.length, base_.length)\n\n\t\t\tfor (let i = 0; i < min; i++) {\n\t\t\t\t// Only untouched indices trigger recursion.\n\t\t\t\tif (assigned_[i] === undefined) markChangesRecursively(draft_[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasObjectChanges(state: ES5ObjectState) {\n\t\tconst {base_, draft_} = state\n\n\t\t// Search for added keys and changed keys. Start at the back, because\n\t\t// non-numeric keys are ordered by time of definition on the object.\n\t\tconst keys = ownKeys(draft_)\n\t\tfor (let i = keys.length - 1; i >= 0; i--) {\n\t\t\tconst key: any = keys[i]\n\t\t\tif (key === DRAFT_STATE) continue\n\t\t\tconst baseValue = base_[key]\n\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\tif (baseValue === undefined && !has(base_, key)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\t// Once a base key is deleted, future changes go undetected, because its\n\t\t\t// descriptor is erased. This branch detects any missed changes.\n\t\t\telse {\n\t\t\t\tconst value = draft_[key]\n\t\t\t\tconst state: ImmerState = value && value[DRAFT_STATE]\n\t\t\t\tif (state ? state.base_ !== baseValue : !is(value, baseValue)) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At this point, no keys were added or changed.\n\t\t// Compare key count to determine if keys were deleted.\n\t\tconst baseIsDraft = !!base_[DRAFT_STATE as any]\n\t\treturn keys.length !== ownKeys(base_).length + (baseIsDraft ? 0 : 1) // + 1 to correct for DRAFT_STATE\n\t}\n\n\tfunction hasArrayChanges(state: ES5ArrayState) {\n\t\tconst {draft_} = state\n\t\tif (draft_.length !== state.base_.length) return true\n\t\t// See #116\n\t\t// If we first shorten the length, our array interceptors will be removed.\n\t\t// If after that new items are added, result in the same original length,\n\t\t// those last items will have no intercepting property.\n\t\t// So if there is no own descriptor on the last position, we know that items were removed and added\n\t\t// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check\n\t\t// the last one\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(\n\t\t\tdraft_,\n\t\t\tdraft_.length - 1\n\t\t)\n\t\t// descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)\n\t\tif (descriptor && !descriptor.get) return true\n\t\t// For all other cases, we don't have to compare, as they would have been picked up by the index setters\n\t\treturn false\n\t}\n\n\tfunction hasChanges_(state: ES5State) {\n\t\treturn state.type_ === ProxyType.ES5Object\n\t\t\t? hasObjectChanges(state)\n\t\t\t: hasArrayChanges(state)\n\t}\n\n\tfunction assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {\n\t\tif (state.revoked_) die(3, JSON.stringify(latest(state)))\n\t}\n\n\tloadPlugin(\"ES5\", {\n\t\tcreateES5Proxy_,\n\t\twillFinalizeES5_,\n\t\thasChanges_\n\t})\n}\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\toriginal,\n\tcurrent,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable,\n\tfreeze\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = immer.produce\nexport default produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * Always freeze by default, even in production mode\n */\nexport const setAutoFreeze = immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n * always faster than using ES5 proxies.\n *\n * By default, feature detection is used, so calling this is rarely necessary.\n */\nexport const setUseProxies = immer.setUseProxies.bind(immer)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft(value: T): Draft {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable(value: T): Immutable {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enableES5} from \"./plugins/es5\"\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\nexport {enableAllPlugins} from \"./plugins/all\"\n","// Should be no imports here!\n\n// Some things that should be evaluated before all else...\n\n// We only want to know if non-polyfilled symbols are available\nconst hasSymbol =\n\ttypeof Symbol !== \"undefined\" && typeof Symbol(\"x\") === \"symbol\"\nexport const hasMap = typeof Map !== \"undefined\"\nexport const hasSet = typeof Set !== \"undefined\"\nexport const hasProxies =\n\ttypeof Proxy !== \"undefined\" &&\n\ttypeof Proxy.revocable !== \"undefined\" &&\n\ttypeof Reflect !== \"undefined\"\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: Nothing = hasSymbol\n\t? Symbol.for(\"immer-nothing\")\n\t: ({[\"immer-nothing\"]: true} as any)\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = hasSymbol\n\t? Symbol.for(\"immer-draftable\")\n\t: (\"__$immer_draftable\" as any)\n\nexport const DRAFT_STATE: unique symbol = hasSymbol\n\t? Symbol.for(\"immer-state\")\n\t: (\"__$immer_state\" as any)\n\n// Even a polyfilled Symbol might provide Symbol.iterator\nexport const iteratorSymbol: typeof Symbol.iterator =\n\t(typeof Symbol != \"undefined\" && Symbol.iterator) || (\"@@iterator\" as any)\n\n/** Use a class type for `nothing` so its type is unique */\nexport class Nothing {\n\t// This lets us do `Exclude`\n\t// @ts-ignore\n\tprivate _!: unique symbol\n}\n","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","import type { Action, ActionCreator, StoreEnhancer } from 'redux'\r\nimport { compose } from 'redux'\r\n\r\n/**\r\n * @public\r\n */\r\nexport interface EnhancerOptions {\r\n /**\r\n * the instance name to be showed on the monitor page. Default value is `document.title`.\r\n * If not specified and there's no document title, it will consist of `tabId` and `instanceId`.\r\n */\r\n name?: string\r\n /**\r\n * action creators functions to be available in the Dispatcher.\r\n */\r\n actionCreators?: ActionCreator[] | { [key: string]: ActionCreator }\r\n /**\r\n * if more than one action is dispatched in the indicated interval, all new actions will be collected and sent at once.\r\n * It is the joint between performance and speed. When set to `0`, all actions will be sent instantly.\r\n * Set it to a higher value when experiencing perf issues (also `maxAge` to a lower value).\r\n *\r\n * @default 500 ms.\r\n */\r\n latency?: number\r\n /**\r\n * (> 1) - maximum allowed actions to be stored in the history tree. The oldest actions are removed once maxAge is reached. It's critical for performance.\r\n *\r\n * @default 50\r\n */\r\n maxAge?: number\r\n /**\r\n * See detailed documentation at https://github.com/reduxjs/redux-devtools/blob/%40redux-devtools/extension%403.2.1/extension/docs/API/Arguments.md#serialize\r\n */\r\n serialize?:\r\n | boolean\r\n | {\r\n options?:\r\n | boolean\r\n | {\r\n date?: boolean\r\n regex?: boolean\r\n undefined?: boolean\r\n error?: boolean\r\n symbol?: boolean\r\n map?: boolean\r\n set?: boolean\r\n function?: boolean | Function\r\n }\r\n replacer?: (key: string, value: unknown) => unknown\r\n reviver?: (key: string, value: unknown) => unknown\r\n immutable?: unknown\r\n refs?: unknown[]\r\n }\r\n /**\r\n * function which takes `action` object and id number as arguments, and should return `action` object back.\r\n */\r\n actionSanitizer?: (action: A, id: number) => A\r\n /**\r\n * function which takes `state` object and index as arguments, and should return `state` object back.\r\n */\r\n stateSanitizer?: (state: S, index: number) => S\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.\r\n */\r\n actionsBlacklist?: string | string[]\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.\r\n */\r\n actionsWhitelist?: string | string[]\r\n /**\r\n * called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor.\r\n * Use it as a more advanced version of `actionsBlacklist`/`actionsWhitelist` parameters.\r\n */\r\n predicate?: (state: S, action: A) => boolean\r\n /**\r\n * if specified as `false`, it will not record the changes till clicking on `Start recording` button.\r\n * Available only for Redux enhancer, for others use `autoPause`.\r\n *\r\n * @default true\r\n */\r\n shouldRecordChanges?: boolean\r\n /**\r\n * if specified, whenever clicking on `Pause recording` button and there are actions in the history log, will add this action type.\r\n * If not specified, will commit when paused. Available only for Redux enhancer.\r\n *\r\n * @default \"@@PAUSED\"\"\r\n */\r\n pauseActionType?: string\r\n /**\r\n * auto pauses when the extension’s window is not opened, and so has zero impact on your app when not in use.\r\n * Not available for Redux enhancer (as it already does it but storing the data to be sent).\r\n *\r\n * @default false\r\n */\r\n autoPause?: boolean\r\n /**\r\n * if specified as `true`, it will not allow any non-monitor actions to be dispatched till clicking on `Unlock changes` button.\r\n * Available only for Redux enhancer.\r\n *\r\n * @default false\r\n */\r\n shouldStartLocked?: boolean\r\n /**\r\n * if set to `false`, will not recompute the states on hot reloading (or on replacing the reducers). Available only for Redux enhancer.\r\n *\r\n * @default true\r\n */\r\n shouldHotReload?: boolean\r\n /**\r\n * if specified as `true`, whenever there's an exception in reducers, the monitors will show the error message, and next actions will not be dispatched.\r\n *\r\n * @default false\r\n */\r\n shouldCatchErrors?: boolean\r\n /**\r\n * If you want to restrict the extension, specify the features you allow.\r\n * If not specified, all of the features are enabled. When set as an object, only those included as `true` will be allowed.\r\n * Note that except `true`/`false`, `import` and `export` can be set as `custom` (which is by default for Redux enhancer), meaning that the importing/exporting occurs on the client side.\r\n * Otherwise, you'll get/set the data right from the monitor part.\r\n */\r\n features?: {\r\n /**\r\n * start/pause recording of dispatched actions\r\n */\r\n pause?: boolean\r\n /**\r\n * lock/unlock dispatching actions and side effects\r\n */\r\n lock?: boolean\r\n /**\r\n * persist states on page reloading\r\n */\r\n persist?: boolean\r\n /**\r\n * export history of actions in a file\r\n */\r\n export?: boolean | 'custom'\r\n /**\r\n * import history of actions from a file\r\n */\r\n import?: boolean | 'custom'\r\n /**\r\n * jump back and forth (time travelling)\r\n */\r\n jump?: boolean\r\n /**\r\n * skip (cancel) actions\r\n */\r\n skip?: boolean\r\n /**\r\n * drag and drop actions in the history list\r\n */\r\n reorder?: boolean\r\n /**\r\n * dispatch custom actions or action creators\r\n */\r\n dispatch?: boolean\r\n /**\r\n * generate tests for the selected actions\r\n */\r\n test?: boolean\r\n }\r\n /**\r\n * Set to true or a stacktrace-returning function to record call stack traces for dispatched actions.\r\n * Defaults to false.\r\n */\r\n trace?: boolean | ((action: A) => string)\r\n /**\r\n * The maximum number of stack trace entries to record per action. Defaults to 10.\r\n */\r\n traceLimit?: number\r\n}\r\n\r\ntype Compose = typeof compose\r\n\r\ninterface ComposeWithDevTools {\r\n (options: EnhancerOptions): Compose\r\n (...funcs: StoreEnhancer[]): StoreEnhancer\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport const composeWithDevTools: ComposeWithDevTools =\r\n typeof window !== 'undefined' &&\r\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n ? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n : function () {\r\n if (arguments.length === 0) return undefined\r\n if (typeof arguments[0] === 'object') return compose\r\n return compose.apply(null, arguments as any as Function[])\r\n }\r\n\r\n/**\r\n * @public\r\n */\r\nexport const devToolsEnhancer: {\r\n (options: EnhancerOptions): StoreEnhancer\r\n} =\r\n typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION__\r\n ? (window as any).__REDUX_DEVTOOLS_EXTENSION__\r\n : function () {\r\n return function (noop) {\r\n return noop\r\n }\r\n }\r\n","/**\r\n * Returns true if the passed value is \"plain\" object, i.e. an object whose\r\n * prototype is the root `Object.prototype`. This includes objects created\r\n * using object literals, but not for instance for class instances.\r\n *\r\n * @param {any} value The value to inspect.\r\n * @returns {boolean} True if the argument appears to be a plain object.\r\n *\r\n * @public\r\n */\r\nexport default function isPlainObject(value: unknown): value is object {\r\n if (typeof value !== 'object' || value === null) return false\r\n\r\n let proto = Object.getPrototypeOf(value)\r\n if (proto === null) return true\r\n\r\n let baseProto = proto\r\n while (Object.getPrototypeOf(baseProto) !== null) {\r\n baseProto = Object.getPrototypeOf(baseProto)\r\n }\r\n\r\n return proto === baseProto\r\n}\r\n","import type { Middleware } from 'redux'\r\n\r\nexport function getTimeMeasureUtils(maxDelay: number, fnName: string) {\r\n let elapsed = 0\r\n return {\r\n measureTime(fn: () => T): T {\r\n const started = Date.now()\r\n try {\r\n return fn()\r\n } finally {\r\n const finished = Date.now()\r\n elapsed += finished - started\r\n }\r\n },\r\n warnIfExceeded() {\r\n if (elapsed > maxDelay) {\r\n console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. \r\nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\r\nIt is disabled in production builds, so you don't need to worry about that.`)\r\n }\r\n },\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class MiddlewareArray<\r\n Middlewares extends Middleware[]\r\n> extends Array {\r\n constructor(...items: Middlewares)\r\n constructor(...args: any[]) {\r\n super(...args)\r\n Object.setPrototypeOf(this, MiddlewareArray.prototype)\r\n }\r\n\r\n static get [Symbol.species]() {\r\n return MiddlewareArray as any\r\n }\r\n\r\n concat>>(\r\n items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...Middlewares, ...AdditionalMiddlewares]>\r\n\r\n concat>>(\r\n ...items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...Middlewares, ...AdditionalMiddlewares]>\r\n concat(...arr: any[]) {\r\n return super.concat.apply(this, arr)\r\n }\r\n\r\n prepend>>(\r\n items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...AdditionalMiddlewares, ...Middlewares]>\r\n\r\n prepend>>(\r\n ...items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...AdditionalMiddlewares, ...Middlewares]>\r\n\r\n prepend(...arr: any[]) {\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new MiddlewareArray(...arr[0].concat(this))\r\n }\r\n return new MiddlewareArray(...arr.concat(this))\r\n }\r\n}\r\n","import type { Middleware, AnyAction } from 'redux'\r\nimport type { ThunkMiddleware } from 'redux-thunk'\r\nimport thunkMiddleware from 'redux-thunk'\r\nimport type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware'\r\n/* PROD_START_REMOVE_UMD */\r\nimport { createImmutableStateInvariantMiddleware } from './immutableStateInvariantMiddleware'\r\n/* PROD_STOP_REMOVE_UMD */\r\n\r\nimport type { SerializableStateInvariantMiddlewareOptions } from './serializableStateInvariantMiddleware'\r\nimport { createSerializableStateInvariantMiddleware } from './serializableStateInvariantMiddleware'\r\nimport type { ExcludeFromTuple } from './tsHelpers'\r\nimport { MiddlewareArray } from './utils'\r\n\r\nfunction isBoolean(x: any): x is boolean {\r\n return typeof x === 'boolean'\r\n}\r\n\r\ninterface ThunkOptions {\r\n extraArgument: E\r\n}\r\n\r\ninterface GetDefaultMiddlewareOptions {\r\n thunk?: boolean | ThunkOptions\r\n immutableCheck?: boolean | ImmutableStateInvariantMiddlewareOptions\r\n serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions\r\n}\r\n\r\nexport type ThunkMiddlewareFor<\r\n S,\r\n O extends GetDefaultMiddlewareOptions = {}\r\n> = O extends {\r\n thunk: false\r\n}\r\n ? never\r\n : O extends { thunk: { extraArgument: infer E } }\r\n ? ThunkMiddleware\r\n : ThunkMiddleware\r\n\r\nexport type CurriedGetDefaultMiddleware = <\r\n O extends Partial = {\r\n thunk: true\r\n immutableCheck: true\r\n serializableCheck: true\r\n }\r\n>(\r\n options?: O\r\n) => MiddlewareArray], never>>\r\n\r\nexport function curryGetDefaultMiddleware<\r\n S = any\r\n>(): CurriedGetDefaultMiddleware {\r\n return function curriedGetDefaultMiddleware(options) {\r\n return getDefaultMiddleware(options)\r\n }\r\n}\r\n\r\n/**\r\n * Returns any array containing the default middleware installed by\r\n * `configureStore()`. Useful if you want to configure your store with a custom\r\n * `middleware` array but still keep the default set.\r\n *\r\n * @return The default middleware used by `configureStore()`.\r\n *\r\n * @public\r\n *\r\n * @deprecated Prefer to use the callback notation for the `middleware` option in `configureStore`\r\n * to access a pre-typed `getDefaultMiddleware` instead.\r\n */\r\nexport function getDefaultMiddleware<\r\n S = any,\r\n O extends Partial = {\r\n thunk: true\r\n immutableCheck: true\r\n serializableCheck: true\r\n }\r\n>(\r\n options: O = {} as O\r\n): MiddlewareArray], never>> {\r\n const {\r\n thunk = true,\r\n immutableCheck = true,\r\n serializableCheck = true,\r\n } = options\r\n\r\n let middlewareArray = new MiddlewareArray()\r\n\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware)\r\n } else {\r\n middlewareArray.push(\r\n thunkMiddleware.withExtraArgument(thunk.extraArgument)\r\n )\r\n }\r\n }\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (immutableCheck) {\r\n /* PROD_START_REMOVE_UMD */\r\n let immutableOptions: ImmutableStateInvariantMiddlewareOptions = {}\r\n\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck\r\n }\r\n\r\n middlewareArray.unshift(\r\n createImmutableStateInvariantMiddleware(immutableOptions)\r\n )\r\n /* PROD_STOP_REMOVE_UMD */\r\n }\r\n\r\n if (serializableCheck) {\r\n let serializableOptions: SerializableStateInvariantMiddlewareOptions = {}\r\n\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck\r\n }\r\n\r\n middlewareArray.push(\r\n createSerializableStateInvariantMiddleware(serializableOptions)\r\n )\r\n }\r\n }\r\n\r\n return middlewareArray as any\r\n}\r\n","import type {\r\n Reducer,\r\n ReducersMapObject,\r\n Middleware,\r\n Action,\r\n AnyAction,\r\n StoreEnhancer,\r\n Store,\r\n Dispatch,\r\n PreloadedState,\r\n CombinedState,\r\n} from 'redux'\r\nimport { createStore, compose, applyMiddleware, combineReducers } from 'redux'\r\nimport type { EnhancerOptions as DevToolsOptions } from './devtoolsExtension'\r\nimport { composeWithDevTools } from './devtoolsExtension'\r\n\r\nimport isPlainObject from './isPlainObject'\r\nimport type {\r\n ThunkMiddlewareFor,\r\n CurriedGetDefaultMiddleware,\r\n} from './getDefaultMiddleware'\r\nimport { curryGetDefaultMiddleware } from './getDefaultMiddleware'\r\nimport type { NoInfer, ExtractDispatchExtensions } from './tsHelpers'\r\n\r\nconst IS_PRODUCTION = process.env.NODE_ENV === 'production'\r\n\r\n/**\r\n * Callback function type, to be used in `ConfigureStoreOptions.enhancers`\r\n *\r\n * @public\r\n */\r\nexport type ConfigureEnhancersCallback = (\r\n defaultEnhancers: readonly StoreEnhancer[]\r\n) => StoreEnhancer[]\r\n\r\n/**\r\n * Options for `configureStore()`.\r\n *\r\n * @public\r\n */\r\nexport interface ConfigureStoreOptions<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = Middlewares\r\n> {\r\n /**\r\n * A single reducer function that will be used as the root reducer, or an\r\n * object of slice reducers that will be passed to `combineReducers()`.\r\n */\r\n reducer: Reducer | ReducersMapObject\r\n\r\n /**\r\n * An array of Redux middleware to install. If not supplied, defaults to\r\n * the set of middleware returned by `getDefaultMiddleware()`.\r\n */\r\n middleware?: ((getDefaultMiddleware: CurriedGetDefaultMiddleware) => M) | M\r\n\r\n /**\r\n * Whether to enable Redux DevTools integration. Defaults to `true`.\r\n *\r\n * Additional configuration can be done by passing Redux DevTools options\r\n */\r\n devTools?: boolean | DevToolsOptions\r\n\r\n /**\r\n * The initial state, same as Redux's createStore.\r\n * You may optionally specify it to hydrate the state\r\n * from the server in universal apps, or to restore a previously serialized\r\n * user session. If you use `combineReducers()` to produce the root reducer\r\n * function (either directly or indirectly by passing an object as `reducer`),\r\n * this must be an object with the same shape as the reducer map keys.\r\n */\r\n /* \r\n Not 100% correct but the best approximation we can get:\r\n - if S is a `CombinedState` applying a second `CombinedState` on it does not change anything.\r\n - if it is not, there could be two cases:\r\n - `ReducersMapObject` is being passed in. In this case, we will call `combineReducers` on it and `CombinedState` is correct\r\n - `Reducer` is being passed in. In this case, actually `CombinedState` is wrong and `S` would be correct.\r\n As we cannot distinguish between those two cases without adding another generic paramter, \r\n we just make the pragmatic assumption that the latter almost never happens.\r\n */\r\n preloadedState?: PreloadedState>>\r\n\r\n /**\r\n * The store enhancers to apply. See Redux's `createStore()`.\r\n * All enhancers will be included before the DevTools Extension enhancer.\r\n * If you need to customize the order of enhancers, supply a callback\r\n * function that will receive the original array (ie, `[applyMiddleware]`),\r\n * and should return a new array (such as `[applyMiddleware, offline]`).\r\n * If you only need to add middleware, you can use the `middleware` parameter instead.\r\n */\r\n enhancers?: StoreEnhancer[] | ConfigureEnhancersCallback\r\n}\r\n\r\ntype Middlewares = ReadonlyArray>\r\n\r\n/**\r\n * A Redux store returned by `configureStore()`. Supports dispatching\r\n * side-effectful _thunks_ in addition to plain actions.\r\n *\r\n * @public\r\n */\r\nexport interface EnhancedStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = Middlewares\r\n> extends Store {\r\n /**\r\n * The `dispatch` method of your store, enhanced by all its middlewares.\r\n *\r\n * @inheritdoc\r\n */\r\n dispatch: ExtractDispatchExtensions & Dispatch\r\n}\r\n\r\n/**\r\n * A friendly abstraction over the standard Redux `createStore()` function.\r\n *\r\n * @param config The store configuration.\r\n * @returns A configured Redux store.\r\n *\r\n * @public\r\n */\r\nexport function configureStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = [ThunkMiddlewareFor]\r\n>(options: ConfigureStoreOptions): EnhancedStore {\r\n const curriedGetDefaultMiddleware = curryGetDefaultMiddleware()\r\n\r\n const {\r\n reducer = undefined,\r\n middleware = curriedGetDefaultMiddleware(),\r\n devTools = true,\r\n preloadedState = undefined,\r\n enhancers = undefined,\r\n } = options || {}\r\n\r\n let rootReducer: Reducer\r\n\r\n if (typeof reducer === 'function') {\r\n rootReducer = reducer\r\n } else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer)\r\n } else {\r\n throw new Error(\r\n '\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'\r\n )\r\n }\r\n\r\n let finalMiddleware = middleware\r\n if (typeof finalMiddleware === 'function') {\r\n finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware)\r\n\r\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\r\n throw new Error(\r\n 'when using a middleware builder function, an array of middleware must be returned'\r\n )\r\n }\r\n }\r\n if (\r\n !IS_PRODUCTION &&\r\n finalMiddleware.some((item: any) => typeof item !== 'function')\r\n ) {\r\n throw new Error(\r\n 'each middleware provided to configureStore must be a function'\r\n )\r\n }\r\n\r\n const middlewareEnhancer = applyMiddleware(...finalMiddleware)\r\n\r\n let finalCompose = compose\r\n\r\n if (devTools) {\r\n finalCompose = composeWithDevTools({\r\n // Enable capture of stack traces for dispatched Redux actions\r\n trace: !IS_PRODUCTION,\r\n ...(typeof devTools === 'object' && devTools),\r\n })\r\n }\r\n\r\n let storeEnhancers: StoreEnhancer[] = [middlewareEnhancer]\r\n\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = [middlewareEnhancer, ...enhancers]\r\n } else if (typeof enhancers === 'function') {\r\n storeEnhancers = enhancers(storeEnhancers)\r\n }\r\n\r\n const composedEnhancer = finalCompose(...storeEnhancers) as any\r\n\r\n return createStore(rootReducer, preloadedState, composedEnhancer)\r\n}\r\n","import type { Action } from 'redux'\r\nimport type {\r\n IsUnknownOrNonInferrable,\r\n IfMaybeUndefined,\r\n IfVoid,\r\n IsAny,\r\n} from './tsHelpers'\r\nimport isPlainObject from './isPlainObject'\r\n\r\n/**\r\n * An action with a string type and an associated payload. This is the\r\n * type of action returned by `createAction()` action creators.\r\n *\r\n * @template P The type of the action's payload.\r\n * @template T the type used for the action type.\r\n * @template M The type of the action's meta (optional)\r\n * @template E The type of the action's error (optional)\r\n *\r\n * @public\r\n */\r\nexport type PayloadAction<\r\n P = void,\r\n T extends string = string,\r\n M = never,\r\n E = never\r\n> = {\r\n payload: P\r\n type: T\r\n} & ([M] extends [never]\r\n ? {}\r\n : {\r\n meta: M\r\n }) &\r\n ([E] extends [never]\r\n ? {}\r\n : {\r\n error: E\r\n })\r\n\r\n/**\r\n * A \"prepare\" method to be used as the second parameter of `createAction`.\r\n * Takes any number of arguments and returns a Flux Standard Action without\r\n * type (will be added later) that *must* contain a payload (might be undefined).\r\n *\r\n * @public\r\n */\r\nexport type PrepareAction

=\r\n | ((...args: any[]) => { payload: P })\r\n | ((...args: any[]) => { payload: P; meta: any })\r\n | ((...args: any[]) => { payload: P; error: any })\r\n | ((...args: any[]) => { payload: P; meta: any; error: any })\r\n\r\n/**\r\n * Internal version of `ActionCreatorWithPreparedPayload`. Not to be used externally.\r\n *\r\n * @internal\r\n */\r\nexport type _ActionCreatorWithPreparedPayload<\r\n PA extends PrepareAction | void,\r\n T extends string = string\r\n> = PA extends PrepareAction\r\n ? ActionCreatorWithPreparedPayload<\r\n Parameters,\r\n P,\r\n T,\r\n ReturnType extends {\r\n error: infer E\r\n }\r\n ? E\r\n : never,\r\n ReturnType extends {\r\n meta: infer M\r\n }\r\n ? M\r\n : never\r\n >\r\n : void\r\n\r\n/**\r\n * Basic type for all action creators.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n */\r\nexport interface BaseActionCreator {\r\n type: T\r\n match: (action: Action) => action is PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator that takes multiple arguments that are passed\r\n * to a `PrepareAction` method to create the final Action.\r\n * @typeParam Args arguments for the action creator function\r\n * @typeParam P `payload` type\r\n * @typeParam T `type` name\r\n * @typeParam E optional `error` type\r\n * @typeParam M optional `meta` type\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithPreparedPayload<\r\n Args extends unknown[],\r\n P,\r\n T extends string = string,\r\n E = never,\r\n M = never\r\n> extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with `Args` will return\r\n * an Action with a payload of type `P` and (depending on the `PrepareAction`\r\n * method used) a `meta`- and `error` property of types `M` and `E` respectively.\r\n */\r\n (...args: Args): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that takes an optional payload of type `P`.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithOptionalPayload\r\n extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`.\r\n * Calling it without an argument will return a PayloadAction with a payload of `undefined`.\r\n */\r\n (payload?: P): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that takes no payload.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithoutPayload\r\n extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} will\r\n * return a {@link PayloadAction} of type `T` with a payload of `undefined`\r\n */\r\n (): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that requires a payload of type P.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithPayload\r\n extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`\r\n */\r\n (payload: P): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator of type `T` whose `payload` type could not be inferred. Accepts everything as `payload`.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithNonInferrablePayload<\r\n T extends string = string\r\n> extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload\r\n * of exactly the type of the argument.\r\n */\r\n (payload: PT): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator that produces actions with a `payload` attribute.\r\n *\r\n * @typeParam P the `payload` type\r\n * @typeParam T the `type` of the resulting action\r\n * @typeParam PA if the resulting action is preprocessed by a `prepare` method, the signature of said method.\r\n *\r\n * @public\r\n */\r\nexport type PayloadActionCreator<\r\n P = void,\r\n T extends string = string,\r\n PA extends PrepareAction

| void = void\r\n> = IfPrepareActionMethodProvided<\r\n PA,\r\n _ActionCreatorWithPreparedPayload,\r\n // else\r\n IsAny<\r\n P,\r\n ActionCreatorWithPayload,\r\n IsUnknownOrNonInferrable<\r\n P,\r\n ActionCreatorWithNonInferrablePayload,\r\n // else\r\n IfVoid<\r\n P,\r\n ActionCreatorWithoutPayload,\r\n // else\r\n IfMaybeUndefined<\r\n P,\r\n ActionCreatorWithOptionalPayload,\r\n // else\r\n ActionCreatorWithPayload\r\n >\r\n >\r\n >\r\n >\r\n>\r\n\r\n/**\r\n * A utility function to create an action creator for the given action type\r\n * string. The action creator accepts a single argument, which will be included\r\n * in the action object as a field called payload. The action creator function\r\n * will also have its toString() overriden so that it returns the action type,\r\n * allowing it to be used in reducer logic that is looking for that action type.\r\n *\r\n * @param type The action type to use for created actions.\r\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\r\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\r\n *\r\n * @public\r\n */\r\nexport function createAction

(\r\n type: T\r\n): PayloadActionCreator\r\n\r\n/**\r\n * A utility function to create an action creator for the given action type\r\n * string. The action creator accepts a single argument, which will be included\r\n * in the action object as a field called payload. The action creator function\r\n * will also have its toString() overriden so that it returns the action type,\r\n * allowing it to be used in reducer logic that is looking for that action type.\r\n *\r\n * @param type The action type to use for created actions.\r\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\r\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\r\n *\r\n * @public\r\n */\r\nexport function createAction<\r\n PA extends PrepareAction,\r\n T extends string = string\r\n>(\r\n type: T,\r\n prepareAction: PA\r\n): PayloadActionCreator['payload'], T, PA>\r\n\r\nexport function createAction(type: string, prepareAction?: Function): any {\r\n function actionCreator(...args: any[]) {\r\n if (prepareAction) {\r\n let prepared = prepareAction(...args)\r\n if (!prepared) {\r\n throw new Error('prepareAction did not return an object')\r\n }\r\n\r\n return {\r\n type,\r\n payload: prepared.payload,\r\n ...('meta' in prepared && { meta: prepared.meta }),\r\n ...('error' in prepared && { error: prepared.error }),\r\n }\r\n }\r\n return { type, payload: args[0] }\r\n }\r\n\r\n actionCreator.toString = () => `${type}`\r\n\r\n actionCreator.type = type\r\n\r\n actionCreator.match = (action: Action): action is PayloadAction =>\r\n action.type === type\r\n\r\n return actionCreator\r\n}\r\n\r\nexport function isFSA(action: unknown): action is {\r\n type: string\r\n payload?: unknown\r\n error?: unknown\r\n meta?: unknown\r\n} {\r\n return (\r\n isPlainObject(action) &&\r\n typeof (action as any).type === 'string' &&\r\n Object.keys(action).every(isValidKey)\r\n )\r\n}\r\n\r\nfunction isValidKey(key: string) {\r\n return ['type', 'payload', 'error', 'meta'].indexOf(key) > -1\r\n}\r\n\r\n/**\r\n * Returns the action type of the actions created by the passed\r\n * `createAction()`-generated action creator (arbitrary action creators\r\n * are not supported).\r\n *\r\n * @param action The action creator whose action type to get.\r\n * @returns The action type used by the action creator.\r\n *\r\n * @public\r\n */\r\nexport function getType(\r\n actionCreator: PayloadActionCreator\r\n): T {\r\n return `${actionCreator}` as T\r\n}\r\n\r\n// helper types for more readable typings\r\n\r\ntype IfPrepareActionMethodProvided<\r\n PA extends PrepareAction | void,\r\n True,\r\n False\r\n> = PA extends (...args: any[]) => any ? True : False\r\n","import type { Action, AnyAction } from 'redux'\r\nimport type {\r\n CaseReducer,\r\n CaseReducers,\r\n ActionMatcherDescriptionCollection,\r\n} from './createReducer'\r\nimport type { TypeGuard } from './tsHelpers'\r\n\r\nexport interface TypedActionCreator {\r\n (...args: any[]): Action\r\n type: Type\r\n}\r\n\r\n/**\r\n * A builder for an action <-> reducer map.\r\n *\r\n * @public\r\n */\r\nexport interface ActionReducerMapBuilder {\r\n /**\r\n * Adds a case reducer to handle a single exact action type.\r\n * @remarks\r\n * All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.\r\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\r\n * @param reducer - The actual case reducer function.\r\n */\r\n addCase>(\r\n actionCreator: ActionCreator,\r\n reducer: CaseReducer>\r\n ): ActionReducerMapBuilder\r\n /**\r\n * Adds a case reducer to handle a single exact action type.\r\n * @remarks\r\n * All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.\r\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\r\n * @param reducer - The actual case reducer function.\r\n */\r\n addCase>(\r\n type: Type,\r\n reducer: CaseReducer\r\n ): ActionReducerMapBuilder\r\n\r\n /**\r\n * Allows you to match your incoming actions against your own filter function instead of only the `action.type` property.\r\n * @remarks\r\n * If multiple matcher reducers match, all of them will be executed in the order\r\n * they were defined in - even if a case reducer already matched.\r\n * All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`.\r\n * @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates)\r\n * function\r\n * @param reducer - The actual case reducer function.\r\n *\r\n * @example\r\n```ts\r\nimport {\r\n createAction,\r\n createReducer,\r\n AsyncThunk,\r\n AnyAction,\r\n} from \"@reduxjs/toolkit\";\r\n\r\ntype GenericAsyncThunk = AsyncThunk;\r\n\r\ntype PendingAction = ReturnType;\r\ntype RejectedAction = ReturnType;\r\ntype FulfilledAction = ReturnType;\r\n\r\nconst initialState: Record = {};\r\nconst resetAction = createAction(\"reset-tracked-loading-state\");\r\n\r\nfunction isPendingAction(action: AnyAction): action is PendingAction {\r\n return action.type.endsWith(\"/pending\");\r\n}\r\n\r\nconst reducer = createReducer(initialState, (builder) => {\r\n builder\r\n .addCase(resetAction, () => initialState)\r\n // matcher can be defined outside as a type predicate function\r\n .addMatcher(isPendingAction, (state, action) => {\r\n state[action.meta.requestId] = \"pending\";\r\n })\r\n .addMatcher(\r\n // matcher can be defined inline as a type predicate function\r\n (action): action is RejectedAction => action.type.endsWith(\"/rejected\"),\r\n (state, action) => {\r\n state[action.meta.requestId] = \"rejected\";\r\n }\r\n )\r\n // matcher can just return boolean and the matcher can receive a generic argument\r\n .addMatcher(\r\n (action) => action.type.endsWith(\"/fulfilled\"),\r\n (state, action) => {\r\n state[action.meta.requestId] = \"fulfilled\";\r\n }\r\n );\r\n});\r\n```\r\n */\r\n addMatcher(\r\n matcher: TypeGuard | ((action: any) => boolean),\r\n reducer: CaseReducer\r\n ): Omit, 'addCase'>\r\n\r\n /**\r\n * Adds a \"default case\" reducer that is executed if no case reducer and no matcher\r\n * reducer was executed for this action.\r\n * @param reducer - The fallback \"default case\" reducer function.\r\n *\r\n * @example\r\n```ts\r\nimport { createReducer } from '@reduxjs/toolkit'\r\nconst initialState = { otherActions: 0 }\r\nconst reducer = createReducer(initialState, builder => {\r\n builder\r\n // .addCase(...)\r\n // .addMatcher(...)\r\n .addDefaultCase((state, action) => {\r\n state.otherActions++\r\n })\r\n})\r\n```\r\n */\r\n addDefaultCase(reducer: CaseReducer): {}\r\n}\r\n\r\nexport function executeReducerBuilderCallback(\r\n builderCallback: (builder: ActionReducerMapBuilder) => void\r\n): [\r\n CaseReducers,\r\n ActionMatcherDescriptionCollection,\r\n CaseReducer | undefined\r\n] {\r\n const actionsMap: CaseReducers = {}\r\n const actionMatchers: ActionMatcherDescriptionCollection = []\r\n let defaultCaseReducer: CaseReducer | undefined\r\n const builder = {\r\n addCase(\r\n typeOrActionCreator: string | TypedActionCreator,\r\n reducer: CaseReducer\r\n ) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n /*\r\n to keep the definition by the user in line with actual behavior, \r\n we enforce `addCase` to always be called before calling `addMatcher`\r\n as matching cases take precedence over matchers\r\n */\r\n if (actionMatchers.length > 0) {\r\n throw new Error(\r\n '`builder.addCase` should only be called before calling `builder.addMatcher`'\r\n )\r\n }\r\n if (defaultCaseReducer) {\r\n throw new Error(\r\n '`builder.addCase` should only be called before calling `builder.addDefaultCase`'\r\n )\r\n }\r\n }\r\n const type =\r\n typeof typeOrActionCreator === 'string'\r\n ? typeOrActionCreator\r\n : typeOrActionCreator.type\r\n if (type in actionsMap) {\r\n throw new Error(\r\n 'addCase cannot be called with two reducers for the same action type'\r\n )\r\n }\r\n actionsMap[type] = reducer\r\n return builder\r\n },\r\n addMatcher(\r\n matcher: TypeGuard,\r\n reducer: CaseReducer\r\n ) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (defaultCaseReducer) {\r\n throw new Error(\r\n '`builder.addMatcher` should only be called before calling `builder.addDefaultCase`'\r\n )\r\n }\r\n }\r\n actionMatchers.push({ matcher, reducer })\r\n return builder\r\n },\r\n addDefaultCase(reducer: CaseReducer) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (defaultCaseReducer) {\r\n throw new Error('`builder.addDefaultCase` can only be called once')\r\n }\r\n }\r\n defaultCaseReducer = reducer\r\n return builder\r\n },\r\n }\r\n builderCallback(builder)\r\n return [actionsMap, actionMatchers, defaultCaseReducer]\r\n}\r\n","import type { AnyAction, Reducer } from 'redux'\r\nimport { createNextState } from '.'\r\nimport type {\r\n ActionCreatorWithoutPayload,\r\n PayloadAction,\r\n PayloadActionCreator,\r\n PrepareAction,\r\n _ActionCreatorWithPreparedPayload,\r\n} from './createAction'\r\nimport { createAction } from './createAction'\r\nimport type {\r\n CaseReducer,\r\n CaseReducers,\r\n ReducerWithInitialState,\r\n} from './createReducer'\r\nimport { createReducer, NotFunction } from './createReducer'\r\nimport type { ActionReducerMapBuilder } from './mapBuilders'\r\nimport { executeReducerBuilderCallback } from './mapBuilders'\r\nimport type { NoInfer } from './tsHelpers'\r\n\r\n/**\r\n * An action creator attached to a slice.\r\n *\r\n * @deprecated please use PayloadActionCreator directly\r\n *\r\n * @public\r\n */\r\nexport type SliceActionCreator

= PayloadActionCreator

\r\n\r\n/**\r\n * The return value of `createSlice`\r\n *\r\n * @public\r\n */\r\nexport interface Slice<\r\n State = any,\r\n CaseReducers extends SliceCaseReducers = SliceCaseReducers,\r\n Name extends string = string\r\n> {\r\n /**\r\n * The slice name.\r\n */\r\n name: Name\r\n\r\n /**\r\n * The slice's reducer.\r\n */\r\n reducer: Reducer\r\n\r\n /**\r\n * Action creators for the types of actions that are handled by the slice\r\n * reducer.\r\n */\r\n actions: CaseReducerActions\r\n\r\n /**\r\n * The individual case reducer functions that were passed in the `reducers` parameter.\r\n * This enables reuse and testing if they were defined inline when calling `createSlice`.\r\n */\r\n caseReducers: SliceDefinedCaseReducers\r\n\r\n /**\r\n * Provides access to the initial state value given to the slice.\r\n * If a lazy state initializer was provided, it will be called and a fresh value returned.\r\n */\r\n getInitialState: () => State\r\n}\r\n\r\n/**\r\n * Options for `createSlice()`.\r\n *\r\n * @public\r\n */\r\nexport interface CreateSliceOptions<\r\n State = any,\r\n CR extends SliceCaseReducers = SliceCaseReducers,\r\n Name extends string = string\r\n> {\r\n /**\r\n * The slice's name. Used to namespace the generated action types.\r\n */\r\n name: Name\r\n\r\n /**\r\n * The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\r\n */\r\n initialState: State | (() => State)\r\n\r\n /**\r\n * A mapping from action types to action-type-specific *case reducer*\r\n * functions. For every action type, a matching action creator will be\r\n * generated using `createAction()`.\r\n */\r\n reducers: ValidateSliceCaseReducers\r\n\r\n /**\r\n * A callback that receives a *builder* object to define\r\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\r\n * \r\n * Alternatively, a mapping from action types to action-type-specific *case reducer*\r\n * functions. These reducers should have existing action types used\r\n * as the keys, and action creators will _not_ be generated.\r\n * \r\n * @example\r\n```ts\r\nimport { createAction, createSlice, Action, AnyAction } from '@reduxjs/toolkit'\r\nconst incrementBy = createAction('incrementBy')\r\nconst decrement = createAction('decrement')\r\n\r\ninterface RejectedAction extends Action {\r\n error: Error\r\n}\r\n\r\nfunction isRejectedAction(action: AnyAction): action is RejectedAction {\r\n return action.type.endsWith('rejected')\r\n}\r\n\r\ncreateSlice({\r\n name: 'counter',\r\n initialState: 0,\r\n reducers: {},\r\n extraReducers: builder => {\r\n builder\r\n .addCase(incrementBy, (state, action) => {\r\n // action is inferred correctly here if using TS\r\n })\r\n // You can chain calls, or have separate `builder.addCase()` lines each time\r\n .addCase(decrement, (state, action) => {})\r\n // You can match a range of action types\r\n .addMatcher(\r\n isRejectedAction,\r\n // `action` will be inferred as a RejectedAction due to isRejectedAction being defined as a type guard\r\n (state, action) => {}\r\n )\r\n // and provide a default case if no other handlers matched\r\n .addDefaultCase((state, action) => {})\r\n }\r\n})\r\n```\r\n */\r\n extraReducers?:\r\n | CaseReducers, any>\r\n | ((builder: ActionReducerMapBuilder>) => void)\r\n}\r\n\r\n/**\r\n * A CaseReducer with a `prepare` method.\r\n *\r\n * @public\r\n */\r\nexport type CaseReducerWithPrepare = {\r\n reducer: CaseReducer\r\n prepare: PrepareAction\r\n}\r\n\r\n/**\r\n * The type describing a slice's `reducers` option.\r\n *\r\n * @public\r\n */\r\nexport type SliceCaseReducers = {\r\n [K: string]:\r\n | CaseReducer>\r\n | CaseReducerWithPrepare>\r\n}\r\n\r\n/**\r\n * Derives the slice's `actions` property from the `reducers` options\r\n *\r\n * @public\r\n */\r\nexport type CaseReducerActions> = {\r\n [Type in keyof CaseReducers]: CaseReducers[Type] extends { prepare: any }\r\n ? ActionCreatorForCaseReducerWithPrepare\r\n : ActionCreatorForCaseReducer\r\n}\r\n\r\n/**\r\n * Get a `PayloadActionCreator` type for a passed `CaseReducerWithPrepare`\r\n *\r\n * @internal\r\n */\r\ntype ActionCreatorForCaseReducerWithPrepare =\r\n _ActionCreatorWithPreparedPayload\r\n\r\n/**\r\n * Get a `PayloadActionCreator` type for a passed `CaseReducer`\r\n *\r\n * @internal\r\n */\r\ntype ActionCreatorForCaseReducer = CR extends (\r\n state: any,\r\n action: infer Action\r\n) => any\r\n ? Action extends { payload: infer P }\r\n ? PayloadActionCreator

\r\n : ActionCreatorWithoutPayload\r\n : ActionCreatorWithoutPayload\r\n\r\n/**\r\n * Extracts the CaseReducers out of a `reducers` object, even if they are\r\n * tested into a `CaseReducerWithPrepare`.\r\n *\r\n * @internal\r\n */\r\ntype SliceDefinedCaseReducers> = {\r\n [Type in keyof CaseReducers]: CaseReducers[Type] extends {\r\n reducer: infer Reducer\r\n }\r\n ? Reducer\r\n : CaseReducers[Type]\r\n}\r\n\r\n/**\r\n * Used on a SliceCaseReducers object.\r\n * Ensures that if a CaseReducer is a `CaseReducerWithPrepare`, that\r\n * the `reducer` and the `prepare` function use the same type of `payload`.\r\n *\r\n * Might do additional such checks in the future.\r\n *\r\n * This type is only ever useful if you want to write your own wrapper around\r\n * `createSlice`. Please don't use it otherwise!\r\n *\r\n * @public\r\n */\r\nexport type ValidateSliceCaseReducers<\r\n S,\r\n ACR extends SliceCaseReducers\r\n> = ACR &\r\n {\r\n [T in keyof ACR]: ACR[T] extends {\r\n reducer(s: S, action?: infer A): any\r\n }\r\n ? {\r\n prepare(...a: never[]): Omit\r\n }\r\n : {}\r\n }\r\n\r\nfunction getType(slice: string, actionKey: string): string {\r\n return `${slice}/${actionKey}`\r\n}\r\n\r\n/**\r\n * A function that accepts an initial state, an object full of reducer\r\n * functions, and a \"slice name\", and automatically generates\r\n * action creators and action types that correspond to the\r\n * reducers and state.\r\n *\r\n * The `reducer` argument is passed to `createReducer()`.\r\n *\r\n * @public\r\n */\r\nexport function createSlice<\r\n State,\r\n CaseReducers extends SliceCaseReducers,\r\n Name extends string = string\r\n>(\r\n options: CreateSliceOptions\r\n): Slice {\r\n const { name } = options\r\n if (!name) {\r\n throw new Error('`name` is a required option for createSlice')\r\n }\r\n const initialState =\r\n typeof options.initialState == 'function'\r\n ? options.initialState\r\n : createNextState(options.initialState, () => {})\r\n\r\n const reducers = options.reducers || {}\r\n\r\n const reducerNames = Object.keys(reducers)\r\n\r\n const sliceCaseReducersByName: Record = {}\r\n const sliceCaseReducersByType: Record = {}\r\n const actionCreators: Record = {}\r\n\r\n reducerNames.forEach((reducerName) => {\r\n const maybeReducerWithPrepare = reducers[reducerName]\r\n const type = getType(name, reducerName)\r\n\r\n let caseReducer: CaseReducer\r\n let prepareCallback: PrepareAction | undefined\r\n\r\n if ('reducer' in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer\r\n prepareCallback = maybeReducerWithPrepare.prepare\r\n } else {\r\n caseReducer = maybeReducerWithPrepare\r\n }\r\n\r\n sliceCaseReducersByName[reducerName] = caseReducer\r\n sliceCaseReducersByType[type] = caseReducer\r\n actionCreators[reducerName] = prepareCallback\r\n ? createAction(type, prepareCallback)\r\n : createAction(type)\r\n })\r\n\r\n function buildReducer() {\r\n const [\r\n extraReducers = {},\r\n actionMatchers = [],\r\n defaultCaseReducer = undefined,\r\n ] =\r\n typeof options.extraReducers === 'function'\r\n ? executeReducerBuilderCallback(options.extraReducers)\r\n : [options.extraReducers]\r\n\r\n const finalCaseReducers = { ...extraReducers, ...sliceCaseReducersByType }\r\n return createReducer(\r\n initialState,\r\n finalCaseReducers as any,\r\n actionMatchers,\r\n defaultCaseReducer\r\n )\r\n }\r\n\r\n let _reducer: ReducerWithInitialState\r\n\r\n return {\r\n name,\r\n reducer(state, action) {\r\n if (!_reducer) _reducer = buildReducer()\r\n\r\n return _reducer(state, action)\r\n },\r\n actions: actionCreators as any,\r\n caseReducers: sliceCaseReducersByName as any,\r\n getInitialState() {\r\n if (!_reducer) _reducer = buildReducer()\r\n\r\n return _reducer.getInitialState()\r\n },\r\n }\r\n}\r\n","import type { Draft } from 'immer'\r\nimport createNextState, { isDraft, isDraftable } from 'immer'\r\nimport type { AnyAction, Action, Reducer } from 'redux'\r\nimport type { ActionReducerMapBuilder } from './mapBuilders'\r\nimport { executeReducerBuilderCallback } from './mapBuilders'\r\nimport type { NoInfer } from './tsHelpers'\r\n\r\n/**\r\n * Defines a mapping from action types to corresponding action object shapes.\r\n *\r\n * @deprecated This should not be used manually - it is only used for internal\r\n * inference purposes and should not have any further value.\r\n * It might be removed in the future.\r\n * @public\r\n */\r\nexport type Actions = Record\r\n\r\n/**\r\n * @deprecated use `TypeGuard` instead\r\n */\r\nexport interface ActionMatcher {\r\n (action: AnyAction): action is A\r\n}\r\n\r\nexport type ActionMatcherDescription = {\r\n matcher: ActionMatcher\r\n reducer: CaseReducer>\r\n}\r\n\r\nexport type ReadonlyActionMatcherDescriptionCollection = ReadonlyArray<\r\n ActionMatcherDescription\r\n>\r\n\r\nexport type ActionMatcherDescriptionCollection = Array<\r\n ActionMatcherDescription\r\n>\r\n\r\n/**\r\n * An *case reducer* is a reducer function for a specific action type. Case\r\n * reducers can be composed to full reducers using `createReducer()`.\r\n *\r\n * Unlike a normal Redux reducer, a case reducer is never called with an\r\n * `undefined` state to determine the initial state. Instead, the initial\r\n * state is explicitly specified as an argument to `createReducer()`.\r\n *\r\n * In addition, a case reducer can choose to mutate the passed-in `state`\r\n * value directly instead of returning a new state. This does not actually\r\n * cause the store state to be mutated directly; instead, thanks to\r\n * [immer](https://github.com/mweststrate/immer), the mutations are\r\n * translated to copy operations that result in a new state.\r\n *\r\n * @public\r\n */\r\nexport type CaseReducer = (\r\n state: Draft,\r\n action: A\r\n) => S | void | Draft\r\n\r\n/**\r\n * A mapping from action types to case reducers for `createReducer()`.\r\n *\r\n * @deprecated This should not be used manually - it is only used\r\n * for internal inference purposes and using it manually\r\n * would lead to type erasure.\r\n * It might be removed in the future.\r\n * @public\r\n */\r\nexport type CaseReducers = {\r\n [T in keyof AS]: AS[T] extends Action ? CaseReducer : void\r\n}\r\n\r\nexport type NotFunction = T extends Function ? never : T\r\n\r\nfunction isStateFunction(x: unknown): x is () => S {\r\n return typeof x === 'function'\r\n}\r\n\r\nexport type ReducerWithInitialState> = Reducer & {\r\n getInitialState: () => S\r\n}\r\n\r\n/**\r\n * A utility function that allows defining a reducer as a mapping from action\r\n * type to *case reducer* functions that handle these action types. The\r\n * reducer's initial state is passed as the first argument.\r\n *\r\n * @remarks\r\n * The body of every case reducer is implicitly wrapped with a call to\r\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\r\n * This means that rather than returning a new state object, you can also\r\n * mutate the passed-in state object directly; these mutations will then be\r\n * automatically and efficiently translated into copies, giving you both\r\n * convenience and immutability.\r\n *\r\n * @overloadSummary\r\n * This overload accepts a callback function that receives a `builder` object as its argument.\r\n * That builder provides `addCase`, `addMatcher` and `addDefaultCase` functions that may be\r\n * called to define what actions this reducer will handle.\r\n *\r\n * @param initialState - `State | (() => State)`: The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\r\n * @param builderCallback - `(builder: Builder) => void` A callback that receives a *builder* object to define\r\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\r\n * @example\r\n```ts\r\nimport {\r\n createAction,\r\n createReducer,\r\n AnyAction,\r\n PayloadAction,\r\n} from \"@reduxjs/toolkit\";\r\n\r\nconst increment = createAction(\"increment\");\r\nconst decrement = createAction(\"decrement\");\r\n\r\nfunction isActionWithNumberPayload(\r\n action: AnyAction\r\n): action is PayloadAction {\r\n return typeof action.payload === \"number\";\r\n}\r\n\r\nconst reducer = createReducer(\r\n {\r\n counter: 0,\r\n sumOfNumberPayloads: 0,\r\n unhandledActions: 0,\r\n },\r\n (builder) => {\r\n builder\r\n .addCase(increment, (state, action) => {\r\n // action is inferred correctly here\r\n state.counter += action.payload;\r\n })\r\n // You can chain calls, or have separate `builder.addCase()` lines each time\r\n .addCase(decrement, (state, action) => {\r\n state.counter -= action.payload;\r\n })\r\n // You can apply a \"matcher function\" to incoming actions\r\n .addMatcher(isActionWithNumberPayload, (state, action) => {})\r\n // and provide a default case if no other handlers matched\r\n .addDefaultCase((state, action) => {});\r\n }\r\n);\r\n```\r\n * @public\r\n */\r\nexport function createReducer>(\r\n initialState: S | (() => S),\r\n builderCallback: (builder: ActionReducerMapBuilder) => void\r\n): ReducerWithInitialState\r\n\r\n/**\r\n * A utility function that allows defining a reducer as a mapping from action\r\n * type to *case reducer* functions that handle these action types. The\r\n * reducer's initial state is passed as the first argument.\r\n *\r\n * The body of every case reducer is implicitly wrapped with a call to\r\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\r\n * This means that rather than returning a new state object, you can also\r\n * mutate the passed-in state object directly; these mutations will then be\r\n * automatically and efficiently translated into copies, giving you both\r\n * convenience and immutability.\r\n * \r\n * @overloadSummary\r\n * This overload accepts an object where the keys are string action types, and the values\r\n * are case reducer functions to handle those action types.\r\n *\r\n * @param initialState - `State | (() => State)`: The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\r\n * @param actionsMap - An object mapping from action types to _case reducers_, each of which handles one specific action type.\r\n * @param actionMatchers - An array of matcher definitions in the form `{matcher, reducer}`.\r\n * All matching reducers will be executed in order, independently if a case reducer matched or not.\r\n * @param defaultCaseReducer - A \"default case\" reducer that is executed if no case reducer and no matcher\r\n * reducer was executed for this action.\r\n *\r\n * @example\r\n```js\r\nconst counterReducer = createReducer(0, {\r\n increment: (state, action) => state + action.payload,\r\n decrement: (state, action) => state - action.payload\r\n})\r\n\r\n// Alternately, use a \"lazy initializer\" to provide the initial state\r\n// (works with either form of createReducer)\r\nconst initialState = () => 0\r\nconst counterReducer = createReducer(initialState, {\r\n increment: (state, action) => state + action.payload,\r\n decrement: (state, action) => state - action.payload\r\n})\r\n```\r\n \r\n * Action creators that were generated using [`createAction`](./createAction) may be used directly as the keys here, using computed property syntax:\r\n\r\n```js\r\nconst increment = createAction('increment')\r\nconst decrement = createAction('decrement')\r\n\r\nconst counterReducer = createReducer(0, {\r\n [increment]: (state, action) => state + action.payload,\r\n [decrement.type]: (state, action) => state - action.payload\r\n})\r\n```\r\n * @public\r\n */\r\nexport function createReducer<\r\n S extends NotFunction,\r\n CR extends CaseReducers = CaseReducers\r\n>(\r\n initialState: S | (() => S),\r\n actionsMap: CR,\r\n actionMatchers?: ActionMatcherDescriptionCollection,\r\n defaultCaseReducer?: CaseReducer\r\n): ReducerWithInitialState\r\n\r\nexport function createReducer>(\r\n initialState: S | (() => S),\r\n mapOrBuilderCallback:\r\n | CaseReducers\r\n | ((builder: ActionReducerMapBuilder) => void),\r\n actionMatchers: ReadonlyActionMatcherDescriptionCollection = [],\r\n defaultCaseReducer?: CaseReducer\r\n): ReducerWithInitialState {\r\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] =\r\n typeof mapOrBuilderCallback === 'function'\r\n ? executeReducerBuilderCallback(mapOrBuilderCallback)\r\n : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer]\r\n\r\n // Ensure the initial state gets frozen either way\r\n let getInitialState: () => S\r\n if (isStateFunction(initialState)) {\r\n getInitialState = () => createNextState(initialState(), () => {})\r\n } else {\r\n const frozenInitialState = createNextState(initialState, () => {})\r\n getInitialState = () => frozenInitialState\r\n }\r\n\r\n function reducer(state = getInitialState(), action: any): S {\r\n let caseReducers = [\r\n actionsMap[action.type],\r\n ...finalActionMatchers\r\n .filter(({ matcher }) => matcher(action))\r\n .map(({ reducer }) => reducer),\r\n ]\r\n if (caseReducers.filter((cr) => !!cr).length === 0) {\r\n caseReducers = [finalDefaultCaseReducer]\r\n }\r\n\r\n return caseReducers.reduce((previousState, caseReducer): S => {\r\n if (caseReducer) {\r\n if (isDraft(previousState)) {\r\n // If it's already a draft, we must already be inside a `createNextState` call,\r\n // likely because this is being wrapped in `createReducer`, `createSlice`, or nested\r\n // inside an existing draft. It's safe to just pass the draft to the mutator.\r\n const draft = previousState as Draft // We can assume this is already a draft\r\n const result = caseReducer(draft, action)\r\n\r\n if (typeof result === 'undefined') {\r\n return previousState\r\n }\r\n\r\n return result as S\r\n } else if (!isDraftable(previousState)) {\r\n // If state is not draftable (ex: a primitive, such as 0), we want to directly\r\n // return the caseReducer func and not wrap it with produce.\r\n const result = caseReducer(previousState as any, action)\r\n\r\n if (typeof result === 'undefined') {\r\n if (previousState === null) {\r\n return previousState\r\n }\r\n throw Error(\r\n 'A case reducer on a non-draftable value must not return undefined'\r\n )\r\n }\r\n\r\n return result as S\r\n } else {\r\n // @ts-ignore createNextState() produces an Immutable> rather\r\n // than an Immutable, and TypeScript cannot find out how to reconcile\r\n // these two types.\r\n return createNextState(previousState, (draft: Draft) => {\r\n return caseReducer(draft, action)\r\n })\r\n }\r\n }\r\n\r\n return previousState\r\n }, state)\r\n }\r\n\r\n reducer.getInitialState = getInitialState\r\n\r\n return reducer as ReducerWithInitialState\r\n}\r\n","// Borrowed from https://github.com/ai/nanoid/blob/3.0.2/non-secure/index.js\r\n// This alphabet uses `A-Za-z0-9_-` symbols. A genetic algorithm helped\r\n// optimize the gzip compression for this alphabet.\r\nlet urlAlphabet =\r\n 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW'\r\n\r\n/**\r\n *\r\n * @public\r\n */\r\nexport let nanoid = (size = 21) => {\r\n let id = ''\r\n // A compact alternative for `for (var i = 0; i < step; i++)`.\r\n let i = size\r\n while (i--) {\r\n // `| 0` is more compact and faster than `Math.floor()`.\r\n id += urlAlphabet[(Math.random() * 64) | 0]\r\n }\r\n return id\r\n}\r\n","import type { AbortSignalWithReason } from './types'\r\n\r\nexport const assertFunction: (\r\n func: unknown,\r\n expected: string\r\n) => asserts func is (...args: unknown[]) => unknown = (\r\n func: unknown,\r\n expected: string\r\n) => {\r\n if (typeof func !== 'function') {\r\n throw new TypeError(`${expected} is not a function`)\r\n }\r\n}\r\n\r\nexport const noop = () => {}\r\n\r\nexport const catchRejection = (\r\n promise: Promise,\r\n onError = noop\r\n): Promise => {\r\n promise.catch(onError)\r\n\r\n return promise\r\n}\r\n\r\nexport const addAbortSignalListener = (\r\n abortSignal: AbortSignal,\r\n callback: (evt: Event) => void\r\n) => {\r\n abortSignal.addEventListener('abort', callback, { once: true })\r\n}\r\n\r\n/**\r\n * Calls `abortController.abort(reason)` and patches `signal.reason`.\r\n * if it is not supported.\r\n *\r\n * At the time of writing `signal.reason` is available in FF chrome, edge node 17 and deno.\r\n * @param abortController\r\n * @param reason\r\n * @returns\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/reason\r\n */\r\nexport const abortControllerWithReason = (\r\n abortController: AbortController,\r\n reason: T\r\n): void => {\r\n type Consumer = (val: T) => void\r\n\r\n const signal = abortController.signal as AbortSignalWithReason\r\n\r\n if (signal.aborted) {\r\n return\r\n }\r\n\r\n // Patch `reason` if necessary.\r\n // - We use defineProperty here because reason is a getter of `AbortSignal.__proto__`.\r\n // - We need to patch 'reason' before calling `.abort()` because listeners to the 'abort'\r\n // event are are notified immediately.\r\n if (!('reason' in signal)) {\r\n Object.defineProperty(signal, 'reason', {\r\n enumerable: true,\r\n value: reason,\r\n configurable: true,\r\n writable: true,\r\n })\r\n }\r\n\r\n ;(abortController.abort as Consumer)(reason)\r\n}\r\n","import type { SerializedError } from '@reduxjs/toolkit'\r\n\r\nconst task = 'task'\r\nconst listener = 'listener'\r\nconst completed = 'completed'\r\nconst cancelled = 'cancelled'\r\n\r\n/* TaskAbortError error codes */\r\nexport const taskCancelled = `task-${cancelled}` as const\r\nexport const taskCompleted = `task-${completed}` as const\r\nexport const listenerCancelled = `${listener}-${cancelled}` as const\r\nexport const listenerCompleted = `${listener}-${completed}` as const\r\n\r\nexport class TaskAbortError implements SerializedError {\r\n name = 'TaskAbortError'\r\n message: string\r\n constructor(public code: string | undefined) {\r\n this.message = `${task} ${cancelled} (reason: ${code})`\r\n }\r\n}\r\n","import { TaskAbortError } from './exceptions'\r\nimport type { AbortSignalWithReason, TaskResult } from './types'\r\nimport { addAbortSignalListener, catchRejection } from './utils'\r\n\r\n/**\r\n * Synchronously raises {@link TaskAbortError} if the task tied to the input `signal` has been cancelled.\r\n * @param signal\r\n * @param reason\r\n * @see {TaskAbortError}\r\n */\r\nexport const validateActive = (signal: AbortSignal): void => {\r\n if (signal.aborted) {\r\n throw new TaskAbortError((signal as AbortSignalWithReason).reason)\r\n }\r\n}\r\n\r\n/**\r\n * Returns a promise that will reject {@link TaskAbortError} if the task is cancelled.\r\n * @param signal\r\n * @returns\r\n */\r\nexport const promisifyAbortSignal = (\r\n signal: AbortSignalWithReason\r\n): Promise => {\r\n return catchRejection(\r\n new Promise((_, reject) => {\r\n const notifyRejection = () => reject(new TaskAbortError(signal.reason))\r\n\r\n if (signal.aborted) {\r\n notifyRejection()\r\n } else {\r\n addAbortSignalListener(signal, notifyRejection)\r\n }\r\n })\r\n )\r\n}\r\n\r\n/**\r\n * Runs a task and returns promise that resolves to {@link TaskResult}.\r\n * Second argument is an optional `cleanUp` function that always runs after task.\r\n *\r\n * **Note:** `runTask` runs the executor in the next microtask.\r\n * @returns\r\n */\r\nexport const runTask = async (\r\n task: () => Promise,\r\n cleanUp?: () => void\r\n): Promise> => {\r\n try {\r\n await Promise.resolve()\r\n const value = await task()\r\n return {\r\n status: 'ok',\r\n value,\r\n }\r\n } catch (error: any) {\r\n return {\r\n status: error instanceof TaskAbortError ? 'cancelled' : 'rejected',\r\n error,\r\n }\r\n } finally {\r\n cleanUp?.()\r\n }\r\n}\r\n\r\n/**\r\n * Given an input `AbortSignal` and a promise returns another promise that resolves\r\n * as soon the input promise is provided or rejects as soon as\r\n * `AbortSignal.abort` is `true`.\r\n * @param signal\r\n * @returns\r\n */\r\nexport const createPause = (signal: AbortSignal) => {\r\n return (promise: Promise): Promise => {\r\n return catchRejection(\r\n Promise.race([promisifyAbortSignal(signal), promise]).then((output) => {\r\n validateActive(signal)\r\n return output\r\n })\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * Given an input `AbortSignal` and `timeoutMs` returns a promise that resolves\r\n * after `timeoutMs` or rejects as soon as `AbortSignal.abort` is `true`.\r\n * @param signal\r\n * @returns\r\n */\r\nexport const createDelay = (signal: AbortSignal) => {\r\n const pause = createPause(signal)\r\n return (timeoutMs: number): Promise => {\r\n return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs)))\r\n }\r\n}\r\n","import type { Dispatch, AnyAction, MiddlewareAPI } from 'redux'\r\nimport type { ThunkDispatch } from 'redux-thunk'\r\nimport { createAction } from '../createAction'\r\nimport { nanoid } from '../nanoid'\r\n\r\nimport type {\r\n ListenerMiddleware,\r\n ListenerMiddlewareInstance,\r\n AddListenerOverloads,\r\n AnyListenerPredicate,\r\n CreateListenerMiddlewareOptions,\r\n TypedAddListener,\r\n TypedCreateListenerEntry,\r\n FallbackAddListenerOptions,\r\n ListenerEntry,\r\n ListenerErrorHandler,\r\n UnsubscribeListener,\r\n TakePattern,\r\n ListenerErrorInfo,\r\n ForkedTaskExecutor,\r\n ForkedTask,\r\n TypedRemoveListener,\r\n TaskResult,\r\n AbortSignalWithReason,\r\n UnsubscribeListenerOptions,\r\n} from './types'\r\nimport {\r\n abortControllerWithReason,\r\n addAbortSignalListener,\r\n assertFunction,\r\n catchRejection,\r\n} from './utils'\r\nimport {\r\n listenerCancelled,\r\n listenerCompleted,\r\n TaskAbortError,\r\n taskCancelled,\r\n taskCompleted,\r\n} from './exceptions'\r\nimport {\r\n runTask,\r\n promisifyAbortSignal,\r\n validateActive,\r\n createPause,\r\n createDelay,\r\n} from './task'\r\nexport { TaskAbortError } from './exceptions'\r\nexport type {\r\n ListenerEffect,\r\n ListenerMiddleware,\r\n ListenerEffectAPI,\r\n ListenerMiddlewareInstance,\r\n CreateListenerMiddlewareOptions,\r\n ListenerErrorHandler,\r\n TypedStartListening,\r\n TypedAddListener,\r\n TypedStopListening,\r\n TypedRemoveListener,\r\n UnsubscribeListener,\r\n UnsubscribeListenerOptions,\r\n ForkedTaskExecutor,\r\n ForkedTask,\r\n ForkedTaskAPI,\r\n AsyncTaskExecutor,\r\n SyncTaskExecutor,\r\n TaskCancelled,\r\n TaskRejected,\r\n TaskResolved,\r\n TaskResult,\r\n} from './types'\r\n\r\n//Overly-aggressive byte-shaving\r\nconst { assign } = Object\r\n/**\r\n * @internal\r\n */\r\nconst INTERNAL_NIL_TOKEN = {} as const\r\n\r\nconst alm = 'listenerMiddleware' as const\r\n\r\nconst createFork = (parentAbortSignal: AbortSignalWithReason) => {\r\n const linkControllers = (controller: AbortController) =>\r\n addAbortSignalListener(parentAbortSignal, () =>\r\n abortControllerWithReason(controller, parentAbortSignal.reason)\r\n )\r\n\r\n return (taskExecutor: ForkedTaskExecutor): ForkedTask => {\r\n assertFunction(taskExecutor, 'taskExecutor')\r\n const childAbortController = new AbortController()\r\n\r\n linkControllers(childAbortController)\r\n\r\n const result = runTask(\r\n async (): Promise => {\r\n validateActive(parentAbortSignal)\r\n validateActive(childAbortController.signal)\r\n const result = (await taskExecutor({\r\n pause: createPause(childAbortController.signal),\r\n delay: createDelay(childAbortController.signal),\r\n signal: childAbortController.signal,\r\n })) as T\r\n validateActive(childAbortController.signal)\r\n return result\r\n },\r\n () => abortControllerWithReason(childAbortController, taskCompleted)\r\n )\r\n\r\n return {\r\n result: createPause>(parentAbortSignal)(result),\r\n cancel() {\r\n abortControllerWithReason(childAbortController, taskCancelled)\r\n },\r\n }\r\n }\r\n}\r\n\r\nconst createTakePattern = (\r\n startListening: AddListenerOverloads<\r\n UnsubscribeListener,\r\n S,\r\n Dispatch\r\n >,\r\n signal: AbortSignal\r\n): TakePattern => {\r\n /**\r\n * A function that takes a ListenerPredicate and an optional timeout,\r\n * and resolves when either the predicate returns `true` based on an action\r\n * state combination or when the timeout expires.\r\n * If the parent listener is canceled while waiting, this will throw a\r\n * TaskAbortError.\r\n */\r\n const take = async

>(\r\n predicate: P,\r\n timeout: number | undefined\r\n ) => {\r\n validateActive(signal)\r\n\r\n // Placeholder unsubscribe function until the listener is added\r\n let unsubscribe: UnsubscribeListener = () => {}\r\n\r\n const tuplePromise = new Promise<[AnyAction, S, S]>((resolve) => {\r\n // Inside the Promise, we synchronously add the listener.\r\n unsubscribe = startListening({\r\n predicate: predicate as any,\r\n effect: (action, listenerApi): void => {\r\n // One-shot listener that cleans up as soon as the predicate passes\r\n listenerApi.unsubscribe()\r\n // Resolve the promise with the same arguments the predicate saw\r\n resolve([\r\n action,\r\n listenerApi.getState(),\r\n listenerApi.getOriginalState(),\r\n ])\r\n },\r\n })\r\n })\r\n\r\n const promises: (Promise | Promise<[AnyAction, S, S]>)[] = [\r\n promisifyAbortSignal(signal),\r\n tuplePromise,\r\n ]\r\n\r\n if (timeout != null) {\r\n promises.push(\r\n new Promise((resolve) => setTimeout(resolve, timeout, null))\r\n )\r\n }\r\n\r\n try {\r\n const output = await Promise.race(promises)\r\n\r\n validateActive(signal)\r\n return output\r\n } finally {\r\n // Always clean up the listener\r\n unsubscribe()\r\n }\r\n }\r\n\r\n return ((predicate: AnyListenerPredicate, timeout: number | undefined) =>\r\n catchRejection(take(predicate, timeout))) as TakePattern\r\n}\r\n\r\nconst getListenerEntryPropsFrom = (options: FallbackAddListenerOptions) => {\r\n let { type, actionCreator, matcher, predicate, effect } = options\r\n\r\n if (type) {\r\n predicate = createAction(type).match\r\n } else if (actionCreator) {\r\n type = actionCreator!.type\r\n predicate = actionCreator.match\r\n } else if (matcher) {\r\n predicate = matcher\r\n } else if (predicate) {\r\n // pass\r\n } else {\r\n throw new Error(\r\n 'Creating or removing a listener requires one of the known fields for matching an action'\r\n )\r\n }\r\n\r\n assertFunction(effect, 'options.listener')\r\n\r\n return { predicate, type, effect }\r\n}\r\n\r\n/** Accepts the possible options for creating a listener, and returns a formatted listener entry */\r\nexport const createListenerEntry: TypedCreateListenerEntry = (\r\n options: FallbackAddListenerOptions\r\n) => {\r\n const { type, predicate, effect } = getListenerEntryPropsFrom(options)\r\n\r\n const id = nanoid()\r\n const entry: ListenerEntry = {\r\n id,\r\n effect,\r\n type,\r\n predicate,\r\n pending: new Set(),\r\n unsubscribe: () => {\r\n throw new Error('Unsubscribe not initialized')\r\n },\r\n }\r\n\r\n return entry\r\n}\r\n\r\nconst createClearListenerMiddleware = (\r\n listenerMap: Map\r\n) => {\r\n return () => {\r\n listenerMap.forEach(cancelActiveListeners)\r\n\r\n listenerMap.clear()\r\n }\r\n}\r\n\r\n/**\r\n * Safely reports errors to the `errorHandler` provided.\r\n * Errors that occur inside `errorHandler` are notified in a new task.\r\n * Inspired by [rxjs reportUnhandledError](https://github.com/ReactiveX/rxjs/blob/6fafcf53dc9e557439b25debaeadfd224b245a66/src/internal/util/reportUnhandledError.ts)\r\n * @param errorHandler\r\n * @param errorToNotify\r\n */\r\nconst safelyNotifyError = (\r\n errorHandler: ListenerErrorHandler,\r\n errorToNotify: unknown,\r\n errorInfo: ListenerErrorInfo\r\n): void => {\r\n try {\r\n errorHandler(errorToNotify, errorInfo)\r\n } catch (errorHandlerError) {\r\n // We cannot let an error raised here block the listener queue.\r\n // The error raised here will be picked up by `window.onerror`, `process.on('error')` etc...\r\n setTimeout(() => {\r\n throw errorHandlerError\r\n }, 0)\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport const addListener = createAction(\r\n `${alm}/add`\r\n) as TypedAddListener\r\n\r\n/**\r\n * @public\r\n */\r\nexport const clearAllListeners = createAction(`${alm}/removeAll`)\r\n\r\n/**\r\n * @public\r\n */\r\nexport const removeListener = createAction(\r\n `${alm}/remove`\r\n) as TypedRemoveListener\r\n\r\nconst defaultErrorHandler: ListenerErrorHandler = (...args: unknown[]) => {\r\n console.error(`${alm}/error`, ...args)\r\n}\r\n\r\nconst cancelActiveListeners = (\r\n entry: ListenerEntry>\r\n) => {\r\n entry.pending.forEach((controller) => {\r\n abortControllerWithReason(controller, listenerCancelled)\r\n })\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport function createListenerMiddleware<\r\n S = unknown,\r\n D extends Dispatch = ThunkDispatch,\r\n ExtraArgument = unknown\r\n>(middlewareOptions: CreateListenerMiddlewareOptions = {}) {\r\n const listenerMap = new Map()\r\n const { extra, onError = defaultErrorHandler } = middlewareOptions\r\n\r\n assertFunction(onError, 'onError')\r\n\r\n const insertEntry = (entry: ListenerEntry) => {\r\n entry.unsubscribe = () => listenerMap.delete(entry!.id)\r\n\r\n listenerMap.set(entry.id, entry)\r\n return (cancelOptions?: UnsubscribeListenerOptions) => {\r\n entry.unsubscribe()\r\n if (cancelOptions?.cancelActive) {\r\n cancelActiveListeners(entry)\r\n }\r\n }\r\n }\r\n\r\n const findListenerEntry = (\r\n comparator: (entry: ListenerEntry) => boolean\r\n ): ListenerEntry | undefined => {\r\n for (const entry of listenerMap.values()) {\r\n if (comparator(entry)) {\r\n return entry\r\n }\r\n }\r\n\r\n return undefined\r\n }\r\n\r\n const startListening = (options: FallbackAddListenerOptions) => {\r\n let entry = findListenerEntry(\r\n (existingEntry) => existingEntry.effect === options.effect\r\n )\r\n\r\n if (!entry) {\r\n entry = createListenerEntry(options as any)\r\n }\r\n\r\n return insertEntry(entry)\r\n }\r\n\r\n const stopListening = (\r\n options: FallbackAddListenerOptions & UnsubscribeListenerOptions\r\n ): boolean => {\r\n const { type, effect, predicate } = getListenerEntryPropsFrom(options)\r\n\r\n const entry = findListenerEntry((entry) => {\r\n const matchPredicateOrType =\r\n typeof type === 'string'\r\n ? entry.type === type\r\n : entry.predicate === predicate\r\n\r\n return matchPredicateOrType && entry.effect === effect\r\n })\r\n\r\n if (entry) {\r\n entry.unsubscribe()\r\n if (options.cancelActive) {\r\n cancelActiveListeners(entry)\r\n }\r\n }\r\n\r\n return !!entry\r\n }\r\n\r\n const notifyListener = async (\r\n entry: ListenerEntry>,\r\n action: AnyAction,\r\n api: MiddlewareAPI,\r\n getOriginalState: () => S\r\n ) => {\r\n const internalTaskController = new AbortController()\r\n const take = createTakePattern(\r\n startListening,\r\n internalTaskController.signal\r\n )\r\n\r\n try {\r\n entry.pending.add(internalTaskController)\r\n await Promise.resolve(\r\n entry.effect(\r\n action,\r\n // Use assign() rather than ... to avoid extra helper functions added to bundle\r\n assign({}, api, {\r\n getOriginalState,\r\n condition: (\r\n predicate: AnyListenerPredicate,\r\n timeout?: number\r\n ) => take(predicate, timeout).then(Boolean),\r\n take,\r\n delay: createDelay(internalTaskController.signal),\r\n pause: createPause(internalTaskController.signal),\r\n extra,\r\n signal: internalTaskController.signal,\r\n fork: createFork(internalTaskController.signal),\r\n unsubscribe: entry.unsubscribe,\r\n subscribe: () => {\r\n listenerMap.set(entry.id, entry)\r\n },\r\n cancelActiveListeners: () => {\r\n entry.pending.forEach((controller, _, set) => {\r\n if (controller !== internalTaskController) {\r\n abortControllerWithReason(controller, listenerCancelled)\r\n set.delete(controller)\r\n }\r\n })\r\n },\r\n })\r\n )\r\n )\r\n } catch (listenerError) {\r\n if (!(listenerError instanceof TaskAbortError)) {\r\n safelyNotifyError(onError, listenerError, {\r\n raisedBy: 'effect',\r\n })\r\n }\r\n } finally {\r\n abortControllerWithReason(internalTaskController, listenerCompleted) // Notify that the task has completed\r\n entry.pending.delete(internalTaskController)\r\n }\r\n }\r\n\r\n const clearListenerMiddleware = createClearListenerMiddleware(listenerMap)\r\n\r\n const middleware: ListenerMiddleware =\r\n (api) => (next) => (action) => {\r\n if (addListener.match(action)) {\r\n return startListening(action.payload)\r\n }\r\n\r\n if (clearAllListeners.match(action)) {\r\n clearListenerMiddleware()\r\n return\r\n }\r\n\r\n if (removeListener.match(action)) {\r\n return stopListening(action.payload)\r\n }\r\n\r\n // Need to get this state _before_ the reducer processes the action\r\n let originalState: S | typeof INTERNAL_NIL_TOKEN = api.getState()\r\n\r\n // `getOriginalState` can only be called synchronously.\r\n // @see https://github.com/reduxjs/redux-toolkit/discussions/1648#discussioncomment-1932820\r\n const getOriginalState = (): S => {\r\n if (originalState === INTERNAL_NIL_TOKEN) {\r\n throw new Error(\r\n `${alm}: getOriginalState can only be called synchronously`\r\n )\r\n }\r\n\r\n return originalState as S\r\n }\r\n\r\n let result: unknown\r\n\r\n try {\r\n // Actually forward the action to the reducer before we handle listeners\r\n result = next(action)\r\n\r\n if (listenerMap.size > 0) {\r\n let currentState = api.getState()\r\n // Work around ESBuild+TS transpilation issue\r\n const listenerEntries = Array.from(listenerMap.values())\r\n for (let entry of listenerEntries) {\r\n let runListener = false\r\n\r\n try {\r\n runListener = entry.predicate(action, currentState, originalState)\r\n } catch (predicateError) {\r\n runListener = false\r\n\r\n safelyNotifyError(onError, predicateError, {\r\n raisedBy: 'predicate',\r\n })\r\n }\r\n\r\n if (!runListener) {\r\n continue\r\n }\r\n\r\n notifyListener(entry, action, api, getOriginalState)\r\n }\r\n }\r\n } finally {\r\n // Remove `originalState` store from this scope.\r\n originalState = INTERNAL_NIL_TOKEN\r\n }\r\n\r\n return result\r\n }\r\n\r\n return {\r\n middleware,\r\n startListening,\r\n stopListening,\r\n clearListeners: clearListenerMiddleware,\r\n } as ListenerMiddlewareInstance\r\n}\r\n","import { enableES5 } from 'immer'\r\nexport * from 'redux'\r\nexport {\r\n default as createNextState,\r\n current,\r\n freeze,\r\n original,\r\n isDraft,\r\n} from 'immer'\r\nexport type { Draft } from 'immer'\r\nexport { createSelector } from 'reselect'\r\nexport type {\r\n Selector,\r\n OutputParametricSelector,\r\n OutputSelector,\r\n ParametricSelector,\r\n} from 'reselect'\r\nexport { createDraftSafeSelector } from './createDraftSafeSelector'\r\nexport type { ThunkAction, ThunkDispatch } from 'redux-thunk'\r\n\r\n// We deliberately enable Immer's ES5 support, on the grounds that\r\n// we assume RTK will be used with React Native and other Proxy-less\r\n// environments. In addition, that's how Immer 4 behaved, and since\r\n// we want to ship this in an RTK minor, we should keep the same behavior.\r\nenableES5()\r\n\r\nexport {\r\n // js\r\n configureStore,\r\n} from './configureStore'\r\nexport type {\r\n // types\r\n ConfigureEnhancersCallback,\r\n ConfigureStoreOptions,\r\n EnhancedStore,\r\n} from './configureStore'\r\nexport {\r\n // js\r\n createAction,\r\n getType,\r\n} from './createAction'\r\nexport type {\r\n // types\r\n PayloadAction,\r\n PayloadActionCreator,\r\n ActionCreatorWithNonInferrablePayload,\r\n ActionCreatorWithOptionalPayload,\r\n ActionCreatorWithPayload,\r\n ActionCreatorWithoutPayload,\r\n ActionCreatorWithPreparedPayload,\r\n PrepareAction,\r\n} from './createAction'\r\nexport {\r\n // js\r\n createReducer,\r\n} from './createReducer'\r\nexport type {\r\n // types\r\n Actions,\r\n CaseReducer,\r\n CaseReducers,\r\n} from './createReducer'\r\nexport {\r\n // js\r\n createSlice,\r\n} from './createSlice'\r\n\r\nexport type {\r\n // types\r\n CreateSliceOptions,\r\n Slice,\r\n CaseReducerActions,\r\n SliceCaseReducers,\r\n ValidateSliceCaseReducers,\r\n CaseReducerWithPrepare,\r\n SliceActionCreator,\r\n} from './createSlice'\r\nexport {\r\n // js\r\n createImmutableStateInvariantMiddleware,\r\n isImmutableDefault,\r\n} from './immutableStateInvariantMiddleware'\r\nexport type {\r\n // types\r\n ImmutableStateInvariantMiddlewareOptions,\r\n} from './immutableStateInvariantMiddleware'\r\nexport {\r\n // js\r\n createSerializableStateInvariantMiddleware,\r\n findNonSerializableValue,\r\n isPlain,\r\n} from './serializableStateInvariantMiddleware'\r\nexport type {\r\n // types\r\n SerializableStateInvariantMiddlewareOptions,\r\n} from './serializableStateInvariantMiddleware'\r\nexport {\r\n // js\r\n getDefaultMiddleware,\r\n} from './getDefaultMiddleware'\r\nexport type {\r\n // types\r\n ActionReducerMapBuilder,\r\n} from './mapBuilders'\r\nexport { MiddlewareArray } from './utils'\r\n\r\nexport { createEntityAdapter } from './entities/create_adapter'\r\nexport type {\r\n Dictionary,\r\n EntityState,\r\n EntityAdapter,\r\n EntitySelectors,\r\n EntityStateAdapter,\r\n EntityId,\r\n Update,\r\n IdSelector,\r\n Comparer,\r\n} from './entities/models'\r\n\r\nexport {\r\n createAsyncThunk,\r\n unwrapResult,\r\n miniSerializeError,\r\n} from './createAsyncThunk'\r\nexport type {\r\n AsyncThunk,\r\n AsyncThunkOptions,\r\n AsyncThunkAction,\r\n AsyncThunkPayloadCreatorReturnValue,\r\n AsyncThunkPayloadCreator,\r\n SerializedError,\r\n} from './createAsyncThunk'\r\n\r\nexport {\r\n // js\r\n isAllOf,\r\n isAnyOf,\r\n isPending,\r\n isRejected,\r\n isFulfilled,\r\n isAsyncThunkAction,\r\n isRejectedWithValue,\r\n} from './matchers'\r\nexport type {\r\n // types\r\n ActionMatchingAllOf,\r\n ActionMatchingAnyOf,\r\n} from './matchers'\r\n\r\nexport { nanoid } from './nanoid'\r\n\r\nexport { default as isPlainObject } from './isPlainObject'\r\n\r\nexport type {\r\n ListenerEffect,\r\n ListenerMiddleware,\r\n ListenerEffectAPI,\r\n ListenerMiddlewareInstance,\r\n CreateListenerMiddlewareOptions,\r\n ListenerErrorHandler,\r\n TypedStartListening,\r\n TypedAddListener,\r\n TypedStopListening,\r\n TypedRemoveListener,\r\n UnsubscribeListener,\r\n UnsubscribeListenerOptions,\r\n ForkedTaskExecutor,\r\n ForkedTask,\r\n ForkedTaskAPI,\r\n AsyncTaskExecutor,\r\n SyncTaskExecutor,\r\n TaskCancelled,\r\n TaskRejected,\r\n TaskResolved,\r\n TaskResult,\r\n} from './listenerMiddleware/index'\r\n\r\nexport {\r\n createListenerMiddleware,\r\n addListener,\r\n removeListener,\r\n clearAllListeners,\r\n TaskAbortError,\r\n} from './listenerMiddleware/index'\r\n","////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Actions represent the type of change to a location value.\n */\nexport enum Action {\n /**\n * A POP indicates a change to an arbitrary index in the history stack, such\n * as a back or forward navigation. It does not describe the direction of the\n * navigation, only that the current index changed.\n *\n * Note: This is the default action for newly created history objects.\n */\n Pop = \"POP\",\n\n /**\n * A PUSH indicates a new entry being added to the history stack, such as when\n * a link is clicked and a new page loads. When this happens, all subsequent\n * entries in the stack are lost.\n */\n Push = \"PUSH\",\n\n /**\n * A REPLACE indicates the entry at the current index in the history stack\n * being replaced by a new one.\n */\n Replace = \"REPLACE\",\n}\n\n/**\n * The pathname, search, and hash values of a URL.\n */\nexport interface Path {\n /**\n * A URL pathname, beginning with a /.\n */\n pathname: string;\n\n /**\n * A URL search string, beginning with a ?.\n */\n search: string;\n\n /**\n * A URL fragment identifier, beginning with a #.\n */\n hash: string;\n}\n\n/**\n * An entry in a history stack. A location contains information about the\n * URL path, as well as possibly some arbitrary state and a key.\n */\nexport interface Location extends Path {\n /**\n * A value of arbitrary data associated with this location.\n */\n state: any;\n\n /**\n * A unique string associated with this location. May be used to safely store\n * and retrieve data in some other storage API, like `localStorage`.\n *\n * Note: This value is always \"default\" on the initial location.\n */\n key: string;\n}\n\n/**\n * A change to the current location.\n */\nexport interface Update {\n /**\n * The action that triggered the change.\n */\n action: Action;\n\n /**\n * The new location.\n */\n location: Location;\n\n /**\n * The delta between this location and the former location in the history stack\n */\n delta: number | null;\n}\n\n/**\n * A function that receives notifications about location changes.\n */\nexport interface Listener {\n (update: Update): void;\n}\n\n/**\n * Describes a location that is the destination of some navigation, either via\n * `history.push` or `history.replace`. May be either a URL or the pieces of a\n * URL path.\n */\nexport type To = string | Partial;\n\n/**\n * A history is an interface to the navigation stack. The history serves as the\n * source of truth for the current location, as well as provides a set of\n * methods that may be used to change it.\n *\n * It is similar to the DOM's `window.history` object, but with a smaller, more\n * focused API.\n */\nexport interface History {\n /**\n * The last action that modified the current location. This will always be\n * Action.Pop when a history instance is first created. This value is mutable.\n */\n readonly action: Action;\n\n /**\n * The current location. This value is mutable.\n */\n readonly location: Location;\n\n /**\n * Returns a valid href for the given `to` value that may be used as\n * the value of an attribute.\n *\n * @param to - The destination URL\n */\n createHref(to: To): string;\n\n /**\n * Returns a URL for the given `to` value\n *\n * @param to - The destination URL\n */\n createURL(to: To): URL;\n\n /**\n * Encode a location the same way window.history would do (no-op for memory\n * history) so we ensure our PUSH/REPLACE navigations for data routers\n * behave the same as POP\n *\n * @param to Unencoded path\n */\n encodeLocation(to: To): Path;\n\n /**\n * Pushes a new location onto the history stack, increasing its length by one.\n * If there were any entries in the stack after the current one, they are\n * lost.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n push(to: To, state?: any): void;\n\n /**\n * Replaces the current location in the history stack with a new one. The\n * location that was replaced will no longer be available.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n replace(to: To, state?: any): void;\n\n /**\n * Navigates `n` entries backward/forward in the history stack relative to the\n * current index. For example, a \"back\" navigation would use go(-1).\n *\n * @param delta - The delta in the stack index\n */\n go(delta: number): void;\n\n /**\n * Sets up a listener that will be called whenever the current location\n * changes.\n *\n * @param listener - A function that will be called when the location changes\n * @returns unlisten - A function that may be used to stop listening\n */\n listen(listener: Listener): () => void;\n}\n\ntype HistoryState = {\n usr: any;\n key?: string;\n idx: number;\n};\n\nconst PopStateEventType = \"popstate\";\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Memory History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A user-supplied object that describes a location. Used when providing\n * entries to `createMemoryHistory` via its `initialEntries` option.\n */\nexport type InitialEntry = string | Partial;\n\nexport type MemoryHistoryOptions = {\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n v5Compat?: boolean;\n};\n\n/**\n * A memory history stores locations in memory. This is useful in stateful\n * environments where there is no web browser, such as node tests or React\n * Native.\n */\nexport interface MemoryHistory extends History {\n /**\n * The current index in the history stack.\n */\n readonly index: number;\n}\n\n/**\n * Memory history stores the current location in memory. It is designed for use\n * in stateful non-browser environments like tests and React Native.\n */\nexport function createMemoryHistory(\n options: MemoryHistoryOptions = {}\n): MemoryHistory {\n let { initialEntries = [\"/\"], initialIndex, v5Compat = false } = options;\n let entries: Location[]; // Declare so we can access from createMemoryLocation\n entries = initialEntries.map((entry, index) =>\n createMemoryLocation(\n entry,\n typeof entry === \"string\" ? null : entry.state,\n index === 0 ? \"default\" : undefined\n )\n );\n let index = clampIndex(\n initialIndex == null ? entries.length - 1 : initialIndex\n );\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n function clampIndex(n: number): number {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n function getCurrentLocation(): Location {\n return entries[index];\n }\n function createMemoryLocation(\n to: To,\n state: any = null,\n key?: string\n ): Location {\n let location = createLocation(\n entries ? getCurrentLocation().pathname : \"/\",\n to,\n state,\n key\n );\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in memory history: ${JSON.stringify(\n to\n )}`\n );\n return location;\n }\n\n function createHref(to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n let history: MemoryHistory = {\n get index() {\n return index;\n },\n get action() {\n return action;\n },\n get location() {\n return getCurrentLocation();\n },\n createHref,\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n encodeLocation(to: To) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\",\n };\n },\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 1 });\n }\n },\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 0 });\n }\n },\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n if (listener) {\n listener({ action, location: nextLocation, delta });\n }\n },\n listen(fn: Listener) {\n listener = fn;\n return () => {\n listener = null;\n };\n },\n };\n\n return history;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Browser History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A browser history stores the current location in regular URLs in a web\n * browser environment. This is the standard for most web apps and provides the\n * cleanest URLs the browser's address bar.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory\n */\nexport interface BrowserHistory extends UrlHistory {}\n\nexport type BrowserHistoryOptions = UrlHistoryOptions;\n\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\nexport function createBrowserHistory(\n options: BrowserHistoryOptions = {}\n): BrowserHistory {\n function createBrowserLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let { pathname, search, hash } = window.location;\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createBrowserHref(window: Window, to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(\n createBrowserLocation,\n createBrowserHref,\n null,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hash History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A hash history stores the current location in the fragment identifier portion\n * of the URL in a web browser environment.\n *\n * This is ideal for apps that do not control the server for some reason\n * (because the fragment identifier is never sent to the server), including some\n * shared hosting environments that do not provide fine-grained controls over\n * which pages are served at which URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#hashhistory\n */\nexport interface HashHistory extends UrlHistory {}\n\nexport type HashHistoryOptions = UrlHistoryOptions;\n\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\nexport function createHashHistory(\n options: HashHistoryOptions = {}\n): HashHistory {\n function createHashLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createHashHref(window: Window, to: To) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location: Location, to: To) {\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in hash history.push(${JSON.stringify(\n to\n )})`\n );\n }\n\n return getUrlBasedHistory(\n createHashLocation,\n createHashHref,\n validateHashLocation,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region UTILS\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n */\nexport function invariant(value: boolean, message?: string): asserts value;\nexport function invariant(\n value: T | null | undefined,\n message?: string\n): asserts value is T;\nexport function invariant(value: any, message?: string) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nfunction warning(cond: any, message: string) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n\n/**\n * For browser-based histories, we combine the state and key into an object\n */\nfunction getHistoryState(location: Location, index: number): HistoryState {\n return {\n usr: location.state,\n key: location.key,\n idx: index,\n };\n}\n\n/**\n * Creates a Location object with a unique key from the given Path\n */\nexport function createLocation(\n current: string | Location,\n to: To,\n state: any = null,\n key?: string\n): Readonly {\n let location: Readonly = {\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\",\n ...(typeof to === \"string\" ? parsePath(to) : to),\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: (to && (to as Location).key) || key || createKey(),\n };\n return location;\n}\n\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\nexport function createPath({\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n}: Partial) {\n if (search && search !== \"?\")\n pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\")\n pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\nexport function parsePath(path: string): Partial {\n let parsedPath: Partial = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport interface UrlHistory extends History {}\n\nexport type UrlHistoryOptions = {\n window?: Window;\n v5Compat?: boolean;\n};\n\nfunction getUrlBasedHistory(\n getLocation: (window: Window, globalHistory: Window[\"history\"]) => Location,\n createHref: (window: Window, to: To) => string,\n validateLocation: ((location: Location, to: To) => void) | null,\n options: UrlHistoryOptions = {}\n): UrlHistory {\n let { window = document.defaultView!, v5Compat = false } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n let index = getIndex()!;\n // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n if (index == null) {\n index = 0;\n globalHistory.replaceState({ ...globalHistory.state, idx: index }, \"\");\n }\n\n function getIndex(): number {\n let state = globalHistory.state || { idx: null };\n return state.idx;\n }\n\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n if (listener) {\n listener({ action, location: history.location, delta });\n }\n }\n\n function push(to: To, state?: any) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n\n // try...catch because iOS limits us to 100 pushState calls :/\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 1 });\n }\n }\n\n function replace(to: To, state?: any) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 0 });\n }\n }\n\n function createURL(to: To): URL {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base =\n window.location.origin !== \"null\"\n ? window.location.origin\n : window.location.href;\n\n let href = typeof to === \"string\" ? to : createPath(to);\n invariant(\n base,\n `No window.location.(origin|href) available to create URL for href: ${href}`\n );\n return new URL(href, base);\n }\n\n let history: History = {\n get action() {\n return action;\n },\n get location() {\n return getLocation(window, globalHistory);\n },\n listen(fn: Listener) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n createHref(to) {\n return createHref(window, to);\n },\n createURL,\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n };\n },\n push,\n replace,\n go(n) {\n return globalHistory.go(n);\n },\n };\n\n return history;\n}\n\n//#endregion\n","import type { Location, Path, To } from \"./history\";\nimport { invariant, parsePath } from \"./history\";\n\n/**\n * Map of routeId -> data returned from a loader/action/error\n */\nexport interface RouteData {\n [routeId: string]: any;\n}\n\nexport enum ResultType {\n data = \"data\",\n deferred = \"deferred\",\n redirect = \"redirect\",\n error = \"error\",\n}\n\n/**\n * Successful result from a loader or action\n */\nexport interface SuccessResult {\n type: ResultType.data;\n data: any;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Successful defer() result from a loader or action\n */\nexport interface DeferredResult {\n type: ResultType.deferred;\n deferredData: DeferredData;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Redirect result from a loader or action\n */\nexport interface RedirectResult {\n type: ResultType.redirect;\n status: number;\n location: string;\n revalidate: boolean;\n}\n\n/**\n * Unsuccessful result from a loader or action\n */\nexport interface ErrorResult {\n type: ResultType.error;\n error: any;\n headers?: Headers;\n}\n\n/**\n * Result from a loader or action - potentially successful or unsuccessful\n */\nexport type DataResult =\n | SuccessResult\n | DeferredResult\n | RedirectResult\n | ErrorResult;\n\nexport type MutationFormMethod = \"post\" | \"put\" | \"patch\" | \"delete\";\nexport type FormMethod = \"get\" | MutationFormMethod;\n\nexport type FormEncType =\n | \"application/x-www-form-urlencoded\"\n | \"multipart/form-data\";\n\n/**\n * @private\n * Internal interface to pass around for action submissions, not intended for\n * external consumption\n */\nexport interface Submission {\n formMethod: FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n}\n\n/**\n * @private\n * Arguments passed to route loader/action functions. Same for now but we keep\n * this as a private implementation detail in case they diverge in the future.\n */\ninterface DataFunctionArgs {\n request: Request;\n params: Params;\n context?: any;\n}\n\n/**\n * Arguments passed to loader functions\n */\nexport interface LoaderFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Arguments passed to action functions\n */\nexport interface ActionFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Route loader function signature\n */\nexport interface LoaderFunction {\n (args: LoaderFunctionArgs): Promise | Response | Promise | any;\n}\n\n/**\n * Route action function signature\n */\nexport interface ActionFunction {\n (args: ActionFunctionArgs): Promise | Response | Promise | any;\n}\n\n/**\n * Route shouldRevalidate function signature. This runs after any submission\n * (navigation or fetcher), so we flatten the navigation/fetcher submission\n * onto the arguments. It shouldn't matter whether it came from a navigation\n * or a fetcher, what really matters is the URLs and the formData since loaders\n * have to re-run based on the data models that were potentially mutated.\n */\nexport interface ShouldRevalidateFunction {\n (args: {\n currentUrl: URL;\n currentParams: AgnosticDataRouteMatch[\"params\"];\n nextUrl: URL;\n nextParams: AgnosticDataRouteMatch[\"params\"];\n formMethod?: Submission[\"formMethod\"];\n formAction?: Submission[\"formAction\"];\n formEncType?: Submission[\"formEncType\"];\n formData?: Submission[\"formData\"];\n actionResult?: DataResult;\n defaultShouldRevalidate: boolean;\n }): boolean;\n}\n\n/**\n * Base RouteObject with common props shared by all types of routes\n */\ntype AgnosticBaseRouteObject = {\n caseSensitive?: boolean;\n path?: string;\n id?: string;\n loader?: LoaderFunction;\n action?: ActionFunction;\n hasErrorBoundary?: boolean;\n shouldRevalidate?: ShouldRevalidateFunction;\n handle?: any;\n};\n\n/**\n * Index routes must not have children\n */\nexport type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {\n children?: undefined;\n index: true;\n};\n\n/**\n * Non-index routes may have children, but cannot have index\n */\nexport type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {\n children?: AgnosticRouteObject[];\n index?: false;\n};\n\n/**\n * A route object represents a logical route, with (optionally) its child\n * routes organized in a tree-like structure.\n */\nexport type AgnosticRouteObject =\n | AgnosticIndexRouteObject\n | AgnosticNonIndexRouteObject;\n\nexport type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {\n id: string;\n};\n\nexport type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {\n children?: AgnosticDataRouteObject[];\n id: string;\n};\n\n/**\n * A data route object, which is just a RouteObject with a required unique ID\n */\nexport type AgnosticDataRouteObject =\n | AgnosticDataIndexRouteObject\n | AgnosticDataNonIndexRouteObject;\n\n// Recursive helper for finding path parameters in the absence of wildcards\ntype _PathParam =\n // split path into individual path segments\n Path extends `${infer L}/${infer R}`\n ? _PathParam | _PathParam\n : // find params after `:`\n Path extends `:${infer Param}`\n ? Param extends `${infer Optional}?`\n ? Optional\n : Param\n : // otherwise, there aren't any params present\n never;\n\n/**\n * Examples:\n * \"/a/b/*\" -> \"*\"\n * \":a\" -> \"a\"\n * \"/a/:b\" -> \"b\"\n * \"/a/blahblahblah:b\" -> \"b\"\n * \"/:a/:b\" -> \"a\" | \"b\"\n * \"/:a/b/:c/*\" -> \"a\" | \"c\" | \"*\"\n */\ntype PathParam =\n // check if path is just a wildcard\n Path extends \"*\"\n ? \"*\"\n : // look for wildcard at the end of the path\n Path extends `${infer Rest}/*`\n ? \"*\" | _PathParam\n : // look for params in the absence of wildcards\n _PathParam;\n\n// Attempt to parse the given string segment. If it fails, then just return the\n// plain string type as a default fallback. Otherwise return the union of the\n// parsed string literals that were referenced as dynamic segments in the route.\nexport type ParamParseKey =\n // if could not find path params, fallback to `string`\n [PathParam] extends [never] ? string : PathParam;\n\n/**\n * The parameters that were parsed from the URL path.\n */\nexport type Params = {\n readonly [key in Key]: string | undefined;\n};\n\n/**\n * A RouteMatch contains info about how a route matched a URL.\n */\nexport interface AgnosticRouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObjectType;\n}\n\nexport interface AgnosticDataRouteMatch\n extends AgnosticRouteMatch {}\n\nfunction isIndexRoute(\n route: AgnosticRouteObject\n): route is AgnosticIndexRouteObject {\n return route.index === true;\n}\n\n// Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\nexport function convertRoutesToDataRoutes(\n routes: AgnosticRouteObject[],\n parentPath: number[] = [],\n allIds: Set = new Set()\n): AgnosticDataRouteObject[] {\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(\n route.index !== true || !route.children,\n `Cannot specify children on an index route`\n );\n invariant(\n !allIds.has(id),\n `Found a route id collision on id \"${id}\". Route ` +\n \"id's must be globally unique within Data Router usages\"\n );\n allIds.add(id);\n\n if (isIndexRoute(route)) {\n let indexRoute: AgnosticDataIndexRouteObject = { ...route, id };\n return indexRoute;\n } else {\n let pathOrLayoutRoute: AgnosticDataNonIndexRouteObject = {\n ...route,\n id,\n children: route.children\n ? convertRoutesToDataRoutes(route.children, treePath, allIds)\n : undefined,\n };\n return pathOrLayoutRoute;\n }\n });\n}\n\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\nexport function matchRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n locationArg: Partial | string,\n basename = \"/\"\n): AgnosticRouteMatch[] | null {\n let location =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(\n branches[i],\n // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname)\n );\n }\n\n return matches;\n}\n\ninterface RouteMeta<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n relativePath: string;\n caseSensitive: boolean;\n childrenIndex: number;\n route: RouteObjectType;\n}\n\ninterface RouteBranch<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n path: string;\n score: number;\n routesMeta: RouteMeta[];\n}\n\nfunction flattenRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n branches: RouteBranch[] = [],\n parentsMeta: RouteMeta[] = [],\n parentPath = \"\"\n): RouteBranch[] {\n let flattenRoute = (\n route: RouteObjectType,\n index: number,\n relativePath?: string\n ) => {\n let meta: RouteMeta = {\n relativePath:\n relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route,\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(\n meta.relativePath.startsWith(parentPath),\n `Absolute route path \"${meta.relativePath}\" nested under path ` +\n `\"${parentPath}\" is not valid. An absolute child route path ` +\n `must start with the combined path of all its parent routes.`\n );\n\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\n\n // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n if (route.children && route.children.length > 0) {\n invariant(\n // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true,\n `Index routes must not have child routes. Please remove ` +\n `all child routes from route path \"${path}\".`\n );\n\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n\n // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta,\n });\n };\n routes.forEach((route, index) => {\n // coarse-grain check for optional params\n if (route.path === \"\" || !route.path?.includes(\"?\")) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n\n return branches;\n}\n\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\nfunction explodeOptionalSegments(path: string): string[] {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n\n let [first, ...rest] = segments;\n\n // Optional path segments are denoted by a trailing `?`\n let isOptional = first.endsWith(\"?\");\n // Compute the corresponding required segment: `foo?` -> `foo`\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n\n let result: string[] = [];\n\n // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n result.push(\n ...restExploded.map((subpath) =>\n subpath === \"\" ? required : [required, subpath].join(\"/\")\n )\n );\n\n // Then if this is an optional value, add all child versions without\n if (isOptional) {\n result.push(...restExploded);\n }\n\n // for absolute paths, ensure `/` instead of empty segment\n return result.map((exploded) =>\n path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded\n );\n}\n\nfunction rankRouteBranches(branches: RouteBranch[]): void {\n branches.sort((a, b) =>\n a.score !== b.score\n ? b.score - a.score // Higher score first\n : compareIndexes(\n a.routesMeta.map((meta) => meta.childrenIndex),\n b.routesMeta.map((meta) => meta.childrenIndex)\n )\n );\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = (s: string) => s === \"*\";\n\nfunction computeScore(path: string, index: boolean | undefined): number {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments\n .filter((s) => !isSplat(s))\n .reduce(\n (score, segment) =>\n score +\n (paramRe.test(segment)\n ? dynamicSegmentValue\n : segment === \"\"\n ? emptySegmentValue\n : staticSegmentValue),\n initialScore\n );\n}\n\nfunction compareIndexes(a: number[], b: number[]): number {\n let siblings =\n a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n\n return siblings\n ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1]\n : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n branch: RouteBranch,\n pathname: string\n): AgnosticRouteMatch[] | null {\n let { routesMeta } = branch;\n\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches: AgnosticRouteMatch[] = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname =\n matchedPathname === \"/\"\n ? pathname\n : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath(\n { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },\n remainingPathname\n );\n\n if (!match) return null;\n\n Object.assign(matchedParams, match.params);\n\n let route = meta.route;\n\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams as Params,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(\n joinPaths([matchedPathname, match.pathnameBase])\n ),\n route,\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\nexport function generatePath(\n originalPath: Path,\n params: {\n [key in PathParam]: string | null;\n } = {} as any\n): string {\n let path = originalPath;\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(\n false,\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n path = path.replace(/\\*$/, \"/*\") as Path;\n }\n\n return (\n path\n .replace(\n /^:(\\w+)(\\??)/g,\n (_, key: PathParam, optional: string | undefined) => {\n let param = params[key];\n if (optional === \"?\") {\n return param == null ? \"\" : param;\n }\n if (param == null) {\n invariant(false, `Missing \":${key}\" param`);\n }\n return param;\n }\n )\n .replace(\n /\\/:(\\w+)(\\??)/g,\n (_, key: PathParam, optional: string | undefined) => {\n let param = params[key];\n if (optional === \"?\") {\n return param == null ? \"\" : `/${param}`;\n }\n if (param == null) {\n invariant(false, `Missing \":${key}\" param`);\n }\n return `/${param}`;\n }\n )\n // Remove any optional markers from optional static segments\n .replace(/\\?/g, \"\")\n .replace(/(\\/?)\\*/, (_, prefix, __, str) => {\n const star = \"*\" as PathParam;\n\n if (params[star] == null) {\n // If no splat was provided, trim the trailing slash _unless_ it's\n // the entire path\n return str === \"/*\" ? \"/\" : \"\";\n }\n\n // Apply the splat\n return `${prefix}${params[star]}`;\n })\n );\n}\n\n/**\n * A PathPattern is used to match on some portion of a URL pathname.\n */\nexport interface PathPattern {\n /**\n * A string to match against a URL pathname. May contain `:id`-style segments\n * to indicate placeholders for dynamic parameters. May also end with `/*` to\n * indicate matching the rest of the URL pathname.\n */\n path: Path;\n /**\n * Should be `true` if the static portions of the `path` should be matched in\n * the same case.\n */\n caseSensitive?: boolean;\n /**\n * Should be `true` if this pattern should match the entire URL pathname.\n */\n end?: boolean;\n}\n\n/**\n * A PathMatch contains info about how a PathPattern matched on a URL pathname.\n */\nexport interface PathMatch {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The pattern that was used to match.\n */\n pattern: PathPattern;\n}\n\ntype Mutable = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\nexport function matchPath<\n ParamKey extends ParamParseKey,\n Path extends string\n>(\n pattern: PathPattern | Path,\n pathname: string\n): PathMatch | null {\n if (typeof pattern === \"string\") {\n pattern = { path: pattern, caseSensitive: false, end: true };\n }\n\n let [matcher, paramNames] = compilePath(\n pattern.path,\n pattern.caseSensitive,\n pattern.end\n );\n\n let match = pathname.match(matcher);\n if (!match) return null;\n\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params: Params = paramNames.reduce>(\n (memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname\n .slice(0, matchedPathname.length - splatValue.length)\n .replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(\n captureGroups[index] || \"\",\n paramName\n );\n return memo;\n },\n {}\n );\n\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern,\n };\n}\n\nfunction compilePath(\n path: string,\n caseSensitive = false,\n end = true\n): [RegExp, string[]] {\n warning(\n path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"),\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n\n let paramNames: string[] = [];\n let regexpSource =\n \"^\" +\n path\n .replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_: string, paramName: string) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource +=\n path === \"*\" || path === \"/*\"\n ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else {\n // Nothing to match for \"\" or \"/\"\n }\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value: string) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(\n false,\n `The URL path \"${value}\" could not be decoded because it is is a ` +\n `malformed URL segment. This is probably due to a bad percent ` +\n `encoding (${error}).`\n );\n\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value: string, paramName: string) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(\n false,\n `The value for the URL param \"${paramName}\" will not be decoded because` +\n ` the string \"${value}\" is a malformed URL segment. This is probably` +\n ` due to a bad percent encoding (${error}).`\n );\n\n return value;\n }\n}\n\n/**\n * @private\n */\nexport function stripBasename(\n pathname: string,\n basename: string\n): string | null {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n let startIndex = basename.endsWith(\"/\")\n ? basename.length - 1\n : basename.length;\n let nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n\n/**\n * @private\n */\nexport function warning(cond: any, message: string): void {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging @remix-run/router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\nexport function resolvePath(to: To, fromPathname = \"/\"): Path {\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\",\n } = typeof to === \"string\" ? parsePath(to) : to;\n\n let pathname = toPathname\n ? toPathname.startsWith(\"/\")\n ? toPathname\n : resolvePathname(toPathname, fromPathname)\n : fromPathname;\n\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash),\n };\n}\n\nfunction resolvePathname(relativePath: string, fromPathname: string): string {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n\n relativeSegments.forEach((segment) => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(\n char: string,\n field: string,\n dest: string,\n path: Partial\n) {\n return (\n `Cannot include a '${char}' character in a manually specified ` +\n `\\`to.${field}\\` field [${JSON.stringify(\n path\n )}]. Please separate it out to the ` +\n `\\`to.${dest}\\` field. Alternatively you may provide the full path as ` +\n `a string in and the router will parse it for you.`\n );\n}\n\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * \n * \n * \n *\n * \n * \n * }> // <-- Does not contribute\n * // <-- Does not contribute\n * \n * \n */\nexport function getPathContributingMatches<\n T extends AgnosticRouteMatch = AgnosticRouteMatch\n>(matches: T[]) {\n return matches.filter(\n (match, index) =>\n index === 0 || (match.route.path && match.route.path.length > 0)\n );\n}\n\n/**\n * @private\n */\nexport function resolveTo(\n toArg: To,\n routePathnames: string[],\n locationPathname: string,\n isPathRelative = false\n): Path {\n let to: Partial;\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = { ...toArg };\n\n invariant(\n !to.pathname || !to.pathname.includes(\"?\"),\n getInvalidPathError(\"?\", \"pathname\", \"search\", to)\n );\n invariant(\n !to.pathname || !to.pathname.includes(\"#\"),\n getInvalidPathError(\"#\", \"pathname\", \"hash\", to)\n );\n invariant(\n !to.search || !to.search.includes(\"#\"),\n getInvalidPathError(\"#\", \"search\", \"hash\", to)\n );\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n\n let from: string;\n\n // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n\n // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n }\n\n // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from);\n\n // Ensure the pathname has a trailing slash if the original \"to\" had one\n let hasExplicitTrailingSlash =\n toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n // Or if this was a link to the current path which has a trailing slash\n let hasCurrentTrailingSlash =\n (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n if (\n !path.pathname.endsWith(\"/\") &&\n (hasExplicitTrailingSlash || hasCurrentTrailingSlash)\n ) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n\n/**\n * @private\n */\nexport function getToPathname(to: To): string | undefined {\n // Empty strings should be treated the same as / paths\n return to === \"\" || (to as Path).pathname === \"\"\n ? \"/\"\n : typeof to === \"string\"\n ? parsePath(to).pathname\n : to.pathname;\n}\n\n/**\n * @private\n */\nexport const joinPaths = (paths: string[]): string =>\n paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n\n/**\n * @private\n */\nexport const normalizePathname = (pathname: string): string =>\n pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n\n/**\n * @private\n */\nexport const normalizeSearch = (search: string): string =>\n !search || search === \"?\"\n ? \"\"\n : search.startsWith(\"?\")\n ? search\n : \"?\" + search;\n\n/**\n * @private\n */\nexport const normalizeHash = (hash: string): string =>\n !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n\nexport type JsonFunction = (\n data: Data,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\nexport const json: JsonFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n let headers = new Headers(responseInit.headers);\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), {\n ...responseInit,\n headers,\n });\n};\n\nexport interface TrackedPromise extends Promise {\n _tracked?: boolean;\n _data?: any;\n _error?: any;\n}\n\nexport class AbortedDeferredError extends Error {}\n\nexport class DeferredData {\n private pendingKeysSet: Set = new Set();\n private controller: AbortController;\n private abortPromise: Promise;\n private unlistenAbortSignal: () => void;\n private subscribers: Set<(aborted: boolean, settledKey?: string) => void> =\n new Set();\n data: Record;\n init?: ResponseInit;\n deferredKeys: string[] = [];\n\n constructor(data: Record, responseInit?: ResponseInit) {\n invariant(\n data && typeof data === \"object\" && !Array.isArray(data),\n \"defer() only accepts plain objects\"\n );\n\n // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n let reject: (e: AbortedDeferredError) => void;\n this.abortPromise = new Promise((_, r) => (reject = r));\n this.controller = new AbortController();\n let onAbort = () =>\n reject(new AbortedDeferredError(\"Deferred data aborted\"));\n this.unlistenAbortSignal = () =>\n this.controller.signal.removeEventListener(\"abort\", onAbort);\n this.controller.signal.addEventListener(\"abort\", onAbort);\n\n this.data = Object.entries(data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: this.trackPromise(key, value),\n }),\n {}\n );\n\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n\n this.init = responseInit;\n }\n\n private trackPromise(\n key: string,\n value: Promise | unknown\n ): TrackedPromise | unknown {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key);\n\n // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n let promise: TrackedPromise = Promise.race([value, this.abortPromise]).then(\n (data) => this.onSettle(promise, key, null, data as unknown),\n (error) => this.onSettle(promise, key, error as unknown)\n );\n\n // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n promise.catch(() => {});\n\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n return promise;\n }\n\n private onSettle(\n promise: TrackedPromise,\n key: string,\n error: unknown,\n data?: unknown\n ): unknown {\n if (\n this.controller.signal.aborted &&\n error instanceof AbortedDeferredError\n ) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", { get: () => error });\n return Promise.reject(error);\n }\n\n this.pendingKeysSet.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n if (error) {\n Object.defineProperty(promise, \"_error\", { get: () => error });\n this.emit(false, key);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", { get: () => data });\n this.emit(false, key);\n return data;\n }\n\n private emit(aborted: boolean, settledKey?: string) {\n this.subscribers.forEach((subscriber) => subscriber(aborted, settledKey));\n }\n\n subscribe(fn: (aborted: boolean, settledKey?: string) => void) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n\n async resolveData(signal: AbortSignal) {\n let aborted = false;\n if (!this.done) {\n let onAbort = () => this.cancel();\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise((resolve) => {\n this.subscribe((aborted) => {\n signal.removeEventListener(\"abort\", onAbort);\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n return aborted;\n }\n\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n\n get unwrappedData() {\n invariant(\n this.data !== null && this.done,\n \"Can only unwrap data on initialized and settled deferreds\"\n );\n\n return Object.entries(this.data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: unwrapTrackedPromise(value),\n }),\n {}\n );\n }\n\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n}\n\nfunction isTrackedPromise(value: any): value is TrackedPromise {\n return (\n value instanceof Promise && (value as TrackedPromise)._tracked === true\n );\n}\n\nfunction unwrapTrackedPromise(value: any) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n return value._data;\n}\n\nexport type DeferFunction = (\n data: Record,\n init?: number | ResponseInit\n) => DeferredData;\n\nexport const defer: DeferFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n return new DeferredData(data, responseInit);\n};\n\nexport type RedirectFunction = (\n url: string,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nexport const redirect: RedirectFunction = (url, init = 302) => {\n let responseInit = init;\n if (typeof responseInit === \"number\") {\n responseInit = { status: responseInit };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n\n return new Response(null, {\n ...responseInit,\n headers,\n });\n};\n\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\nexport class ErrorResponse {\n status: number;\n statusText: string;\n data: any;\n error?: Error;\n internal: boolean;\n\n constructor(\n status: number,\n statusText: string | undefined,\n data: any,\n internal = false\n ) {\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n}\n\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\nexport function isRouteErrorResponse(error: any): error is ErrorResponse {\n return (\n error != null &&\n typeof error.status === \"number\" &&\n typeof error.statusText === \"string\" &&\n typeof error.internal === \"boolean\" &&\n \"data\" in error\n );\n}\n","import type { History, Location, Path, To } from \"./history\";\nimport {\n Action as HistoryAction,\n createLocation,\n createPath,\n invariant,\n parsePath,\n} from \"./history\";\nimport type {\n DataResult,\n AgnosticDataRouteMatch,\n AgnosticDataRouteObject,\n DeferredResult,\n ErrorResult,\n FormEncType,\n FormMethod,\n RedirectResult,\n RouteData,\n AgnosticRouteObject,\n Submission,\n SuccessResult,\n AgnosticRouteMatch,\n MutationFormMethod,\n ShouldRevalidateFunction,\n} from \"./utils\";\nimport {\n DeferredData,\n ErrorResponse,\n ResultType,\n convertRoutesToDataRoutes,\n getPathContributingMatches,\n isRouteErrorResponse,\n joinPaths,\n matchRoutes,\n resolveTo,\n warning,\n} from \"./utils\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A Router instance manages all navigation and data loading/mutations\n */\nexport interface Router {\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the basename for the router\n */\n get basename(): RouterInit[\"basename\"];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the current state of the router\n */\n get state(): RouterState;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the routes for this router instance\n */\n get routes(): AgnosticDataRouteObject[];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Initialize the router, including adding history listeners and kicking off\n * initial data fetches. Returns a function to cleanup listeners and abort\n * any in-progress loads\n */\n initialize(): Router;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Subscribe to router.state updates\n *\n * @param fn function to call with the new state\n */\n subscribe(fn: RouterSubscriber): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Enable scroll restoration behavior in the router\n *\n * @param savedScrollPositions Object that will manage positions, in case\n * it's being restored from sessionStorage\n * @param getScrollPosition Function to get the active Y scroll position\n * @param getKey Function to get the key to use for restoration\n */\n enableScrollRestoration(\n savedScrollPositions: Record,\n getScrollPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Navigate forward/backward in the history stack\n * @param to Delta to move in the history stack\n */\n navigate(to: number): Promise;\n\n /**\n * Navigate to the given path\n * @param to Path to navigate to\n * @param opts Navigation options (method, submission, etc.)\n */\n navigate(to: To, opts?: RouterNavigateOptions): Promise;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a fetcher load/submission\n *\n * @param key Fetcher key\n * @param routeId Route that owns the fetcher\n * @param href href to fetch\n * @param opts Fetcher options, (method, submission, etc.)\n */\n fetch(\n key: string,\n routeId: string,\n href: string,\n opts?: RouterNavigateOptions\n ): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a revalidation of all current route loaders and fetcher loads\n */\n revalidate(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to create an href for the given location\n * @param location\n */\n createHref(location: Location | URL): string;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to URL encode a destination path according to the internal\n * history implementation\n * @param to\n */\n encodeLocation(to: To): Path;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get/create a fetcher for the given key\n * @param key\n */\n getFetcher(key?: string): Fetcher;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete the fetcher for a given key\n * @param key\n */\n deleteFetcher(key?: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Cleanup listeners and abort any in-progress loads\n */\n dispose(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get a navigation blocker\n * @param key The identifier for the blocker\n * @param fn The blocker function implementation\n */\n getBlocker(key: string, fn: BlockerFunction): Blocker;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete a navigation blocker\n * @param key The identifier for the blocker\n */\n deleteBlocker(key: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal fetch AbortControllers accessed by unit tests\n */\n _internalFetchControllers: Map;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal pending DeferredData instances accessed by unit tests\n */\n _internalActiveDeferreds: Map;\n}\n\n/**\n * State maintained internally by the router. During a navigation, all states\n * reflect the the \"old\" location unless otherwise noted.\n */\nexport interface RouterState {\n /**\n * The action of the most recent navigation\n */\n historyAction: HistoryAction;\n\n /**\n * The current location reflected by the router\n */\n location: Location;\n\n /**\n * The current set of route matches\n */\n matches: AgnosticDataRouteMatch[];\n\n /**\n * Tracks whether we've completed our initial data load\n */\n initialized: boolean;\n\n /**\n * Current scroll position we should start at for a new view\n * - number -> scroll position to restore to\n * - false -> do not restore scroll at all (used during submissions)\n * - null -> don't have a saved position, scroll to hash or top of page\n */\n restoreScrollPosition: number | false | null;\n\n /**\n * Indicate whether this navigation should skip resetting the scroll position\n * if we are unable to restore the scroll position\n */\n preventScrollReset: boolean;\n\n /**\n * Tracks the state of the current navigation\n */\n navigation: Navigation;\n\n /**\n * Tracks any in-progress revalidations\n */\n revalidation: RevalidationState;\n\n /**\n * Data from the loaders for the current matches\n */\n loaderData: RouteData;\n\n /**\n * Data from the action for the current matches\n */\n actionData: RouteData | null;\n\n /**\n * Errors caught from loaders for the current matches\n */\n errors: RouteData | null;\n\n /**\n * Map of current fetchers\n */\n fetchers: Map;\n\n /**\n * Map of current blockers\n */\n blockers: Map;\n}\n\n/**\n * Data that can be passed into hydrate a Router from SSR\n */\nexport type HydrationState = Partial<\n Pick\n>;\n\n/**\n * Initialization options for createRouter\n */\nexport interface RouterInit {\n basename?: string;\n routes: AgnosticRouteObject[];\n history: History;\n hydrationData?: HydrationState;\n}\n\n/**\n * State returned from a server-side query() call\n */\nexport interface StaticHandlerContext {\n basename: Router[\"basename\"];\n location: RouterState[\"location\"];\n matches: RouterState[\"matches\"];\n loaderData: RouterState[\"loaderData\"];\n actionData: RouterState[\"actionData\"];\n errors: RouterState[\"errors\"];\n statusCode: number;\n loaderHeaders: Record;\n actionHeaders: Record;\n activeDeferreds: Record | null;\n _deepestRenderedBoundaryId?: string | null;\n}\n\n/**\n * A StaticHandler instance manages a singular SSR navigation/fetch event\n */\nexport interface StaticHandler {\n dataRoutes: AgnosticDataRouteObject[];\n query(\n request: Request,\n opts?: { requestContext?: unknown }\n ): Promise;\n queryRoute(\n request: Request,\n opts?: { routeId?: string; requestContext?: unknown }\n ): Promise;\n}\n\n/**\n * Subscriber function signature for changes to router state\n */\nexport interface RouterSubscriber {\n (state: RouterState): void;\n}\n\ninterface UseMatchesMatch {\n id: string;\n pathname: string;\n params: AgnosticRouteMatch[\"params\"];\n data: unknown;\n handle: unknown;\n}\n\n/**\n * Function signature for determining the key to be used in scroll restoration\n * for a given location\n */\nexport interface GetScrollRestorationKeyFunction {\n (location: Location, matches: UseMatchesMatch[]): string | null;\n}\n\n/**\n * Function signature for determining the current scroll position\n */\nexport interface GetScrollPositionFunction {\n (): number;\n}\n\n/**\n * Options for a navigate() call for a Link navigation\n */\ntype LinkNavigateOptions = {\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n};\n\n/**\n * Options for a navigate() call for a Form navigation\n */\ntype SubmissionNavigateOptions = {\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n formMethod?: FormMethod;\n formEncType?: FormEncType;\n formData: FormData;\n};\n\n/**\n * Options to pass to navigate() for either a Link or Form navigation\n */\nexport type RouterNavigateOptions =\n | LinkNavigateOptions\n | SubmissionNavigateOptions;\n\n/**\n * Options to pass to fetch()\n */\nexport type RouterFetchOptions =\n | Omit\n | Omit;\n\n/**\n * Potential states for state.navigation\n */\nexport type NavigationStates = {\n Idle: {\n state: \"idle\";\n location: undefined;\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n formData: undefined;\n };\n Loading: {\n state: \"loading\";\n location: Location;\n formMethod: FormMethod | undefined;\n formAction: string | undefined;\n formEncType: FormEncType | undefined;\n formData: FormData | undefined;\n };\n Submitting: {\n state: \"submitting\";\n location: Location;\n formMethod: FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n };\n};\n\nexport type Navigation = NavigationStates[keyof NavigationStates];\n\nexport type RevalidationState = \"idle\" | \"loading\";\n\n/**\n * Potential states for fetchers\n */\ntype FetcherStates = {\n Idle: {\n state: \"idle\";\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n formData: undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Loading: {\n state: \"loading\";\n formMethod: FormMethod | undefined;\n formAction: string | undefined;\n formEncType: FormEncType | undefined;\n formData: FormData | undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Submitting: {\n state: \"submitting\";\n formMethod: FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n};\n\nexport type Fetcher =\n FetcherStates[keyof FetcherStates];\n\ninterface BlockerBlocked {\n state: \"blocked\";\n reset(): void;\n proceed(): void;\n location: Location;\n}\n\ninterface BlockerUnblocked {\n state: \"unblocked\";\n reset: undefined;\n proceed: undefined;\n location: undefined;\n}\n\ninterface BlockerProceeding {\n state: \"proceeding\";\n reset: undefined;\n proceed: undefined;\n location: Location;\n}\n\nexport type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;\n\nexport type BlockerFunction = (args: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n}) => boolean;\n\ninterface ShortCircuitable {\n /**\n * startNavigation does not need to complete the navigation because we\n * redirected or got interrupted\n */\n shortCircuited?: boolean;\n}\n\ninterface HandleActionResult extends ShortCircuitable {\n /**\n * Error thrown from the current action, keyed by the route containing the\n * error boundary to render the error. To be committed to the state after\n * loaders have completed\n */\n pendingActionError?: RouteData;\n /**\n * Data returned from the current action, keyed by the route owning the action.\n * To be committed to the state after loaders have completed\n */\n pendingActionData?: RouteData;\n}\n\ninterface HandleLoadersResult extends ShortCircuitable {\n /**\n * loaderData returned from the current set of loaders\n */\n loaderData?: RouterState[\"loaderData\"];\n /**\n * errors thrown from the current set of loaders\n */\n errors?: RouterState[\"errors\"];\n}\n\n/**\n * Cached info for active fetcher.load() instances so they can participate\n * in revalidation\n */\ninterface FetchLoadMatch {\n routeId: string;\n path: string;\n match: AgnosticDataRouteMatch;\n matches: AgnosticDataRouteMatch[];\n}\n\n/**\n * Identified fetcher.load() calls that need to be revalidated\n */\ninterface RevalidatingFetcher extends FetchLoadMatch {\n key: string;\n}\n\n/**\n * Wrapper object to allow us to throw any response out from callLoaderOrAction\n * for queryRouter while preserving whether or not it was thrown or returned\n * from the loader/action\n */\ninterface QueryRouteResponse {\n type: ResultType.data | ResultType.error;\n response: Response;\n}\n\nconst validMutationMethodsArr: MutationFormMethod[] = [\n \"post\",\n \"put\",\n \"patch\",\n \"delete\",\n];\nconst validMutationMethods = new Set(\n validMutationMethodsArr\n);\n\nconst validRequestMethodsArr: FormMethod[] = [\n \"get\",\n ...validMutationMethodsArr,\n];\nconst validRequestMethods = new Set(validRequestMethodsArr);\n\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\n\nexport const IDLE_NAVIGATION: NavigationStates[\"Idle\"] = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n};\n\nexport const IDLE_FETCHER: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n};\n\nexport const IDLE_BLOCKER: BlockerUnblocked = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined,\n};\n\nconst isBrowser =\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\";\nconst isServer = !isBrowser;\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\nexport function createRouter(init: RouterInit): Router {\n invariant(\n init.routes.length > 0,\n \"You must provide a non-empty routes array to createRouter\"\n );\n\n let dataRoutes = convertRoutesToDataRoutes(init.routes);\n // Cleanup function for history\n let unlistenHistory: (() => void) | null = null;\n // Externally-provided functions to call on all state changes\n let subscribers = new Set();\n // Externally-provided object to hold scroll restoration locations during routing\n let savedScrollPositions: Record | null = null;\n // Externally-provided function to get scroll restoration keys\n let getScrollRestorationKey: GetScrollRestorationKeyFunction | null = null;\n // Externally-provided function to get current scroll position\n let getScrollPosition: GetScrollPositionFunction | null = null;\n // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n let initialScrollRestored = init.hydrationData != null;\n\n let initialMatches = matchRoutes(\n dataRoutes,\n init.history.location,\n init.basename\n );\n let initialErrors: RouteData | null = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname,\n });\n let { matches, route } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = { [route.id]: error };\n }\n\n let initialized =\n !initialMatches.some((m) => m.route.loader) || init.hydrationData != null;\n\n let router: Router;\n let state: RouterState = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: (init.hydrationData && init.hydrationData.loaderData) || {},\n actionData: (init.hydrationData && init.hydrationData.actionData) || null,\n errors: (init.hydrationData && init.hydrationData.errors) || initialErrors,\n fetchers: new Map(),\n blockers: new Map(),\n };\n\n // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n let pendingAction: HistoryAction = HistoryAction.Pop;\n\n // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n let pendingPreventScrollReset = false;\n\n // AbortController for the active navigation\n let pendingNavigationController: AbortController | null;\n\n // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n let isUninterruptedRevalidation = false;\n\n // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidate()\n // - X-Remix-Revalidate (from redirect)\n let isRevalidationRequired = false;\n\n // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n let cancelledDeferredRoutes: string[] = [];\n\n // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n let cancelledFetcherLoads: string[] = [];\n\n // AbortControllers for any in-flight fetchers\n let fetchControllers = new Map();\n\n // Track loads based on the order in which they started\n let incrementingLoadId = 0;\n\n // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n let pendingNavigationLoadId = -1;\n\n // Fetchers that triggered data reloads as a result of their actions\n let fetchReloadIds = new Map();\n\n // Fetchers that triggered redirect navigations from their actions\n let fetchRedirectIds = new Set();\n\n // Most recent href/match for fetcher.load calls for fetchers\n let fetchLoadMatches = new Map();\n\n // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n let activeDeferreds = new Map();\n\n // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n let activeBlocker: string | null = null;\n\n // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n let blockerFunctions = new Map();\n\n // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n let ignoreNextHistoryUpdate = false;\n\n // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(\n ({ action: historyAction, location, delta }) => {\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (ignoreNextHistoryUpdate) {\n ignoreNextHistoryUpdate = false;\n return;\n }\n\n warning(\n activeBlocker != null && delta === null,\n \"You are trying to use a blocker on a POP navigation to a location \" +\n \"that was not created by @remix-run/router. This will fail silently in \" +\n \"production. This can happen if you are navigating outside the router \" +\n \"via `window.history.pushState`/`window.location.hash` instead of using \" +\n \"router navigation APIs. This can also happen if you are using \" +\n \"createHashRouter and the user manually changes the URL.\"\n );\n\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction,\n });\n\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n ignoreNextHistoryUpdate = true;\n init.history.go(delta * -1);\n\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location,\n });\n // Re-do the same POP navigation we just blocked\n init.history.go(delta);\n },\n reset() {\n deleteBlocker(blockerKey!);\n updateState({ blockers: new Map(router.state.blockers) });\n },\n });\n return;\n }\n\n return startNavigation(historyAction, location);\n }\n );\n\n // Kick off initial data load if needed. Use Pop to avoid modifying history\n if (!state.initialized) {\n startNavigation(HistoryAction.Pop, state.location);\n }\n\n return router;\n }\n\n // Clean up a router and it's side effects\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n }\n\n // Subscribe to state updates for the router\n function subscribe(fn: RouterSubscriber) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n }\n\n // Update our state and notify the calling context of the change\n function updateState(newState: Partial): void {\n state = {\n ...state,\n ...newState,\n };\n subscribers.forEach((subscriber) => subscriber(state));\n }\n\n // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n function completeNavigation(\n location: Location,\n newState: Partial>\n ): void {\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload =\n state.actionData != null &&\n state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n state.navigation.state === \"loading\" &&\n location.state?._isRedirect !== true;\n\n let actionData: RouteData | null;\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n }\n\n // Always preserve any existing loaderData from re-used routes\n let loaderData = newState.loaderData\n ? mergeLoaderData(\n state.loaderData,\n newState.loaderData,\n newState.matches || [],\n newState.errors\n )\n : state.loaderData;\n\n // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n for (let [key] of blockerFunctions) {\n deleteBlocker(key);\n }\n\n // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n let preventScrollReset =\n pendingPreventScrollReset === true ||\n (state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n location.state?._isRedirect !== true);\n\n updateState({\n ...newState, // matches, errors, fetchers go through as-is\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(\n location,\n newState.matches || state.matches\n ),\n preventScrollReset,\n blockers: new Map(state.blockers),\n });\n\n if (isUninterruptedRevalidation) {\n // If this was an uninterrupted revalidation then do not touch history\n } else if (pendingAction === HistoryAction.Pop) {\n // Do nothing for POP - URL has already been updated\n } else if (pendingAction === HistoryAction.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === HistoryAction.Replace) {\n init.history.replace(location, location.state);\n }\n\n // Reset stateful navigation vars\n pendingAction = HistoryAction.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n }\n\n // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n async function navigate(\n to: number | To,\n opts?: RouterNavigateOptions\n ): Promise {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let { path, submission, error } = normalizeNavigateOptions(to, opts);\n\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state);\n\n // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n nextLocation = {\n ...nextLocation,\n ...init.history.encodeLocation(nextLocation),\n };\n\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n\n let historyAction = HistoryAction.Push;\n\n if (userReplace === true) {\n historyAction = HistoryAction.Replace;\n } else if (userReplace === false) {\n // no-op\n } else if (\n submission != null &&\n isMutationMethod(submission.formMethod) &&\n submission.formAction === state.location.pathname + state.location.search\n ) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = HistoryAction.Replace;\n }\n\n let preventScrollReset =\n opts && \"preventScrollReset\" in opts\n ? opts.preventScrollReset === true\n : undefined;\n\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n });\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation,\n });\n // Send the same navigation through\n navigate(to, opts);\n },\n reset() {\n deleteBlocker(blockerKey!);\n updateState({ blockers: new Map(state.blockers) });\n },\n });\n return;\n }\n\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace,\n });\n }\n\n // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n function revalidate() {\n interruptActiveLoads();\n updateState({ revalidation: \"loading\" });\n\n // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n if (state.navigation.state === \"submitting\") {\n return;\n }\n\n // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true,\n });\n return;\n }\n\n // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n startNavigation(\n pendingAction || state.historyAction,\n state.navigation.location,\n { overrideNavigation: state.navigation }\n );\n }\n\n // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n async function startNavigation(\n historyAction: HistoryAction,\n location: Location,\n opts?: {\n submission?: Submission;\n overrideNavigation?: Navigation;\n pendingError?: ErrorResponse;\n startUninterruptedRevalidation?: boolean;\n preventScrollReset?: boolean;\n replace?: boolean;\n }\n ): Promise {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation =\n (opts && opts.startUninterruptedRevalidation) === true;\n\n // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(dataRoutes, location, init.basename);\n\n // Short circuit with a 404 on the root error boundary if we match nothing\n if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(dataRoutes);\n // Cancel all pending deferred on 404s since we don't keep any routes\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error,\n },\n });\n return;\n }\n\n // Short circuit if it's only a hash change and not a mutation submission\n // For example, on /page#hash and submit a

which will\n // default to a navigation to /page\n if (\n isHashChangeOnly(state.location, location) &&\n !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))\n ) {\n completeNavigation(location, { matches });\n return;\n }\n\n // Create a controller/Request for this navigation\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(\n init.history,\n location,\n pendingNavigationController.signal,\n opts && opts.submission\n );\n let pendingActionData: RouteData | undefined;\n let pendingError: RouteData | undefined;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError,\n };\n } else if (\n opts &&\n opts.submission &&\n isMutationMethod(opts.submission.formMethod)\n ) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(\n request,\n location,\n opts.submission,\n matches,\n { replace: opts.replace }\n );\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n ...opts.submission,\n };\n loadingNavigation = navigation;\n\n // Create a GET request for the loaders\n request = new Request(request.url, { signal: request.signal });\n }\n\n // Call loaders\n let { shortCircuited, loaderData, errors } = await handleLoaders(\n request,\n location,\n matches,\n loadingNavigation,\n opts && opts.submission,\n opts && opts.replace,\n pendingActionData,\n pendingError\n );\n\n if (shortCircuited) {\n return;\n }\n\n // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n pendingNavigationController = null;\n\n completeNavigation(location, {\n matches,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n loaderData,\n errors,\n });\n }\n\n // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n async function handleAction(\n request: Request,\n location: Location,\n submission: Submission,\n matches: AgnosticDataRouteMatch[],\n opts?: { replace?: boolean }\n ): Promise {\n interruptActiveLoads();\n\n // Put us in a submitting state\n let navigation: NavigationStates[\"Submitting\"] = {\n state: \"submitting\",\n location,\n ...submission,\n };\n updateState({ navigation });\n\n // Call our action and get the result\n let result: DataResult;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id,\n }),\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n router.basename\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace: boolean;\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace =\n result.location === state.location.pathname + state.location.search;\n }\n await startRedirectNavigation(state, result, { submission, replace });\n return { shortCircuited: true };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n\n // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n if ((opts && opts.replace) !== true) {\n pendingAction = HistoryAction.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: { [boundaryMatch.route.id]: result.error },\n };\n }\n\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n return {\n pendingActionData: { [actionMatch.route.id]: result.data },\n };\n }\n\n // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n async function handleLoaders(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n overrideNavigation?: Navigation,\n submission?: Submission,\n replace?: boolean,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n ): Promise {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation = overrideNavigation;\n if (!loadingNavigation) {\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n ...submission,\n };\n loadingNavigation = navigation;\n }\n\n // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n let activeSubmission = submission\n ? submission\n : loadingNavigation.formMethod &&\n loadingNavigation.formAction &&\n loadingNavigation.formData &&\n loadingNavigation.formEncType\n ? {\n formMethod: loadingNavigation.formMethod,\n formAction: loadingNavigation.formAction,\n formData: loadingNavigation.formData,\n formEncType: loadingNavigation.formEncType,\n }\n : undefined;\n\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n activeSubmission,\n location,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n pendingActionData,\n pendingError,\n fetchLoadMatches\n );\n\n // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n cancelActiveDeferreds(\n (routeId) =>\n !(matches && matches.some((m) => m.route.id === routeId)) ||\n (matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId))\n );\n\n // Short circuit if we have no loaders to run\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n completeNavigation(location, {\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n });\n return { shortCircuited: true };\n }\n\n // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach((rf) => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n data: fetcher && fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState({\n navigation: loadingNavigation,\n ...(actionData\n ? Object.keys(actionData).length === 0\n ? { actionData: null }\n : { actionData }\n : {}),\n ...(revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n });\n }\n\n pendingNavigationLoadId = ++incrementingLoadId;\n revalidatingFetchers.forEach((rf) =>\n fetchControllers.set(rf.key, pendingNavigationController!)\n );\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n request\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n\n // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));\n\n // If any loaders returned a redirect Response, start a new REPLACE navigation\n let redirect = findRedirect(results);\n if (redirect) {\n await startRedirectNavigation(state, redirect, { replace });\n return { shortCircuited: true };\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n matches,\n matchesToLoad,\n loaderResults,\n pendingError,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n // Wire up subscribers to update loaderData as promises settle\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe((aborted) => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n\n markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n\n return {\n loaderData,\n errors,\n ...(didAbortFetchLoads || revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n };\n }\n\n function getFetcher(key: string): Fetcher {\n return state.fetchers.get(key) || IDLE_FETCHER;\n }\n\n // Trigger a fetcher load/submit for the given fetcher key\n function fetch(\n key: string,\n routeId: string,\n href: string,\n opts?: RouterFetchOptions\n ) {\n if (isServer) {\n throw new Error(\n \"router.fetch() was called during the server render, but it shouldn't be. \" +\n \"You are likely calling a useFetcher() method in the body of your component. \" +\n \"Try moving it to a useEffect or a callback.\"\n );\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n\n let matches = matchRoutes(dataRoutes, href, init.basename);\n if (!matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: href })\n );\n return;\n }\n\n let { path, submission } = normalizeNavigateOptions(href, opts, true);\n let match = getTargetMatch(matches, path);\n\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n }\n\n // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n fetchLoadMatches.set(key, { routeId, path, match, matches });\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n }\n\n // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n async function handleFetcherAction(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n requestMatches: AgnosticDataRouteMatch[],\n submission: Submission\n ) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId,\n });\n setFetcherError(key, routeId, error);\n return;\n }\n\n // Put this fetcher into it's submitting state\n let existingFetcher = state.fetchers.get(key);\n let fetcher: FetcherStates[\"Submitting\"] = {\n state: \"submitting\",\n ...submission,\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, fetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the action for the fetcher\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal,\n submission\n );\n fetchControllers.set(key, abortController);\n\n let actionResult = await callLoaderOrAction(\n \"action\",\n fetchRequest,\n match,\n requestMatches,\n router.basename\n );\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n fetchRedirectIds.add(key);\n let loadingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n ...submission,\n data: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n return startRedirectNavigation(state, actionResult, {\n isFetchActionRedirect: true,\n });\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(\n init.history,\n\n nextLocation,\n abortController.signal\n );\n let matches =\n state.navigation.state !== \"idle\"\n ? matchRoutes(dataRoutes, state.navigation.location, init.basename)\n : state.matches;\n\n invariant(matches, \"Didn't find any matches after fetcher action\");\n\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n data: actionResult.data,\n ...submission,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, loadFetcher);\n\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n submission,\n nextLocation,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n { [match.route.id]: actionResult.data },\n undefined, // No need to send through errors since we short circuit above\n fetchLoadMatches\n );\n\n // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n revalidatingFetchers\n .filter((rf) => rf.key !== key)\n .forEach((rf) => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n data: existingFetcher && existingFetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(staleKey, revalidatingFetcher);\n fetchControllers.set(staleKey, abortController);\n });\n\n updateState({ fetchers: new Map(state.fetchers) });\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n revalidationRequest\n );\n\n if (abortController.signal.aborted) {\n return;\n }\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));\n\n let redirect = findRedirect(results);\n if (redirect) {\n return startRedirectNavigation(state, redirect);\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n state.matches,\n matchesToLoad,\n loaderResults,\n undefined,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: actionResult.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n\n let didAbortFetchLoads = abortStaleFetchLoads(loadId);\n\n // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n if (\n state.navigation.state === \"loading\" &&\n loadId > pendingNavigationLoadId\n ) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers),\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState({\n errors,\n loaderData: mergeLoaderData(\n state.loaderData,\n loaderData,\n matches,\n errors\n ),\n ...(didAbortFetchLoads ? { fetchers: new Map(state.fetchers) } : {}),\n });\n isRevalidationRequired = false;\n }\n }\n\n // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n async function handleFetcherLoader(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n submission?: Submission\n ) {\n let existingFetcher = state.fetchers.get(key);\n // Put this fetcher into it's loading state\n let loadingFetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n ...submission,\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the loader for this fetcher route match\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal\n );\n fetchControllers.set(key, abortController);\n let result: DataResult = await callLoaderOrAction(\n \"loader\",\n fetchRequest,\n match,\n matches,\n router.basename\n );\n\n // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n if (isDeferredResult(result)) {\n result =\n (await resolveDeferredData(result, fetchRequest.signal, true)) ||\n result;\n }\n\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n }\n\n // If the loader threw a redirect Response, start a new REPLACE navigation\n if (isRedirectResult(result)) {\n await startRedirectNavigation(state, result);\n return;\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key);\n // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error,\n },\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\");\n\n // Put the fetcher back into an idle state\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n }\n\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n async function startRedirectNavigation(\n state: RouterState,\n redirect: RedirectResult,\n {\n submission,\n replace,\n isFetchActionRedirect,\n }: {\n submission?: Submission;\n replace?: boolean;\n isFetchActionRedirect?: boolean;\n } = {}\n ) {\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(\n state.location,\n redirect.location,\n // TODO: This can be removed once we get rid of useTransition in Remix v2\n {\n _isRedirect: true,\n ...(isFetchActionRedirect ? { _isFetchActionRedirect: true } : {}),\n }\n );\n invariant(\n redirectLocation,\n \"Expected a location on the redirect navigation\"\n );\n\n // Check if this an external redirect that goes to a new origin\n if (isBrowser && typeof window?.location !== \"undefined\") {\n let newOrigin = init.history.createURL(redirect.location).origin;\n if (window.location.origin !== newOrigin) {\n if (replace) {\n window.location.replace(redirect.location);\n } else {\n window.location.assign(redirect.location);\n }\n return;\n }\n }\n\n // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n pendingNavigationController = null;\n\n let redirectHistoryAction =\n replace === true ? HistoryAction.Replace : HistoryAction.Push;\n\n // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n let { formMethod, formAction, formEncType, formData } = state.navigation;\n if (!submission && formMethod && formAction && formData && formEncType) {\n submission = {\n formMethod,\n formAction,\n formEncType,\n formData,\n };\n }\n\n // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n if (\n redirectPreserveMethodStatusCodes.has(redirect.status) &&\n submission &&\n isMutationMethod(submission.formMethod)\n ) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: {\n ...submission,\n formAction: redirect.location,\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else {\n // Otherwise, we kick off a new loading navigation, preserving the\n // submission info for the duration of this navigation\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: {\n state: \"loading\",\n location: redirectLocation,\n formMethod: submission ? submission.formMethod : undefined,\n formAction: submission ? submission.formAction : undefined,\n formEncType: submission ? submission.formEncType : undefined,\n formData: submission ? submission.formData : undefined,\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(\n currentMatches: AgnosticDataRouteMatch[],\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n fetchersToLoad: RevalidatingFetcher[],\n request: Request\n ) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\"loader\", request, match, matches, router.basename)\n ),\n ...fetchersToLoad.map((f) =>\n callLoaderOrAction(\n \"loader\",\n createClientSideRequest(init.history, f.path, request.signal),\n f.match,\n f.matches,\n router.basename\n )\n ),\n ]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n\n await Promise.all([\n resolveDeferredResults(\n currentMatches,\n matchesToLoad,\n loaderResults,\n request.signal,\n false,\n state.loaderData\n ),\n resolveDeferredResults(\n currentMatches,\n fetchersToLoad.map((f) => f.match),\n fetcherResults,\n request.signal,\n true\n ),\n ]);\n\n return { results, loaderResults, fetcherResults };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true;\n\n // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n cancelledDeferredRoutes.push(...cancelActiveDeferreds());\n\n // Abort in-flight fetcher loads\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key: string, routeId: string, error: any) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error,\n },\n fetchers: new Map(state.fetchers),\n });\n }\n\n function deleteFetcher(key: string): void {\n if (fetchControllers.has(key)) abortFetcher(key);\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key: string) {\n let controller = fetchControllers.get(key);\n invariant(controller, `Expected fetch controller: ${key}`);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys: string[]) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone(): void {\n let doneKeys = [];\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n }\n }\n markFetchersDone(doneKeys);\n }\n\n function abortStaleFetchLoads(landedId: number): boolean {\n let yeetedKeys = [];\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function getBlocker(key: string, fn: BlockerFunction) {\n let blocker: Blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n if (activeBlocker == null) {\n // This is now the active blocker\n activeBlocker = key;\n } else if (key !== activeBlocker) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n }\n\n return blocker;\n }\n\n function deleteBlocker(key: string) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n if (activeBlocker === key) {\n activeBlocker = null;\n }\n }\n\n // Utility function to update blockers, ensuring valid state transitions\n function updateBlocker(key: string, newBlocker: Blocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n invariant(\n (blocker.state === \"unblocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"proceeding\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"unblocked\") ||\n (blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\"),\n `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`\n );\n\n state.blockers.set(key, newBlocker);\n updateState({ blockers: new Map(state.blockers) });\n }\n\n function shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n }: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n }): string | undefined {\n if (activeBlocker == null) {\n return;\n }\n\n // We only allow a single blocker at the moment. This will need to be\n // updated if we enhance to support multiple blockers in the future\n let blockerFunction = blockerFunctions.get(activeBlocker);\n invariant(\n blockerFunction,\n \"Could not find a function for the active blocker\"\n );\n let blocker = state.blockers.get(activeBlocker);\n\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n }\n\n // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n if (blockerFunction({ currentLocation, nextLocation, historyAction })) {\n return activeBlocker;\n }\n }\n\n function cancelActiveDeferreds(\n predicate?: (routeId: string) => boolean\n ): string[] {\n let cancelledRouteIds: string[] = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n }\n\n // Opt in to capturing and reporting scroll positions during navigations,\n // used by the component\n function enableScrollRestoration(\n positions: Record,\n getPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n getScrollRestorationKey = getKey || ((location) => location.key);\n\n // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered \n // and therefore have no savedScrollPositions available\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n if (y != null) {\n updateState({ restoreScrollPosition: y });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function saveScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): void {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map((m) =>\n createUseMatchesMatch(m, state.loaderData)\n );\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): number | null {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map((m) =>\n createUseMatchesMatch(m, state.loaderData)\n );\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n let y = savedScrollPositions[key];\n if (typeof y === \"number\") {\n return y;\n }\n }\n return null;\n }\n\n router = {\n get basename() {\n return init.basename;\n },\n get state() {\n return state;\n },\n get routes() {\n return dataRoutes;\n },\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: (to: To) => init.history.createHref(to),\n encodeLocation: (to: To) => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n getBlocker,\n deleteBlocker,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds,\n };\n\n return router;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nexport const UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\n\nexport function createStaticHandler(\n routes: AgnosticRouteObject[],\n opts?: {\n basename?: string;\n }\n): StaticHandler {\n invariant(\n routes.length > 0,\n \"You must provide a non-empty routes array to createStaticHandler\"\n );\n\n let dataRoutes = convertRoutesToDataRoutes(routes);\n let basename = (opts ? opts.basename : null) || \"/\";\n\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n async function query(\n request: Request,\n { requestContext }: { requestContext?: unknown } = {}\n ): Promise {\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"head\") {\n let error = getInternalRouterError(405, { method });\n let { matches: methodNotAllowedMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n if (isResponse(result)) {\n return result;\n }\n\n // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n return { location, basename, ...result };\n }\n\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n async function queryRoute(\n request: Request,\n {\n routeId,\n requestContext,\n }: { requestContext?: unknown; routeId?: string } = {}\n ): Promise {\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"head\" && method !== \"options\") {\n throw getInternalRouterError(405, { method });\n } else if (!matches) {\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let match = routeId\n ? matches.find((m) => m.route.id === routeId)\n : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId,\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let result = await queryImpl(\n request,\n location,\n matches,\n requestContext,\n match\n );\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n }\n\n // Pick off the right state value to return\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n\n if (result.loaderData) {\n let data = Object.values(result.loaderData)[0];\n if (result.activeDeferreds?.[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n return data;\n }\n\n return undefined;\n }\n\n async function queryImpl(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch\n ): Promise | Response> {\n invariant(\n request.signal,\n \"query()/queryRoute() requests must contain an AbortController signal\"\n );\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(\n request,\n matches,\n routeMatch || getTargetMatch(matches, location),\n requestContext,\n routeMatch != null\n );\n return result;\n }\n\n let result = await loadRouteData(\n request,\n matches,\n requestContext,\n routeMatch\n );\n return isResponse(result)\n ? result\n : {\n ...result,\n actionData: null,\n actionHeaders: {},\n };\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n return e.response;\n }\n // Redirects are always returned since they don't propagate to catch\n // boundaries\n if (isRedirectResponse(e)) {\n return e;\n }\n throw e;\n }\n }\n\n async function submit(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n actionMatch: AgnosticDataRouteMatch,\n requestContext: unknown,\n isRouteRequest: boolean\n ): Promise | Response> {\n let result: DataResult;\n\n if (!actionMatch.route.action) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id,\n });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n basename,\n true,\n isRouteRequest,\n requestContext\n );\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location,\n },\n });\n }\n\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, { type: \"defer-action\" });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: { [actionMatch.route.id]: result.data },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(\n request,\n matches,\n requestContext,\n undefined,\n {\n [boundaryMatch.route.id]: result.error,\n }\n );\n\n // action status codes take precedence over loader status codes\n return {\n ...context,\n statusCode: isRouteErrorResponse(result.error)\n ? result.error.status\n : 500,\n actionData: null,\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n // Create a GET request for the loaders\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal,\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n\n return {\n ...context,\n // action status codes take precedence over loader status codes\n ...(result.statusCode ? { statusCode: result.statusCode } : {}),\n actionData: {\n [actionMatch.route.id]: result.data,\n },\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n async function loadRouteData(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch,\n pendingActionError?: RouteData\n ): Promise<\n | Omit<\n StaticHandlerContext,\n \"location\" | \"basename\" | \"actionData\" | \"actionHeaders\"\n >\n | Response\n > {\n let isRouteRequest = routeMatch != null;\n\n // Short circuit if we have no loaders to run (queryRoute())\n if (isRouteRequest && !routeMatch?.route.loader) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch?.route.id,\n });\n }\n\n let requestMatches = routeMatch\n ? [routeMatch]\n : getLoaderMatchesUntilBoundary(\n matches,\n Object.keys(pendingActionError || {})[0]\n );\n let matchesToLoad = requestMatches.filter((m) => m.route.loader);\n\n // Short circuit if we have no loaders to run (query())\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce(\n (acc, m) => Object.assign(acc, { [m.route.id]: null }),\n {}\n ),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n basename,\n true,\n isRouteRequest,\n requestContext\n )\n ),\n ]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n\n // Process and commit output from loaders\n let activeDeferreds = new Map();\n let context = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingActionError,\n activeDeferreds\n );\n\n // Add a null for any non-loader matches for proper revalidation on the client\n let executedLoaders = new Set(\n matchesToLoad.map((match) => match.route.id)\n );\n matches.forEach((match) => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n\n return {\n ...context,\n matches,\n activeDeferreds:\n activeDeferreds.size > 0\n ? Object.fromEntries(activeDeferreds.entries())\n : null,\n };\n }\n\n return {\n dataRoutes,\n query,\n queryRoute,\n };\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\nexport function getStaticContextFromError(\n routes: AgnosticDataRouteObject[],\n context: StaticHandlerContext,\n error: any\n) {\n let newContext: StaticHandlerContext = {\n ...context,\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error,\n },\n };\n return newContext;\n}\n\nfunction isSubmissionNavigation(\n opts: RouterNavigateOptions\n): opts is SubmissionNavigateOptions {\n return opts != null && \"formData\" in opts;\n}\n\n// Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\nfunction normalizeNavigateOptions(\n to: To,\n opts?: RouterNavigateOptions,\n isFetcher = false\n): {\n path: string;\n submission?: Submission;\n error?: ErrorResponse;\n} {\n let path = typeof to === \"string\" ? to : createPath(to);\n\n // Return location verbatim on non-submission navigations\n if (!opts || !isSubmissionNavigation(opts)) {\n return { path };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, { method: opts.formMethod }),\n };\n }\n\n // Create a Submission on non-GET navigations\n let submission: Submission | undefined;\n if (opts.formData) {\n submission = {\n formMethod: opts.formMethod || \"get\",\n formAction: stripHashFromPath(path),\n formEncType:\n (opts && opts.formEncType) || \"application/x-www-form-urlencoded\",\n formData: opts.formData,\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return { path, submission };\n }\n }\n\n // Flatten submission onto URLSearchParams for GET submissions\n let parsedPath = parsePath(path);\n let searchParams = convertFormDataToSearchParams(opts.formData);\n // Since fetcher GET submissions only run a single loader (as opposed to\n // navigation GET submissions which run all loaders), we need to preserve\n // any incoming ?index params\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n parsedPath.search = `?${searchParams}`;\n\n return { path: createPath(parsedPath), submission };\n}\n\n// Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\nfunction getLoaderMatchesUntilBoundary(\n matches: AgnosticDataRouteMatch[],\n boundaryId?: string\n) {\n let boundaryMatches = matches;\n if (boundaryId) {\n let index = matches.findIndex((m) => m.route.id === boundaryId);\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(\n history: History,\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n submission: Submission | undefined,\n location: Location,\n isRevalidationRequired: boolean,\n cancelledDeferredRoutes: string[],\n cancelledFetcherLoads: string[],\n pendingActionData?: RouteData,\n pendingError?: RouteData,\n fetchLoadMatches?: Map\n): [AgnosticDataRouteMatch[], RevalidatingFetcher[]] {\n let actionResult = pendingError\n ? Object.values(pendingError)[0]\n : pendingActionData\n ? Object.values(pendingActionData)[0]\n : undefined;\n\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n\n let defaultShouldRevalidate =\n // Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate\n isRevalidationRequired ||\n // Clicked the same link, resubmitted a GET form\n currentUrl.toString() === nextUrl.toString() ||\n // Search params affect all loaders\n currentUrl.search !== nextUrl.search;\n\n // Pick navigation matches that are net-new or qualify for revalidation\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n\n let navigationMatches = boundaryMatches.filter((match, index) => {\n if (match.route.loader == null) {\n return false;\n }\n\n // Always call the loader on new route instances and pending defer cancellations\n if (\n isNewLoader(state.loaderData, state.matches[index], match) ||\n cancelledDeferredRoutes.some((id) => id === match.route.id)\n ) {\n return true;\n }\n\n // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n\n return shouldRevalidateLoader(match, {\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params,\n ...submission,\n actionResult,\n defaultShouldRevalidate:\n defaultShouldRevalidate ||\n isNewRouteInstance(currentRouteMatch, nextRouteMatch),\n });\n });\n\n // Pick fetcher.loads that need to be revalidated\n let revalidatingFetchers: RevalidatingFetcher[] = [];\n fetchLoadMatches &&\n fetchLoadMatches.forEach((f, key) => {\n if (!matches.some((m) => m.route.id === f.routeId)) {\n // This fetcher is not going to be present in the subsequent render so\n // there's no need to revalidate it\n return;\n } else if (cancelledFetcherLoads.includes(key)) {\n // This fetcher was cancelled from a prior action submission - force reload\n revalidatingFetchers.push({ key, ...f });\n } else {\n // Revalidating fetchers are decoupled from the route matches since they\n // hit a static href, so they _always_ check shouldRevalidate and the\n // default is strictly if a revalidation is explicitly required (action\n // submissions, useRevalidator, X-Remix-Revalidate).\n let shouldRevalidate = shouldRevalidateLoader(f.match, {\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params,\n ...submission,\n actionResult,\n defaultShouldRevalidate,\n });\n if (shouldRevalidate) {\n revalidatingFetchers.push({ key, ...f });\n }\n }\n });\n\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(\n currentLoaderData: RouteData,\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let isNew =\n // [a] -> [a, b]\n !currentMatch ||\n // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id;\n\n // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n let isMissingData = currentLoaderData[match.route.id] === undefined;\n\n // Always load if this is a net-new route or we don't yet have data\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let currentPath = currentMatch.route.path;\n return (\n // param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname ||\n // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n (currentPath != null &&\n currentPath.endsWith(\"*\") &&\n currentMatch.params[\"*\"] !== match.params[\"*\"])\n );\n}\n\nfunction shouldRevalidateLoader(\n loaderMatch: AgnosticDataRouteMatch,\n arg: Parameters[0]\n) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return arg.defaultShouldRevalidate;\n}\n\nasync function callLoaderOrAction(\n type: \"loader\" | \"action\",\n request: Request,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n basename = \"/\",\n isStaticRequest: boolean = false,\n isRouteRequest: boolean = false,\n requestContext?: unknown\n): Promise {\n let resultType;\n let result;\n\n // Setup a promise we can race against so that abort signals short circuit\n let reject: () => void;\n let abortPromise = new Promise((_, r) => (reject = r));\n let onReject = () => reject();\n request.signal.addEventListener(\"abort\", onReject);\n\n try {\n let handler = match.route[type];\n invariant(\n handler,\n `Could not find the ${type} to run on the \"${match.route.id}\" route`\n );\n\n result = await Promise.race([\n handler({ request, params: match.params, context: requestContext }),\n abortPromise,\n ]);\n\n invariant(\n result !== undefined,\n `You defined ${type === \"action\" ? \"an action\" : \"a loader\"} for route ` +\n `\"${match.route.id}\" but didn't return anything from your \\`${type}\\` ` +\n `function. Please return a value or \\`null\\`.`\n );\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n\n if (isResponse(result)) {\n let status = result.status;\n\n // Process redirects\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(\n location,\n \"Redirects returned/thrown from loaders/actions must have a Location header\"\n );\n\n let isAbsolute = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(location);\n\n // Support relative routing in internal redirects\n if (!isAbsolute) {\n let activeMatches = matches.slice(0, matches.indexOf(match) + 1);\n let routePathnames = getPathContributingMatches(activeMatches).map(\n (match) => match.pathnameBase\n );\n let resolvedLocation = resolveTo(\n location,\n routePathnames,\n new URL(request.url).pathname\n );\n invariant(\n createPath(resolvedLocation),\n `Unable to resolve redirect location: ${location}`\n );\n\n // Prepend the basename to the redirect location if we have one\n if (basename) {\n let path = resolvedLocation.pathname;\n resolvedLocation.pathname =\n path === \"/\" ? basename : joinPaths([basename, path]);\n }\n\n location = createPath(resolvedLocation);\n } else if (!isStaticRequest) {\n // Strip off the protocol+origin for same-origin absolute redirects.\n // If this is a static reques, we can let it go back to the browser\n // as-is\n let currentUrl = new URL(request.url);\n let url = location.startsWith(\"//\")\n ? new URL(currentUrl.protocol + location)\n : new URL(location);\n if (url.origin === currentUrl.origin) {\n location = url.pathname + url.search + url.hash;\n }\n }\n\n // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n if (isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null,\n };\n }\n\n // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n if (isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result,\n };\n }\n\n let data: any;\n let contentType = result.headers.get(\"Content-Type\");\n // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers,\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers,\n };\n }\n\n if (resultType === ResultType.error) {\n return { type: resultType, error: result };\n }\n\n if (result instanceof DeferredData) {\n return { type: ResultType.deferred, deferredData: result };\n }\n\n return { type: ResultType.data, data: result };\n}\n\n// Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\nfunction createClientSideRequest(\n history: History,\n location: string | Location,\n signal: AbortSignal,\n submission?: Submission\n): Request {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init: RequestInit = { signal };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let { formMethod, formEncType, formData } = submission;\n init.method = formMethod.toUpperCase();\n init.body =\n formEncType === \"application/x-www-form-urlencoded\"\n ? convertFormDataToSearchParams(formData)\n : formData;\n }\n\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData: FormData): URLSearchParams {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, value instanceof File ? value.name : value);\n }\n\n return searchParams;\n}\n\nfunction processRouteLoaderData(\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n activeDeferreds: Map\n): {\n loaderData: RouterState[\"loaderData\"];\n errors: RouterState[\"errors\"] | null;\n statusCode: number;\n loaderHeaders: Record;\n} {\n // Fill in loaderData/errors from our loaders\n let loaderData: RouterState[\"loaderData\"] = {};\n let errors: RouterState[\"errors\"] | null = null;\n let statusCode: number | undefined;\n let foundError = false;\n let loaderHeaders: Record = {};\n\n // Process loader results into state.loaderData/state.errors\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(\n !isRedirectResult(result),\n \"Cannot handle redirect results in processLoaderData\"\n );\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error;\n // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {};\n\n // Prefer higher error values if lower errors bubble to the same boundary\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n }\n\n // Clear our any prior loaderData for the throwing route\n loaderData[id] = undefined;\n\n // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error)\n ? result.error.status\n : 500;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n } else {\n loaderData[id] = result.data;\n }\n\n // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n if (\n result.statusCode != null &&\n result.statusCode !== 200 &&\n !foundError\n ) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n });\n\n // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders,\n };\n}\n\nfunction processLoaderData(\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n revalidatingFetchers: RevalidatingFetcher[],\n fetcherResults: DataResult[],\n activeDeferreds: Map\n): {\n loaderData: RouterState[\"loaderData\"];\n errors?: RouterState[\"errors\"];\n} {\n let { loaderData, errors } = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingError,\n activeDeferreds\n );\n\n // Process results from our revalidating fetchers\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let { key, match } = revalidatingFetchers[index];\n invariant(\n fetcherResults !== undefined && fetcherResults[index] !== undefined,\n \"Did not find corresponding fetcher result\"\n );\n let result = fetcherResults[index];\n\n // Process fetcher non-redirect errors\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match.route.id);\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = {\n ...errors,\n [boundaryMatch.route.id]: result.error,\n };\n }\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return { loaderData, errors };\n}\n\nfunction mergeLoaderData(\n loaderData: RouteData,\n newLoaderData: RouteData,\n matches: AgnosticDataRouteMatch[],\n errors: RouteData | null | undefined\n): RouteData {\n let mergedLoaderData = { ...newLoaderData };\n for (let match of matches) {\n let id = match.route.id;\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n } else {\n // No-op - this is so we ignore existing data if we have a key in the\n // incoming object with an undefined value, which is how we unset a prior\n // loaderData if we encounter a loader error\n }\n } else if (loaderData[id] !== undefined) {\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n return mergedLoaderData;\n}\n\n// Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\nfunction findNearestBoundary(\n matches: AgnosticDataRouteMatch[],\n routeId?: string\n): AgnosticDataRouteMatch {\n let eligibleMatches = routeId\n ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1)\n : [...matches];\n return (\n eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) ||\n matches[0]\n );\n}\n\nfunction getShortCircuitMatches(routes: AgnosticDataRouteObject[]): {\n matches: AgnosticDataRouteMatch[];\n route: AgnosticDataRouteObject;\n} {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find((r) => r.index || !r.path || r.path === \"/\") || {\n id: `__shim-error-route__`,\n };\n\n return {\n matches: [\n {\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route,\n },\n ],\n route,\n };\n}\n\nfunction getInternalRouterError(\n status: number,\n {\n pathname,\n routeId,\n method,\n type,\n }: {\n pathname?: string;\n routeId?: string;\n method?: string;\n type?: \"defer-action\";\n } = {}\n) {\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method} request to \"${pathname}\" but ` +\n `did not provide a \\`loader\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = `Route \"${routeId}\" does not match URL \"${pathname}\"`;\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = `No route matches URL \"${pathname}\"`;\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method.toUpperCase()} request to \"${pathname}\" but ` +\n `did not provide an \\`action\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (method) {\n errorMessage = `Invalid request method \"${method.toUpperCase()}\"`;\n }\n }\n\n return new ErrorResponse(\n status || 500,\n statusText,\n new Error(errorMessage),\n true\n );\n}\n\n// Find any returned redirect errors, starting from the lowest match\nfunction findRedirect(results: DataResult[]): RedirectResult | undefined {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n if (isRedirectResult(result)) {\n return result;\n }\n }\n}\n\nfunction stripHashFromPath(path: To) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath({ ...parsedPath, hash: \"\" });\n}\n\nfunction isHashChangeOnly(a: Location, b: Location): boolean {\n return (\n a.pathname === b.pathname && a.search === b.search && a.hash !== b.hash\n );\n}\n\nfunction isDeferredResult(result: DataResult): result is DeferredResult {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result: DataResult): result is ErrorResult {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result?: DataResult): result is RedirectResult {\n return (result && result.type) === ResultType.redirect;\n}\n\nfunction isResponse(value: any): value is Response {\n return (\n value != null &&\n typeof value.status === \"number\" &&\n typeof value.statusText === \"string\" &&\n typeof value.headers === \"object\" &&\n typeof value.body !== \"undefined\"\n );\n}\n\nfunction isRedirectResponse(result: any): result is Response {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj: any): obj is QueryRouteResponse {\n return (\n obj &&\n isResponse(obj.response) &&\n (obj.type === ResultType.data || ResultType.error)\n );\n}\n\nfunction isValidMethod(method: string): method is FormMethod {\n return validRequestMethods.has(method as FormMethod);\n}\n\nfunction isMutationMethod(method?: string): method is MutationFormMethod {\n return validMutationMethods.has(method as MutationFormMethod);\n}\n\nasync function resolveDeferredResults(\n currentMatches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n signal: AbortSignal,\n isFetcher: boolean,\n currentLoaderData?: RouteData\n) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index];\n let currentMatch = currentMatches.find(\n (m) => m.route.id === match.route.id\n );\n let isRevalidatingLoader =\n currentMatch != null &&\n !isNewRouteInstance(currentMatch, match) &&\n (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n await resolveDeferredData(result, signal, isFetcher).then((result) => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(\n result: DeferredResult,\n signal: AbortSignal,\n unwrap = false\n): Promise {\n let aborted = await result.deferredData.resolveData(signal);\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData,\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e,\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data,\n };\n}\n\nfunction hasNakedIndexQuery(search: string): boolean {\n return new URLSearchParams(search).getAll(\"index\").some((v) => v === \"\");\n}\n\n// Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\nfunction createUseMatchesMatch(\n match: AgnosticDataRouteMatch,\n loaderData: RouteData\n): UseMatchesMatch {\n let { route, pathname, params } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id] as unknown,\n handle: route.handle as unknown,\n };\n}\n\nfunction getTargetMatch(\n matches: AgnosticDataRouteMatch[],\n location: Location | string\n) {\n let search =\n typeof location === \"string\" ? parsePath(location).search : location.search;\n if (\n matches[matches.length - 1].route.index &&\n hasNakedIndexQuery(search || \"\")\n ) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n }\n // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n}\n//#endregion\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","module.exports = false;\n\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IAuthAPI } from './auth';\nimport type { IMediaAPI } from './media';\nimport type { IMediaDiffAPI } from './mediaDiff';\nimport type { ISiteDataAPI } from './siteData';\n\nexport const TYPES = {\n IMediaAPI: Symbol.for('IMediaAPI'),\n IAuthAPI: Symbol.for('IAuthAPI'),\n IMediaDiffAPI: Symbol.for('IMediaDiffAPI'),\n ISiteDataAPI: Symbol.for('ISiteDataAPI'),\n};\n\nexport function injectMediaAPI(container: IContainer = injectOrBuildContainer()): IMediaAPI[] {\n return container.get(TYPES.IMediaAPI);\n}\n\nexport function bindMediaAPI(\n val: IMediaAPI[],\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IMediaAPI, val);\n}\n\nexport function unbindMediaAPI(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IMediaAPI);\n}\n\nexport function injectAuthAPI(container: IContainer = injectOrBuildContainer()): IAuthAPI {\n return container.get(TYPES.IAuthAPI);\n}\n\nexport function bindAuthAPI(val: IAuthAPI, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IAuthAPI, val);\n}\n\nexport function unbindAuthAPI(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IAuthAPI);\n}\n\nexport function injectMediaDiffAPI(\n container: IContainer = injectOrBuildContainer(),\n): IMediaDiffAPI {\n return container.get(TYPES.IMediaDiffAPI);\n}\n\nexport function bindMediaDiffAPI(\n val: IMediaDiffAPI,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IMediaDiffAPI, val);\n}\n\nexport function unbindMediaDiffAPI(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IMediaDiffAPI);\n}\n\nexport function injectSiteDataAPI(container: IContainer = injectOrBuildContainer()): ISiteDataAPI {\n return container.get(TYPES.ISiteDataAPI);\n}\n\nexport function bindSiteDataAPI(\n val: ISiteDataAPI,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ISiteDataAPI, val);\n}\n\nexport function unbindSiteDataAPI(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ISiteDataAPI);\n}\n","export interface IMediumDiffRequestStatus {\n id: string;\n mediumHash: string;\n}\n\nexport interface IMediaDiffRequestInner {\n siteId: number;\n hash: string;\n requests: IMediumDiffRequestStatus[];\n}\n\nexport interface IMediaDiffRequest {\n requestDto: IMediaDiffRequestInner;\n}\n\nexport enum MediumStatus {\n UpToDate = 'UpToDate',\n New = 'New',\n Updated = 'Updated',\n Deleted = 'Delete',\n}\n\nexport interface IMediumDiffResponseStatus {\n id: string;\n fileHash: string;\n fileName: string;\n mimeType: string;\n mediumStatus: MediumStatus;\n}\n\nexport interface IMediaDiffResponse {\n value: IMediumDiffResponseStatus[];\n}\n\nexport interface IMediaDiffAPI {\n getMediaDiff: (\n authToken: string,\n siteId: number,\n siteHash?: string,\n existingMedia?: IMediumDiffRequestStatus[],\n ) => Promise;\n}\n","import type { IFetcher, IFetchRequest, ILog, IQueryURL, Method } from '@monofe/util';\nimport type { IAuthenticateResponse } from '../interface/auth';\n\nconst HTTP_STATUS_BAD_REQUEST = 400;\nconst DEFAULT_TIMEOUT_MS = 20000; /* 2Os */\n\nfunction _isIAuthenticateResponse(object: unknown): object is IAuthenticateResponse {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.access_token) &&\n !isNullOrUndefined(record.userName) &&\n !isNullOrUndefined(record.token_type) &&\n !isNullOrUndefined(record.expires_in) &&\n !isNullOrUndefined(record.refresh_token) &&\n !isNullOrUndefined(record['.expires']) &&\n !isNullOrUndefined(record['.issued'])\n );\n}\n\nfunction _request(\n query: IQueryURL,\n url: string,\n extension: string,\n clientId: string,\n clientSecret: string,\n grantType: string,\n username: string,\n password: string,\n): IFetchRequest {\n const authParams = {\n /* eslint-disable-next-line camelcase */\n client_id: clientId,\n /* eslint-disable-next-line camelcase */\n client_secret: clientSecret,\n /* eslint-disable-next-line camelcase */\n grant_type: grantType,\n username,\n password,\n };\n\n const req: IFetchRequest = {\n url: url + extension,\n method: 'POST' as Method,\n body: query.assemble(authParams, false),\n headers: [{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' }],\n };\n\n return req;\n}\n\nasync function _authenticate(\n fetcher: IFetcher,\n logger: ILog,\n query: IQueryURL,\n authParams: IAuthParams,\n timeout: number,\n retryCount: number,\n): Promise {\n const req = _request(\n query,\n authParams.apiUrl,\n authParams.apiExtension,\n authParams.clientId,\n authParams.clientSecret,\n authParams.grantType,\n authParams.username,\n authParams.password,\n );\n\n const response = await fetcher(req, timeout, retryCount).catch((error: Error) => {\n logger.error(\n `Authentication request failed: ${JSON.stringify(error)}, request:${JSON.stringify(\n req,\n )}`,\n );\n throw error;\n });\n\n if (response.statusCode === HTTP_STATUS_BAD_REQUEST) {\n throw new Error('Invalid credentials, authentication failed');\n } else if (!response.isStatusOk) {\n throw new Error(\n `Authenticate request failed: ${response.statusCode}, request:${JSON.stringify(req)}`,\n );\n } else if (!_isIAuthenticateResponse(response.payload)) {\n throw new Error('Missing access_token in auth response');\n }\n\n return response.payload;\n}\n\nexport interface IAuthParams {\n apiUrl: string;\n apiExtension: string;\n clientId: string;\n clientSecret: string;\n grantType: string;\n username: string;\n password: string;\n}\n\nasync function authenticate(\n fetchLoader: IFetcher,\n logger: ILog,\n query: IQueryURL,\n authParams: IAuthParams[],\n timeout = DEFAULT_TIMEOUT_MS,\n retryCount = DEFAULT_TIMEOUT_MS,\n): Promise {\n const errors: unknown[] = [];\n\n logger.assert(\n authParams.length > 0,\n `Failed to find authentication params for apiservice:auth`,\n );\n\n for (const auth of authParams) {\n logger.assert(auth.clientId, `Bad clientId ${JSON.stringify(auth)}`);\n\n try {\n return await _authenticate(fetchLoader, logger, query, auth, timeout, retryCount);\n } catch (error) {\n errors.push(error);\n }\n }\n\n throw new Error(\n `Failed to authenticate: ${JSON.stringify(authParams)}, error:${JSON.stringify(errors)}`,\n );\n}\n\nexport default authenticate;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport {\n injectConfigAPI,\n injectFetch,\n injectLog,\n injectQueryURL,\n TYPES as UTIL_TYPES,\n} from '@monofe/util';\nimport { injectAuthAPI } from '../interface';\nimport type { IAuthAPI } from '../interface/auth';\nimport { bindAuthAPI, TYPES, unbindAuthAPI } from '../interface/bind';\nimport authImpl from './auth';\n\nfunction _build(container: IContainer): Readonly {\n const fetcher = injectFetch(container);\n const logger = injectLog(container);\n const configAPI = injectConfigAPI(container);\n const query = injectQueryURL(container);\n\n const auth: IAuthAPI = {\n authenticate: (apiUrl: string, username: string, password: string, timeout?: number) =>\n authImpl(\n fetcher,\n logger,\n query,\n [\n {\n /* Take the default parameters & apply our overrides */\n ...configAPI.auth,\n apiExtension: configAPI.extension.auth,\n username,\n password,\n apiUrl,\n },\n ],\n timeout,\n ),\n };\n\n return Object.freeze(auth);\n}\n\nexport default buildBindable({\n id: TYPES.IAuthAPI,\n dependencies: [UTIL_TYPES.IFetch, UTIL_TYPES.ILog, UTIL_TYPES.IQueryURL, UTIL_TYPES.IConfigAPI],\n bind: bindAuthAPI,\n remove: unbindAuthAPI,\n build: container => Promise.resolve(_build(container)),\n inject: injectAuthAPI,\n});\n","import type { IDB, IDBCreate, IDBOptions, IDBStoreEngine } from './interface';\n\nfunction _openIDB(name: string, options?: Partial): Promise {\n return new Promise((resolve, reject) => {\n import('./idb')\n .then(idb => idb.default(name, options))\n .then((db: IDB) => {\n resolve(db);\n })\n .catch((err: Error) => {\n reject(err);\n });\n });\n}\n\nfunction _openMem(name: string, options?: Partial): Promise {\n return new Promise((resolve, reject) => {\n import('./mem')\n .then(mem => mem.default(name, options))\n .then((db: IDB) => {\n resolve(db);\n })\n .catch((err: Error) => {\n reject(err);\n });\n });\n}\n\nconst STORAGEENGINE: Record<\n IDBStoreEngine,\n (name: string, options?: Partial) => Promise\n> = {\n indexeddb: _openIDB,\n memory: _openMem,\n};\n\nconst OPTIONS_DEFAULTS: IDBOptions = {\n version: 1,\n engine: 'memory',\n mappings: {},\n};\n\nlet OPTIONS_OVERRIDES: Partial = {};\n\nfunction _options(options?: Partial): IDBOptions {\n const isRunningOnNodeJS = typeof window === 'undefined';\n\n const optionsDB: IDBOptions = {\n ...OPTIONS_DEFAULTS,\n ...OPTIONS_OVERRIDES,\n ...options,\n engine:\n options?.engine ??\n OPTIONS_OVERRIDES.engine ??\n (isRunningOnNodeJS ? 'memory' : 'indexeddb'),\n };\n\n return optionsDB;\n}\n\nfunction _open(name: string, optionsIn?: Partial) {\n const options = _options(optionsIn);\n\n return STORAGEENGINE[options.engine](name, options);\n}\n\nasync function _expand(data: string, name: string, optionsIn?: Partial): Promise {\n const options = _options(optionsIn);\n\n const db = await STORAGEENGINE[options.engine](name, options);\n\n await db.apply(data);\n\n return db;\n}\n\nfunction DB(): IDBCreate {\n return {\n open: _open,\n expand: _expand,\n setDefaults: (options: Partial) => {\n OPTIONS_OVERRIDES = options;\n },\n };\n}\n\nexport default DB;\n","import env from './env';\n\nconst settings = {\n loggingEnabled: env.isProduction,\n};\n\nexport default Object.freeze({\n logging: {\n enable: () => {\n settings.loggingEnabled = true;\n },\n disable: () => {\n settings.loggingEnabled = false;\n },\n isEnabled: () => settings.loggingEnabled,\n },\n});\n","const _isProduction = (): boolean => {\n try {\n /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */\n return Boolean(process !== undefined && process.env['NODE_ENV'] === 'production');\n } catch (error: unknown) {\n return true;\n }\n};\n\nexport default Object.freeze({\n isProduction: _isProduction(),\n});\n","import settings from './settings';\n\nconst loggingEnabled = settings.logging.isEnabled();\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */\nconst _noop = (message: string): void => {};\n\nconst _logInfo = loggingEnabled\n ? (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.info(message);\n }\n : _noop;\n\nconst _logWarn = loggingEnabled\n ? (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.warn(message);\n }\n : _noop;\n\nconst _logError = loggingEnabled\n ? (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.error(message);\n }\n : _noop;\n\nconst _logAssert = (condition: unknown, message?: string): void => {\n /* eslint-disable-next-line no-extra-boolean-cast */\n if (Boolean(condition)) {\n _logError(`Condition failed, ${message ?? ''}`);\n }\n};\n\nexport default Object.freeze({\n info: _logInfo,\n warn: _logWarn,\n error: _logError,\n assert: _logAssert,\n});\n","import type { IConfigAPI, IFetcher, IFetchRequest, ResponseTypes } from '@monofe/util';\nimport { log } from '../../private';\nimport type { IMediaDiffResponse, IMediumDiffRequestStatus } from '../interface';\n\ninterface IMediaDiffRequest {\n requestDto: {\n siteId: number;\n hash: string;\n requests: { id: string; mediumHash: string }[];\n };\n}\n\nfunction _request(params: {\n apiHref: string;\n authToken: string;\n siteId: number;\n siteHash?: string;\n existingMedia?: IMediumDiffRequestStatus[];\n}): IFetchRequest {\n const mapMediumToBodyRequest = (\n medium: IMediumDiffRequestStatus,\n ): { id: string; mediumHash: string } => ({\n id: medium.id,\n mediumHash: medium.mediumHash,\n });\n\n const body: IMediaDiffRequest = {\n requestDto: {\n siteId: params.siteId,\n hash: params.siteHash ?? '',\n requests: (params.existingMedia ?? []).map(medium => mapMediumToBodyRequest(medium)),\n },\n };\n\n const req: IFetchRequest = {\n url: params.apiHref,\n method: 'POST',\n headers: [\n { name: 'Authorization', value: `Bearer ${params.authToken}` },\n { name: 'Content-Type', value: 'application/json' },\n ],\n body: JSON.stringify(body),\n expectedResponseType: 'json' as ResponseTypes,\n };\n\n return req;\n}\n\nfunction _isMediaDiffResponse(object: unknown): object is IMediaDiffResponse {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return !isNullOrUndefined(record.value) && Array.isArray(record.value);\n}\n\nasync function getMediaDiff(\n requester: IFetcher,\n config: IConfigAPI,\n authToken: string,\n siteId: number,\n siteHash = '',\n existingMedia: IMediumDiffRequestStatus[] = [],\n): Promise {\n const apiHrefs = [`${config.url}${config.extension.mediaDiff}`];\n\n for (const apiHref of apiHrefs) {\n const req = _request({\n apiHref,\n authToken,\n siteId,\n siteHash,\n existingMedia,\n });\n\n const response = await requester(req).catch(error => {\n log.error(`Failed to fetch site data url:${apiHref}, error:${JSON.stringify(error)}`);\n return null;\n });\n\n const payload = response?.payload;\n\n if (_isMediaDiffResponse(payload)) {\n return payload;\n }\n }\n\n throw new Error(`Failed to resolve mediaDiff from hrefs: ${JSON.stringify(apiHrefs)}`);\n}\n\nexport default getMediaDiff;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectConfigAPI, injectFetch, TYPES as UTIL_TYPES } from '@monofe/util';\nimport type { IMediumDiffRequestStatus } from '../interface';\nimport { injectMediaDiffAPI } from '../interface';\nimport { bindMediaDiffAPI, TYPES, unbindMediaDiffAPI } from '../interface/bind';\nimport type { IMediaDiffAPI } from '../interface/mediaDiff';\nimport getMediaDiff from './mediaDiff';\n\nfunction _build(container: IContainer): Readonly {\n const fetcher = injectFetch(container);\n const config = injectConfigAPI(container);\n\n const module: IMediaDiffAPI = {\n getMediaDiff: (\n authToken: string,\n siteId: number,\n siteHash = '',\n existingMedia: IMediumDiffRequestStatus[] = [],\n ) => getMediaDiff(fetcher, config, authToken, siteId, siteHash, existingMedia),\n };\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: TYPES.IMediaDiffAPI,\n dependencies: [UTIL_TYPES.IFetch, UTIL_TYPES.IConfigAPI],\n bind: bindMediaDiffAPI,\n remove: unbindMediaDiffAPI,\n build: container => Promise.resolve(_build(container)),\n inject: injectMediaDiffAPI,\n});\n","import type {\n IFetcher,\n IFetchRequest,\n ILog,\n IProgressPromise,\n IProgressPromiseGenerator,\n} from '@monofe/util';\nimport type { MediaBinaryStorageTypeMap } from '../interface/media';\n\nconst DEFAULT_TIMEOUT = 300000; /* 5 mins */\nconst DEFAULT_RETRY_COUNT = 2;\n\nfunction download<\n K extends keyof MediaBinaryStorageTypeMap,\n V extends MediaBinaryStorageTypeMap[K],\n>(\n promiser: IProgressPromiseGenerator,\n fetcher: IFetcher,\n logger: ILog,\n requests: IFetchRequest[],\n type: K,\n retryCount = DEFAULT_RETRY_COUNT,\n timeout = DEFAULT_TIMEOUT,\n): IProgressPromise {\n return promiser.async(async progressCallback => {\n for (const request of requests) {\n const promise = fetcher(request, timeout, retryCount);\n\n promise.onProgress(progressCallback);\n\n const response = await promise;\n const payload = response.payload;\n if (!payload) {\n logger.error('Missing payload from media response');\n continue;\n }\n\n return payload as V;\n }\n\n throw new Error(`Failed to get response from requests: ${JSON.stringify(requests)}`);\n });\n}\n\nexport default Object.freeze({\n download,\n});\n","import type { IFetchRequest, ResponseTypes } from '@monofe/util';\nimport type { MediaBinaryStorageTypeMap } from '../interface/media';\n\nconst RESPONSETYPE_MAP: Record = {\n Blob: 'blob',\n ArrayBuffer: 'arraybuffer',\n none: 'blob',\n};\n\nexport const requestForURL = (\n url: string,\n type: keyof MediaBinaryStorageTypeMap,\n): IFetchRequest => ({\n url,\n method: 'GET',\n /* Map our interface response type to Fetchers type */\n expectedResponseType: RESPONSETYPE_MAP[type],\n});\n\nexport default Object.freeze({\n requestForURL,\n});\n","import type {\n IConfigAPI,\n IFetcher,\n ILog,\n IProgressPromise,\n IProgressPromiseGenerator,\n} from '@monofe/util';\nimport type { IMediaURLResolverParameters, MediaBinaryStorageTypeMap } from '../interface/media';\nimport mediaDownload from './media.download';\nimport mediaUtil from './media.util';\n\nconst FETCH_RETRY_COUNT = 3;\n\nconst _hasHttpPrefix = (url = '') =>\n url.startsWith('http://') || url.startsWith('https://') || false;\n\nfunction _requestFromConfig(config: IConfigAPI, mediaId: string): string | undefined {\n if (!config.extension.media) {\n return undefined;\n }\n\n const templatedPath = _hasHttpPrefix(config.extension.media)\n ? config.extension.media\n : `${config.url}${config.extension.media}`;\n\n const resolvedPath = templatedPath ? templatedPath.replace('%MEDIAID%', mediaId) : undefined;\n\n return _hasHttpPrefix(resolvedPath) ? resolvedPath : undefined;\n}\n\nfunction _requestFromConfigWithToken(\n config: IConfigAPI,\n mediaId: string,\n accessToken: string,\n): string | undefined {\n if (!config.extension.mediaWithAccessToken) {\n return undefined;\n }\n\n const templatedPath = _hasHttpPrefix(config.extension.mediaWithAccessToken)\n ? config.extension.mediaWithAccessToken\n : `${config.url || ''}${config.extension.mediaWithAccessToken}`;\n\n const resolvedPath = templatedPath\n ? templatedPath.replace('%MEDIAID%', mediaId).replace('%ACCESS_TOKEN%', accessToken)\n : undefined;\n\n return _hasHttpPrefix(resolvedPath) ? resolvedPath : undefined;\n}\n\nfunction canResolveMedium(mediaId: string): Promise {\n /* No way to query for this, just assume we can */\n return Promise.resolve(true);\n}\n\nfunction requestURL(\n config: IConfigAPI,\n mediaId: string,\n parameters: IMediaURLResolverParameters = {},\n): string[] {\n let resolver = (mediaId: string, config: IConfigAPI) => _requestFromConfig(config, mediaId);\n\n const authToken = parameters.accessToken;\n\n if (authToken !== undefined) {\n resolver = (mediaId: string, config: IConfigAPI) =>\n _requestFromConfigWithToken(config, mediaId, authToken);\n }\n\n const result = resolver(mediaId, config);\n\n return result !== undefined ? [result] : [];\n}\n\nfunction getMedia<\n K extends keyof MediaBinaryStorageTypeMap,\n V extends MediaBinaryStorageTypeMap[K],\n>(\n promiser: IProgressPromiseGenerator,\n config: IConfigAPI,\n fetcher: IFetcher,\n logger: ILog,\n type: K,\n mediaId: string,\n parameters: IMediaURLResolverParameters,\n): IProgressPromise {\n const urls = requestURL(config, mediaId, parameters);\n const requests = urls.map(url => mediaUtil.requestForURL(url, type));\n\n return mediaDownload.download(promiser, fetcher, logger, requests, type, FETCH_RETRY_COUNT);\n}\n\nexport default Object.freeze({\n canResolveMedium,\n getMedia,\n requestURL,\n});\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport {\n injectConfigAPI,\n injectFetch,\n injectLog,\n injectProgressPromise,\n TYPES as UTIL_TYPES,\n} from '@monofe/util';\nimport type { MediaBinaryStorageTypeMap } from '../../controller/interface/media';\nimport { bindMediaAPI, injectMediaAPI, TYPES, unbindMediaAPI } from '../interface/bind';\nimport type { IMediaAPI, IMediaURLResolverParameters } from '../interface/media';\nimport mediaImpl from './mediaVTS';\n\nfunction _build(container: IContainer): Readonly {\n const promiser = injectProgressPromise(container);\n const fetcher = injectFetch(container);\n const log = injectLog(container);\n const config = injectConfigAPI(container);\n\n const module: IMediaAPI = {\n getMedia: <\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n >(\n type: T,\n mediaId: string,\n parameters?: IMediaURLResolverParameters,\n ) =>\n mediaImpl.getMedia(\n promiser,\n config,\n fetcher,\n log,\n type,\n mediaId,\n parameters ?? {},\n ),\n\n /* IMediaURLResolver */\n canResolveMedium: (mediaId: string) => mediaImpl.canResolveMedium(mediaId),\n\n requestURL: (mediaId: string, parameters: IMediaURLResolverParameters = {}) =>\n mediaImpl.requestURL(config, mediaId, parameters),\n };\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: TYPES.IMediaAPI,\n dependencies: [UTIL_TYPES.IProgressPromiseGenerator, UTIL_TYPES.IFetch, UTIL_TYPES.IConfigAPI],\n bind: (value, container) => {\n bindMediaAPI([value], container);\n },\n remove: unbindMediaAPI,\n build: container => Promise.resolve(_build(container)),\n inject: container => {\n const [mediaAPI] = injectMediaAPI(container);\n if (mediaAPI === undefined) throw new Error(\"Couldn't find media API after injection\");\n return mediaAPI;\n },\n});\n","import type {\n IConfigAPI,\n IFetcher,\n IFetchRequest,\n ILog,\n IProgressPromise,\n IProgressPromiseGenerator,\n IZip,\n Method,\n} from '@monofe/util';\nimport { arrayBuffer } from '@monofe/util';\nimport type { ISiteData } from '../interface/siteData';\n\nconst DEFAULT_TIMEOUT_MS = 20000; /* 20s */\nconst DEFAULT_RETRY_COUNT = 3;\n\nfunction _isBlob(object: unknown): object is Blob {\n try {\n return (\n object instanceof Blob ||\n ['[object Blob]', '[object File]'].includes(Object.prototype.toString.call(object))\n );\n } catch (error) {\n /* Blob typings missing (running on NodeJS) */\n return false;\n }\n}\n\nfunction _blobToString(blob: Blob): Promise {\n return blob.text();\n}\n\nfunction _request(apiHref: string, authToken: string, hash: string): IFetchRequest {\n const isRunningOnNodeJS = typeof window === 'undefined';\n\n const req: IFetchRequest = {\n url: apiHref,\n method: 'POST' as Method,\n headers: [\n { name: 'Authorization', value: `Bearer ${authToken}` },\n { name: 'Content-Type', value: 'application/json' },\n ],\n body: JSON.stringify({ hash: hash }),\n expectedResponseType: isRunningOnNodeJS ? 'arraybuffer' : 'blob',\n };\n\n return req;\n}\n\nfunction _downloadSiteData(\n fetcher: IFetcher,\n promiser: IProgressPromiseGenerator,\n apiHref: string,\n authToken: string,\n hash: string,\n timeout: number,\n retryCount: number,\n): IProgressPromise {\n return promiser.async(async progressCallback => {\n const req = _request(apiHref, authToken, hash);\n const promise = fetcher(req, timeout, retryCount);\n promise.onProgress(progressCallback);\n\n const response = await promise;\n const payload = response.payload;\n\n if (!payload) {\n throw new Error('Missing payload from response');\n }\n\n return payload;\n });\n}\n\nfunction _isISiteData(object: unknown): object is ISiteData {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.currentHash) &&\n !isNullOrUndefined(record.previousHash) &&\n !isNullOrUndefined(record.patch)\n );\n}\n\nconst PATCH_DATA_FILE_NAME = 'data.json';\n\nfunction _unzipSiteData(\n promiser: IProgressPromiseGenerator,\n zip: IZip,\n srcData: ArrayBuffer | Blob,\n): IProgressPromise {\n return promiser.async(async progressCallback => {\n const dataFile = await zip.unzipFile(srcData, PATCH_DATA_FILE_NAME);\n progressCallback(0.9);\n\n let dataStr = '';\n\n if (_isBlob(dataFile)) {\n dataStr = await _blobToString(dataFile);\n } else if (arrayBuffer.isArrayBuffer(dataFile)) {\n dataStr = arrayBuffer.arrayBufferToString(dataFile);\n } else {\n throw new Error(`unknown zip-file response type: ${JSON.stringify(dataFile)}`);\n }\n\n const jsonData = JSON.parse(dataStr) as unknown;\n\n if (!_isISiteData(jsonData)) {\n throw new Error('Response does not match expected ISiteData type');\n }\n\n return jsonData;\n });\n}\n\nfunction getSiteData(\n promiser: IProgressPromiseGenerator,\n fetcher: IFetcher,\n zipper: IZip,\n logger: ILog,\n config: IConfigAPI,\n authToken: string,\n hash = '',\n timeout = DEFAULT_TIMEOUT_MS,\n retryCount = DEFAULT_RETRY_COUNT,\n): IProgressPromise {\n return promiser.async(async progressCallback => {\n const apiHrefs = [`${config.url}${config.extension.siteData}`];\n\n let siteDataBinary: ArrayBuffer | Blob | null = null;\n\n for (const apiHref of apiHrefs) {\n const promise = _downloadSiteData(\n fetcher,\n promiser,\n apiHref,\n authToken,\n hash,\n timeout,\n retryCount,\n );\n\n promise.onProgress(data => {\n progressCallback((data * 0.9) / 2); /* 2 Jobs */\n });\n\n siteDataBinary = await promise.catch((error: Error) => {\n logger.error(\n `Failed to download site data url:${apiHref}, hash:${hash}, token:${authToken}, error:${error.message}`,\n );\n return null;\n });\n\n if (siteDataBinary !== null) {\n break;\n }\n }\n\n if (siteDataBinary) {\n const unzipPromise = _unzipSiteData(promiser, zipper, siteDataBinary);\n unzipPromise.onProgress(data => {\n progressCallback(0.5 + data / 2); /* 2 Jobs */\n });\n const srcData = await unzipPromise;\n return srcData;\n } else {\n const message = `Unable to fetch site data from hrefs:${JSON.stringify(\n apiHrefs,\n )}, token:${authToken}, hash:${hash}`;\n throw new Error(message);\n }\n });\n}\n\nexport default getSiteData;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport {\n injectConfigAPI,\n injectFetch,\n injectLog,\n injectProgressPromise,\n injectZip,\n TYPES as UTIL_TYPES,\n} from '@monofe/util';\nimport { bindSiteDataAPI, injectSiteDataAPI, TYPES, unbindSiteDataAPI } from '../interface/bind';\nimport type { ISiteDataAPI } from '../interface/siteData';\nimport getSiteDataAPI from './siteData';\n\nfunction _build(container: IContainer): Readonly {\n const promiser = injectProgressPromise(container);\n const fetcher = injectFetch(container);\n const zip = injectZip(container);\n const log = injectLog(container);\n const config = injectConfigAPI(container);\n\n const module: ISiteDataAPI = {\n getSiteData: (apiURL: string, authToken: string, hash?: string, timeout?: number) =>\n getSiteDataAPI(promiser, fetcher, zip, log, config, authToken, hash, timeout),\n };\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: TYPES.ISiteDataAPI,\n dependencies: [\n UTIL_TYPES.IProgressPromiseGenerator,\n UTIL_TYPES.IFetch,\n UTIL_TYPES.IZip,\n UTIL_TYPES.IConfigAPI,\n ],\n bind: bindSiteDataAPI,\n remove: unbindSiteDataAPI,\n build: container => Promise.resolve(_build(container)),\n inject: injectSiteDataAPI,\n});\n","import { buildBinderListings } from '@monofe/di';\nimport authApiBinder from '../impl/auth.bind';\nimport mediaDiffApiBinder from '../impl/mediaDiff.bind';\nimport mediaApiBinder from '../impl/mediaVTS.bind';\nimport siteDataApiBinder from '../impl/siteData.bind';\n\nexport default buildBinderListings([\n authApiBinder,\n mediaDiffApiBinder,\n mediaApiBinder,\n siteDataApiBinder,\n]);\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IAuthManagerInstantiator } from './auth';\nimport type { IMediaManagerInstantiator } from './media';\nimport type { IUserStateInstantiator } from './userstate';\n\nexport const TYPES = {\n IAuthenticationManager: Symbol.for('IAuthenticationManager'),\n IMediaManager: Symbol.for('IMediaManager'),\n IUserStateManager: Symbol.for('IUserStateManager'),\n};\n\nexport function injectMediaManager(\n container: IContainer = injectOrBuildContainer(),\n): IMediaManagerInstantiator {\n return container.get(TYPES.IMediaManager);\n}\n\nexport function bindMediaManager(\n val: IMediaManagerInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IMediaManager, val);\n}\n\nexport function unbindMediaManager(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IMediaManager);\n}\n\nexport function injectAuthManager(\n container: IContainer = injectOrBuildContainer(),\n): IAuthManagerInstantiator {\n return container.get(TYPES.IAuthenticationManager);\n}\n\nexport function bindAuthManager(\n val: IAuthManagerInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IAuthenticationManager, val);\n}\n\nexport function unbindAuthManager(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IAuthenticationManager);\n}\n\nexport function injectUserStateManager(\n container: IContainer = injectOrBuildContainer(),\n): IUserStateInstantiator {\n return container.get(TYPES.IUserStateManager);\n}\n\nexport function bindUserStateManager(\n val: IUserStateInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IUserStateManager, val);\n}\n\nexport function unbindUserStateManager(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IUserStateManager);\n}\n","import type { IAuthAPI } from '../../api/interface';\nimport type {\n IAuthenticationManager,\n IAuthManagerArguments,\n IAuthManagerStatus,\n} from '../interface/auth';\n\nconst TIME_REFRESH_THRESHOLD_MS = 30 * 1000; /* 30s */\n\ninterface IAuthManagerPrv extends IAuthenticationManager {\n pendingRenew: Promise | null;\n}\n\ninterface IAuthManagerSaveState {\n accessToken: string;\n expiry: number;\n apiUrl: string;\n apiExtension: string;\n clientId: string;\n clientSecret: string;\n grantType: string;\n username: string;\n password: string;\n}\n\nfunction _open(authAPI: IAuthAPI, initState: IAuthManagerSaveState): IAuthenticationManager {\n const manager: IAuthManagerPrv = {\n pendingRenew: null,\n\n accessToken: initState.accessToken,\n expiry: new Date(initState.expiry * 1000),\n\n apiUrl: initState.apiUrl,\n apiExtension: initState.apiExtension,\n clientId: initState.clientId,\n clientSecret: initState.clientSecret,\n grantType: initState.grantType,\n username: initState.username,\n password: initState.password,\n\n status: function (this: IAuthManagerPrv): IAuthManagerStatus {\n if (this.accessToken.length <= 1) {\n return 'Unset';\n }\n\n if (this.hasExpired()) {\n return 'Expired';\n }\n\n return 'Authorized';\n },\n\n hasExpired: function (this: IAuthManagerPrv): boolean {\n const now = new Date().getTime();\n const threshold =\n now - TIME_REFRESH_THRESHOLD_MS; /* If we are within 30s, get a new token */\n const expiry = this.expiry.getTime();\n const hasExpired = expiry < threshold;\n return hasExpired;\n },\n\n renew: function (this: IAuthManagerPrv): Promise {\n if (!manager.hasExpired()) {\n return Promise.resolve(manager.accessToken);\n }\n\n if (!manager.pendingRenew) {\n const renewResult: () => Promise = async () => {\n const authResponse = await authAPI\n .authenticate(manager.apiUrl, manager.username, manager.password)\n .catch((error: Error) => {\n throw new Error(\n `Renew failed: ${error.message} auth:${manager.username}`,\n );\n });\n\n /* eslint-disable-next-line require-atomic-updates */\n manager.accessToken = authResponse.access_token;\n this.expiry = new Date(new Date().getTime() + authResponse.expires_in * 1000);\n this.pendingRenew = null;\n\n return authResponse.access_token;\n };\n\n manager.pendingRenew = renewResult();\n }\n\n return manager.pendingRenew;\n },\n\n serialize: function (this: IAuthManagerPrv): string {\n const obj: IAuthManagerSaveState = {\n accessToken: this.accessToken,\n expiry: this.expiry.getSeconds(),\n apiUrl: this.apiUrl,\n apiExtension: this.apiExtension,\n clientId: this.clientId,\n clientSecret: this.clientSecret,\n grantType: this.grantType,\n username: this.username,\n password: this.password,\n };\n\n return JSON.stringify(obj);\n },\n };\n\n return manager as IAuthenticationManager;\n}\n\nfunction open(authAPI: IAuthAPI, args: IAuthManagerArguments): IAuthenticationManager {\n const state: IAuthManagerSaveState = {\n /* Make sure onCreation #hasExpired() returns true */\n expiry: new Date().getSeconds() - TIME_REFRESH_THRESHOLD_MS - 1,\n accessToken: '',\n ...args,\n };\n\n return _open(authAPI, state);\n}\n\nfunction expand(authAPI: IAuthAPI, initString: string): IAuthenticationManager {\n const initState: IAuthManagerSaveState = initString.length > 2 ? JSON.parse(initString) : {};\n return _open(authAPI, initState);\n}\n\nexport default Object.freeze({\n open,\n expand,\n});\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectAuthAPI } from '../../api/interface';\nimport { TYPES as API_TYPES } from '../../api/interface/bind';\nimport type { IAuthManagerArguments, IAuthManagerInstantiator } from '../interface/auth';\nimport {\n bindAuthManager,\n injectAuthManager,\n TYPES as CONTROLLER_TYPES,\n unbindAuthManager,\n} from '../interface/bind';\nimport authImpl from './auth';\n\nfunction _build(container: IContainer): Readonly {\n const authAPI = injectAuthAPI(container);\n\n return Object.freeze({\n open: (args: IAuthManagerArguments) => authImpl.open(authAPI, args),\n expand: (data: string) => authImpl.expand(authAPI, data),\n });\n}\n\nexport default buildBindable({\n id: CONTROLLER_TYPES.IAuthenticationManager,\n dependencies: [API_TYPES.IAuthAPI],\n bind: bindAuthManager,\n remove: unbindAuthManager,\n build: container => Promise.resolve(_build(container)),\n inject: injectAuthManager,\n});\n","import type { IMediaAPI } from '../../api/interface/media';\nimport type { IWorkspaceDB } from '../../db/interface/db';\nimport type { IMediaCacheController } from '../../util/interface';\nimport type { IAuthenticationManager } from '../interface/auth';\nimport type { MediaBinaryStorageTypeMap } from '../interface/media';\n\nasync function downloadToBinary<\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n>(\n database: Readonly,\n auth: Readonly,\n cacheController: Readonly,\n mediaAPIs: Readonly[]>,\n mediaId: string,\n cacheOnly: boolean,\n type?: T,\n): Promise> {\n await database.open();\n\n /* Do this first, as if it doesn't exist, lets crash out early before network requests */\n const medium = await database.get('IMediumDto', mediaId);\n let data: U | undefined;\n\n if (await cacheController.isMediumCached(mediaId)) {\n data = (await cacheController.cachedResponse(mediaId, type ?? 'Blob')) as U | undefined;\n } else if (!cacheOnly && !data) {\n const token = auth.hasExpired() ? await auth.renew() : auth.accessToken;\n\n for (const api of mediaAPIs) {\n const mediaBinary = await api\n .getMedia(type ?? 'Blob', mediaId, { accessToken: token })\n .catch(() => undefined);\n\n if (mediaBinary === undefined) {\n /* Failed, try next api */\n continue;\n } else if (type === 'Blob') {\n data = mediaBinary as U | undefined;\n break;\n } else if (type === 'ArrayBuffer') {\n data = mediaBinary as U | undefined;\n break;\n } else {\n /* Type === 'none' */\n }\n }\n }\n\n database.close();\n\n if (data) {\n if (type === 'Blob') {\n /* Make sure to specify the mime-type in the blob, otherwise media such as mp3/mp4's won't play on Safari */\n data = new Blob([data as Blob], { type: medium.mimeType }) as U;\n }\n\n return data;\n } else {\n throw new Error(`Unable to find data for mediaId:${mediaId}`);\n }\n}\n\nasync function downloadToBinaries<\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n>(\n database: Readonly,\n auth: Readonly,\n cacheController: Readonly,\n mediaAPI: Readonly[]>,\n mediaIds: Readonly,\n cacheOnly: boolean,\n type?: T,\n): Promise[]>> {\n const promises = mediaIds.map(id =>\n downloadToBinary(database, auth, cacheController, mediaAPI, id, cacheOnly, type),\n );\n\n const results = await Promise.all(promises);\n\n return Object.freeze(results);\n}\n\nasync function downloadToUrl(\n database: Readonly,\n auth: Readonly,\n cacheController: Readonly,\n mediaAPI: Readonly[]>,\n mediaId: string,\n cacheOnly: boolean,\n): Promise {\n const blob = await downloadToBinary(\n database,\n auth,\n cacheController,\n mediaAPI,\n mediaId,\n cacheOnly,\n 'Blob',\n );\n const url = URL.createObjectURL(blob);\n return url;\n}\n\nasync function downloadToUrls(\n database: Readonly,\n auth: Readonly,\n cacheController: Readonly,\n mediaAPI: Readonly[]>,\n mediaIds: Readonly,\n cacheOnly: boolean,\n): Promise {\n const blobs = await downloadToBinaries(\n database,\n auth,\n cacheController,\n mediaAPI,\n mediaIds,\n cacheOnly,\n 'Blob',\n );\n const urls = blobs.map(blob => URL.createObjectURL(blob));\n return urls;\n}\n\nexport default Object.freeze({\n downloadToUrl,\n downloadToUrls,\n downloadToBinary,\n downloadToBinaries,\n});\n","import type { IWorkspaceDB } from '../../db/interface';\nimport type { IMediumDto, IStyleDto } from '../../model/interface';\n\nasync function mediaForStyling(db: IWorkspaceDB, style: IStyleDto): Promise {\n const shouldOpenClose = !db.isOpen();\n\n if (shouldOpenClose) {\n await db.open();\n }\n\n const queryIds: string[] = [\n style.backgroundImageMediumId,\n style.foregroundImageMediumId,\n style.menuImageMediumId,\n ].filter(mediumId => mediumId && mediumId.length > 1); /* Filter falsy values */\n\n const media = await Promise.all(queryIds.map(mediumId => db.get('IMediumDto', mediumId)));\n\n if (shouldOpenClose) {\n db.close();\n }\n\n return media;\n}\n\nexport default Object.freeze({\n mediaForStyling,\n});\n","import type { IWorkspaceDB } from '../../db/interface';\nimport type {\n ILanguageDto,\n IMediumDto,\n IModelSource,\n ISiteObjectDto,\n ISiteObjectTranslationDto,\n ITourDto,\n} from '../../model/interface';\nimport mediaUtil from './media.util';\n\nasync function mediaForSiteObject(\n db: IWorkspaceDB,\n siteObject: ISiteObjectDto,\n language: ILanguageDto,\n): Promise {\n const shouldOpenClose = !db.isOpen();\n\n if (shouldOpenClose) {\n await db.open();\n }\n\n const allTranslations = await siteObject.translations(db as IModelSource);\n /* If only 1 translation provided assume universal(no-translation-needed) & include */\n const matchTranslations =\n allTranslations.length > 1\n ? allTranslations.filter(sot => sot.languageId === language.id)\n : allTranslations;\n\n const downloadList = matchTranslations\n .map(sot => sot.mediumId)\n .filter(mediumId => mediumId && mediumId.length > 1);\n\n const media = await Promise.all(downloadList.map(mediumId => db.get('IMediumDto', mediumId)));\n\n if (siteObject.styleId) {\n const style = await db.get('IStyleDto', siteObject.styleId);\n media.push(...(await mediaUtil.mediaForStyling(db, style)));\n }\n\n const localMediaIds = [\n siteObject.foregroundImageMediumId,\n siteObject.backgroundImageMediumId,\n siteObject.menuImageMediumId,\n ];\n\n const allLocalMedia = await Promise.all(\n localMediaIds.filter(id => id).map(id => db.get('IMediumDto', id)),\n );\n\n media.push(...allLocalMedia);\n\n if (shouldOpenClose) {\n db.close();\n }\n\n return media;\n}\n\nasync function mediaUsedForSiteObjectTranslationsInLanguage(\n db: IWorkspaceDB,\n allSiteObjectTranslations: ISiteObjectTranslationDto[],\n language: ILanguageDto,\n): Promise {\n const shouldOpenClose = !db.isOpen();\n\n if (shouldOpenClose) {\n await db.open();\n }\n\n const allMediaWithTranslations = allSiteObjectTranslations.filter(\n sot => sot.mediumId,\n ); /* If the mediumId is blank, ignore */\n const matchMediaTranslations = await Promise.all(\n allMediaWithTranslations\n .filter(sot => sot.languageId === language.id)\n .map(sot => db.get('IMediumDto', sot.mediumId)),\n ); /* Filter all SOTs with valid mediumId, where language matches & pull sot.mediumId from db */\n\n /* Any media without an associated translation, treat as if it is universal (needed on all languages) & download regardless */\n const allMedia = await db.all('IMediumDto');\n const allMediaWithTranslationsIds = allMediaWithTranslations.map(medium => medium.mediumId);\n const mediaUniversal = allMedia.filter(\n medium => !allMediaWithTranslationsIds.includes(medium.id),\n );\n\n if (shouldOpenClose) {\n db.close();\n }\n\n /* Generate Mapping, so as to remove any duplicates */\n const downloadMedia: Record = {};\n\n mediaUniversal.forEach(medium => (downloadMedia[medium.id] = medium));\n matchMediaTranslations.forEach(medium => (downloadMedia[medium.id] = medium));\n\n const downloadList = Object.values(downloadMedia);\n\n return downloadList;\n}\n\nasync function mediaUsedForLanguage(\n db: IWorkspaceDB,\n language: ILanguageDto,\n): Promise {\n const shouldOpenClose = !db.isOpen();\n\n if (shouldOpenClose) {\n await db.open();\n }\n\n /* Get a list of all media associated with SiteObjectTranslations & filter these by #language */\n const allSiteObjectTranslations = await db.all('ISiteObjectTranslationDto');\n const downloadList = mediaUsedForSiteObjectTranslationsInLanguage(\n db,\n allSiteObjectTranslations,\n language,\n );\n\n if (shouldOpenClose) {\n db.close();\n }\n\n return downloadList;\n}\n\nasync function _siteObjectsForTour(db: IWorkspaceDB, tour: ITourDto): Promise {\n const shouldOpenClose = !db.isOpen();\n\n if (shouldOpenClose) {\n await db.open();\n }\n\n const tourRelatedSiteObjects = await db.all('ITourRelatedSiteObjectDto');\n const siteObjectIds = tourRelatedSiteObjects\n .filter(x => x.tourId === tour.id)\n .map(x => x.siteObjectId);\n const siteObjects = await Promise.all(siteObjectIds.map(id => db.get('ISiteObjectDto', id)));\n\n if (shouldOpenClose) {\n db.close();\n }\n\n return siteObjects;\n}\n\nasync function mediaForLanguageWithTour(\n db: IWorkspaceDB,\n language: ILanguageDto,\n tour: ITourDto,\n): Promise {\n const shouldOpenClose = !db.isOpen();\n\n if (shouldOpenClose) {\n await db.open();\n }\n\n const mediaList: IMediumDto[] = [];\n\n if (tour.styleId) {\n const tourStyle = await tour.style(db as IModelSource);\n mediaList.push(...(await mediaUtil.mediaForStyling(db, tourStyle)));\n }\n\n const siteObjects = await _siteObjectsForTour(db, tour);\n\n const soMediaList = await Promise.all(\n siteObjects.map(so => mediaForSiteObject(db, so, language)),\n );\n\n soMediaList.forEach(soMedia => mediaList.push(...soMedia));\n\n if (shouldOpenClose) {\n db.close();\n }\n\n return mediaList;\n}\n\nexport default Object.freeze({\n mediaUsedForLanguage,\n mediaForSiteObject,\n mediaForLanguageWithTour,\n});\n","import type { IFetcher } from '@monofe/util';\nimport type { IMediaAPI } from '../../api/interface';\nimport type { IWorkspaceDB } from '../../db/interface';\nimport type { ILanguageDto, ITourDto } from '../../model/interface';\nimport type { IMediaCacheController } from '../../util/interface';\nimport type { IAuthenticationManager } from '../interface/auth';\nimport type { IMediaManager, MediaBinaryStorageTypeMap } from '../interface/media';\nimport mediaDownload from './media.download';\nimport mediaFilter from './media.filter';\n\nasync function _resolveUrlWithToken(\n database: Readonly,\n auth: Readonly,\n apis: Readonly[]>,\n fetcher: IFetcher,\n cacheController: Readonly,\n mediaId: string,\n): Promise {\n /* Short circuit, if we can just get the asset from cache */\n const isCached = await cacheController.isMediumCached(mediaId);\n\n if (isCached) {\n const url = mediaDownload.downloadToUrl(\n database,\n auth,\n cacheController,\n apis,\n mediaId,\n true,\n );\n return url;\n }\n\n const authToken = await auth.renew();\n\n let url: string | undefined = '';\n\n for (const api of apis) {\n const canResolve = await api.canResolveMedium(mediaId);\n\n if (!canResolve) {\n continue;\n }\n\n const urls = api.requestURL(mediaId, { accessToken: authToken });\n\n url = urls.find(item => item.length > 0);\n\n if (url !== undefined) {\n break;\n }\n }\n\n if (url === undefined) {\n throw new Error(`Unable to resolve mediaId: ${mediaId}`);\n }\n\n return url;\n}\n\nfunction mediaManager(\n database: Readonly,\n auth: Readonly,\n mediaAPI: () => IMediaAPI[],\n fetcher: IFetcher,\n cacheController: Readonly,\n): IMediaManager {\n const manager: IMediaManager = {\n downloadToURL: (id: string, cacheOnly?: boolean) =>\n mediaDownload.downloadToUrl(\n database,\n auth,\n cacheController,\n mediaAPI(),\n id,\n cacheOnly ?? false,\n ),\n downloadToURLs: (ids: string[], cacheOnly?: boolean) =>\n mediaDownload.downloadToUrls(\n database,\n auth,\n cacheController,\n mediaAPI(),\n ids,\n cacheOnly ?? false,\n ),\n\n downloadToBinary: <\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n >(\n id: string,\n type?: T,\n cacheOnly?: boolean,\n ) =>\n mediaDownload.downloadToBinary(\n database,\n auth,\n cacheController,\n mediaAPI(),\n id,\n cacheOnly ?? false,\n type,\n ),\n\n downloadToBinaries: <\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n >(\n ids: string[],\n type?: T,\n cacheOnly?: boolean,\n ) =>\n mediaDownload.downloadToBinaries(\n database,\n auth,\n cacheController,\n mediaAPI(),\n ids,\n cacheOnly ?? false,\n type,\n ),\n\n isMediumCached: (mediaId: string) => cacheController.isMediumCached(mediaId),\n isAllMediaCached: (mediaIds: string[]) => cacheController.isAllMediaCached(mediaIds),\n removeMediumCache: (mediaId: string) => cacheController.removeMediumCache(mediaId),\n\n mediaForLanguage: (language: Readonly) =>\n mediaFilter.mediaUsedForLanguage(database, language),\n mediaForLanguageWithTour: (language: Readonly, tour: Readonly) =>\n mediaFilter.mediaForLanguageWithTour(database, language, tour),\n\n resolveUrlWithToken: (mediaId: string) =>\n _resolveUrlWithToken(database, auth, mediaAPI(), fetcher, cacheController, mediaId),\n };\n\n return manager;\n}\n\nexport default mediaManager;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectFetch, TYPES as UTIL_TYPES } from '@monofe/util';\nimport { injectMediaAPI, TYPES as API_TYPES } from '../../api/interface/bind';\nimport type { IWorkspaceDB } from '../../db/interface/db';\nimport { injectMediaCacheController } from '../../util/interface';\nimport { TYPES as CACHE_TYPES } from '../../util/interface/bind';\nimport type { IAuthenticationManager } from '../interface/auth';\nimport {\n bindMediaManager,\n injectMediaManager,\n TYPES as CONTROLLER_TYPES,\n unbindMediaManager,\n} from '../interface/bind';\nimport type { IMediaManagerInstantiator } from '../interface/media';\nimport mediaManager from './media';\n\nfunction _build(container: IContainer): Readonly {\n const mediaAPI = () => injectMediaAPI(container);\n const fetcher = injectFetch(container);\n const cacheController = injectMediaCacheController(container);\n\n return Object.freeze({\n open: (db: IWorkspaceDB, auth: IAuthenticationManager) =>\n mediaManager(db, auth, mediaAPI, fetcher, cacheController),\n });\n}\n\nexport default buildBindable({\n id: CONTROLLER_TYPES.IMediaManager,\n dependencies: [API_TYPES.IMediaAPI, UTIL_TYPES.IFetch, CACHE_TYPES.IMediaCacheController],\n bind: bindMediaManager,\n remove: unbindMediaManager,\n build: container => Promise.resolve(_build(container)),\n inject: injectMediaManager,\n});\n","import type { IUserState, IUserStateCallback } from '../interface/userstate';\n\ninterface ICallbackRecord {\n name: string;\n callback: IUserStateCallback;\n}\n\ninterface IUserStatePrv extends IUserState {\n name: string;\n collection: Record;\n callbacks: Record;\n}\n\ninterface IUserStateSaveStructure {\n name: string;\n collection: Record;\n}\n\nconst StoreSymbol = Symbol.for('user-state');\n\n/* eslint-disable-next-line no-restricted-globals */\nconst globalObject: Record = typeof window === 'undefined' ? globalThis : window;\n\nfunction _saveUserState(key: string, state: IUserStatePrv) {\n let store = globalObject[StoreSymbol] as Record | undefined;\n if (!store) {\n store = {} as Record;\n }\n\n store[key] = state;\n globalObject[StoreSymbol] = store;\n}\n\nfunction _loadFromStore(name: string): IUserStatePrv | null {\n let store = globalObject[StoreSymbol] as Record | undefined;\n if (!store) {\n store = {} as Record;\n }\n\n const value = store[name];\n return value ?? null;\n}\n\nfunction _GetValue(state: IUserStatePrv, key: string): unknown | undefined {\n return state.collection[key];\n}\n\nfunction _SetValue(state: IUserStatePrv, key: string, value: unknown | undefined) {\n if (value === undefined) {\n delete state.collection[key];\n } else {\n state.collection[key] = value;\n }\n _saveUserState(state.name, state);\n}\n\nfunction _init(name: string, startingData: Record): IUserState {\n const value: IUserStatePrv = {\n name,\n collection: startingData,\n callbacks: {},\n getProperty: function (this: IUserStatePrv, key: string) {\n return _GetValue(this, key) as T | undefined;\n },\n getPropertyWithDefault: function (this: IUserStatePrv, key: string, defaultValue: T) {\n return (_GetValue(this, key) as T | undefined) ?? defaultValue;\n },\n setProperty: function (this: IUserStatePrv, key: string, value: unknown | undefined) {\n _SetValue(this, key, value);\n const callbackArray = this.callbacks[key] ?? [];\n\n for (const record of callbackArray) {\n record.callback(key, value);\n }\n },\n subscribeChanges: function (\n this: IUserStatePrv,\n key: string,\n callback: IUserStateCallback,\n subscriberKey?: string,\n ): void {\n const array: ICallbackRecord[] = this.callbacks[key] ?? [];\n const subKey = subscriberKey ?? `${key}-${array.length}`;\n\n const record: ICallbackRecord = {\n name: subKey,\n callback,\n };\n\n array.push(record);\n\n this.callbacks[key] = array as ICallbackRecord[];\n },\n unsubscribeChanges: function (\n this: IUserStatePrv,\n key: string,\n callback: IUserStateCallback,\n ): void {\n const array = this.callbacks[key] ?? [];\n this.callbacks[key] = array.filter(record => callback !== record.callback);\n },\n subscriber: function (\n this: IUserStatePrv,\n subscriberKey: string,\n ): IUserStateCallback | undefined {\n for (const key of Object.keys(this.callbacks)) {\n const records = this.callbacks[key];\n const match = records?.filter(record => record.name === subscriberKey);\n const primaryMatch = match?.at(0);\n\n if (primaryMatch) {\n return primaryMatch.callback;\n }\n }\n return undefined;\n },\n flatten: function (this: IUserStatePrv): string {\n const data: IUserStateSaveStructure = {\n name: this.name,\n collection: this.collection,\n };\n return JSON.stringify(data);\n },\n };\n\n return value as IUserState;\n}\n\nfunction load(name: string): IUserState {\n return _loadFromStore(name) ?? _init(name, {});\n}\n\nfunction expand(data: string): IUserState {\n const dataObject: IUserStateSaveStructure = data.length > 2 ? JSON.parse(data) : {};\n return _init(dataObject.name, dataObject.collection);\n}\n\nexport default Object.freeze({\n load,\n expand,\n});\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport {\n bindUserStateManager,\n injectUserStateManager,\n TYPES as CONTROLLER_TYPES,\n unbindUserStateManager,\n} from '../interface/bind';\nimport type { IUserStateInstantiator } from '../interface/userstate';\nimport userState from './userState';\n\nfunction _build(container: IContainer): Readonly {\n return Object.freeze({\n open: (name: string) => userState.load(name),\n expand: (data: string) => userState.expand(data),\n });\n}\n\nexport default buildBindable({\n id: CONTROLLER_TYPES.IUserStateManager,\n bind: bindUserStateManager,\n remove: unbindUserStateManager,\n build: container => Promise.resolve(_build(container)),\n inject: injectUserStateManager,\n});\n","import { buildBinderListings } from '@monofe/di';\nimport authBinder from '../impl/auth.bind';\nimport mediaBinder from '../impl/media.bind';\nimport userStateBinder from '../impl/userState.bind';\n\nexport default buildBinderListings([authBinder, mediaBinder, userStateBinder]);\n","const MAPPING_V1: Record = {\n IBackgroundModeDto: '++id,name',\n IBeaconDto: '++id,name,uuid,major,minor,siteId',\n IBeaconSensitivityDto: '++id,name',\n IFloorPlanDto:\n '++id,name,imageFileName,removeImage,imageMediumId,siteId,siteObjectsOnFloorPlanCount,styleId',\n IFontAlignmentDto: '++id,name',\n IFontFamilyDto: '++id,name',\n IFontSizeUnitDto: '++id,name',\n IFontStyleDto: '++id,name',\n ILanguageDto: '++id,name,code,isDefault',\n IMediumDto: '++id,mediumHash,fileName,mimeType,mediumSize,deleted,siteId',\n IMenuItemDto:\n '++id,name,namePropagation,imageFileName,removeImage,imageMediumId,siteId,toursCount,publishedToursCount,deleted',\n IMenuItemTranslationDto: '++id,menuItemId,languageId,name,deleted',\n IPinTypeDto: '++value,content,icon,text',\n IScreenOrientationDto: '++id,name',\n ISiteDto:\n '++id,name,logoFileName,removeLogo,logoMediumId,alarmEnabled,alarmPin,adminPin,languageSelectionMenu,tourSelectionMenu,clientId,screenOrientationId,majorVersion,minorVersion,toursCount,deviceAccountsCount,languageSelectionStyleId,tourSelectionStyleId',\n ISiteObjectOnFloorPlanDto:\n '++id,siteObjectId,floorPlanId,x,y,pinTypeId,pinColor,siteObjectName',\n ISiteObjectDto:\n '++id,name,int1,int2,int3,int4,altBoolean1,altBoolean2,isUniversal,keypadNumber,siteId,siteObjectTypeId,beaconId,beaconSensitivityId,fontSize,fontFamily,fontColor,menuPosition,nextObjectId,relatedObject1Id,relatedObject2Id,relatedObject3Id,relatedObject4Id,relatedObject5Id,removeForegroundImage,foregroundImageMediumId,foregroundImageFileName,removeBackgroundImage,backgroundImageMediumId,backgroundImageFileName,removeMenuImage,menuImageMediumId,menuImageFileName,namePropagation,longNamePropagation,descriptionPropagation,alternativeText1Propagation,alternativeText2Propagation,mediumPropagation,mediumFileName,removeMedium,backgroundColor,foregroundColor,styleId,toursCount,publishedToursCount,deleted,keywords',\n ISiteObjectTranslationDto:\n '++id,siteObjectId,languageId,name,longName,description,alternativeText1,alternativeText2,mediumId,text,deleted',\n ISiteObjectTypeDto: '++id,defaultExtensions,name',\n ISiteSupportedLanguageDto: '++id,siteId,languageId',\n IStyleDto:\n '++id,parentId,isDefault,siteId,name,description,foregroundImageMediumId,backgroundImageMediumId,backgroundColor,menuImageMediumId,backgroundModeId,menuColor,primaryFontFamilyId,primaryFontStyleId,primaryFontSize,primaryFontSizeUnitId,primaryFontColor,primaryFontAlignmentId,secondaryFontFamilyId,secondaryFontStyleId,secondaryFontSize,secondaryFontSizeUnitId,secondaryFontColor,secondaryFontAlignmentId,tertiaryFontFamilyId,tertiaryFontStyleId,tertiaryFontSize,tertiaryFontSizeUnitId,tertiaryFontColor,tertiaryFontAlignmentId,foregroundImageFileName,removeForegroundImage,menuImageFileName,removeMenuImage,backgroundImageFileName,removeBackgroundImage,hasChildren',\n ITourMenuItemDto: '++id,menuItemId,tourId,menuOrder',\n ITourRelatedSiteObjectDto: '++id,tourId,elementOrder,siteObjectId',\n ITourDto:\n '++id,name,fontColor,fontSize,fontName,backgroundColor,foregroundColor,description,siteId,tourTypeId,tourSubTypeId,styleId,tourStatusId,stage1,stage2,stage3,stage4,createdById,modifiedById,version,minorVersion,publishedVersion,testVersion',\n ITourStatusDto: '++id,name',\n ITourSubTypeDto: '++id,name,tourTypeId',\n ITourSupportedLanguageDto: '++id,siteSupportedLanguageId,tourId',\n ITourTranslationDto: '++name,completed,tourSupportedLanguageId',\n ITourTypeDto: '++id,name',\n};\n\nconst MAPPING_V2: Record = {\n ICountryDto: '++id,name',\n IDeviceAccountDto:\n '++id,userName,password,confirmPassword,siteId,modifiedById,isProductionUser',\n\n IFloorPlanTourDto: '++id,floorPlanId,tourId',\n IFloorPlanTranslationDto:\n '++id,name,imageFileName,removeImage,imageMediumId,siteId,languageId,floorPlanId,positionX,positionY,zoom,siteObjectsOnFloorPlanCount,styleId',\n\n IFontSizeUnitDto: '++id,name',\n ILanguageDto: '++id,name,localizedName,isDefault',\n\n IMenuItemDto:\n '++id,name,namePropagation,imageFileName,removeImage,imageMediumId,siteId,toursCount,publishedToursCount,deleted,menuPosition,keypadNumber,contentStyleId,menuStyleId,isBackButtonOverride,backButtonStyleId,siteObjectId,int1,int2,int3,int4,bool1,bool2,tourId,menuTypeId,menuSubTypeId',\n IMenuItemKeywordDto: '++id,name,siteId,isTag',\n IMenuItemTranslationDto:\n '++id,menuItemId,languageId,name,deleted,subMenuName,description,backgroundImageFileName,removeBackgroundImage,backgroundImageMediumId,menuImageFileName,removeMenuImage,menuImageMediumId',\n\n IRoleDto: '++id,name',\n IScreenOrientationDto: '++id,name,byteValue',\n\n ISiteDto:\n '++id,name,logoFileName,removeLogo,logoMediumId,alarmEnabled,alarmPin,adminPin,languageSelectionMenu,tourSelectionMenu,clientId,screenOrientationId,majorVersion,minorVersion,toursCount,deviceAccountsCount,languageSelectionStyleId,tourSelectionStyleId,groupingSelectionMenu,screenOrientations,contactName,title,phone,mobile,addressLine1,addressLine2,county,postalCode,countryId,notes,bluetoothEnabled,streamMedia,streamingMediaPrefixUrl,showBatteryDot,disableSpeakerOutput,grayOutContentOnPlayback,backButtonStyleId,batteryThresholdRed,batteryThresholdOrange,screensaverEnabled,screensaverShowDelay,resetInactivityDelay,alwaysShowLanguageSelection,alwaysShowTourSelection,alwaysShowGroupingSelection,showGroupingSelectionHeader,showLanguageSelectionHeader,showTourSelectionHeader,showLanguageConfirmation,resetGroupingDaily,groupingMenuEnabled,groupingShow,groupingSelectionStyleId,defaultLanguageId,groupingHeader,languageHeader,tourHeader,siteObjectOnGroupingSelectionId,siteObjectOnGroupingSelectionInitName,siteObjectOnLanguageSelectionId,siteObjectOnLanguageSelectionInitName,siteObjectOnTourSelectionId,siteObjectOnTourSelectionInitName',\n ISiteObjectDto:\n '++id,name,int1,int2,int3,int4,altBoolean1,altBoolean2,isUniversal,keypadNumber,siteId,siteObjectTypeId,beaconId,beaconSensitivityId,fontSize,fontFamily,fontColor,menuPosition,nextObjectId,relatedObject1Id,relatedObject2Id,relatedObject3Id,relatedObject4Id,relatedObject5Id,removeForegroundImage,foregroundImageMediumId,foregroundImageFileName,removeBackgroundImage,backgroundImageMediumId,backgroundImageFileName,removeMenuImage,menuImageMediumId,menuImageFileName,namePropagation,longNamePropagation,descriptionPropagation,alternativeText1Propagation,alternativeText2Propagation,mediumPropagation,mediumFileName,removeMedium,backgroundColor,foregroundColor,styleId,toursCount,publishedToursCount,deleted,screenOrientations,keywords,isSiteObjectV2,siteObjectTypeV2Id',\n\n ISiteObjectKeywordDto: '++id,name,siteId,isTag',\n\n IStyleDto:\n '++id,parentId,isDefault,siteId,name,description,foregroundImageMediumId,backgroundImageMediumId,backgroundColor,menuImageMediumId,backgroundModeId,menuColor,primaryFontFamilyId,primaryFontStyleId,primaryFontSize,primaryFontSizeUnitId,primaryFontColor,primaryFontAlignmentId,secondaryFontFamilyId,secondaryFontStyleId,secondaryFontSize,secondaryFontSizeUnitId,secondaryFontColor,secondaryFontAlignmentId,tertiaryFontFamilyId,tertiaryFontStyleId,tertiaryFontSize,tertiaryFontSizeUnitId,tertiaryFontColor,tertiaryFontAlignmentId,foregroundImageFileName,removeForegroundImage,menuImageFileName,removeMenuImage,backgroundImageFileName,removeBackgroundImage,hasChildren,primaryColor,secondaryColor,tertiaryColor,quaternaryColor',\n ITourDto:\n '++id,name,fontColor,fontSize,fontName,backgroundColor,foregroundColor,description,siteId,tourTypeId,tourSubTypeId,styleId,tourStatusId,stage1,stage2,stage3,stage4,createdById,modifiedById,version,minorVersion,publishedVersion,testVersion,internalName,grayOutContentOnPlayback,qrCode,visibilityScheduleShow,visibilityScheduleHide,siteObjectPlayOnLaunchId,showFloorplanOnMenuOnly,hideOnTourSelect,backButtonStyleId,hideKeypadNumber,screenOrientations',\n\n ITourRelatedSiteObjectDto:\n '++id,tourId,elementOrder,siteObjectId,menuItemId,parentTourRelatedSiteObjectId',\n\n ITourTranslationDto:\n '++name,completed,tourSupportedLanguageId,mediumId,mediumFileName,removeMedium',\n\n ITourSupportedLanguageDto: '++id,siteSupportedLanguageId,tourId,languageId',\n IUserDto:\n '++id,userName,firstName,lastName,avatarFileName,removeAvatar,avatar,avatarMimeType,isCmsUser,emailConfirmed,siteId,managedClientId,managedSiteId,modifiedById,mainRole,workingForClientId,mainRoleHR',\n ILegacy_FloorPlanDto:\n '++id,name,imageFileName,removeImage,imageMediumId,siteId,siteObjectsOnFloorPlanCount,styleId',\n};\n\n/* Migration is split across 3 stages,\n #1 We need to move all the data to a new table & Delete the old\n #2 Recreate the new table, move the data in & delete the tmp table\n One does not simply change the primaryKey. Refs: \n https://github.com/dexie/Dexie.js/issues/646#issuecomment-359460164, \n https://github.com/dexie/Dexie.js/blob/issue713/test/tests-upgrading.js#L568-L604\n*/\nconst MAPPING_V3: Record = {\n ITourTranslationDto: null,\n ITourTranslationDto_tmp:\n '++tourSupportedLanguageId,name,completed,mediumId,mediumFileName,removeMedium',\n};\n\nconst MAPPING_V4: Record = {\n ITourTranslationDto:\n '++tourSupportedLanguageId,name,completed,mediumId,mediumFileName,removeMedium',\n ITourTranslationDto_tmp: null,\n};\n\nconst MAPPING_V5: Record = {\n ISiteObjectOnFloorPlanDto: null,\n ISiteObjectOnFloorPlanDto_tmp:\n '[siteObjectId+floorPlanId],x,y,pinTypeId,pinColor,siteObjectName',\n};\n\nconst MAPPING_V6: Record = {\n ISiteObjectOnFloorPlanDto: '[siteObjectId+floorPlanId],x,y,pinTypeId,pinColor,siteObjectName',\n ISiteObjectOnFloorPlanDto_tmp: null,\n};\n\nexport type VERSION = 1 | 2 | 3 | 4 | 5 | 6;\n\nconst MappedVersions: Record> = {\n 1: MAPPING_V1,\n 2: MAPPING_V2,\n 3: MAPPING_V3,\n 4: MAPPING_V4,\n 5: MAPPING_V5,\n 6: MAPPING_V6,\n};\n\nconst Mapping = (version: VERSION): Record => MappedVersions[version];\n\nexport default Mapping;\n","import Schema from './schema';\n\nconst VERSION = 1;\n\nexport default Object.freeze({\n version: VERSION,\n description: 'Initial version',\n mappingsChanges: Schema(VERSION),\n});\n","/* eslint-disable no-bitwise */\n/* eslint-disable @typescript-eslint/no-magic-numbers */\nexport const VALUES_FIELD_NAME = [\n 'All',\n 'Landscape',\n 'Landscape (left)',\n 'Landscape (right)',\n 'Portrait',\n 'Portrait (up)',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n\n/* Can be any value between 0<->(2^4)-1 */\nexport type TYPES_FIELD_BYTEVALUE =\n | 0\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10\n | 11\n | 12\n | 13\n | 14\n | 15;\n\n/* Various BitMask combinations needed for #VALUES_FIELD_BYTEVALUE */\nconst BYTEVALUE_LANDSCAPE_LEFT = (1 << 0) as TYPES_FIELD_BYTEVALUE; /* 1 */\nconst BYTEVALUE_LANDSCAPE_RIGHT = (1 << 1) as TYPES_FIELD_BYTEVALUE; /* 2 */\nconst BYTEVALUE_LANDSCAPE_PORTRAIT = (1 << 2) as TYPES_FIELD_BYTEVALUE; /* 4 */\nconst BYTEVALUE_LANDSCAPE_PORTRAIT_UPSIDE_DOWN = (1 << 3) as TYPES_FIELD_BYTEVALUE; /* 8 */\n\nconst BYTEVALUE_LANDSCAPE_ALL = (BYTEVALUE_LANDSCAPE_LEFT |\n BYTEVALUE_LANDSCAPE_RIGHT) as TYPES_FIELD_BYTEVALUE;\nconst BYTEVALUE_PORTRAIT_ALL = (BYTEVALUE_LANDSCAPE_PORTRAIT |\n BYTEVALUE_LANDSCAPE_PORTRAIT_UPSIDE_DOWN) as TYPES_FIELD_BYTEVALUE;\nconst BYTEVALUE_ALL = (BYTEVALUE_LANDSCAPE_ALL | BYTEVALUE_PORTRAIT_ALL) as TYPES_FIELD_BYTEVALUE;\n\nexport const VALUES_FIELD_BYTEVALUE: Record = {\n All: BYTEVALUE_ALL,\n Landscape: BYTEVALUE_LANDSCAPE_ALL,\n 'Landscape (left)': BYTEVALUE_LANDSCAPE_LEFT,\n 'Landscape (right)': BYTEVALUE_LANDSCAPE_RIGHT,\n Portrait: BYTEVALUE_LANDSCAPE_PORTRAIT,\n 'Portrait (up)': BYTEVALUE_LANDSCAPE_PORTRAIT_UPSIDE_DOWN,\n} as const;\n","import type { ILegacy_FloorPlanDto } from '../../../model';\nimport type { TYPES_FIELD_NAME as ScreenOrientation_TYPES_FIELD_NAME } from '../../../model/impl/ScreenOrientationDto.private';\nimport { VALUES_FIELD_BYTEVALUE as ScreenOrientation_FIELD_BYTEVALUE } from '../../../model/impl/ScreenOrientationDto.private';\nimport type { ITransaction } from '../../../private/db/interface';\nimport type { DataMap } from './interface';\nimport Schema from './schema';\n\nconst VERSION = 2;\n\nfunction _isLegacyFloorPlan(floorplan: object): floorplan is ILegacy_FloorPlanDto {\n return 'imageMediumId' in floorplan;\n}\n\nexport default Object.freeze({\n version: VERSION,\n description: 'Workspace 2.0 support',\n mappingsChanges: Schema(VERSION),\n upgrade: async (transaction: ITransaction) => {\n /* Move IFloorPlanDto to ILegacy_FloorPlanDto (no move support, must add+delete) */\n const allFloorplansLegacy = await transaction.table('IFloorPlanDto').toArray();\n await transaction.table('ILegacy_FloorPlanDto').bulkAdd(allFloorplansLegacy);\n const floorPlanLegacyPrimaryKeys = await transaction\n .table('IFloorPlanDto')\n .toCollection()\n .keys();\n\n await transaction\n .table('IFloorPlanDto')\n .bulkDelete(floorPlanLegacyPrimaryKeys)\n .catch(error => {\n throw error;\n });\n\n /* Ignore addition operations */\n /* ICountryDto - add table */\n /* IDeviceAccountDto - add table */\n /* IFloorPlanTourDto - add table */\n /* IFloorPlanTranslationDto - add table */\n\n /* IMenuItemDto -- add fields */\n /* IMenuItemKeywordDto - add table */\n /* IMenuItemTranslationDto - add table */\n /* IRoleDto - add table */\n /* IScreenOrientationDto - add field byteValue(manual migration) */\n await transaction\n .table('IScreenOrientationDto')\n .toCollection()\n .modify((object: Record) => {\n const name = (object['name'] as ScreenOrientation_TYPES_FIELD_NAME) ?? 'All';\n object['byteValue'] = ScreenOrientation_FIELD_BYTEVALUE[name];\n })\n .catch(error => {\n throw error;\n });\n\n /* ISiteDto - add fields */\n /* ISiteObjectDto - add fields */\n /* IStyleDto - add fields */\n /* ITourRelatedSiteObjectDto - add fields */\n /* ITourDto - add fields\n /* ITourSupportedLanguageDto - add fields */\n /* ITourTranslationDto - add fields */\n /* IUserDto - add fields */\n /* ILegacy_FloorPlanDto - add fields */\n },\n preInsertCleanup: (dataIn: DataMap) => {\n const dataOut = { ...dataIn };\n\n const floorplans = dataOut.IFloorPlanDto;\n const primaryFloorplan = floorplans.at(0);\n\n /* Move to Legacy interface & remove existing */\n if (floorplans.length > 0 && primaryFloorplan && _isLegacyFloorPlan(primaryFloorplan)) {\n dataOut.ILegacy_FloorPlanDto = floorplans;\n dataOut.IFloorPlanDto = [];\n }\n\n return dataOut;\n },\n});\n","import type { ITransaction } from '../../../private/db/interface';\nimport Schema from './schema';\n\nconst VERSION = 3;\n\nexport default Object.freeze({\n version: VERSION,\n description: 'ITourTranslationDto PK change #name->#tourSupportedLanguageId (part.1)',\n mappingsChanges: Schema(VERSION),\n upgrade: async (transaction: ITransaction) => {\n /* ITourSupportedLanguage - change PK from name to tourSupportedLanguageId,\n Remove all items & force re-insertion, triggering PK change */\n const tableOld = transaction.table('ITourTranslationDto');\n const tableNew = transaction.table('ITourTranslationDto_tmp');\n const collection = tableOld.toCollection();\n const keys = await collection.keys();\n const items = await collection.toArray();\n\n await tableNew.bulkAdd(items);\n await tableOld.bulkDelete(keys);\n },\n});\n","import type { ITransaction } from '../../../private/db/interface';\nimport Schema from './schema';\n\nconst VERSION = 4;\n\nexport default Object.freeze({\n version: VERSION,\n description: 'ITourTranslationDto PK change #name->#tourSupportedLanguageId (part.2)',\n mappingsChanges: Schema(VERSION),\n upgrade: async (transaction: ITransaction) => {\n /* ITourSupportedLanguage - change PK from name to tourSupportedLanguageId,\n Remove all items & force re-insertion, triggering PK change */\n const tableOld = transaction.table('ITourTranslationDto_tmp');\n const tableNew = transaction.table('ITourTranslationDto');\n const collection = tableOld.toCollection();\n const keys = await collection.keys();\n const items = await collection.toArray();\n\n await tableNew.bulkAdd(items);\n await tableOld.bulkDelete(keys);\n },\n});\n","import type { ITransaction } from '../../../private/db/interface';\nimport type { IDBVersionMigrator } from './interface';\nimport Schema from './schema';\n\nconst VERSION = 5;\n\nconst module: IDBVersionMigrator = {\n version: VERSION,\n description: 'ISiteObjectOnFloorPlanDto composite PK update',\n mappingsChanges: Schema(VERSION),\n upgrade: async (transaction: ITransaction) => {\n const tableOld = transaction.table('ISiteObjectOnFloorPlanDto');\n const tableNew = transaction.table('ISiteObjectOnFloorPlanDto_tmp');\n const collection = tableOld.toCollection();\n const keys = await collection.keys();\n const items = await collection.toArray();\n\n await tableNew.bulkAdd(items);\n await tableOld.bulkDelete(keys);\n },\n};\n\nexport default Object.freeze(module);\n","import type { ITransaction } from '../../../private/db/interface';\nimport type { IDBVersionMigrator } from './interface';\nimport Schema from './schema';\n\nconst VERSION = 6;\n\nconst module: IDBVersionMigrator = {\n version: VERSION,\n description: 'ISiteObjectOnFloorPlanDto composite PK update (part 2)',\n mappingsChanges: Schema(VERSION),\n upgrade: async (transaction: ITransaction) => {\n const tableOld = transaction.table('ISiteObjectOnFloorPlanDto_tmp');\n const tableNew = transaction.table('ISiteObjectOnFloorPlanDto');\n const collection = tableOld.toCollection();\n const keys = await collection.keys();\n const items = await collection.toArray();\n\n await tableNew.bulkAdd(items);\n await tableOld.bulkDelete(keys);\n },\n};\n\nexport default Object.freeze(module);\n","import v1 from './1';\nimport v2 from './2';\nimport v3 from './3';\nimport v4 from './4';\nimport v5 from './5';\nimport v6 from './6';\n\nexport default Object.freeze([v1, v2, v3, v4, v5, v6]);\n","import versions from './versions';\n\nexport default Object.freeze({\n versions,\n});\n","import type BaseDto from '../interface/IBaseDto';\nimport type { ExternalBaseDataType, InternalBaseDataType } from '../interface/IBaseDto';\n\ntype BaseType = BaseDto;\n\nfunction isEntity(object: unknown): object is Entity {\n if (object === undefined || object === null || typeof object !== 'object') {\n return false;\n }\n\n const record = object as Partial;\n\n return (\n typeof record.flatten === 'function' &&\n typeof record.apply === 'function' &&\n typeof record.mappings === 'function'\n );\n}\n\nexport default isEntity;\n","import type BaseDto from '../interface/IBaseDto';\nimport type {\n CustomBaseDataType,\n ExternalBaseDataType,\n InternalBaseDataType,\n} from '../interface/IBaseDto';\nimport create from './create';\nimport type IMapProperty from './IMapProperty';\nimport isEntity from './isEntity';\n\n/** Take an incoming IMapProperty[] and generate a new object with the sourceObject */\nfunction apply<\n PK extends keyof IntProps,\n ExtProps extends ExternalBaseDataType,\n IntProps extends InternalBaseDataType,\n CustomProps extends CustomBaseDataType,\n>(\n primaryKey: PK,\n mappings: IMapProperty[],\n customProps: CustomProps,\n sourceObject: ExtProps | BaseDto,\n): BaseDto & IntProps & CustomProps {\n const newEntity = create(\n primaryKey,\n mappings,\n customProps,\n /* If we are given an existing entity, flatten it out & apply that */\n isEntity(sourceObject)\n ? (sourceObject.flatten() as Partial)\n : (sourceObject as Partial) ?? {},\n );\n\n return newEntity;\n}\n\nexport default apply;\n","import type IMapProperty from './IMapProperty';\nimport type { ObjectType } from './interface';\n\nfunction mapToInternalProps(\n mappings: IMapProperty[],\n sourceObject?: Partial,\n): IntProps {\n const props: Record = {};\n\n for (const property of mappings) {\n let newValue = null;\n const externalName = (property.externalName ?? property.localName) as keyof ExtProps;\n const saveKey = property.localName;\n\n if (!saveKey) {\n /* Ignore */\n } else if (!sourceObject) {\n /* Ignore */\n } else if (property.removeValueOnImport ?? false) {\n /* Ignore */\n } else if (property.customImport) {\n newValue = property.customImport(sourceObject);\n } else if (sourceObject[externalName] !== undefined) {\n newValue = sourceObject[externalName] as typeof property.defaultValue;\n } else if (property.defaultValue !== null && property.defaultValue !== undefined) {\n newValue = property.defaultValue;\n }\n\n if (saveKey && newValue !== null && newValue !== undefined) {\n props[saveKey] = newValue;\n }\n }\n\n return props as IntProps;\n}\n\nfunction mapToExternalProps(\n mappings: IMapProperty[],\n sourceObject?: Partial,\n): ExtProps {\n const props: Record = {};\n\n for (const property of mappings) {\n let newValue = null;\n const saveKey = (property.localName ?? property.externalName) as keyof IntProps;\n\n if (!saveKey) {\n /* Ignore */\n } else if (!sourceObject) {\n /* Ignore */\n } else if (property.removeValueOnExport ?? false) {\n /* Ignore */\n } else if (property.customExport) {\n newValue = property.customExport(sourceObject);\n } else if (sourceObject[saveKey] !== undefined) {\n newValue = sourceObject[saveKey] as typeof property.defaultValue;\n } else if (property.defaultValue !== null && property.defaultValue !== undefined) {\n newValue = property.defaultValue;\n }\n\n if (saveKey && newValue !== null && newValue !== undefined) {\n props[saveKey as string] = newValue;\n }\n }\n\n return props as ExtProps;\n}\n\nexport default Object.freeze({\n mapToExternalProps,\n mapToInternalProps,\n});\n","import type BaseDto from '../interface/IBaseDto';\nimport type {\n CustomBaseDataType,\n ExternalBaseDataType,\n InternalBaseDataType,\n} from '../interface/IBaseDto';\nimport apply from './apply';\nimport type IMapProperty from './IMapProperty';\nimport mapping from './mapping';\n\n/** IntProps = internal props, the consumer api, ExtProps = the external workspace api, CustomProps = linkables */\nfunction create<\n ExtensionProperties extends ExternalBaseDataType,\n IntProperties extends InternalBaseDataType,\n CustomProperties extends CustomBaseDataType,\n PK extends keyof IntProperties,\n>(\n primaryKey: PK,\n mappings: IMapProperty[],\n customProperties: CustomProperties,\n sourceObject?: Partial,\n): BaseDto & IntProperties & CustomProperties {\n const defaultProps = Object.fromEntries(\n mappings.map(item => [item.localName, item.defaultValue]),\n );\n\n const intProperties = mapping.mapToInternalProps(\n mappings,\n sourceObject,\n );\n\n const newEntity: BaseDto &\n IntProperties &\n CustomProperties = {\n /* BaseDto fields */\n apply: (data: Partial) =>\n apply(primaryKey, mappings, customProperties, { ...newEntity, ...data }),\n\n flatten: () =>\n mapping.mapToExternalProps(mappings, newEntity),\n\n mappings: () => mappings,\n\n primaryKey: () => intProperties[primaryKey],\n\n /* Load default values */\n ...defaultProps,\n\n /* Convert Ext(external field definitions) to local field definitions */\n ...intProperties,\n\n /* Any custom fields passed in (will override above) */\n ...customProperties,\n };\n\n return newEntity;\n}\n\nexport default create;\n","import type { CustomBaseDataType } from '../interface';\nimport type IBackgroundModeDto_Api from './BackgroundModeDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IBackgroundModeDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n BeaconSensitivityDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IBackgroundModeDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type IMapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './BackgroundModeDto.private';\n\nconst MAPPINGS: IMapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = ['contain', 'cover'] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IBeaconDto_Api from './BeaconDto.api';\nimport type { IBeaconDto_SourceProps } from './BeaconDto.if';\nimport type ISiteDto from './SiteDto.if';\n\nexport interface IBeaconDto_Linkables extends CustomBaseDataType {\n site: (db: IModelSource) => Promise;\n}\n\nfunction _site(this: Partial, db: IModelSource): Promise {\n return this.siteId\n ? db.get('ISiteDto', this.siteId)\n : Promise.reject('Missing field beacon.siteId');\n}\n\n/** \n * @description all custom properties for\n BeaconDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IBeaconDto_Linkables {\n return {\n site: _site.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'uuid',\n\n defaultValue: '',\n },\n {\n localName: 'major',\n\n defaultValue: 0,\n },\n {\n localName: 'minor',\n\n defaultValue: 0,\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type IBeaconSensitivityDto_Api from './BeaconSensitivityDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IBeaconSensitivityDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n BeaconSensitivityDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IBeaconSensitivityDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './BeaconSensitivityDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = ['Immediate', 'Near', 'Far'] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type ICountryDto_Api from './CountryDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ICountryDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n CountryDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ICountryDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './CountryDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n 'Afghanistan',\n 'Aland Islands',\n 'Albania',\n 'Algeria',\n 'American Samoa',\n 'Andorra',\n 'Angola',\n 'Anguilla',\n 'Antigua and Barbuda',\n 'Argentina',\n 'Armenia',\n 'Aruba',\n 'Australia',\n 'Austria',\n 'Azerbaijan',\n 'Bahamas',\n 'Bahrain',\n 'Bangladesh',\n 'Barbados',\n 'Belarus',\n 'Belgium',\n 'Belize',\n 'Benin',\n 'Bermuda',\n 'Bhutan',\n 'Bolivia (Plurinational State of)',\n 'Bonaire, Saint Eustatius and Saba',\n 'Bosnia and Herzegovina',\n 'Botswana',\n 'Brazil',\n 'British Virgin Islands',\n 'Brunei Darussalam',\n 'Bulgaria',\n 'Burkina Faso',\n 'Burundi',\n 'Cambodia',\n 'Cameroon',\n 'Canada',\n 'Cape Verde',\n 'Cayman Islands',\n 'Central African Republic',\n 'Chad',\n 'Chile',\n 'China',\n 'China, Hong Kong Special Administrative Region',\n 'China, Macao Special Administrative Region',\n 'Colombia',\n 'Comoros',\n 'Congo',\n 'Cook Islands',\n 'Costa Rica',\n 'Côte dIvoire',\n 'Croatia',\n 'Cuba',\n 'Curaçao',\n 'Cyprus',\n 'Czech Republic',\n 'Democratic Peoples Republic of Korea',\n 'Democratic Republic of the Congo',\n 'Denmark',\n 'Djibouti',\n 'Dominica',\n 'Dominican Republic',\n 'Ecuador',\n 'Egypt',\n 'El Salvador',\n 'Equatorial Guinea',\n 'Eritrea',\n 'Estonia',\n 'Ethiopia',\n 'Faeroe Islands',\n 'Falkland Islands (Malvinas)',\n 'Fiji',\n 'Finland',\n 'France',\n 'French Guiana',\n 'French Polynesia',\n 'Gabon',\n 'Gambia',\n 'Georgia',\n 'Germany',\n 'Ghana',\n 'Gibraltar',\n 'Greece',\n 'Greenland',\n 'Grenada',\n 'Guadeloupe',\n 'Guam',\n 'Guatemala',\n 'Guernsey',\n 'Guinea',\n 'Guinea-Bissau',\n 'Guyana',\n 'Haiti',\n 'Holy See',\n 'Honduras',\n 'Hungary',\n 'Iceland',\n 'India',\n 'Indonesia',\n 'Iran (Islamic Republic of)',\n 'Iraq',\n 'Ireland',\n 'Isle of Man',\n 'Israel',\n 'Italy',\n 'Jamaica',\n 'Japan',\n 'Jersey',\n 'Jordan',\n 'Kazakhstan',\n 'Kenya',\n 'Kiribati',\n 'Kuwait',\n 'Kyrgyzstan',\n 'Lao Peoples Democratic Republic',\n 'Latvia',\n 'Lebanon',\n 'Lesotho',\n 'Liberia',\n 'Libya',\n 'Liechtenstein',\n 'Lithuania',\n 'Luxembourg',\n 'Madagascar',\n 'Malawi',\n 'Malaysia',\n 'Maldives',\n 'Mali',\n 'Malta',\n 'Marshall Islands',\n 'Martinique',\n 'Mauritania',\n 'Mauritius',\n 'Mayotte',\n 'Mexico',\n 'Micronesia (Federated States of)',\n 'Monaco',\n 'Mongolia',\n 'Montenegro',\n 'Montserrat',\n 'Morocco',\n 'Mozambique',\n 'Myanmar',\n 'Namibia',\n 'Nauru',\n 'Nepal',\n 'Netherlands',\n 'New Caledonia',\n 'New Zealand',\n 'Nicaragua',\n 'Niger',\n 'Nigeria',\n 'Niue',\n 'Norfolk Island',\n 'Northern Mariana Islands',\n 'Norway',\n 'Occupied Palestinian Territory',\n 'Oman',\n 'Pakistan',\n 'Palau',\n 'Panama',\n 'Papua New Guinea',\n 'Paraguay',\n 'Peru',\n 'Philippines',\n 'Pitcairn',\n 'Poland',\n 'Portugal',\n 'Puerto Rico',\n 'Qatar',\n 'Republic of Korea',\n 'Republic of Moldova',\n 'Réunion',\n 'Romania',\n 'Russian Federation',\n 'Rwanda',\n 'Saint Helena',\n 'Saint Kitts and Nevis',\n 'Saint Lucia',\n 'Saint Pierre and Miquelon',\n 'Saint Vincent and the Grenadines',\n 'Saint-Barthélemy',\n 'Saint-Martin (French part)',\n 'Samoa',\n 'San Marino',\n 'Sao Tome and Principe',\n 'Saudi Arabia',\n 'Senegal',\n 'Serbia',\n 'Seychelles',\n 'Sierra Leone',\n 'Singapore',\n 'Sint Maarten (Dutch part)',\n 'Slovakia',\n 'Slovenia',\n 'Solomon Islands',\n 'Somalia',\n 'South Africa',\n 'South Sudan',\n 'Spain',\n 'Sri Lanka',\n 'Sudan',\n 'Suriname',\n 'Svalbard and Jan Mayen Islands',\n 'Swaziland',\n 'Sweden',\n 'Switzerland',\n 'Syrian Arab Republic',\n 'Tajikistan',\n 'Thailand',\n 'The former Yugoslav Republic of Macedonia',\n 'Timor-Leste',\n 'Togo',\n 'Tokelau',\n 'Tonga',\n 'Trinidad and Tobago',\n 'Tunisia',\n 'Turkey',\n 'Turkmenistan',\n 'Turks and Caicos Islands',\n 'Tuvalu',\n 'Uganda',\n 'Ukraine',\n 'United Arab Emirates',\n 'United Kingdom',\n 'United Republic of Tanzania',\n 'United States of America',\n 'United States Virgin Islands',\n 'Uruguay',\n 'Uzbekistan',\n 'Vanuatu',\n 'Venezuela (Bolivarian Republic of)',\n 'Vietnam',\n 'Wallis and Futuna Islands',\n 'Western Sahara',\n 'Yemen',\n 'Zambia',\n 'Zimbabwe',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type IDeviceAccountDto_Api from './DeviceAccountDto.api';\n\n/** \n * @description all custom properties for\n DeviceAccountDto & methods to link against other entities\n*/\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IDeviceAccountDto_Linkables extends CustomBaseDataType {}\n\nfunction linkables(model: Partial): IDeviceAccountDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'userName',\n\n defaultValue: '',\n },\n {\n localName: 'password',\n\n defaultValue: '',\n },\n {\n localName: 'confirmPassword',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'modifiedById',\n\n defaultValue: 0,\n },\n {\n localName: 'isProductionUser',\n\n defaultValue: false,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IFloorPlanDto_Api from './FloorPlanDto.api';\nimport type { IFloorPlanDto_SourceProps } from './FloorPlanDto.if';\nimport type IFloorPlanTranslationDto from './FloorPlanTranslationDto.if';\n\nasync function _translations(\n this: Partial,\n db: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject('Missing field floorplan.id');\n }\n\n const floorPlanId = this.id;\n\n const results = await db.all('IFloorPlanTranslationDto');\n const translations = results.filter(translation => translation.floorPlanId === floorPlanId);\n\n return translations;\n}\n\nexport interface IFloorPlanDto_Linkables extends CustomBaseDataType {\n translations: (db: IModelSource) => Promise;\n}\n\n/** \n * @description all custom properties for\n FloorPlanDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IFloorPlanDto_Linkables {\n return {\n translations: _translations.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'imageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeImage',\n\n defaultValue: false,\n },\n {\n localName: 'imageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'siteObjectsOnFloorPlanCount',\n\n defaultValue: 0,\n },\n {\n localName: 'styleId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IFloorPlanTourDto_Api from './FloorPlanTourDto.api';\nimport type { IFloorPlanTourDto_SourceProps } from './FloorPlanTourDto.if';\nimport type IFloorPlanTranslationDto from './FloorPlanTranslationDto.if';\n\nasync function _translations(\n this: Partial,\n db: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject('Missing field floorplan.id');\n }\n\n const floorplanTourId = this.id;\n\n const results = await db.all('IFloorPlanTranslationDto');\n const translations = results.filter(translation => translation.floorPlanId === floorplanTourId);\n return translations;\n}\n\nexport interface IFloorPlanTourDto_Linkables extends CustomBaseDataType {\n translations: (db: IModelSource) => Promise;\n}\n\n/** \n * @description all custom properties for\n FloorPlanDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IFloorPlanTourDto_Linkables {\n return {\n translations: _translations.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'floorPlanId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IFloorPlanTranslationDto_Api from './FloorPlanTranslationDto.if';\nimport type ILanguageDto from './LanguageDto.if';\nimport type IMediumDto from './MediumDto.if';\nimport type ISiteDto from './SiteDto.if';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type ISiteObjectOnFloorPlanDto from './SiteObjectOnFloorPlanDto.if';\nimport type IStyleDto from './StyleDto.if';\n\nexport interface IFloorPlanTranslationDto_Linkables extends CustomBaseDataType {\n image: (database: IModelSource) => Promise;\n site: (database: IModelSource) => Promise;\n language: (database: IModelSource) => Promise;\n style: (database: IModelSource) => Promise;\n allSiteObjectsOnFloorplan: (database: IModelSource) => Promise;\n siteObjectOnFloorplan: (\n siteObject: ISiteObjectDto,\n database: IModelSource,\n ) => Promise;\n}\n\nfunction _image(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.imageMediumId\n ? database.get('IMediumDto', this.imageMediumId)\n : Promise.reject(new Error('Missing field floorPlanTranslation.imageMediumId'));\n}\n\nfunction _site(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.siteId\n ? database.get('ISiteDto', this.siteId)\n : Promise.reject(new Error('Missing field floorPlanTranslation.siteId'));\n}\n\nfunction _language(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.languageId\n ? database.get('ILanguageDto', this.languageId)\n : Promise.reject(new Error('Missing field floorPlanTranslation.languageId'));\n}\n\nfunction _style(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.styleId\n ? database.get('IStyleDto', this.styleId)\n : Promise.reject(new Error('Missing field floorPlanTranslation.styleId'));\n}\n\nasync function _allSiteObjectsOnFloorplan(\n this: Partial,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject(new Error('Missing field floorPlanTranslation.id'));\n }\n\n const floorPlanTranslationId = this.id;\n\n const results = await database.all('ISiteObjectOnFloorPlanDto');\n const matches = results.filter(item => item.floorPlanId === floorPlanTranslationId);\n\n if (matches.length === 0) {\n throw new Error(\n `No SiteObjectOnFloorplans found for floorplanId:${floorPlanTranslationId}`,\n );\n }\n\n return matches;\n}\n\nasync function _siteObjectOnFloorplan(\n this: Partial,\n siteObject: ISiteObjectDto,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n throw new Error('Missing field floorPlanTranslation.id');\n }\n\n const soFPs = await _allSiteObjectsOnFloorplan.call(this, database);\n\n const match = soFPs.find(x => x.siteObjectId === siteObject.id);\n\n if (!match) {\n throw new Error(\n `No matching soFPs found for floorplanId ${this.id}/siteObjectId: ${siteObject.id}`,\n );\n }\n\n return match;\n}\n\n/** \n * @description all custom properties for\n FloorPlanDto & methods to link against other entities\n*/\nfunction linkables(\n model: Partial,\n): IFloorPlanTranslationDto_Linkables {\n return {\n image: _image,\n site: _site,\n language: _language,\n style: _style,\n allSiteObjectsOnFloorplan: _allSiteObjectsOnFloorplan,\n siteObjectOnFloorplan: _siteObjectOnFloorplan,\n };\n}\n\nexport default linkables;\n","import type IMapProperty from '../private/IMapProperty';\n\nconst MAPPINGS: IMapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'imageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeImage',\n\n defaultValue: false,\n },\n {\n localName: 'imageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'languageId',\n\n defaultValue: 0,\n },\n {\n localName: 'floorPlanId',\n\n defaultValue: 0,\n },\n {\n localName: 'positionX',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'positionY',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'zoom',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'siteObjectsOnFloorPlanCount',\n\n defaultValue: 0,\n },\n {\n localName: 'styleId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type IFontAlignmentDto_Api from './FontAlignmentDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IFontAlignmentDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n FontAlignmentDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IFontAlignmentDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './FontAlignmentDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = ['Left', 'Right', 'Center', 'Justify'] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type IFontFamilyDto_Api from './FontFamilyDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IFontFamilyDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n FontFamilyDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IFontFamilyDto_Linkables {\n return {\n /* None */\n };\n}\n\nexport default linkables;\n","import { VALUES_FIELD_NAME } from './FontFamilyDto.private';\nimport type IMapProperty from '../private/IMapProperty';\n\nconst MAPPINGS: IMapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n 'Abel',\n 'Arial',\n 'Arya',\n 'Bebas Neue',\n 'Boogaloo',\n 'Calibri',\n 'Chewy',\n 'Dosis',\n 'Gill Sans',\n 'Goudy Old Style',\n 'Heebo',\n 'Imprima',\n 'Josefin Sans',\n 'Lato',\n 'Libre Franklin',\n 'Mada',\n 'Montserrat',\n 'Muli',\n 'Nobile',\n 'Overpass',\n 'Pavanam',\n 'Poppins',\n 'Quicksand',\n 'Raleway',\n 'Reem Kufi',\n 'Roboto',\n 'Source Sans Pro',\n 'Times New Roman',\n 'Tahoma',\n 'Tenor Sans',\n 'Ubuntu',\n 'Varela',\n 'Varela Round',\n 'Verdana',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type IFontSizeUnitDto_Api from './FontSizeUnitDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IFontSizeUnitDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n FontSizeUnitDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IFontSizeUnitDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import { VALUES_FIELD_NAME } from './FontSizeUnitDto.private';\nimport type IMapProperty from '../private/IMapProperty';\n\nconst MAPPINGS: IMapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n '%',\n 'cm',\n 'em',\n 'ex',\n 'in',\n 'mm',\n 'pc',\n 'px',\n 'pt',\n 'vh',\n 'vw',\n 'vmin',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type IFontStyleDto_Api from './FontStyleDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IFontStyleDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n FontStyleDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IFontStyleDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './FontStyleDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n 'Thin',\n 'Thin Italic',\n 'Light',\n 'Light Italic',\n 'Regular',\n 'Regular Italic',\n 'Medium',\n 'Medium Italic',\n 'Semi-Bold',\n 'Semi-Bold Italic',\n 'Bold',\n 'Bold Italic',\n 'Black',\n 'Black Italic',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type ILanguageDto_Api from './LanguageDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ILanguageDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n LanguageDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ILanguageDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_LOCALIZEDNAME, VALUES_FIELD_NAME } from './LanguageDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n {\n localName: 'localizedName',\n\n defaultValue: VALUES_FIELD_LOCALIZEDNAME[0],\n },\n {\n localName: 'isDefault',\n\n defaultValue: false,\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n 'EN',\n 'AA',\n 'AB',\n 'AD',\n 'AE',\n 'AF',\n 'AK',\n 'AM',\n 'AN',\n 'AR',\n 'AS',\n 'ASL',\n 'AV',\n 'AY',\n 'AZ',\n 'BA',\n 'BE',\n 'BG',\n 'BH',\n 'BI',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BSL',\n 'CA',\n 'CE',\n 'CH',\n 'CO',\n 'CR',\n 'CS',\n 'CU',\n 'CV',\n 'CY',\n 'DA',\n 'DE',\n 'DV',\n 'DZ',\n 'EE',\n 'EL',\n 'EO',\n 'ES',\n 'ET',\n 'EU',\n 'FA',\n 'FF',\n 'FI',\n 'FJ',\n 'FO',\n 'FR',\n 'FY',\n 'GA',\n 'GD',\n 'GL',\n 'GN',\n 'GU',\n 'GV',\n 'HA',\n 'HE',\n 'HI',\n 'HO',\n 'HR',\n 'HT',\n 'HU',\n 'HY',\n 'HZ',\n 'IA',\n 'ID',\n 'IE',\n 'IG',\n 'II',\n 'IK',\n 'INSL',\n 'IO',\n 'IS',\n 'ISE',\n 'ISG',\n 'IT',\n 'IU',\n 'JA',\n 'JV',\n 'KA',\n 'KG',\n 'KI',\n 'KJ',\n 'KK',\n 'KL',\n 'KM',\n 'KN',\n 'KO',\n 'KR',\n 'KS',\n 'KU',\n 'KV',\n 'KW',\n 'KY',\n 'LA',\n 'LB',\n 'LG',\n 'LI',\n 'LN',\n 'LO',\n 'LT',\n 'LU',\n 'LV',\n 'MG',\n 'MH',\n 'MI',\n 'MK',\n 'ML',\n 'MN',\n 'MR',\n 'MS',\n 'MT',\n 'MY',\n 'NA',\n 'NB',\n 'ND',\n 'NE',\n 'NG',\n 'NL',\n 'NN',\n 'NO',\n 'NR',\n 'NV',\n 'NY',\n 'OC',\n 'OJ',\n 'OM',\n 'OR',\n 'OS',\n 'PA',\n 'PI',\n 'PL',\n 'PS',\n 'PT',\n 'PT-BR',\n 'QU',\n 'RM',\n 'RN',\n 'RO',\n 'RU',\n 'RW',\n 'SA',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SI',\n 'SIEN',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SQ',\n 'SR',\n 'SS',\n 'SSP',\n 'ST',\n 'SU',\n 'SV',\n 'SW',\n 'TA',\n 'TE',\n 'TG',\n 'TH',\n 'TI',\n 'TK',\n 'TL',\n 'TN',\n 'TO',\n 'TR',\n 'TS',\n 'TT',\n 'TW',\n 'TY',\n 'UG',\n 'UK',\n 'UR',\n 'UZ',\n 'VE',\n 'VI',\n 'VO',\n 'WA',\n 'WO',\n 'XH',\n 'YI',\n 'YO',\n 'YUE',\n 'ZA',\n 'ZH',\n 'ZU',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n\nexport const VALUES_FIELD_LOCALIZEDNAME = [\n 'English',\n 'Afaraf',\n 'аҧсуа бызшәа, аҧсшәа',\n 'Access Tours',\n 'avesta',\n 'Afrikaans',\n 'Akan',\n 'አማርኛ',\n 'aragonés',\n 'العربية',\n 'অসমীয়া',\n 'American Sign Language',\n 'авар мацӀ, магӀарул мацӀ',\n 'aymar aru',\n 'azərbaycan dili',\n 'башҡорт теле',\n 'беларуская мова',\n 'български език',\n 'भोजपुरी',\n 'Bislama',\n 'bamanankan',\n 'বাংলা',\n 'བོད་ཡིག',\n 'brezhoneg',\n 'bosanski jezik',\n 'BSL',\n 'Catalan',\n 'нохчийн мотт',\n 'Chamoru',\n 'corsu, lingua corsa',\n 'ᓀᐦᐃᔭᐍᐏᐣ',\n 'Ceský jazyk',\n 'ѩзыкъ словѣньскъ',\n 'чӑваш чӗлхи',\n 'Cymraeg',\n 'Dansk',\n 'Deutsch',\n 'ދިވެހި',\n 'རྫོང་ཁ',\n 'E?egbe',\n 'Hellenic',\n 'Esperanto',\n 'Español',\n 'eesti, eesti keel',\n 'euskara, euskera',\n 'فارسی',\n 'Fulfulde, Pulaar, Pular',\n 'Finnish',\n 'vosa Vakaviti',\n 'føroyskt',\n 'Français',\n 'Frysk',\n 'Gaeilge',\n 'Gàidhlig',\n 'Galego',\n \"Avañe'ẽ\",\n 'ગુજરાતી',\n 'Gaelg, Gailck',\n 'هَوُسَ',\n 'עברית',\n 'हिन्दी, हिंदी',\n 'Hiri Motu',\n 'Hrvatski jezik',\n 'Kreyòl ayisyen',\n 'magyar',\n 'Հայերեն',\n 'Otjiherero',\n 'Interlingua',\n 'Bahasa Indonesia',\n 'Originally called Occidental; then Interlingue after WWII',\n 'Asụsụ Igbo',\n 'ꆈꌠ꒿ Nuosuhxop',\n 'Iñupiaq, Iñupiatun',\n 'International Sign Language',\n 'Ido',\n 'Íslenska',\n 'Italian Sign Language',\n 'Irish Sign Language',\n 'Italiano',\n 'ᐃᓄᒃᑎᑐᑦ',\n '日本語',\n 'ꦧꦱꦗꦮ',\n 'ქართული',\n 'Kikongo',\n 'Gĩkũyũ',\n 'Kuanyama',\n 'қазақ тілі',\n 'kalaallisut',\n 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ',\n 'ಕನ್ನಡ',\n '한국어',\n 'Kanuri',\n 'कश्मीरी, كشميري‎',\n 'Kurdî, کوردی‎',\n 'коми кыв',\n 'Kernewek',\n 'Кыргызча, Кыргыз тили',\n 'latine, lingua latina',\n 'Lëtzebuergesch',\n 'Luganda',\n 'Limburgs',\n 'Lingála',\n 'ພາສາລາວ',\n 'Lietuviu kalba',\n 'Kiluba',\n 'Latviešu valoda',\n 'fiteny malagasy',\n 'Kajin M̧ajeļ',\n 'te reo Maori',\n 'македонски јазик',\n 'മലയാളം',\n 'Монгол хэл',\n 'मराठी',\n 'Bahasa Melayu, بهاس ملايو‎',\n 'Malti',\n 'ဗမာစာ',\n 'Dorerin Naoero',\n 'Norsk Bokmål',\n 'isiNdebele',\n 'Nepali',\n 'Owambo',\n 'Nederlands',\n 'Norsk Nynorsk',\n 'Norsk',\n 'isiNdebele',\n 'Diné bizaad',\n 'chiCheŵa, chinyanja',\n \"occitan, lenga d'òc\",\n 'ᐊᓂᔑᓈᐯᒧᐎᓐ',\n 'Afaan Oromoo',\n 'ଓଡ଼ିଆ',\n 'ирон æвзаг',\n 'ਪੰਜਾਬੀ',\n 'पाऴि',\n 'Jezyk polski',\n 'پښتو',\n 'Português',\n 'Português do Brasil',\n 'Runa Simi, Kichwa',\n 'Rumantsch grischun',\n 'Ikirundi',\n 'Română',\n 'Русский',\n 'Ikinyarwanda',\n 'संस्कृतम्',\n 'sardu',\n 'सिन्धी, سنڌي، سندھی‎',\n 'Davvisámegiella',\n 'yângâ tî sängö',\n 'සිංහල',\n 'Simplified English',\n 'Slovencina',\n 'Slovenski Jezik, Slovenščina',\n \"gagana fa'a Samoa\",\n 'chiShona',\n 'Soomaaliga, af Soomaali',\n 'Shqip',\n 'српски језик',\n 'SiSwati',\n 'Spanish Sign Language',\n 'Sesotho',\n 'Basa Sunda',\n 'Svenska',\n 'Kiswahili',\n 'தமிழ்',\n 'తెలుగు',\n 'тоҷикӣ, toçikī, تاجیکی‎',\n 'ไทย',\n 'ትግርኛ',\n 'Türkmen, Түркмен',\n 'Wikang Tagalog',\n 'Setswana',\n 'Faka Tonga',\n 'Türkçe',\n 'Xitsonga',\n 'татар теле, tatar tele',\n 'Twi',\n 'Reo Tahiti',\n 'ئۇيغۇرچە‎, Uyghurche',\n 'Ukrainian',\n 'اردو',\n 'Oʻzbek, Ўзбек, أۇزبېك‎',\n 'Tshiven?a',\n 'Tiếng Việt',\n 'Volapük',\n 'Walon',\n 'Wollof',\n 'isiXhosa',\n 'ייִדיש',\n 'Yorùbá',\n '粵語',\n 'Saɯ cueŋƅ, Saw cuengh',\n '中文',\n 'isiZulu',\n] as const;\nexport type TYPES_FIELD_LOCALIZEDNAME = typeof VALUES_FIELD_LOCALIZEDNAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ILegacy_FloorPlanDto_Api from './Legacy_FloorPlanDto.api';\nimport type { ILegacy_FloorPlanDto_SourceProps as ILegacy_FloorPlanDto_SourceProperties } from './Legacy_FloorPlanDto.if';\nimport type IMediumDto from './MediumDto.if';\nimport type ISiteDto from './SiteDto.if';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type ISiteObjectOnFloorPlanDto from './SiteObjectOnFloorPlanDto.if';\nimport type IStyleDto from './StyleDto.if';\n\nexport interface ILegacy_FloorPlanDto_Linkables extends CustomBaseDataType {\n image: (database: IModelSource) => Promise;\n site: (database: IModelSource) => Promise;\n style: (database: IModelSource) => Promise;\n allSiteObjectsOnFloorplan: (database: IModelSource) => Promise;\n siteObjectOnFloorplan: (\n siteObject: ISiteObjectDto,\n database: IModelSource,\n ) => Promise;\n}\n\nfunction _image(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.imageMediumId\n ? database.get('IMediumDto', this.imageMediumId)\n : Promise.reject('Missing field legacy_floorPlan.imageMediumId');\n}\n\nfunction _site(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.siteId\n ? database.get('ISiteDto', this.siteId)\n : Promise.reject('Missing field legacy_floorPlan.siteId');\n}\n\nfunction _style(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.styleId\n ? database.get('IStyleDto', this.styleId)\n : Promise.reject('Missing field legacy_floorPlan.styleId');\n}\n\nasync function _allSiteObjectsOnFloorplan(\n this: ILegacy_FloorPlanDto_SourceProperties,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n throw new Error('Missing field legacy_floorPLan.id');\n }\n\n const soFPs = await database.all('ISiteObjectOnFloorPlanDto');\n\n const match = soFPs.filter(x => x.floorPlanId === this.id);\n\n if (match.length <= 0) {\n throw new Error(`No SiteObjectOnFloorplans found for floorplanId:${this.id}`);\n }\n\n return match;\n}\n\nasync function _siteObjectOnFloorplan(\n this: ILegacy_FloorPlanDto_SourceProperties,\n siteObject: ISiteObjectDto,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n throw new Error('Missing field legacy_floorPLan.id');\n }\n\n const soFPs = await _allSiteObjectsOnFloorplan.call(this, database);\n\n const match = soFPs.filter(x => x.siteObjectId === siteObject.id);\n\n const primaryMatch = match.at(0);\n\n if (!primaryMatch) {\n throw new Error(\n `No matching soFPs found for floorplanId ${this.id}/siteObjectId: ${siteObject.id}`,\n );\n }\n\n return primaryMatch;\n}\n\n/** \n * @description all custom properties for\n LanguageDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ILegacy_FloorPlanDto_Linkables {\n return {\n image: _image,\n site: _site,\n style: _style,\n allSiteObjectsOnFloorplan: _allSiteObjectsOnFloorplan,\n siteObjectOnFloorplan: _siteObjectOnFloorplan,\n };\n}\n\nexport default linkables;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ILanguageDto from './LanguageDto.if';\nimport type IMediumDto_Api from './MediumDto.api';\nimport type { IMediumDto_SourceProps } from './MediumDto.if';\nimport type ISiteDto from './SiteDto.if';\n\nexport interface IMediumDto_Linkables extends CustomBaseDataType {\n site: (db: IModelSource) => Promise;\n languages: (db: IModelSource) => Promise;\n}\n\nfunction _site(this: Partial, db: IModelSource): Promise {\n return this.siteId !== undefined && this.siteId > 0\n ? db.get('ISiteDto', this.siteId)\n : Promise.reject(new Error('Missing field medium.siteId'));\n}\n\nasync function _languages(\n this: Partial,\n db: IModelSource,\n): Promise {\n if ((this.id?.length ?? 0) <= 0) {\n throw new Error('Missing field medium.id');\n }\n\n const mediumId = this.id;\n\n try {\n /* This is inefficient, but works. Fetch all translations, filter until the mediumId matches this & then fetch the related languages */\n const allSOTs = await db.all('ISiteObjectTranslationDto');\n const matchSOTs = allSOTs.filter(sot => sot.mediumId === mediumId);\n const languageIds = matchSOTs.map(sot => sot.languageId);\n const languages = await Promise.all(languageIds.map(id => db.get('ILanguageDto', id)));\n\n return languages;\n } catch (error) {\n throw new Error(`Error occurred fetching MediumDto.languages: ${JSON.stringify(error)}`);\n }\n}\n\n/** \n * @description all custom properties for\n MediumDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IMediumDto_Linkables {\n return {\n site: _site,\n languages: _languages,\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: '',\n },\n {\n localName: 'mediumHash',\n\n defaultValue: false,\n },\n {\n localName: 'fileName',\n\n defaultValue: '',\n },\n {\n localName: 'mimeType',\n\n defaultValue: '',\n },\n {\n localName: 'mediumSize',\n\n defaultValue: 0,\n },\n {\n localName: 'deleted',\n\n defaultValue: false,\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IMediumDto from './MediumDto.if';\nimport type IMenuItemDto_Api from './MenuItemDto.api';\nimport type { IMenuItemDto_SourceProps } from './MenuItemDto.if';\nimport type ISiteDto from './SiteDto.if';\n\nexport interface IMenuItemDto_Linkables extends CustomBaseDataType {\n image: (db: IModelSource) => Promise;\n site: (db: IModelSource) => Promise;\n}\n\nfunction _image(this: Partial, db: IModelSource): Promise {\n return this.imageMediumId\n ? db.get('IMediumDto', this.imageMediumId)\n : Promise.reject('Missing field menuItem.imageMediumId');\n}\n\nfunction _site(this: Partial, db: IModelSource): Promise {\n return this.siteId\n ? db.get('ISiteDto', this.siteId)\n : Promise.reject('Missing field menuItem.siteId');\n}\n\n/** \n * @description all custom properties for\n MenuItemDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IMenuItemDto_Linkables {\n return {\n image: _image.bind(model),\n site: _site.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'namePropagation',\n\n defaultValue: false,\n },\n {\n localName: 'imageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeImage',\n\n defaultValue: false,\n },\n {\n localName: 'imageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'toursCount',\n\n defaultValue: 0,\n },\n {\n localName: 'publishedToursCount',\n\n defaultValue: 0,\n },\n {\n localName: 'deleted',\n\n defaultValue: false,\n },\n {\n localName: 'menuPosition',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'keypadNumber',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'contentStyleId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'menuStyleId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'isBackButtonOverride',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'backButtonStyleId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'siteObjectId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'int1',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'int2',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'int3',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'int4',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'bool1',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'bool2',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'tourId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'menuTypeId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'menuSubTypeId',\n\n defaultValue: 0,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type IMenuItemKeywordDto_Api from './MenuItemKeywordDto.api';\n\n/** \n * @description all custom properties for\n MenuItemKeywordDto & methods to link against other entities\n*/\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IMenuItemKeywordDto_Linkables extends CustomBaseDataType {}\n\nfunction linkables(model: Partial): IMenuItemKeywordDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'isTag',\n\n defaultValue: false,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ILanguageDto from './LanguageDto.if';\nimport type IMenuItemDto from './MenuItemDto.if';\nimport type IMenuItemTranslationDto_Api from './MenuItemTranslationDto.api';\n\nexport interface IMenuItemTranslationDto_Linkables extends CustomBaseDataType {\n language: (db: IModelSource) => Promise;\n menuItem: (db: IModelSource) => Promise;\n}\n\nfunction _language(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.languageId\n ? db.get('ILanguageDto', this.languageId)\n : Promise.reject('Missing field menuItemTranslation.languageId');\n}\nfunction _menuItem(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.menuItemId\n ? db.get('IMenuItemDto', this.menuItemId)\n : Promise.reject('Missing field menuItemTranslation.menuItemId');\n}\n\n/** \n * @description all custom properties for\n MenuItemTranslationDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IMenuItemTranslationDto_Linkables {\n return {\n language: _language.bind(model),\n menuItem: _menuItem.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'menuItemId',\n\n defaultValue: 0,\n },\n {\n localName: 'languageId',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'deleted',\n\n defaultValue: false,\n },\n {\n localName: 'subMenuName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'description',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'backgroundImageFileName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'removeBackgroundImage',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'backgroundImageMediumId',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'menuImageFileName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'removeMenuImage',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'menuImageMediumId',\n\n defaultValue: '',\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type IPinTypeDto_Api from './PinTypeDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IPinTypeDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n PinTypeDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IPinTypeDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_CONTENT, VALUES_FIELD_ICON, VALUES_FIELD_TEXT } from './PinTypeDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'value',\n\n defaultValue: '',\n },\n {\n localName: 'content',\n\n defaultValue: VALUES_FIELD_CONTENT[0],\n },\n {\n localName: 'icon',\n\n defaultValue: VALUES_FIELD_ICON[0],\n },\n {\n localName: 'text',\n\n defaultValue: VALUES_FIELD_TEXT[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_CONTENT = [\n 'f3a5',\n 'f192',\n 'f111',\n 'f111',\n 'f0fe',\n 'f182',\n 'f183',\n 'f0f4',\n 'f2e7',\n 'f015',\n 'f193',\n] as const;\nexport type TYPES_FIELD_CONTENT = typeof VALUES_FIELD_CONTENT[number];\n\nexport const VALUES_FIELD_ICON = [\n 'far fa-gem',\n 'far fa-dot-circle',\n 'fas fa-circle',\n 'far fa-circle',\n 'fas fa-plus-square',\n 'fas fa-female',\n 'fas fa-male',\n 'fas fa-coffee',\n 'fas fa-utensils',\n 'fas fa-home',\n 'fas fa-wheelchair',\n] as const;\nexport type TYPES_FIELD_ICON = typeof VALUES_FIELD_ICON[number];\n\nexport const VALUES_FIELD_TEXT = [\n '[[f219]]',\n 'Dot circle',\n '[[f111]]',\n 'Circle',\n '[[f0fe]]',\n 'Female',\n 'Male',\n 'Coffee',\n 'Cutlery',\n '[[f015]]',\n '[[f193]]',\n] as const;\nexport type TYPES_FIELD_TEXT = typeof VALUES_FIELD_TEXT[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type IRoleDto_Api from './RoleDto.api';\n\n/** \n * @description all custom properties for\n RoleDto & methods to link against other entities\n*/\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IRoleDto_Linkables extends CustomBaseDataType {}\n\nfunction linkables(model: Partial): IRoleDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type IScreenOrientationDto_Api from './ScreenOrientationDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IScreenOrientationDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n ScreenOrientationDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IScreenOrientationDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './ScreenOrientationDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n {\n localName: 'byteValue',\n\n defaultValue: 0,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IMediumDto from './MediumDto.if';\nimport type IScreenOrientationDto from './ScreenOrientationDto.if';\nimport type ISiteDto_Api from './SiteDto.api';\nimport type ISiteSupportedLanguageDto from './SiteSupportedLanguageDto.if';\nimport type IStyleDto from './StyleDto.if';\n\nexport interface ISiteDto_Linkables extends CustomBaseDataType {\n imageLogo: (db: IModelSource) => Promise;\n screenOrientation: (db: IModelSource) => Promise;\n languageSelectionStyle: (db: IModelSource) => Promise;\n tourSelectionStyle: (db: IModelSource) => Promise;\n siteSupportedLanguages: (db: IModelSource) => Promise;\n}\n\nfunction _imageLogo(this: Partial, db: IModelSource): Promise {\n return this.logoMediumId\n ? db.get('IMediumDto', this.logoMediumId)\n : Promise.reject(new Error('Missing field site.logoMediumId'));\n}\n\nfunction _screenOrientation(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.screenOrientationId\n ? db.get('IScreenOrientationDto', this.screenOrientationId)\n : Promise.reject(new Error('Missing field site.screenOrientationId'));\n}\n\nfunction _languageSelectionStyle(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.languageSelectionStyleId\n ? db.get('IStyleDto', this.languageSelectionStyleId)\n : Promise.reject(new Error('Missing field site.languageSelectionStyleId'));\n}\n\nfunction _tourSelectionStyle(this: Partial, db: IModelSource): Promise {\n return this.tourSelectionStyleId\n ? db.get('IStyleDto', this.tourSelectionStyleId)\n : Promise.reject(new Error('Missing field site.tourSelectionStyleId'));\n}\n\nasync function _siteSupportedLanguages(\n this: Partial,\n db: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject(new Error('Missing field site.id'));\n }\n\n const siteId = this.id;\n\n const ssl = await db.all('ISiteSupportedLanguageDto');\n const sslMatch = ssl.filter(x => x.siteId === siteId);\n\n return sslMatch;\n}\n\n/** \n * @description all custom properties for\n SiteDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ISiteDto_Linkables {\n return {\n imageLogo: _imageLogo.bind(model),\n screenOrientation: _screenOrientation.bind(model),\n languageSelectionStyle: _languageSelectionStyle.bind(model),\n tourSelectionStyle: _tourSelectionStyle.bind(model),\n siteSupportedLanguages: _siteSupportedLanguages.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'logoFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeLogo',\n\n defaultValue: false,\n },\n {\n localName: 'logoMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'alarmEnabled',\n\n defaultValue: false,\n },\n {\n localName: 'alarmPin',\n\n defaultValue: '',\n },\n {\n localName: 'adminPin',\n\n defaultValue: '',\n },\n {\n localName: 'languageSelectionMenu',\n\n defaultValue: 0,\n },\n {\n localName: 'tourSelectionMenu',\n\n defaultValue: 0,\n },\n {\n localName: 'clientId',\n\n defaultValue: 0,\n },\n {\n localName: 'screenOrientationId',\n\n defaultValue: 0,\n },\n {\n localName: 'majorVersion',\n\n defaultValue: 0,\n },\n {\n localName: 'minorVersion',\n\n defaultValue: 0,\n },\n {\n localName: 'toursCount',\n\n defaultValue: 0,\n },\n {\n localName: 'deviceAccountsCount',\n\n defaultValue: 0,\n },\n {\n localName: 'languageSelectionStyleId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourSelectionStyleId',\n\n defaultValue: 0,\n },\n {\n localName: 'groupingSelectionMenu',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'screenOrientations',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'contactName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'title',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'phone',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'mobile',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'addressLine1',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'addressLine2',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'county',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'postalCode',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'countryId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'notes',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'bluetoothEnabled',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'streamMedia',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'streamingMediaPrefixUrl',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'showBatteryDot',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'disableSpeakerOutput',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'grayOutContentOnPlayback',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'backButtonStyleId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'batteryThresholdRed',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'batteryThresholdOrange',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'screensaverEnabled',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'screensaverShowDelay',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'resetInactivityDelay',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'alwaysShowLanguageSelection',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'alwaysShowTourSelection',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'alwaysShowGroupingSelection',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'showGroupingSelectionHeader',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'showLanguageSelectionHeader',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'showTourSelectionHeader',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'showLanguageConfirmation',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'resetGroupingDaily',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'groupingMenuEnabled',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'groupingShow',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'groupingSelectionStyleId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'defaultLanguageId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'groupingHeader',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'languageHeader',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'tourHeader',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'siteObjectOnGroupingSelectionId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'siteObjectOnGroupingSelectionInitName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'siteObjectOnLanguageSelectionId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'siteObjectOnLanguageSelectionInitName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'siteObjectOnTourSelectionId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'siteObjectOnTourSelectionInitName',\n\n defaultValue: '',\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IBeaconDto from './BeaconDto.if';\nimport type IBeaconSensitivityDto from './BeaconSensitivityDto.if';\nimport type ILanguageDto from './LanguageDto.if';\nimport type IMediumDto from './MediumDto.if';\nimport type ISiteDto from './SiteDto.if';\nimport type ISiteObjectDto_Api from './SiteObjectDto.api';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type ISiteObjectTranslationDto from './SiteObjectTranslationDto.if';\nimport type ISiteObjectTypeDto from './SiteObjectTypeDto.if';\nimport type IStyleDto from './StyleDto.if';\n\nexport interface ISiteObjectDto_Linkables extends CustomBaseDataType {\n site: (database: IModelSource) => Promise;\n type: (database: IModelSource) => Promise;\n beacon: (database: IModelSource) => Promise;\n beaconSensitivity: (database: IModelSource) => Promise;\n nextObject: (database: IModelSource) => Promise;\n relatedObject1: (database: IModelSource) => Promise;\n relatedObject2: (database: IModelSource) => Promise;\n relatedObject3: (database: IModelSource) => Promise;\n relatedObject4: (database: IModelSource) => Promise;\n relatedObject5: (database: IModelSource) => Promise;\n foregroundImageMedium: (database: IModelSource) => Promise;\n backgroundImageMedium: (database: IModelSource) => Promise;\n menuImageMedium: (database: IModelSource) => Promise;\n style: (database: IModelSource) => Promise;\n translations: (database: IModelSource) => Promise;\n translation: (\n database: IModelSource,\n language: ILanguageDto | number,\n ) => Promise;\n relatedObjects: (database: IModelSource) => Promise;\n}\n\nfunction _site(this: Partial, database: IModelSource): Promise {\n return this.siteId\n ? database.get('ISiteDto', this.siteId)\n : Promise.reject('Missing field siteObject.siteId');\n}\n\nfunction _type(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.siteObjectTypeId\n ? database.get('ISiteObjectTypeDto', this.siteObjectTypeId)\n : Promise.reject('Missing field siteObject.siteObjectTypeId');\n}\n\nfunction _beacon(this: Partial, database: IModelSource): Promise {\n return this.beaconId\n ? database.get('IBeaconDto', this.beaconId)\n : Promise.reject('Missing field siteObject.beaconId');\n}\n\nfunction _beaconSensitivity(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.beaconSensitivityId\n ? database.get('IBeaconSensitivityDto', this.beaconSensitivityId)\n : Promise.reject('Missing field siteObject.beaconSensitivityId');\n}\n\nfunction _nextObject(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.nextObjectId\n ? database.get('ISiteObjectDto', this.nextObjectId)\n : Promise.reject('Missing field siteObject.nextObjectId');\n}\n\nfunction _relatedObject1(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.relatedObject1Id\n ? database.get('ISiteObjectDto', this.relatedObject1Id)\n : Promise.reject('Missing field siteObject.relatedObject1Id');\n}\n\nfunction _relatedObject2(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.relatedObject2Id\n ? database.get('ISiteObjectDto', this.relatedObject2Id)\n : Promise.reject('Missing field siteObject.relatedObject2Id');\n}\n\nfunction _relatedObject3(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.relatedObject3Id\n ? database.get('ISiteObjectDto', this.relatedObject3Id)\n : Promise.reject('Missing field siteObject.relatedObject3Id');\n}\n\nfunction _relatedObject4(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.relatedObject4Id\n ? database.get('ISiteObjectDto', this.relatedObject4Id)\n : Promise.reject('Missing field siteObject.relatedObject4Id');\n}\n\nfunction _relatedObject5(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.relatedObject5Id\n ? database.get('ISiteObjectDto', this.relatedObject5Id)\n : Promise.reject('Missing field siteObject.relatedObject5Id');\n}\n\nfunction _foregroundImageMedium(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.foregroundImageMediumId\n ? database.get('IMediumDto', this.foregroundImageMediumId)\n : Promise.reject('Missing field siteObject.foregroundImageMediumId');\n}\n\nfunction _backgroundImageMedium(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.backgroundImageMediumId\n ? database.get('IMediumDto', this.backgroundImageMediumId)\n : Promise.reject('Missing field siteObject.backgroundImageMediumId');\n}\n\nfunction _menuImageMedium(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.menuImageMediumId\n ? database.get('IMediumDto', this.menuImageMediumId)\n : Promise.reject('Missing field siteObject.menuImageMediumId');\n}\n\nfunction _style(this: Partial, database: IModelSource): Promise {\n return this.styleId\n ? database.get('IStyleDto', this.styleId)\n : Promise.reject('Missing field siteObject.styleId');\n}\n\nasync function _translations(\n this: Partial,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject('Missing field siteObject.id');\n }\n\n const siteObjectId = this.id;\n\n const results = await database.all('ISiteObjectTranslationDto');\n const matches = results.filter(item => item.siteObjectId === siteObjectId);\n\n if (matches.length === 0) {\n throw new Error(`No translations found for siteObjectId:${siteObjectId}`);\n }\n\n return matches;\n}\n\nasync function _translation(\n this: Partial,\n database: IModelSource,\n language: ILanguageDto | number,\n): Promise {\n if (!this.id) {\n return Promise.reject(new Error('Missing field siteObject.id'));\n }\n\n const languageId: number =\n (language as ILanguageDto).id !== undefined\n ? Number((language as ILanguageDto).id ?? -1)\n : Number(language);\n\n const allTranslations = await _translations.call(this, database);\n\n const match = allTranslations.filter(x => x.languageId === languageId);\n\n const primaryMatch = match.at(0);\n\n if (!primaryMatch) {\n throw new Error(\n `Unable to find matching translation in siteobject:${this.id}, for language:${languageId}`,\n );\n }\n\n return primaryMatch;\n}\n\nasync function _relatedObjects(\n this: Partial,\n database: IModelSource,\n): Promise {\n const promises: Promise[] = [];\n\n if (this.relatedObject1Id) {\n promises.push(_relatedObject1.call(this, database));\n }\n\n if (this.relatedObject2Id) {\n promises.push(_relatedObject2.call(this, database));\n }\n\n if (this.relatedObject3Id) {\n promises.push(_relatedObject3.call(this, database));\n }\n\n if (this.relatedObject4Id) {\n promises.push(_relatedObject4.call(this, database));\n }\n\n if (this.relatedObject5Id) {\n promises.push(_relatedObject5.call(this, database));\n }\n\n const objects: ISiteObjectDto[] = await Promise.all(promises);\n\n return objects;\n}\n\n/** \n * @description all custom properties for\n SiteObjectDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ISiteObjectDto_Linkables {\n return {\n site: _site.bind(model),\n type: _type.bind(model),\n beacon: _beacon.bind(model),\n beaconSensitivity: _beaconSensitivity.bind(model),\n nextObject: _nextObject.bind(model),\n relatedObject1: _relatedObject1.bind(model),\n relatedObject2: _relatedObject2.bind(model),\n relatedObject3: _relatedObject3.bind(model),\n relatedObject4: _relatedObject4.bind(model),\n relatedObject5: _relatedObject5.bind(model),\n foregroundImageMedium: _foregroundImageMedium.bind(model),\n backgroundImageMedium: _backgroundImageMedium.bind(model),\n menuImageMedium: _menuImageMedium.bind(model),\n style: _style.bind(model),\n translations: _translations.bind(model),\n translation: _translation.bind(model),\n relatedObjects: _relatedObjects.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport type ISiteObjectDto_Api from './SiteObjectDto.api';\nimport type { ISiteObjectDto_SourceProps } from './SiteObjectDto.if';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'int1',\n\n defaultValue: 0,\n },\n {\n localName: 'int2',\n\n defaultValue: 0,\n },\n {\n localName: 'int3',\n\n defaultValue: 0,\n },\n {\n localName: 'int4',\n\n defaultValue: 0,\n },\n {\n localName: 'altBoolean1',\n\n defaultValue: false,\n },\n {\n localName: 'altBoolean2',\n\n defaultValue: false,\n },\n {\n localName: 'isUniversal',\n\n defaultValue: false,\n },\n {\n localName: 'keypadNumber',\n\n defaultValue: 0,\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'siteObjectTypeId',\n\n defaultValue: 0,\n },\n {\n localName: 'beaconId',\n\n defaultValue: 0,\n },\n {\n localName: 'beaconSensitivityId',\n\n defaultValue: 0,\n },\n {\n localName: 'fontSize',\n\n defaultValue: 0,\n },\n {\n localName: 'fontFamily',\n\n defaultValue: '',\n },\n {\n localName: 'fontColor',\n\n defaultValue: '',\n },\n {\n localName: 'menuPosition',\n\n defaultValue: 0,\n },\n {\n localName: 'nextObjectId',\n\n defaultValue: 0,\n },\n {\n localName: 'relatedObject1Id',\n\n defaultValue: 0,\n },\n {\n localName: 'relatedObject2Id',\n\n defaultValue: 0,\n },\n {\n localName: 'relatedObject3Id',\n\n defaultValue: 0,\n },\n {\n localName: 'relatedObject4Id',\n\n defaultValue: 0,\n },\n {\n localName: 'relatedObject5Id',\n\n defaultValue: 0,\n },\n {\n localName: 'removeForegroundImage',\n\n defaultValue: false,\n },\n {\n localName: 'foregroundImageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'foregroundImageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeBackgroundImage',\n\n defaultValue: false,\n },\n {\n localName: 'backgroundImageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'backgroundImageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeMenuImage',\n\n defaultValue: false,\n },\n {\n localName: 'menuImageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'menuImageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'namePropagation',\n\n defaultValue: false,\n },\n {\n localName: 'longNamePropagation',\n\n defaultValue: false,\n },\n {\n localName: 'descriptionPropagation',\n\n defaultValue: false,\n },\n {\n localName: 'alternativeText1Propagation',\n\n defaultValue: false,\n },\n {\n localName: 'alternativeText2Propagation',\n\n defaultValue: false,\n },\n {\n localName: 'mediumPropagation',\n\n defaultValue: false,\n },\n {\n localName: 'mediumFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeMedium',\n\n defaultValue: false,\n },\n {\n localName: 'backgroundColor',\n\n defaultValue: '',\n },\n {\n localName: 'foregroundColor',\n\n defaultValue: '',\n },\n {\n localName: 'styleId',\n\n defaultValue: 0,\n },\n {\n localName: 'toursCount',\n\n defaultValue: 0,\n },\n {\n localName: 'publishedToursCount',\n\n defaultValue: 0,\n },\n {\n localName: 'deleted',\n\n defaultValue: false,\n },\n {\n localName: 'screenOrientations',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'keywords',\n\n defaultValue: [],\n\n customImport: function (sourceInput: Record): unknown {\n const dataSource = sourceInput as Partial;\n\n const keywords: ISiteObjectDto_SourceProps['keywords'] = (\n dataSource.siteObjectKeywords ?? []\n ).map(keyword => keyword.name);\n\n return keywords;\n },\n\n customExport: function (sourceInput: Record): unknown {\n const dataSource = sourceInput as Partial;\n\n /* Some information is lost on import, so we just have to do the best we can, just clear the values */\n const siteObjectKeywords: ISiteObjectDto_Api['siteObjectKeywords'] = (\n dataSource.keywords ?? []\n ).map(keyword => ({ name: keyword, id: 0, siteId: 0, isTag: null }));\n\n return siteObjectKeywords;\n },\n },\n {\n localName: 'isSiteObjectV2',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'siteObjectTypeV2Id',\n\n defaultValue: 0,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type ISiteObjectKeywordDto_Api from './SiteObjectKeywordDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ISiteObjectKeywordDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n SiteObjectKeywordDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ISiteObjectKeywordDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'isTag',\n\n defaultValue: false,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IFloorPlanDto from './FloorPlanDto.if';\nimport type IPinTypeDto from './PinTypeDto.if';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type ISiteObjectOnFloorPlanDto_Api from './SiteObjectOnFloorPlanDto.api';\n\nexport interface ISiteObjectOnFloorPlanDto_Linkables extends CustomBaseDataType {\n siteObject: (db: IModelSource) => Promise;\n floorPlan: (db: IModelSource) => Promise;\n pinType: (db: IModelSource) => Promise;\n}\n\nfunction _siteObject(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.siteObjectId\n ? db.get('ISiteObjectDto', this.siteObjectId)\n : Promise.reject(new Error('Missing field siteObjectOnFloorPlan.siteObjectId'));\n}\nfunction _floorPlan(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.floorPlanId\n ? db.get('IFloorPlanDto', this.floorPlanId)\n : Promise.reject(new Error('Missing field siteObjectOnFloorPlan.floorPlanId'));\n}\nfunction _pinType(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.pinTypeId\n ? db.get('IPinTypeDto', this.pinTypeId)\n : Promise.reject(new Error('Missing field siteObjectOnFloorPlan.pinTypeId'));\n}\n\n/** \n * @description all custom properties for\n SiteObjectOnFloorPlanDto & methods to link against other entities\n*/\nfunction linkables(\n model: Partial,\n): ISiteObjectOnFloorPlanDto_Linkables {\n return {\n siteObject: _siteObject.bind(model),\n floorPlan: _floorPlan.bind(model),\n pinType: _pinType.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'siteObjectId',\n\n defaultValue: 0,\n },\n {\n localName: 'floorPlanId',\n\n defaultValue: 0,\n },\n {\n localName: 'x',\n\n defaultValue: 0,\n },\n {\n localName: 'y',\n\n defaultValue: 0,\n },\n {\n localName: 'pinTypeId',\n\n defaultValue: 0,\n },\n {\n localName: 'pinColor',\n\n defaultValue: '',\n },\n {\n localName: 'siteObjectName',\n\n defaultValue: '',\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ILanguageDto from './LanguageDto.if';\nimport type IMediumDto from './MediumDto.if';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type ISiteObjectTranslationDto_Api from './SiteObjectTranslationDto.api';\n\nexport interface ISiteObjectTranslationDto_Linkables extends CustomBaseDataType {\n siteObject: (db: IModelSource) => Promise;\n language: (db: IModelSource) => Promise;\n medium: (db: IModelSource) => Promise;\n}\n\nfunction _siteObject(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.siteObjectId\n ? db.get('ISiteObjectDto', this.siteObjectId)\n : Promise.reject(new Error('Missing field siteObjectTranslation.siteObjectId'));\n}\n\nfunction _language(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.languageId\n ? db.get('ILanguageDto', this.languageId)\n : Promise.reject(new Error('Missing field siteObjectTranslation.languageId'));\n}\n\nfunction _medium(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.mediumId\n ? db.get('IMediumDto', this.mediumId)\n : Promise.reject(new Error('Missing field siteObjectTranslation.mediumId'));\n}\n\n/** \n * @description all custom properties for\n SiteObjectTranslationDto & methods to link against other entities\n*/\nfunction linkables(\n model: Partial,\n): ISiteObjectTranslationDto_Linkables {\n return {\n siteObject: _siteObject.bind(model),\n language: _language.bind(model),\n medium: _medium.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'siteObjectId',\n\n defaultValue: 0,\n },\n {\n localName: 'languageId',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'longName',\n\n defaultValue: '',\n },\n {\n localName: 'description',\n\n defaultValue: '',\n },\n {\n localName: 'alternativeText1',\n\n defaultValue: '',\n },\n {\n localName: 'alternativeText2',\n\n defaultValue: '',\n },\n {\n localName: 'mediumId',\n\n defaultValue: '',\n },\n {\n localName: 'text',\n\n defaultValue: '',\n },\n {\n localName: 'deleted',\n\n defaultValue: false,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type ISiteObjectTypeDto_Api from './SiteObjectTypeDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ISiteObjectTypeDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n SiteObjectTypeDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ISiteObjectTypeDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_DEFAULTEXTENSIONS, VALUES_FIELD_NAME } from './SiteObjectTypeDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'defaultExtensions',\n\n defaultValue: VALUES_FIELD_DEFAULTEXTENSIONS[0],\n },\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n 'Image',\n 'Audio',\n 'Video',\n 'Text file',\n 'HTML file',\n 'Rubaway',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n\nexport const VALUES_FIELD_ID = [1, 2, 3, 4, 5, 6] as const;\nexport type TYPES_FIELD_ID = typeof VALUES_FIELD_ID[number];\n\nexport const VALUES_FIELD_DEFAULTEXTENSIONS = [\n '.png, .jpg, .jpeg',\n '.mp3, .aac',\n '.mp4',\n '.txt, .md',\n '.html, .zip',\n // Null,\n];\nexport type TYPES_FIELD_DEFAULTEXTENSIONS = typeof VALUES_FIELD_DEFAULTEXTENSIONS[number];\n","import type { CustomBaseDataType, ILanguageDto } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ISiteDto from './SiteDto.if';\nimport type ISiteSupportedLanguageDto_Api from './SiteSupportedLanguageDto.api';\n\nexport interface ISiteSupportedLanguageDto_Linkables extends CustomBaseDataType {\n site: (database: IModelSource) => Promise;\n language: (database: IModelSource) => Promise;\n}\n\nfunction _site(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.siteId\n ? database.get('ISiteDto', this.siteId)\n : Promise.reject(new Error('Missing field siteSupportedLanguage.siteId'));\n}\n\nfunction _language(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.languageId\n ? database.get('ILanguageDto', this.languageId)\n : Promise.reject(new Error('Missing field siteSupportedLanguage.languageId'));\n}\n\n/** \n * @description all custom properties for\n SiteSupportedLanguageDto & methods to link against other entities\n*/\nfunction linkables(\n model: Partial,\n): ISiteSupportedLanguageDto_Linkables {\n return {\n site: _site.bind(model),\n language: _language.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'languageId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IBackgroundModeDto from './BackgroundModeDto.if';\nimport type IFontAlignmentDto from './FontAlignmentDto.if';\nimport type IFontFamilyDto from './FontFamilyDto.if';\nimport type IFontSizeUnitDto from './FontSizeUnitDto.if';\nimport type IFontStyleDto from './FontStyleDto.if';\nimport type IMediumDto from './MediumDto.if';\nimport type ISiteDto from './SiteDto.if';\nimport type IStyleDto_Api from './StyleDto.api';\nimport type IStyleDto from './StyleDto.if';\n\nexport interface IStyleDto_Linkables extends CustomBaseDataType {\n parent: (db: IModelSource) => Promise;\n site: (db: IModelSource) => Promise;\n foregroundImageMedium: (db: IModelSource) => Promise;\n backgroundImageMedium: (db: IModelSource) => Promise;\n menuImageMedium: (db: IModelSource) => Promise;\n backgroundMode: (db: IModelSource) => Promise;\n primaryFontFamily: (db: IModelSource) => Promise;\n primaryFontStyle: (db: IModelSource) => Promise;\n primaryFontSizeUnit: (db: IModelSource) => Promise;\n primaryFontAlignment: (db: IModelSource) => Promise;\n secondaryFontFamily: (db: IModelSource) => Promise;\n secondaryFontStyle: (db: IModelSource) => Promise;\n secondaryFontSizeUnit: (db: IModelSource) => Promise;\n secondaryFontAlignment: (db: IModelSource) => Promise;\n tertiaryFontFamily: (db: IModelSource) => Promise;\n tertiaryFontStyle: (db: IModelSource) => Promise;\n tertiaryFontSizeUnit: (db: IModelSource) => Promise;\n tertiaryFontAlignment: (db: IModelSource) => Promise;\n}\n\nfunction _parent(this: Partial, db: IModelSource): Promise {\n return this.parentId\n ? db.get('IStyleDto', this.parentId)\n : Promise.reject(new Error('Missing field style.parentId'));\n}\n\nfunction _site(this: Partial, db: IModelSource): Promise {\n return this.siteId\n ? db.get('ISiteDto', this.siteId)\n : Promise.reject(new Error('Missing field style.siteId'));\n}\n\nfunction _foregroundImageMedium(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.foregroundImageMediumId\n ? db.get('IMediumDto', this.foregroundImageMediumId)\n : Promise.reject(new Error('Missing field style.foregroundImageMediumId'));\n}\n\nfunction _backgroundImageMedium(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.backgroundImageMediumId\n ? db.get('IMediumDto', this.backgroundImageMediumId)\n : Promise.reject(new Error('Missing field style.backgroundImageMediumId'));\n}\n\nfunction _menuImageMedium(this: Partial, db: IModelSource): Promise {\n return this.menuImageMediumId\n ? db.get('IMediumDto', this.menuImageMediumId)\n : Promise.reject(new Error('Missing field style.menuImageMediumId'));\n}\n\nfunction _backgroundMode(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.backgroundModeId\n ? db.get('IBackgroundModeDto', this.backgroundModeId)\n : Promise.reject(new Error('Missing field style.backgroundModeId'));\n}\n\nfunction _primaryFontFamily(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.primaryFontFamilyId\n ? db.get('IFontFamilyDto', this.primaryFontFamilyId)\n : Promise.reject(new Error('Missing field style.primaryFontFamilyId'));\n}\n\nfunction _primaryFontStyle(this: Partial, db: IModelSource): Promise {\n return this.primaryFontStyleId\n ? db.get('IFontStyleDto', this.primaryFontStyleId)\n : Promise.reject(new Error('Missing field style.primaryFontStyleId'));\n}\n\nfunction _primaryFontSizeUnit(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.primaryFontSizeUnitId\n ? db.get('IFontSizeUnitDto', this.primaryFontSizeUnitId)\n : Promise.reject(new Error('Missing field style.primaryFontSizeUnitId'));\n}\n\nfunction _primaryFontAlignment(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.primaryFontAlignmentId\n ? db.get('IFontAlignmentDto', this.primaryFontAlignmentId)\n : Promise.reject(new Error('Missing field style.primaryFontAlignmentId'));\n}\n\nfunction _secondaryFontFamily(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.secondaryFontFamilyId\n ? db.get('IFontFamilyDto', this.secondaryFontFamilyId)\n : Promise.reject(new Error('Missing field style.secondaryFontFamilyId'));\n}\n\nfunction _secondaryFontStyle(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.secondaryFontStyleId\n ? db.get('IFontStyleDto', this.secondaryFontStyleId)\n : Promise.reject(new Error('Missing field style.secondaryFontStyleId'));\n}\n\nfunction _secondaryFontSizeUnit(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.secondaryFontSizeUnitId\n ? db.get('IFontSizeUnitDto', this.secondaryFontSizeUnitId)\n : Promise.reject(new Error('Missing field style.secondaryFontSizeUnitId'));\n}\n\nfunction _secondaryFontAlignment(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.secondaryFontAlignmentId\n ? db.get('IFontAlignmentDto', this.secondaryFontAlignmentId)\n : Promise.reject(new Error('Missing field style.secondaryFontAlignmentId'));\n}\n\nfunction _tertiaryFontFamily(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.tertiaryFontFamilyId\n ? db.get('IFontFamilyDto', this.tertiaryFontFamilyId)\n : Promise.reject(new Error('Missing field style.tertiaryFontFamilyId'));\n}\n\nfunction _tertiaryFontStyle(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.tertiaryFontStyleId\n ? db.get('IFontStyleDto', this.tertiaryFontStyleId)\n : Promise.reject(new Error('Missing field style.tertiaryFontStyleId'));\n}\n\nfunction _tertiaryFontSizeUnit(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.tertiaryFontSizeUnitId\n ? db.get('IFontSizeUnitDto', this.tertiaryFontSizeUnitId)\n : Promise.reject(new Error('Missing field style.tertiaryFontSizeUnitId'));\n}\n\nfunction _tertiaryFontAlignment(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.tertiaryFontAlignmentId\n ? db.get('IFontAlignmentDto', this.tertiaryFontAlignmentId)\n : Promise.reject(new Error('Missing field style.tertiaryFontAlignmentId'));\n}\n\n/** \n * @description all custom properties for\n StyleDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): IStyleDto_Linkables {\n return {\n parent: _parent.bind(model),\n site: _site.bind(model),\n foregroundImageMedium: _foregroundImageMedium.bind(model),\n backgroundImageMedium: _backgroundImageMedium.bind(model),\n menuImageMedium: _menuImageMedium.bind(model),\n backgroundMode: _backgroundMode.bind(model),\n primaryFontFamily: _primaryFontFamily.bind(model),\n primaryFontStyle: _primaryFontStyle.bind(model),\n primaryFontSizeUnit: _primaryFontSizeUnit.bind(model),\n primaryFontAlignment: _primaryFontAlignment.bind(model),\n secondaryFontFamily: _secondaryFontFamily.bind(model),\n secondaryFontStyle: _secondaryFontStyle.bind(model),\n secondaryFontSizeUnit: _secondaryFontSizeUnit.bind(model),\n secondaryFontAlignment: _secondaryFontAlignment.bind(model),\n tertiaryFontFamily: _tertiaryFontFamily.bind(model),\n tertiaryFontStyle: _tertiaryFontStyle.bind(model),\n tertiaryFontSizeUnit: _tertiaryFontSizeUnit.bind(model),\n tertiaryFontAlignment: _tertiaryFontAlignment.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'parentId',\n\n defaultValue: 0,\n },\n {\n localName: 'isDefault',\n\n defaultValue: false,\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'description',\n\n defaultValue: '',\n },\n {\n localName: 'foregroundImageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'backgroundImageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'backgroundColor',\n\n defaultValue: '',\n },\n {\n localName: 'menuImageMediumId',\n\n defaultValue: '',\n },\n {\n localName: 'backgroundModeId',\n\n defaultValue: 0,\n },\n {\n localName: 'menuColor',\n\n defaultValue: '',\n },\n {\n localName: 'primaryFontFamilyId',\n\n defaultValue: 0,\n },\n {\n localName: 'primaryFontStyleId',\n\n defaultValue: 0,\n },\n {\n localName: 'primaryFontSize',\n\n defaultValue: 0,\n },\n {\n localName: 'primaryFontSizeUnitId',\n\n defaultValue: 0,\n },\n {\n localName: 'primaryFontColor',\n\n defaultValue: '',\n },\n {\n localName: 'primaryFontAlignmentId',\n\n defaultValue: 0,\n },\n {\n localName: 'secondaryFontFamilyId',\n\n defaultValue: 0,\n },\n {\n localName: 'secondaryFontStyleId',\n\n defaultValue: 0,\n },\n {\n localName: 'secondaryFontSize',\n\n defaultValue: 0,\n },\n {\n localName: 'secondaryFontSizeUnitId',\n\n defaultValue: 0,\n },\n {\n localName: 'secondaryFontColor',\n\n defaultValue: '',\n },\n {\n localName: 'secondaryFontAlignmentId',\n\n defaultValue: 0,\n },\n {\n localName: 'tertiaryFontFamilyId',\n\n defaultValue: 0,\n },\n {\n localName: 'tertiaryFontStyleId',\n\n defaultValue: 0,\n },\n {\n localName: 'tertiaryFontSize',\n\n defaultValue: 0,\n },\n {\n localName: 'tertiaryFontSizeUnitId',\n\n defaultValue: 0,\n },\n {\n localName: 'tertiaryFontColor',\n\n defaultValue: '',\n },\n {\n localName: 'tertiaryFontAlignmentId',\n\n defaultValue: 0,\n },\n {\n localName: 'foregroundImageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeForegroundImage',\n\n defaultValue: false,\n },\n {\n localName: 'menuImageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeMenuImage',\n\n defaultValue: false,\n },\n {\n localName: 'backgroundImageFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeBackgroundImage',\n\n defaultValue: false,\n },\n {\n localName: 'hasChildren',\n\n defaultValue: false,\n },\n {\n localName: 'primaryColor',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'secondaryColor',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'tertiaryColor',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'quaternaryColor',\n\n defaultValue: '',\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IFloorPlanDto from './FloorPlanDto.if';\nimport type ILanguageDto from './LanguageDto.if';\nimport type ISiteDto from './SiteDto.if';\nimport type IStyleDto from './StyleDto.if';\nimport type ITourDto_Api from './TourDto.api';\nimport type ITourStatusDto from './TourStatusDto.if';\nimport type ITourSubTypeDto from './TourSubTypeDto.if';\nimport type ITourSupportedLanguageDto from './TourSupportedLanguageDto.if';\nimport type ITourTranslationDto from './TourTranslationDto.if';\nimport type ITourTypeDto from './TourTypeDto.if';\n\nexport interface ITourDto_Linkables extends CustomBaseDataType {\n site: (database: IModelSource) => Promise;\n tourType: (database: IModelSource) => Promise;\n tourSubType: (database: IModelSource) => Promise;\n style: (database: IModelSource) => Promise;\n tourStatus: (database: IModelSource) => Promise;\n tourSupportedLanguages: (database: IModelSource) => Promise;\n translations: (database: IModelSource) => Promise;\n translation: (\n database: IModelSource,\n language: ILanguageDto | number,\n ) => Promise;\n floorplans: (database: IModelSource) => Promise;\n}\n\nfunction _site(this: Partial, database: IModelSource): Promise {\n return this.siteId\n ? database.get('ISiteDto', this.siteId)\n : Promise.reject(new Error('Missing field tour.siteId'));\n}\n\nfunction _tourType(this: Partial, database: IModelSource): Promise {\n return this.tourTypeId\n ? database.get('ITourTypeDto', this.tourTypeId)\n : Promise.reject(new Error('Missing field tour.tourTypeId'));\n}\n\nfunction _tourSubType(\n this: Partial,\n database: IModelSource,\n): Promise {\n return this.tourSubTypeId\n ? database.get('ITourSubTypeDto', this.tourSubTypeId)\n : Promise.reject(new Error('Missing field tour.tourSubTypeId'));\n}\n\nfunction _style(this: Partial, database: IModelSource): Promise {\n return this.styleId\n ? database.get('IStyleDto', this.styleId)\n : Promise.reject(new Error('Missing field tour.styleId'));\n}\n\nfunction _tourStatus(this: Partial, database: IModelSource): Promise {\n return this.tourStatusId\n ? database.get('ITourStatusDto', this.tourStatusId)\n : Promise.reject(new Error('Missing field tour.tourStatusId'));\n}\n\nasync function _tourSupportedLanguages(\n this: Partial,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject(new Error('Missing field tour.id'));\n }\n\n const tourId = this.id;\n\n const results = await database.all('ITourSupportedLanguageDto');\n const matches = results.filter(item => item.tourId === tourId);\n return matches;\n}\n\nasync function _translations(\n this: Partial,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n return Promise.reject(new Error('Missing field tour.id'));\n }\n\n /* TourDto <-1-M=> TourSupportedLanguageDto <-1-1-> TourTranslationDto */\n const matchTSL = await _tourSupportedLanguages.call(this, database);\n const matchTSLIds = new Set(matchTSL.map(x => x.id));\n const allTranslations = await database.all('ITourTranslationDto');\n const matchTranslations = allTranslations.filter(x =>\n matchTSLIds.has(x.tourSupportedLanguageId),\n );\n\n return matchTranslations;\n}\n\nasync function _translation(\n this: Partial,\n database: IModelSource,\n language: ILanguageDto | number,\n): Promise {\n if (!this.id) {\n return Promise.reject(new Error('Missing field tour.id'));\n }\n\n const languageId: number =\n (language as ILanguageDto).id !== undefined\n ? Number((language as ILanguageDto).id ?? -1)\n : Number(language);\n\n /* Find all matching ISiteSupportedLanguageDto objects with match our #ILanguageDto */\n const allSSL = await database.all('ISiteSupportedLanguageDto');\n const matchSSL = allSSL.filter(x => x.languageId === languageId);\n const matchSSLIds = new Set(matchSSL.map(x => x.id));\n\n /* Find any matching ITourSupportingLanguageDto to our ISiteSupportedLanguageDto */\n const allTSL = await _tourSupportedLanguages.call(this, database);\n const matchTSL = allTSL.filter(\n x =>\n matchSSLIds.has(x.siteSupportedLanguageId) /* Workspace 1.0 */ ||\n x.languageId === languageId /* Workspace 2.0 */,\n );\n const matchTSLIds = matchTSL.map(x => x.id);\n\n const tourTranslations = await _translations.call(this, database);\n\n let matchTranslation = tourTranslations.find(x =>\n matchTSLIds.includes(x.tourSupportedLanguageId),\n );\n\n /* Workspace 2.0 */\n if (!matchTranslation && matchTSLIds.length > 0) {\n matchTranslation = await database.get('ITourTranslationDto', matchTSLIds[0]);\n }\n\n if (!matchTranslation) {\n throw new Error(\n `Unable to find translation for languageId:${languageId}, tourId:${this.id}`,\n );\n }\n\n return matchTranslation;\n}\n\nasync function _floorplans(\n this: Partial,\n database: IModelSource,\n): Promise {\n if (!this.id) {\n throw new Error('Missing field tour.id');\n }\n\n const thisId = this.id;\n\n const allFloorPlanTours = await database.all('IFloorPlanTourDto');\n const matchFPTours = allFloorPlanTours.filter(fpTour => fpTour.tourId === thisId);\n const matchFloorPlans = await Promise.all(\n matchFPTours.map(fpTour => database.get('IFloorPlanDto', fpTour.floorPlanId)),\n );\n\n return matchFloorPlans;\n}\n\n/** \n * @description all custom properties for\n TourDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ITourDto_Linkables {\n return {\n site: _site.bind(model),\n tourType: _tourType.bind(model),\n tourSubType: _tourSubType.bind(model),\n style: _style.bind(model),\n tourStatus: _tourStatus.bind(model),\n tourSupportedLanguages: _tourSupportedLanguages.bind(model),\n translations: _translations.bind(model),\n translation: _translation.bind(model),\n floorplans: _floorplans.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'fontColor',\n\n defaultValue: '',\n },\n {\n localName: 'fontSize',\n\n defaultValue: 0,\n },\n {\n localName: 'fontName',\n\n defaultValue: '',\n },\n {\n localName: 'backgroundColor',\n\n defaultValue: '',\n },\n {\n localName: 'foregroundColor',\n\n defaultValue: '',\n },\n {\n localName: 'description',\n\n defaultValue: '',\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourTypeId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourSubTypeId',\n\n defaultValue: 0,\n },\n {\n localName: 'styleId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourStatusId',\n\n defaultValue: 0,\n },\n {\n localName: 'stage1',\n\n defaultValue: false,\n },\n {\n localName: 'stage2',\n\n defaultValue: false,\n },\n {\n localName: 'stage3',\n\n defaultValue: false,\n },\n {\n localName: 'stage4',\n\n defaultValue: false,\n },\n {\n localName: 'createdById',\n\n defaultValue: 0,\n },\n {\n localName: 'modifiedById',\n\n defaultValue: 0,\n },\n {\n localName: 'version',\n\n defaultValue: 0,\n },\n {\n localName: 'minorVersion',\n\n defaultValue: 0,\n },\n {\n localName: 'publishedVersion',\n\n defaultValue: 0,\n },\n {\n localName: 'testVersion',\n\n defaultValue: 0,\n },\n {\n localName: 'internalName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'grayOutContentOnPlayback',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'qrCode',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'visibilityScheduleShow',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'visibilityScheduleHide',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'siteObjectPlayOnLaunchId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'showFloorplanOnMenuOnly',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'hideOnTourSelect',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'backButtonStyleId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'hideKeypadNumber',\n\n defaultValue: false,\n optional: true,\n },\n {\n localName: 'screenOrientations',\n\n defaultValue: 0,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type IMenuItemDto from './MenuItemDto.if';\nimport type ITourDto from './TourDto.if';\nimport type ITourMenuItemDto_Api from './TourMenuItemDto.api';\n\nexport interface ITourMenuItemDto_Linkables extends CustomBaseDataType {\n menuItem: (db: IModelSource) => Promise;\n tour: (db: IModelSource) => Promise;\n}\n\nfunction _menuItem(this: Partial, db: IModelSource): Promise {\n return this.menuItemId\n ? db.get('IMenuItemDto', this.menuItemId)\n : Promise.reject(new Error('Missing field tourMenuItem.menuItemId'));\n}\n\nfunction _tour(this: Partial, db: IModelSource): Promise {\n return this.tourId\n ? db.get('ITourDto', this.tourId)\n : Promise.reject(new Error('Missing field tourMenuItem.tourId'));\n}\n\n/** \n * @description all custom properties for\n TourMenuItemDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ITourMenuItemDto_Linkables {\n return {\n menuItem: _menuItem.bind(model),\n tour: _tour.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'menuItemId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourId',\n\n defaultValue: 0,\n },\n {\n localName: 'menuOrder',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type ITourDto from './TourDto.if';\nimport type ITourRelatedSiteObjectDto_Api from './TourRelatedSiteObjectDto.api';\n\nexport interface ITourRelatedSiteObjectDto_Linkables extends CustomBaseDataType {\n siteObject: (db: IModelSource) => Promise;\n tour: (db: IModelSource) => Promise;\n}\n\nfunction _siteObject(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.siteObjectId\n ? db.get('ISiteObjectDto', this.siteObjectId)\n : Promise.reject(new Error('Missing field tourRelatedSiteObject.siteObjectId'));\n}\nfunction _tour(this: Partial, db: IModelSource): Promise {\n return this.tourId\n ? db.get('ITourDto', this.tourId)\n : Promise.reject(new Error('Missing field tourRelatedSiteObject.tourId'));\n}\n\n/** \n * @description all custom properties for\n TourRelatedSiteObjectDto & methods to link against other entities\n*/\nfunction linkables(\n model: Partial,\n): ITourRelatedSiteObjectDto_Linkables {\n return {\n siteObject: _siteObject.bind(model),\n tour: _tour.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'tourId',\n\n defaultValue: 0,\n },\n {\n localName: 'elementOrder',\n\n defaultValue: 0,\n },\n {\n localName: 'siteObjectId',\n\n defaultValue: 0,\n },\n {\n localName: 'menuItemId',\n\n defaultValue: 0,\n optional: true,\n },\n {\n localName: 'parentTourRelatedSiteObjectId',\n\n defaultValue: 0,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type ITourStatusDto_Api from './TourStatusDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ITourStatusDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n TourStatusDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ITourStatusDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './TourStatusDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = ['Published', 'Test', 'Draft', 'Unpublished', 'Deleted'] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type ITourSubTypeDto_Api from './TourSubTypeDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ITourSubTypeDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n TourSubTypeDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ITourSubTypeDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'tourTypeId',\n\n defaultValue: 0,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ISiteSupportedLanguageDto from './SiteSupportedLanguageDto.if';\nimport type ITourDto from './TourDto.if';\nimport type ITourSupportedLanguageDto_Api from './TourSupportedLanguageDto.api';\n\nexport interface ITourSupportedLanguageDto_Linkables extends CustomBaseDataType {\n tour: (db: IModelSource) => Promise;\n siteSupportedLanguage: (db: IModelSource) => Promise;\n}\n\nfunction _siteSupportedLanguage(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.siteSupportedLanguageId\n ? db.get('ISiteSupportedLanguageDto', this.siteSupportedLanguageId)\n : Promise.reject(new Error('Missing field tourSupportedLanguage.siteSupportedLanguageId'));\n}\n\nfunction _tour(this: Partial, db: IModelSource): Promise {\n return this.tourId\n ? db.get('ITourDto', this.tourId)\n : Promise.reject(new Error('Missing field tourSupportedLanguage.tourId'));\n}\n\n/** \n * @description all custom properties for\n TourSupportedLanguageDto & methods to link against other entities\n*/\nfunction linkables(\n model: Partial,\n): ITourSupportedLanguageDto_Linkables {\n return {\n siteSupportedLanguage: _siteSupportedLanguage.bind(model),\n tour: _tour.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'siteSupportedLanguageId',\n\n defaultValue: 0,\n },\n {\n localName: 'tourId',\n\n defaultValue: 0,\n },\n {\n localName: 'languageId',\n\n defaultValue: 0,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type { IModelSource } from '../interface/db';\nimport type ITourSupportedLanguageDto from './TourSupportedLanguageDto.if';\nimport type ITourTranslationDto_Api from './TourTranslationDto.api';\n\nexport interface ITourTranslationDto_Linkables extends CustomBaseDataType {\n tourSupportedLanguage: (db: IModelSource) => Promise;\n}\n\nfunction _tourSupportedLanguage(\n this: Partial,\n db: IModelSource,\n): Promise {\n return this.tourSupportedLanguageId\n ? db.get('ITourSupportedLanguageDto', this.tourSupportedLanguageId)\n : Promise.reject(new Error('Missing field tourTranslation.tourSupportedLanguageId'));\n}\n\n/** \n * @description all custom properties for\n TourTranslationDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ITourTranslationDto_Linkables {\n return {\n tourSupportedLanguage: _tourSupportedLanguage.bind(model),\n };\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n /* Cannot use 'name' as PK, as name may be set the same across multiple translations */\n {\n localName: 'tourSupportedLanguageId',\n\n defaultValue: 0,\n },\n\n {\n localName: 'name',\n\n defaultValue: '',\n },\n {\n localName: 'completed',\n\n defaultValue: false,\n },\n {\n localName: 'mediumId',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'mediumFileName',\n\n defaultValue: '',\n optional: true,\n },\n {\n localName: 'removeMedium',\n\n defaultValue: false,\n optional: true,\n },\n];\n\nexport default MAPPINGS;\n","import type { CustomBaseDataType } from '../interface';\nimport type ITourTypeDto_Api from './TourTypeDto.api';\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface ITourTypeDto_Linkables extends CustomBaseDataType {}\n\n/** \n * @description all custom properties for\n TourTypeDto & methods to link against other entities\n*/\nfunction linkables(model: Partial): ITourTypeDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\nimport { VALUES_FIELD_NAME } from './TourTypeDto.private';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'name',\n\n defaultValue: VALUES_FIELD_NAME[0],\n },\n];\n\nexport default MAPPINGS;\n","export const VALUES_FIELD_NAME = [\n 'Cascaded',\n 'Hamburger style',\n 'Keypad style',\n 'List menu',\n 'Outdoor map',\n] as const;\nexport type TYPES_FIELD_NAME = typeof VALUES_FIELD_NAME[number];\n","import type { CustomBaseDataType } from '../interface';\nimport type IUserDto_Api from './UserDto.api';\n\n/** \n * @description all custom properties for\n UserDto & methods to link against other entities\n*/\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface */\nexport interface IUserDto_Linkables extends CustomBaseDataType {}\n\nfunction linkables(model: Partial): IUserDto_Linkables {\n return {};\n}\n\nexport default linkables;\n","import type MapProperty from '../private/IMapProperty';\n\n/**\n * @description array of each field & how to convert between external(api) & internal representations\n */\nconst MAPPINGS: MapProperty[] = [\n {\n localName: 'id',\n\n defaultValue: 0,\n },\n {\n localName: 'userName',\n\n defaultValue: '',\n },\n {\n localName: 'firstName',\n\n defaultValue: '',\n },\n {\n localName: 'lastName',\n\n defaultValue: '',\n },\n {\n localName: 'avatarFileName',\n\n defaultValue: '',\n },\n {\n localName: 'removeAvatar',\n\n defaultValue: false,\n },\n {\n localName: 'avatar',\n\n defaultValue: false,\n },\n {\n localName: 'avatarMimeType',\n\n defaultValue: '',\n },\n {\n localName: 'isCmsUser',\n\n defaultValue: false,\n },\n {\n localName: 'emailConfirmed',\n\n defaultValue: false,\n },\n {\n localName: 'siteId',\n\n defaultValue: 0,\n },\n {\n localName: 'managedClientId',\n\n defaultValue: 0,\n },\n {\n localName: 'managedSiteId',\n\n defaultValue: 0,\n },\n {\n localName: 'modifiedById',\n\n defaultValue: 0,\n },\n {\n localName: 'mainRole',\n\n defaultValue: '',\n },\n {\n localName: 'workingForClientId',\n\n defaultValue: 0,\n },\n {\n localName: 'mainRoleHR',\n\n defaultValue: '',\n },\n];\n\nexport default MAPPINGS;\n","import transformerCreate from '../private/create';\nimport type IUserDto_Api from './UserDto.api';\nimport type IUserDto from './UserDto.if';\nimport type { IUserDto_ComputedProps, IUserDto_SourceProps } from './UserDto.if';\nimport type { IUserDto_Linkables } from './UserDto.link';\nimport linkables from './UserDto.link';\nimport mappings from './UserDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IUserDto_SourceProps & IUserDto_Linkables \n & can be flattened back down to IUserDto_Api \n*/\nfunction generator(data: Partial): IUserDto {\n return transformerCreate<\n IUserDto_Api,\n IUserDto_SourceProps & IUserDto_ComputedProps,\n IUserDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import { default as BackgroundModeDto } from '../impl/BackgroundModeDto';\nimport { default as BeaconDto } from '../impl/BeaconDto';\nimport { default as BeaconSensitivityDto } from '../impl/BeaconSensitivityDto';\nimport { default as CountryDto } from '../impl/CountryDto';\nimport { default as DeviceAccountDto } from '../impl/DeviceAccountDto';\nimport { default as FloorPlanDto } from '../impl/FloorPlanDto';\nimport { default as FloorPlanTourDto } from '../impl/FloorPlanTourDto';\nimport { default as FloorPlanTranslationDto } from '../impl/FloorPlanTranslationDto';\nimport { default as FontAlignmentDto } from '../impl/FontAlignmentDto';\nimport { default as FontFamilyDto } from '../impl/FontFamilyDto';\nimport { default as FontSizeUnitDto } from '../impl/FontSizeUnitDto';\nimport { default as FontStyleDto } from '../impl/FontStyleDto';\nimport { default as LanguageDto } from '../impl/LanguageDto';\nimport { default as Legacy_FloorPlanDto } from '../impl/Legacy_FloorPlanDto';\nimport { default as MediumDto } from '../impl/MediumDto';\nimport { default as MenuItemDto } from '../impl/MenuItemDto';\nimport { default as MenuItemKeywordDto } from '../impl/MenuItemKeywordDto';\nimport { default as MenuItemTranslationDto } from '../impl/MenuItemTranslationDto';\nimport { default as PinTypeDto } from '../impl/PinTypeDto';\nimport { default as RoleDto } from '../impl/RoleDto';\nimport { default as ScreenOrientationDto } from '../impl/ScreenOrientationDto';\nimport { default as SiteDto } from '../impl/SiteDto';\nimport { default as SiteObjectDto } from '../impl/SiteObjectDto';\nimport { default as SiteObjectKeywordDto } from '../impl/SiteObjectKeywordDto';\nimport { default as SiteObjectOnFloorPlanDto } from '../impl/SiteObjectOnFloorPlanDto';\nimport { default as SiteObjectTranslationDto } from '../impl/SiteObjectTranslationDto';\nimport { default as SiteObjectTypeDto } from '../impl/SiteObjectTypeDto';\nimport { default as SiteSupportedLanguageDto } from '../impl/SiteSupportedLanguageDto';\nimport { default as StyleDto } from '../impl/StyleDto';\nimport { default as TourDto } from '../impl/TourDto';\nimport { default as TourMenuItemDto } from '../impl/TourMenuItemDto';\nimport { default as TourRelatedSiteObjectDto } from '../impl/TourRelatedSiteObjectDto';\nimport { default as TourStatusDto } from '../impl/TourStatusDto';\nimport { default as TourSubTypeDto } from '../impl/TourSubTypeDto';\nimport { default as TourSupportedLanguageDto } from '../impl/TourSupportedLanguageDto';\nimport { default as TourTranslationDto } from '../impl/TourTranslationDto';\nimport { default as TourTypeDto } from '../impl/TourTypeDto';\nimport { default as UserDto } from '../impl/UserDto';\n\nimport type { INSTANTIATOR_INTERFACES } from '../interface/instantiator';\n\nconst InstantiateMap: INSTANTIATOR_INTERFACES = {\n IBackgroundModeDto: BackgroundModeDto,\n IBeaconDto: BeaconDto,\n IBeaconSensitivityDto: BeaconSensitivityDto,\n ICountryDto: CountryDto,\n IDeviceAccountDto: DeviceAccountDto,\n IFloorPlanDto: FloorPlanDto,\n IFloorPlanTourDto: FloorPlanTourDto,\n IFloorPlanTranslationDto: FloorPlanTranslationDto,\n IFontFamilyDto: FontFamilyDto,\n IFontStyleDto: FontStyleDto,\n IFontSizeUnitDto: FontSizeUnitDto,\n IFontAlignmentDto: FontAlignmentDto,\n ILanguageDto: LanguageDto,\n IMediumDto: MediumDto,\n IMenuItemDto: MenuItemDto,\n IMenuItemKeywordDto: MenuItemKeywordDto,\n IMenuItemTranslationDto: MenuItemTranslationDto,\n IPinTypeDto: PinTypeDto,\n IRoleDto: RoleDto,\n IScreenOrientationDto: ScreenOrientationDto,\n ISiteDto: SiteDto,\n ISiteObjectDto: SiteObjectDto,\n ISiteObjectOnFloorPlanDto: SiteObjectOnFloorPlanDto,\n ISiteObjectKeywordDto: SiteObjectKeywordDto,\n ISiteObjectTranslationDto: SiteObjectTranslationDto,\n ISiteObjectTypeDto: SiteObjectTypeDto,\n ISiteSupportedLanguageDto: SiteSupportedLanguageDto,\n IStyleDto: StyleDto,\n ITourDto: TourDto,\n ITourMenuItemDto: TourMenuItemDto,\n ITourRelatedSiteObjectDto: TourRelatedSiteObjectDto,\n ITourStatusDto: TourStatusDto,\n ITourSubTypeDto: TourSubTypeDto,\n ITourTranslationDto: TourTranslationDto,\n ITourTypeDto: TourTypeDto,\n ITourSupportedLanguageDto: TourSupportedLanguageDto,\n IUserDto: UserDto,\n\n ILegacy_FloorPlanDto: Legacy_FloorPlanDto,\n} as const;\n\nfunction instantiate<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Constructor extends INSTANTIATOR_INTERFACES[Interface],\n ApiData extends Parameters[0],\n Response extends ReturnType,\n>(className: Interface, data: Partial): Response {\n const constructor = InstantiateMap[className];\n\n if (!constructor) {\n throw new Error(`Unable to find instantiator for: ${className}`);\n }\n\n return constructor(data) as Response;\n}\n\nfunction allInterfaces(): (keyof INSTANTIATOR_INTERFACES)[] {\n return Object.keys(InstantiateMap) as (keyof INSTANTIATOR_INTERFACES)[];\n}\n\nexport default Object.freeze({\n instantiate,\n allInterfaces,\n});\n","import transformerCreate from '../private/create';\nimport type IBackgroundModeDto_Api from './BackgroundModeDto.api';\nimport type IBackgroundModeDto from './BackgroundModeDto.if';\nimport type {\n IBackgroundModeDto_ComputedProps,\n IBackgroundModeDto_SourceProps,\n} from './BackgroundModeDto.if';\nimport type { IBackgroundModeDto_Linkables } from './BackgroundModeDto.link';\nimport linkables from './BackgroundModeDto.link';\nimport mappings from './BackgroundModeDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IBeaconDto_SourceProps & IBeaconDto_Linkables \n & can be flattened back down to IBeaconDto_Api \n*/\nfunction generator(data: Partial): IBackgroundModeDto {\n return transformerCreate<\n IBackgroundModeDto_Api,\n IBackgroundModeDto_SourceProps & IBackgroundModeDto_ComputedProps,\n IBackgroundModeDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IBeaconDto_Api from './BeaconDto.api';\nimport type IBeaconDto from './BeaconDto.if';\nimport type { IBeaconDto_ComputedProps, IBeaconDto_SourceProps } from './BeaconDto.if';\nimport type { IBeaconDto_Linkables } from './BeaconDto.link';\nimport linkables from './BeaconDto.link';\nimport mappings from './BeaconDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IBeaconDto_SourceProps & IBeaconDto_Linkables \n & can be flattened back down to IBeaconDto_Api \n*/\nfunction generator(data: Partial): IBeaconDto {\n return transformerCreate<\n IBeaconDto_Api,\n IBeaconDto_SourceProps & IBeaconDto_ComputedProps,\n IBeaconDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IBeaconSensitivityDto_Api from './BeaconSensitivityDto.api';\nimport type IBeaconSensitivityDto from './BeaconSensitivityDto.if';\nimport type {\n IBeaconSensitivityDto_ComputedProps,\n IBeaconSensitivityDto_SourceProps,\n} from './BeaconSensitivityDto.if';\nimport type { IBeaconSensitivityDto_Linkables } from './BeaconSensitivityDto.link';\nimport linkables from './BeaconSensitivityDto.link';\nimport mappings from './BeaconSensitivityDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IBeaconSensitivityDto_SourceProps & IBeaconSensitivityDto_Linkables \n & can be flattened back down to IBeaconSensitivityDto_Api \n*/\nfunction generator(data: Partial): IBeaconSensitivityDto {\n return transformerCreate<\n IBeaconSensitivityDto_Api,\n IBeaconSensitivityDto_SourceProps & IBeaconSensitivityDto_ComputedProps,\n IBeaconSensitivityDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ICountryDto_Api from './CountryDto.api';\nimport type ICountryDto from './CountryDto.if';\nimport type { ICountryDto_ComputedProps, ICountryDto_SourceProps } from './CountryDto.if';\nimport type { ICountryDto_Linkables } from './CountryDto.link';\nimport linkables from './CountryDto.link';\nimport mappings from './CountryDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ICountryDto_SourceProps & ICountryDto_Linkables \n & can be flattened back down to ICountryDto_Api \n*/\nfunction generator(data: Partial): ICountryDto {\n return transformerCreate<\n ICountryDto_Api,\n ICountryDto_SourceProps & ICountryDto_ComputedProps,\n ICountryDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IDeviceAccountDto_Api from './DeviceAccountDto.api';\nimport type IDeviceAccountDto from './DeviceAccountDto.if';\nimport type {\n IDeviceAccountDto_ComputedProps,\n IDeviceAccountDto_SourceProps,\n} from './DeviceAccountDto.if';\nimport type { IDeviceAccountDto_Linkables } from './DeviceAccountDto.link';\nimport linkables from './DeviceAccountDto.link';\nimport mappings from './DeviceAccountDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IDeviceAccountDto_SourceProps & IDeviceAccountDto_Linkables \n & can be flattened back down to IDeviceAccountDto_Api \n*/\nfunction generator(data: Partial): IDeviceAccountDto {\n return transformerCreate<\n IDeviceAccountDto_Api,\n IDeviceAccountDto_SourceProps & IDeviceAccountDto_ComputedProps,\n IDeviceAccountDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFloorPlanDto_Api from './FloorPlanDto.api';\nimport type IFloorPlanDto from './FloorPlanDto.if';\nimport type { IFloorPlanDto_ComputedProps, IFloorPlanDto_SourceProps } from './FloorPlanDto.if';\nimport type { IFloorPlanDto_Linkables } from './FloorPlanDto.link';\nimport linkables from './FloorPlanDto.link';\nimport mappings from './FloorPlanDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFloorPlanDto_SourceProps & IFloorPlanDto_Linkables \n & can be flattened back down to IFloorPlanDto_Api \n*/\nfunction generator(data: Partial): IFloorPlanDto {\n return transformerCreate<\n IFloorPlanDto_Api,\n IFloorPlanDto_SourceProps & IFloorPlanDto_ComputedProps,\n IFloorPlanDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFloorPlanTourDto_Api from './FloorPlanTourDto.api';\nimport type IFloorPlanTourDto from './FloorPlanTourDto.if';\nimport type {\n IFloorPlanTourDto_ComputedProps,\n IFloorPlanTourDto_SourceProps,\n} from './FloorPlanTourDto.if';\nimport type { IFloorPlanTourDto_Linkables } from './FloorPlanTourDto.link';\nimport linkables from './FloorPlanTourDto.link';\nimport mappings from './FloorPlanTourDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFloorPlanDto_SourceProps & IFloorPlanDto_Linkables \n & can be flattened back down to IFloorPlanDto_Api \n*/\nfunction generator(data: Partial): IFloorPlanTourDto {\n return transformerCreate<\n IFloorPlanTourDto_Api,\n IFloorPlanTourDto_SourceProps & IFloorPlanTourDto_ComputedProps,\n IFloorPlanTourDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFloorPlanTranslationDto_Api from './FloorPlanTranslationDto.api';\nimport type IFloorPlanTranslationDto from './FloorPlanTranslationDto.if';\nimport type {\n IFloorPlanTranslationDto_ComputedProps,\n IFloorPlanTranslationDto_SourceProps,\n} from './FloorPlanTranslationDto.if';\nimport type { IFloorPlanTranslationDto_Linkables } from './FloorPlanTranslationDto.link';\nimport linkables from './FloorPlanTranslationDto.link';\nimport mappings from './FloorPlanTranslationDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFloorPlanTranslationDto_SourceProps & IFloorPlanTranslationDto_Linkables \n & can be flattened back down to IFloorPlanTranslationDto_Api \n*/\nfunction generator(data: Partial): IFloorPlanTranslationDto {\n return transformerCreate<\n IFloorPlanTranslationDto_Api,\n IFloorPlanTranslationDto_SourceProps & IFloorPlanTranslationDto_ComputedProps,\n IFloorPlanTranslationDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFontFamilyDto_Api from './FontFamilyDto.api';\nimport type IFontFamilyDto from './FontFamilyDto.if';\nimport type { IFontFamilyDto_ComputedProps, IFontFamilyDto_SourceProps } from './FontFamilyDto.if';\nimport type { IFontFamilyDto_Linkables } from './FontFamilyDto.link';\nimport linkables from './FontFamilyDto.link';\nimport mappings from './FontFamilyDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFontFamilyDto_SourceProps & IFontFamilyDto_Linkables \n & can be flattened back down to IFontFamilyDto_Api \n*/\nfunction generator(data: Partial): IFontFamilyDto {\n return transformerCreate<\n IFontFamilyDto_Api,\n IFontFamilyDto_SourceProps & IFontFamilyDto_ComputedProps,\n IFontFamilyDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFontStyleDto_Api from './FontStyleDto.api';\nimport type IFontStyleDto from './FontStyleDto.if';\nimport type { IFontStyleDto_ComputedProps, IFontStyleDto_SourceProps } from './FontStyleDto.if';\nimport type { IFontStyleDto_Linkables } from './FontStyleDto.link';\nimport linkables from './FontStyleDto.link';\nimport mappings from './FontStyleDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFontStyleDto_SourceProps & IFontStyleDto_Linkables \n & can be flattened back down to IFontStyleDto_Api \n*/\nfunction generator(data: Partial): IFontStyleDto {\n return transformerCreate<\n IFontStyleDto_Api,\n IFontStyleDto_SourceProps & IFontStyleDto_ComputedProps,\n IFontStyleDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFontSizeUnitDto_Api from './FontSizeUnitDto.api';\nimport type IFontSizeUnitDto from './FontSizeUnitDto.if';\nimport type {\n IFontSizeUnitDto_ComputedProps,\n IFontSizeUnitDto_SourceProps,\n} from './FontSizeUnitDto.if';\nimport type { IFontSizeUnitDto_Linkables } from './FontSizeUnitDto.link';\nimport linkables from './FontSizeUnitDto.link';\nimport mappings from './FontSizeUnitDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFontSizeUnitDto_SourceProps & IFontSizeUnitDto_Linkables \n & can be flattened back down to IFontSizeUnitDto_Api \n*/\nfunction generator(data: Partial): IFontSizeUnitDto {\n return transformerCreate<\n IFontSizeUnitDto_Api,\n IFontSizeUnitDto_SourceProps & IFontSizeUnitDto_ComputedProps,\n IFontSizeUnitDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IFontAlignmentDto_Api from './FontAlignmentDto.api';\nimport type IFontAlignmentDto from './FontAlignmentDto.if';\nimport type {\n IFontAlignmentDto_ComputedProps,\n IFontAlignmentDto_SourceProps,\n} from './FontAlignmentDto.if';\nimport type { IFontAlignmentDto_Linkables } from './FontAlignmentDto.link';\nimport linkables from './FontAlignmentDto.link';\nimport mappings from './FontAlignmentDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFontAlignmentDto_SourceProps & IFontAlignmentDto_Linkables \n & can be flattened back down to IFontAlignmentDto_Api \n*/\nfunction generator(data: Partial): IFontAlignmentDto {\n return transformerCreate<\n IFontAlignmentDto_Api,\n IFontAlignmentDto_SourceProps & IFontAlignmentDto_ComputedProps,\n IFontAlignmentDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ILanguageDto_Api from './LanguageDto.api';\nimport type ILanguageDto from './LanguageDto.if';\nimport type { ILanguageDto_ComputedProps, ILanguageDto_SourceProps } from './LanguageDto.if';\nimport type { ILanguageDto_Linkables } from './LanguageDto.link';\nimport linkables from './LanguageDto.link';\nimport mappings from './LanguageDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ILanguageDto_SourceProps & ILanguageDto_Linkables \n & can be flattened back down to ILanguageDto_Api \n*/\nfunction generator(data: Partial): ILanguageDto {\n return transformerCreate<\n ILanguageDto_Api,\n ILanguageDto_SourceProps & ILanguageDto_ComputedProps,\n ILanguageDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IMediumDto_Api from './MediumDto.api';\nimport type IMediumDto from './MediumDto.if';\nimport type { IMediumDto_ComputedProps, IMediumDto_SourceProps } from './MediumDto.if';\nimport type { IMediumDto_Linkables } from './MediumDto.link';\nimport linkables from './MediumDto.link';\nimport mappings from './MediumDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IMediumDto_SourceProps & IMediumDto_Linkables \n & can be flattened back down to IMediumDto_Api \n*/\nfunction generator(data: Partial): IMediumDto {\n return transformerCreate<\n IMediumDto_Api,\n IMediumDto_SourceProps & IMediumDto_ComputedProps,\n IMediumDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IMenuItemDto_Api from './MenuItemDto.api';\nimport type IMenuItemDto from './MenuItemDto.if';\nimport type { IMenuItemDto_ComputedProps, IMenuItemDto_SourceProps } from './MenuItemDto.if';\nimport type { IMenuItemDto_Linkables } from './MenuItemDto.link';\nimport linkables from './MenuItemDto.link';\nimport mappings from './MenuItemDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IMenuItemDto_SourceProps & IMenuItemDto_Linkables \n & can be flattened back down to IMenuItemDto_Api \n*/\nfunction generator(data: Partial): IMenuItemDto {\n return transformerCreate<\n IMenuItemDto_Api,\n IMenuItemDto_SourceProps & IMenuItemDto_ComputedProps,\n IMenuItemDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IMenuItemKeywordDto_Api from './MenuItemKeywordDto.api';\nimport type IMenuItemKeywordDto from './MenuItemKeywordDto.if';\nimport type {\n IMenuItemKeywordDto_ComputedProps,\n IMenuItemKeywordDto_SourceProps,\n} from './MenuItemKeywordDto.if';\nimport type { IMenuItemKeywordDto_Linkables } from './MenuItemKeywordDto.link';\nimport linkables from './MenuItemKeywordDto.link';\nimport mappings from './MenuItemKeywordDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IMenuItemKeywordDto_SourceProps & IMenuItemKeywordDto_Linkables \n & can be flattened back down to IMenuItemKeywordDto_Api \n*/\nfunction generator(data: Partial): IMenuItemKeywordDto {\n return transformerCreate<\n IMenuItemKeywordDto_Api,\n IMenuItemKeywordDto_SourceProps & IMenuItemKeywordDto_ComputedProps,\n IMenuItemKeywordDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IMenuItemTranslationDto_Api from './MenuItemTranslationDto.api';\nimport type IMenuItemTranslationDto from './MenuItemTranslationDto.if';\nimport type {\n IMenuItemTranslationDto_ComputedProps,\n IMenuItemTranslationDto_SourceProps,\n} from './MenuItemTranslationDto.if';\nimport type { IMenuItemTranslationDto_Linkables } from './MenuItemTranslationDto.link';\nimport linkables from './MenuItemTranslationDto.link';\nimport mappings from './MenuItemTranslationDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IMenuItemTranslationDto_SourceProps & IMenuItemTranslationDto_Linkables \n & can be flattened back down to IMenuItemTranslationDto_Api \n*/\nfunction generator(data: Partial): IMenuItemTranslationDto {\n return transformerCreate<\n IMenuItemTranslationDto_Api,\n IMenuItemTranslationDto_SourceProps & IMenuItemTranslationDto_ComputedProps,\n IMenuItemTranslationDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IPinTypeDto_Api from './PinTypeDto.api';\nimport type IPinTypeDto from './PinTypeDto.if';\nimport type { IPinTypeDto_ComputedProps, IPinTypeDto_SourceProps } from './PinTypeDto.if';\nimport type { IPinTypeDto_Linkables } from './PinTypeDto.link';\nimport linkables from './PinTypeDto.link';\nimport mappings from './PinTypeDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IPinTypeDto_SourceProps & IPinTypeDto_Linkables \n & can be flattened back down to IPinTypeDto_Api \n*/\nfunction generator(data: Partial): IPinTypeDto {\n return transformerCreate<\n IPinTypeDto_Api,\n IPinTypeDto_SourceProps & IPinTypeDto_ComputedProps,\n IPinTypeDto_Linkables,\n 'value'\n >('value', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IRoleDto_Api from './RoleDto.api';\nimport type IRoleDto from './RoleDto.if';\nimport type { IRoleDto_ComputedProps, IRoleDto_SourceProps } from './RoleDto.if';\nimport type { IRoleDto_Linkables } from './RoleDto.link';\nimport linkables from './RoleDto.link';\nimport mappings from './RoleDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IRoleDto_SourceProps & IRoleDto_Linkables \n & can be flattened back down to IRoleDto_Api \n*/\nfunction generator(data: Partial): IRoleDto {\n return transformerCreate<\n IRoleDto_Api,\n IRoleDto_SourceProps & IRoleDto_ComputedProps,\n IRoleDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IScreenOrientationDto_Api from './ScreenOrientationDto.api';\nimport type IScreenOrientationDto from './ScreenOrientationDto.if';\nimport type {\n IScreenOrientationDto_ComputedProps,\n IScreenOrientationDto_SourceProps,\n} from './ScreenOrientationDto.if';\nimport type { IScreenOrientationDto_Linkables } from './ScreenOrientationDto.link';\nimport linkables from './ScreenOrientationDto.link';\nimport mappings from './ScreenOrientationDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IScreenOrientationDto_SourceProps & IScreenOrientationDto_Linkables \n & can be flattened back down to IScreenOrientationDto_Api \n*/\nfunction generator(data: Partial): IScreenOrientationDto {\n return transformerCreate<\n IScreenOrientationDto_Api,\n IScreenOrientationDto_SourceProps & IScreenOrientationDto_ComputedProps,\n IScreenOrientationDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteDto_Api from './SiteDto.api';\nimport type ISiteDto from './SiteDto.if';\nimport type { ISiteDto_ComputedProps, ISiteDto_SourceProps } from './SiteDto.if';\nimport type { ISiteDto_Linkables } from './SiteDto.link';\nimport linkables from './SiteDto.link';\nimport mappings from './SiteDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteDto_SourceProps & ISiteDto_Linkables \n & can be flattened back down to ISiteDto_Api \n*/\nfunction generator(data: Partial): ISiteDto {\n return transformerCreate<\n ISiteDto_Api,\n ISiteDto_SourceProps & ISiteDto_ComputedProps,\n ISiteDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteObjectDto_Api from './SiteObjectDto.api';\nimport type ISiteObjectDto from './SiteObjectDto.if';\nimport type { ISiteObjectDto_ComputedProps, ISiteObjectDto_SourceProps } from './SiteObjectDto.if';\nimport type { ISiteObjectDto_Linkables } from './SiteObjectDto.link';\nimport linkables from './SiteObjectDto.link';\nimport mappings from './SiteObjectDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteObjectDto_SourceProps & ISiteObjectDto_Linkables \n & can be flattened back down to ISiteObjectDto_Api \n*/\nfunction generator(data: Partial): ISiteObjectDto {\n return transformerCreate<\n ISiteObjectDto_Api,\n ISiteObjectDto_SourceProps & ISiteObjectDto_ComputedProps,\n ISiteObjectDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteObjectOnFloorPlanDto_Api from './SiteObjectOnFloorPlanDto.api';\nimport type ISiteObjectOnFloorPlanDto from './SiteObjectOnFloorPlanDto.if';\nimport type {\n ISiteObjectOnFloorPlanDto_ComputedProps,\n ISiteObjectOnFloorPlanDto_SourceProps,\n} from './SiteObjectOnFloorPlanDto.if';\nimport type { ISiteObjectOnFloorPlanDto_Linkables } from './SiteObjectOnFloorPlanDto.link';\nimport linkables from './SiteObjectOnFloorPlanDto.link';\nimport mappings from './SiteObjectOnFloorPlanDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteObjectOnFloorPlanDto_SourceProps & ISiteObjectOnFloorPlanDto_Linkables \n & can be flattened back down to ISiteObjectOnFloorPlanDto_Api \n*/\nfunction generator(data: Partial): ISiteObjectOnFloorPlanDto {\n return transformerCreate<\n ISiteObjectOnFloorPlanDto_Api,\n ISiteObjectOnFloorPlanDto_SourceProps & ISiteObjectOnFloorPlanDto_ComputedProps,\n ISiteObjectOnFloorPlanDto_Linkables,\n 'siteObjectId'\n >('siteObjectId', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteObjectKeywordDto_Api from './SiteObjectKeywordDto.api';\nimport type ISiteObjectKeywordDto from './SiteObjectKeywordDto.if';\nimport type {\n ISiteObjectKeywordDto_ComputedProps,\n ISiteObjectKeywordDto_SourceProps,\n} from './SiteObjectKeywordDto.if';\nimport type { ISiteObjectKeywordDto_Linkables } from './SiteObjectKeywordDto.link';\nimport linkables from './SiteObjectKeywordDto.link';\nimport mappings from './SiteObjectKeywordDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteObjectKeywordDto_SourceProps & ISiteObjectKeywordDto_Linkables \n & can be flattened back down to ISiteObjectKeywordDto_Api \n*/\nfunction generator(data: Partial): ISiteObjectKeywordDto {\n return transformerCreate<\n ISiteObjectKeywordDto_Api,\n ISiteObjectKeywordDto_SourceProps & ISiteObjectKeywordDto_ComputedProps,\n ISiteObjectKeywordDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteObjectTranslationDto_Api from './SiteObjectTranslationDto.api';\nimport type ISiteObjectTranslationDto from './SiteObjectTranslationDto.if';\nimport type {\n ISiteObjectTranslationDto_ComputedProps,\n ISiteObjectTranslationDto_SourceProps,\n} from './SiteObjectTranslationDto.if';\nimport type { ISiteObjectTranslationDto_Linkables } from './SiteObjectTranslationDto.link';\nimport linkables from './SiteObjectTranslationDto.link';\nimport mappings from './SiteObjectTranslationDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteObjectTranslationDto_SourceProps & ISiteObjectTranslationDto_Linkables \n & can be flattened back down to ISiteObjectTranslationDto_Api \n*/\nfunction generator(data: Partial): ISiteObjectTranslationDto {\n return transformerCreate<\n ISiteObjectTranslationDto_Api,\n ISiteObjectTranslationDto_SourceProps & ISiteObjectTranslationDto_ComputedProps,\n ISiteObjectTranslationDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteObjectTypeDto_Api from './SiteObjectTypeDto.api';\nimport type ISiteObjectTypeDto from './SiteObjectTypeDto.if';\nimport type {\n ISiteObjectTypeDto_ComputedProps,\n ISiteObjectTypeDto_SourceProps,\n} from './SiteObjectTypeDto.if';\nimport type { ISiteObjectTypeDto_Linkables } from './SiteObjectTypeDto.link';\nimport linkables from './SiteObjectTypeDto.link';\nimport mappings from './SiteObjectTypeDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteObjectTypeDto_SourceProps & ISiteObjectTypeDto_Linkables \n & can be flattened back down to ISiteObjectTypeDto_Api \n*/\nfunction generator(data: Partial): ISiteObjectTypeDto {\n return transformerCreate<\n ISiteObjectTypeDto_Api,\n ISiteObjectTypeDto_SourceProps & ISiteObjectTypeDto_ComputedProps,\n ISiteObjectTypeDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ISiteSupportedLanguageDto_Api from './SiteSupportedLanguageDto.api';\nimport type ISiteSupportedLanguageDto from './SiteSupportedLanguageDto.if';\nimport type {\n ISiteSupportedLanguageDto_ComputedProps,\n ISiteSupportedLanguageDto_SourceProps,\n} from './SiteSupportedLanguageDto.if';\nimport type { ISiteSupportedLanguageDto_Linkables } from './SiteSupportedLanguageDto.link';\nimport linkables from './SiteSupportedLanguageDto.link';\nimport mappings from './SiteSupportedLanguageDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ISiteSupportedLanguageDto_SourceProps & ISiteSupportedLanguageDto_Linkables \n & can be flattened back down to ISiteSupportedLanguageDto_Api \n*/\nfunction generator(data: Partial): ISiteSupportedLanguageDto {\n return transformerCreate<\n ISiteSupportedLanguageDto_Api,\n ISiteSupportedLanguageDto_SourceProps & ISiteSupportedLanguageDto_ComputedProps,\n ISiteSupportedLanguageDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type IStyleDto_Api from './StyleDto.api';\nimport type IStyleDto from './StyleDto.if';\nimport type { IStyleDto_ComputedProps, IStyleDto_SourceProps } from './StyleDto.if';\nimport type { IStyleDto_Linkables } from './StyleDto.link';\nimport linkables from './StyleDto.link';\nimport mappings from './StyleDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IStyleDto_SourceProps & IStyleDto_Linkables \n & can be flattened back down to IStyleDto_Api \n*/\nfunction generator(data: Partial): IStyleDto {\n return transformerCreate<\n IStyleDto_Api,\n IStyleDto_SourceProps & IStyleDto_ComputedProps,\n IStyleDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourDto_Api from './TourDto.api';\nimport type ITourDto from './TourDto.if';\nimport type { ITourDto_ComputedProps, ITourDto_SourceProps } from './TourDto.if';\nimport type { ITourDto_Linkables } from './TourDto.link';\nimport linkables from './TourDto.link';\nimport mappings from './TourDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourDto_SourceProps & ITourDto_Linkables \n & can be flattened back down to ITourDto_Api \n*/\nfunction generator(data: Partial): ITourDto {\n return transformerCreate<\n ITourDto_Api,\n ITourDto_SourceProps & ITourDto_ComputedProps,\n ITourDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourMenuItemDto_Api from './TourMenuItemDto.api';\nimport type ITourMenuItemDto from './TourMenuItemDto.if';\nimport type {\n ITourMenuItemDto_ComputedProps,\n ITourMenuItemDto_SourceProps,\n} from './TourMenuItemDto.if';\nimport type { ITourMenuItemDto_Linkables } from './TourMenuItemDto.link';\nimport linkables from './TourMenuItemDto.link';\nimport mappings from './TourMenuItemDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourMenuItemDto_SourceProps & ITourMenuItemDto_Linkables \n & can be flattened back down to ITourMenuItemDto_Api \n*/\nfunction generator(data: Partial): ITourMenuItemDto {\n return transformerCreate<\n ITourMenuItemDto_Api,\n ITourMenuItemDto_SourceProps & ITourMenuItemDto_ComputedProps,\n ITourMenuItemDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourRelatedSiteObjectDto_Api from './TourRelatedSiteObjectDto.api';\nimport type ITourRelatedSiteObjectDto from './TourRelatedSiteObjectDto.if';\nimport type {\n ITourRelatedSiteObjectDto_ComputedProps,\n ITourRelatedSiteObjectDto_SourceProps,\n} from './TourRelatedSiteObjectDto.if';\nimport type { ITourRelatedSiteObjectDto_Linkables } from './TourRelatedSiteObjectDto.link';\nimport linkables from './TourRelatedSiteObjectDto.link';\nimport mappings from './TourRelatedSiteObjectDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourRelatedSiteObjectDto_SourceProps & ITourRelatedSiteObjectDto_Linkables \n & can be flattened back down to ITourRelatedSiteObjectDto_Api \n*/\nfunction generator(data: Partial): ITourRelatedSiteObjectDto {\n return transformerCreate<\n ITourRelatedSiteObjectDto_Api,\n ITourRelatedSiteObjectDto_SourceProps & ITourRelatedSiteObjectDto_ComputedProps,\n ITourRelatedSiteObjectDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourStatusDto_Api from './TourStatusDto.api';\nimport type ITourStatusDto from './TourStatusDto.if';\nimport type { ITourStatusDto_ComputedProps, ITourStatusDto_SourceProps } from './TourStatusDto.if';\nimport type { ITourStatusDto_Linkables } from './TourStatusDto.link';\nimport linkables from './TourStatusDto.link';\nimport mappings from './TourStatusDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourStatusDto_SourceProps & ITourStatusDto_Linkables \n & can be flattened back down to ITourStatusDto_Api \n*/\nfunction generator(data: Partial): ITourStatusDto {\n return transformerCreate<\n ITourStatusDto_Api,\n ITourStatusDto_SourceProps & ITourStatusDto_ComputedProps,\n ITourStatusDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourSubTypeDto_Api from './TourSubTypeDto.api';\nimport type ITourSubTypeDto from './TourSubTypeDto.if';\nimport type {\n ITourSubTypeDto_ComputedProps,\n ITourSubTypeDto_SourceProps,\n} from './TourSubTypeDto.if';\nimport type { ITourSubTypeDto_Linkables } from './TourSubTypeDto.link';\nimport linkables from './TourSubTypeDto.link';\nimport mappings from './TourSubTypeDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourSubTypeDto_SourceProps & ITourSubTypeDto_Linkables \n & can be flattened back down to ITourSubTypeDto_Api \n*/\nfunction generator(data: Partial): ITourSubTypeDto {\n return transformerCreate<\n ITourSubTypeDto_Api,\n ITourSubTypeDto_SourceProps & ITourSubTypeDto_ComputedProps,\n ITourSubTypeDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourTranslationDto_Api from './TourTranslationDto.api';\nimport type ITourTranslationDto from './TourTranslationDto.if';\nimport type {\n ITourTranslationDto_ComputedProps,\n ITourTranslationDto_SourceProps,\n} from './TourTranslationDto.if';\nimport type { ITourTranslationDto_Linkables } from './TourTranslationDto.link';\nimport linkables from './TourTranslationDto.link';\nimport mappings from './TourTranslationDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourTranslationDto_SourceProps & ITourTranslationDto_Linkables \n & can be flattened back down to ITourTranslationDto_Api \n*/\nfunction generator(data: Partial): ITourTranslationDto {\n return transformerCreate<\n ITourTranslationDto_Api,\n ITourTranslationDto_SourceProps & ITourTranslationDto_ComputedProps,\n ITourTranslationDto_Linkables,\n 'tourSupportedLanguageId'\n >('tourSupportedLanguageId', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourTypeDto_Api from './TourTypeDto.api';\nimport type ITourTypeDto from './TourTypeDto.if';\nimport type { ITourTypeDto_ComputedProps, ITourTypeDto_SourceProps } from './TourTypeDto.if';\nimport type { ITourTypeDto_Linkables } from './TourTypeDto.link';\nimport linkables from './TourTypeDto.link';\nimport mappings from './TourTypeDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourTypeDto_SourceProps & ITourTypeDto_Linkables \n & can be flattened back down to ITourTypeDto_Api \n*/\nfunction generator(data: Partial): ITourTypeDto {\n return transformerCreate<\n ITourTypeDto_Api,\n ITourTypeDto_SourceProps & ITourTypeDto_ComputedProps,\n ITourTypeDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport type ITourSupportedLanguageDto_Api from './TourSupportedLanguageDto.api';\nimport type ITourSupportedLanguageDto from './TourSupportedLanguageDto.if';\nimport type {\n ITourSupportedLanguageDto_ComputedProps,\n ITourSupportedLanguageDto_SourceProps,\n} from './TourSupportedLanguageDto.if';\nimport type { ITourSupportedLanguageDto_Linkables } from './TourSupportedLanguageDto.link';\nimport linkables from './TourSupportedLanguageDto.link';\nimport mappings from './TourSupportedLanguageDto.map';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & ITourSupportedLanguageDto_SourceProps & ITourSupportedLanguageDto_Linkables \n & can be flattened back down to ITourSupportedLanguageDto_Api \n*/\nfunction generator(data: Partial): ITourSupportedLanguageDto {\n return transformerCreate<\n ITourSupportedLanguageDto_Api,\n ITourSupportedLanguageDto_SourceProps & ITourSupportedLanguageDto_ComputedProps,\n ITourSupportedLanguageDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import transformerCreate from '../private/create';\nimport mappings from './FloorPlanDto.map';\nimport type ILegacy_FloorPlanDto_Api from './Legacy_FloorPlanDto.api';\nimport type ILegacy_FloorPlanDto from './Legacy_FloorPlanDto.if';\nimport type {\n ILegacy_FloorPlanDto_ComputedProps,\n ILegacy_FloorPlanDto_SourceProps,\n} from './Legacy_FloorPlanDto.if';\nimport type { ILegacy_FloorPlanDto_Linkables } from './Legacy_FloorPlanDto.link';\nimport linkables from './Legacy_FloorPlanDto.link';\n\n/** \n * @description pass in the data from the api response & build\n an object that responds to BaseDto & IFloorPlanDto_SourceProps & IFloorPlanDto_Linkables \n & can be flattened back down to IFloorPlanDto_Api \n*/\nfunction generator(data: Partial): ILegacy_FloorPlanDto {\n return transformerCreate<\n ILegacy_FloorPlanDto_Api,\n ILegacy_FloorPlanDto_SourceProps & ILegacy_FloorPlanDto_ComputedProps,\n ILegacy_FloorPlanDto_Linkables,\n 'id'\n >('id', mappings, linkables(data), data);\n}\n\nexport default generator;\n","import type BaseDto from '../../model/interface/IBaseDto';\nimport type { INSTANTIATOR_INTERFACES } from '../../model/interface/instantiator';\nimport instantiator from '../../model/util/instantiator';\nimport type { ITable } from '../../private/db/interface';\nimport type { IWorkspaceTable } from '../interface/table';\n\n/* Api data from serve response for type of Interface */\ntype ApiData = Parameters<\n INSTANTIATOR_INTERFACES[Interface]\n>[0];\n\nfunction _isEntity(object: unknown): object is BaseDto {\n if (object === null || object === undefined || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial> = object as Record;\n\n return (\n typeof record.flatten === 'function' &&\n typeof record.apply === 'function' &&\n typeof record.mappings === 'function'\n );\n}\n\nclass ContainerTable<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Constructor extends INSTANTIATOR_INTERFACES[Interface],\n Entity extends ReturnType,\n> implements IWorkspaceTable\n{\n private _table: ITable, keyof ApiData>;\n\n private _entityName: Interface;\n\n constructor(options: {\n table: ITable, keyof ApiData>;\n name: keyof INSTANTIATOR_INTERFACES;\n }) {\n this._table = options.table;\n this._entityName = options.name as Interface;\n }\n\n count(): Promise {\n return this._table.count();\n }\n\n async first(): Promise {\n const table = this._table;\n const entityName = this._entityName;\n const items = (await table.toArray()) as Partial>[];\n const primaryItem = items.at(0);\n\n if (items.length === 0 || !primaryItem) {\n throw new Error('No items found');\n }\n\n const item = instantiator.instantiate(entityName, primaryItem) as Entity | undefined;\n\n if (!item) {\n throw new Error(`Failed to instantiate element ${entityName}`);\n }\n\n return item;\n }\n\n async get>(pk: Key): Promise {\n const table = this._table;\n const entityName: Interface = this._entityName;\n const data = (await table.get(pk)) as Partial> | undefined;\n\n if (!data) {\n throw new Error(`Unable to instantiate item for pk:${String(pk)}`);\n }\n\n const item = instantiator.instantiate(entityName, data);\n\n return item as Entity;\n }\n\n async all(): Promise {\n const table = this._table;\n const entityName = this._entityName;\n\n const array = (await table.toArray()) as Partial>[];\n\n const items: Entity[] = [];\n for (const x of array) {\n const item = instantiator.instantiate(entityName, x) as Entity | undefined;\n\n if (item) {\n items.push(item);\n }\n }\n\n return items;\n }\n\n async bulkAddOrUpdate(items: Readonly<(ApiData | Entity)[]>): Promise {\n const table = this._table;\n\n const insItems: ApiData[] = items.map(item =>\n _isEntity(item) ? item.flatten() : item,\n );\n\n await table.bulkAddOrUpdate(insItems);\n }\n}\n\nfunction ctor<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Constructor extends INSTANTIATOR_INTERFACES[Interface],\n Entity extends ReturnType,\n>(\n name: Interface,\n table: ITable, keyof ApiData>,\n): IWorkspaceTable {\n const object = new ContainerTable({\n name,\n table,\n });\n\n return object as IWorkspaceTable;\n}\n\nexport default ctor;\n","import type {\n IModelInstantiator,\n INSTANTIATOR_INTERFACES,\n} from '../../model/interface/instantiator';\nimport database from '../../private/db';\nimport type { IDB } from '../../private/db/interface';\nimport type { IWorkspaceDB } from '../interface/db';\nimport type { IDBOptions } from '../interface/instantiator';\nimport type { IWorkspaceTable } from '../interface/table';\nimport type { DataMap, IDBVersionMigrator } from '../private/migration/interface';\nimport tableConstructor from './table';\n\n/* Api data from serve response for type of Interface */\ntype ApiData = Parameters<\n INSTANTIATOR_INTERFACES[Interface]\n>[0];\n\nclass ContainerDB implements IWorkspaceDB {\n name = '';\n\n private _db: IDB;\n\n private _openCount = 0;\n\n private _modelInstantiator: IModelInstantiator;\n\n private _migrators: IDBVersionMigrator[];\n\n constructor(\n modelInstantiator: IModelInstantiator,\n migrators: IDBVersionMigrator[],\n database_: IDB,\n ) {\n this._db = database_;\n\n for (const migrator of migrators.sort((itemA, itemB) => itemA.version - itemB.version)) {\n const storesTask = migrator.mappingsChanges ?? {};\n const upgradeTask = migrator.upgrade ?? (() => Promise.resolve());\n\n this._db.version(migrator.version).stores(storesTask).upgrade(upgradeTask);\n }\n\n this._modelInstantiator = modelInstantiator;\n this._migrators = migrators;\n this.name = this._db.name;\n }\n\n async open(): Promise {\n this._openCount += 1;\n if (this._openCount <= 1) {\n await this._db.open();\n }\n\n return this;\n }\n\n close(): void {\n if (this._db && this.isOpen() && this._openCount <= 1) {\n this._db.close();\n }\n\n this._openCount = Math.max(0, this._openCount - 1);\n }\n\n isOpen(): boolean {\n return this._db.isOpen() ?? false;\n }\n\n preInsertCleanup(dataIn: DataMap): DataMap {\n let dataOut = dataIn;\n\n for (const migrator of this._migrators) {\n dataOut = migrator.preInsertCleanup?.(dataOut) ?? dataOut;\n }\n\n return dataOut;\n }\n\n table<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Constructor extends INSTANTIATOR_INTERFACES[Interface],\n Entity extends ReturnType,\n >(\n tableName: Interface,\n ): IWorkspaceTable {\n const table = this._db.table, keyof ApiData>(tableName);\n return tableConstructor(tableName, table);\n }\n\n first<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n >(tableName: Interface): Promise {\n if (!tableName) {\n return Promise.reject(new Error('No Table to search with'));\n }\n\n const database_ = this._db;\n const instantiator = this._modelInstantiator.instantiate;\n\n return new Promise((resolve, reject) => {\n database_\n .table(tableName)\n .toArray()\n .then(items => {\n const [item] = items;\n if (item) {\n const object = instantiator(tableName, item);\n resolve(object as Entity);\n } else {\n reject(new Error(`No items found in table: ${tableName}`));\n }\n })\n .catch((error: Error) => {\n reject(error);\n });\n });\n }\n\n async get<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n PrimaryKey extends ReturnType,\n >(tableName: Interface, pk: PrimaryKey): Promise {\n if (!pk) {\n return Promise.reject(new Error(`No PK to search with, table:${tableName}`));\n }\n\n const database_ = this._db;\n const instantiator = this._modelInstantiator.instantiate;\n\n const data = (await database_.table(tableName).get(pk)) as Entity | undefined;\n\n if (data && typeof data === 'object') {\n const item = instantiator(tableName, data);\n return item as Entity;\n } else {\n throw new Error(`No data found in ${tableName} matching pk:${pk.toString()}`);\n }\n }\n\n async all<\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n >(tableName: Interface): Promise {\n if (!tableName) {\n return Promise.reject(new Error('No Table to search with'));\n }\n\n const database_ = this._db;\n const instantiator = this._modelInstantiator.instantiate;\n\n const itemsData = await database_.table(tableName).toArray();\n\n const items: Entity[] = itemsData.map(itemData => instantiator(tableName, itemData));\n\n return items;\n }\n\n flatten(): Promise {\n return this._db.flatten();\n }\n\n apply(data: string): Promise {\n return this._db.apply(data);\n }\n}\n\nasync function create(\n modelInstantiator: IModelInstantiator,\n migrators: IDBVersionMigrator[],\n options: IDBOptions = {},\n): Promise {\n const databaseMigrator = migrators[migrators.length - 1];\n\n const database_ = await database().open(options.name ?? 'Workspace', {\n version: databaseMigrator?.version ?? 1,\n mappings: databaseMigrator?.mappingsChanges ?? {},\n });\n\n const controller = new ContainerDB(modelInstantiator, migrators, database_);\n\n return controller;\n}\n\nexport default create;\n","import type { IModelInstantiator } from '../../model/interface/instantiator';\nimport type { IWorkspaceDB } from '../interface/db';\nimport type { IDBOptions } from '../interface/instantiator';\nimport type { IDBVersionMigrator } from '../private/migration/interface';\nimport containerDB from './db';\n\ninterface IControllerDB {\n openCount: number;\n db: IWorkspaceDB;\n open: () => Promise;\n close: () => void;\n isOpen: () => boolean;\n}\n\nasync function _open(this: IControllerDB): Promise {\n this.openCount += 1;\n\n if (this.isOpen() && this.openCount > 1) {\n return Promise.resolve(this.db); /* Already open */\n }\n\n const db = this.db;\n\n const dbOpen = await db.open();\n\n return dbOpen;\n}\n\nfunction _close(this: IControllerDB): void {\n this.openCount = Math.max(0, this.openCount - 1);\n\n if (this.isOpen() && this.openCount <= 0) {\n this.db.close();\n }\n}\n\nfunction _isOpen(this: IControllerDB): boolean {\n return this.db.isOpen();\n}\n\nasync function _newController(\n modelInstantiator: IModelInstantiator,\n migrators: IDBVersionMigrator[],\n options: IDBOptions,\n): Promise {\n const db = await containerDB(modelInstantiator, migrators, options);\n\n const controller: IControllerDB = {\n openCount: 0,\n db,\n open: _open,\n close: _close,\n isOpen: _isOpen,\n };\n\n return controller;\n}\n\nconst records: Record = {};\n\nasync function instantiator(\n modelInstantiator: IModelInstantiator,\n migrators: IDBVersionMigrator[],\n options: IDBOptions & { noCache?: boolean },\n): Promise {\n const recordName = options.name ?? '';\n const existing = records[recordName];\n\n if (existing && !options.noCache) {\n return existing.db;\n }\n\n const controller = await _newController(modelInstantiator, migrators, options);\n /* eslint-disable-next-line require-atomic-updates */\n records[recordName] = controller;\n\n return controller.db;\n}\n\nexport default instantiator;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectModelInstantiator, TYPES as MODEL_TYPES } from '../../model/interface/bind';\nimport {\n bindWorkspaceDB,\n injectWorkspaceDB,\n TYPES as DB_TYPES,\n unbindWorkspaceDB,\n} from '../interface/bind';\nimport type { IDBOptions, IWorkspaceDBInstantiator } from '../interface/instantiator';\nimport migration from '../private/migration';\nimport instantiator from './instantiator';\n\nfunction _build(container: IContainer): Readonly {\n const modelInstantiator = injectModelInstantiator(container);\n const migrators = [...migration.versions];\n\n return Object.freeze({\n open: (options: IDBOptions) => instantiator(modelInstantiator, migrators, options),\n });\n}\n\nexport default buildBindable({\n id: DB_TYPES.IWorkspaceDBInstantiate,\n dependencies: [MODEL_TYPES.IModelInstantiator],\n bind: bindWorkspaceDB,\n remove: unbindWorkspaceDB,\n build: container => Promise.resolve(_build(container)),\n inject: injectWorkspaceDB,\n});\n","import { buildBinderListings } from '@monofe/di';\nimport dbInst from '../impl/instantiator.bind';\n\nexport default buildBinderListings([dbInst]);\n","import type { IProgressPromise, IProgressPromiseGenerator } from '@monofe/util';\nimport type { IMediaManager } from '../../controller/interface';\nimport type { IMediumDto } from '../../model';\n\nfunction _isMedium(object: unknown): object is IMediumDto {\n if (object === null || object === undefined || typeof object !== 'object') {\n return false;\n }\n const record: Partial = object as Partial;\n\n /* Force to boolean type */\n return Boolean(record.apply && record.flatten && record.mappings);\n}\n\nasync function _removeMedia(\n manager: IMediaManager,\n media: (IMediumDto | string)[],\n onProgressCallback: (progress: number) => void,\n) {\n const mediaIds = media.map(item => (_isMedium(item) ? item.id : item));\n const progressPerItem = 1 / mediaIds.length;\n for (const [index, mediaId] of mediaIds.entries()) {\n await manager.removeMediumCache(mediaId);\n onProgressCallback(index * progressPerItem);\n }\n}\n\nfunction removeMedia(\n promiser: IProgressPromiseGenerator,\n manager: IMediaManager,\n media: (IMediumDto | string)[],\n): IProgressPromise {\n return promiser.promise((resolve, reject, progress) => {\n _removeMedia(manager, media, progress)\n .then(() => {\n resolve();\n })\n .catch(error => {\n reject(error);\n });\n });\n}\n\nexport default removeMedia;\n","import type { IContainer } from '@monofe/di';\nimport type { IProgressPromise } from '@monofe/util';\nimport { injectProgressPromise } from '@monofe/util';\nimport type { IMediaManager } from '../../controller/interface';\nimport type { IMediumDto } from '../../model';\nimport mediaDelete from './delete';\n\nexport default function build(\n container: IContainer,\n): (manager: IMediaManager, media: (IMediumDto | string)[]) => IProgressPromise {\n const promiser = injectProgressPromise(container);\n\n return (manager: IMediaManager, media: (IMediumDto | string)[]) =>\n mediaDelete(promiser, manager, media);\n}\n","import type { IProgressPromise, IProgressPromiseGenerator } from '@monofe/util';\nimport type { IMediaAPI } from '../../api/interface/media';\nimport type { IAuthenticationManager } from '../../controller/interface/auth';\nimport type { IMediumDto } from '../../model';\nimport { log } from '../../private';\n\ninterface IMediaResponseType {\n Blob: Blob;\n ArrayBuffer: ArrayBuffer;\n none: undefined;\n}\n\nconst DEFAULT_MEDIUM_SIZE = 5242880; /* 5MiB */\n\nconst _clamp = (value: number, min: number, max: number): number =>\n Math.max(Math.min(value, max), min);\n\nfunction _isMediumDto(object: unknown): object is IMediumDto {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.id) &&\n !isNullOrUndefined(record.mediumHash) &&\n !isNullOrUndefined(record.fileName) &&\n !isNullOrUndefined(record.mimeType) &&\n !isNullOrUndefined(record.mediumSize)\n );\n}\n\nexport function download(\n promiser: IProgressPromiseGenerator,\n mediaAPI: () => IMediaAPI[],\n type: K,\n media: (IMediumDto | string)[],\n auth: IAuthenticationManager,\n): IProgressPromise {\n return promiser.promise(async (resolve, reject, progressCb) => {\n const accessToken = await auth.renew();\n let fetchError: string | null = null;\n\n progressCb(0.01);\n\n const totalBytesToDownload = media.reduce(\n (total: number, medium: IMediumDto | string) =>\n total + (_isMediumDto(medium) ? medium.mediumSize : DEFAULT_MEDIUM_SIZE),\n 0,\n );\n\n const responses: V[] = [];\n\n let progressUptoThisFetch = 0; /* As we loop through keep a running counter of all weightings up to this point */\n\n /* Download each fetch in order sequentially */\n for (const medium of media) {\n const mediaId = _isMediumDto(medium) ? medium.id : medium;\n const mediumSize = _isMediumDto(medium) ? medium.mediumSize : DEFAULT_MEDIUM_SIZE;\n\n /* How much is this request worth overall to the progress */\n const progressWeighting = mediumSize / totalBytesToDownload;\n\n /* Fix warning: https://eslint.org/docs/rules/no-loop-func */\n const progressCounterSoFar = progressUptoThisFetch;\n\n const parameters = { accessToken };\n\n const fetchers: (() => IProgressPromise | null)[] = mediaAPI().map(\n api => () => api.getMedia(type, mediaId, parameters),\n );\n\n const fetchErrors: unknown[] = [];\n\n let result: V | null = null;\n\n for (const fetchLoader of fetchers) {\n const fetcher = fetchLoader();\n\n fetcher?.onProgress(progressNow => {\n const newProgress = progressCounterSoFar + progressNow * progressWeighting;\n progressCb(_clamp(newProgress, 0, 1));\n });\n\n try {\n result = await fetcher;\n\n if (type === 'Blob' && result) {\n responses.push(result);\n }\n\n progressUptoThisFetch += progressWeighting;\n\n progressCb(_clamp(progressUptoThisFetch, 0, 1));\n\n break; /* We're done, skip over rest of fetchers & move to next medium download */\n } catch (error) {\n fetchErrors.push(error);\n continue;\n }\n }\n\n if (fetchErrors.length > 0 && !result) {\n fetchError = `Download all media failed: ${JSON.stringify(fetchErrors)}`;\n log.error(fetchError);\n }\n }\n\n if (fetchError && fetchError.length > 0) {\n throw new Error(fetchError ?? 'Download all media failed');\n }\n\n return responses;\n });\n}\n\nexport default download;\n","import type { IContainer } from '@monofe/di';\nimport type { IProgressPromise } from '@monofe/util';\nimport { injectProgressPromise } from '@monofe/util';\nimport { injectMediaAPI } from '../../api/interface/bind';\nimport type { IAuthenticationManager } from '../../controller/interface/auth';\nimport type { IMediumDto } from '../../model';\nimport download from './download';\n\nfunction downloadMedia(\n container: IContainer,\n): (media: (IMediumDto | string)[], auth: IAuthenticationManager) => IProgressPromise {\n const promiser = injectProgressPromise(container);\n const mediaAPI = () => injectMediaAPI(container);\n\n return (media: (IMediumDto | string)[], auth: IAuthenticationManager) =>\n download(promiser, mediaAPI, 'Blob', media, auth);\n}\n\nfunction downloadMediaNoResponse(\n container: IContainer,\n): (media: (IMediumDto | string)[], auth: IAuthenticationManager) => IProgressPromise {\n const promiser = injectProgressPromise(container);\n const mediaAPI = () => injectMediaAPI(container);\n\n return (media: (IMediumDto | string)[], auth: IAuthenticationManager) =>\n download(promiser, mediaAPI, 'none', media, auth);\n}\n\nexport default Object.freeze({\n downloadMedia,\n downloadMediaNoResponse,\n});\n","/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2022 Joachim Wester\n * MIT licensed\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function hasOwnProperty(obj, key) {\n return _hasOwnProperty.call(obj, key);\n}\nexport function _objectKeys(obj) {\n if (Array.isArray(obj)) {\n var keys_1 = new Array(obj.length);\n for (var k = 0; k < keys_1.length; k++) {\n keys_1[k] = \"\" + k;\n }\n return keys_1;\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keys = [];\n for (var i in obj) {\n if (hasOwnProperty(obj, i)) {\n keys.push(i);\n }\n }\n return keys;\n}\n;\n/**\n* Deeply clone the object.\n* https://jsperf.com/deep-copy-vs-json-stringify-json-parse/25 (recursiveDeepCopy)\n* @param {any} obj value to clone\n* @return {any} cloned obj\n*/\nexport function _deepClone(obj) {\n switch (typeof obj) {\n case \"object\":\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case \"undefined\":\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n}\n//3x faster than cached /^\\d+$/.test(str)\nexport function isInteger(str) {\n var i = 0;\n var len = str.length;\n var charCode;\n while (i < len) {\n charCode = str.charCodeAt(i);\n if (charCode >= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n}\n/**\n* Escapes a json pointer path\n* @param path The raw pointer\n* @return the Escaped path\n*/\nexport function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n/**\n * Unescapes a json pointer path\n * @param path The escaped pointer\n * @return The unescaped path\n */\nexport function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n}\nexport function _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (hasOwnProperty(root, key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n }\n else if (typeof root[key] === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n}\nexport function getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new Error(\"Object not found in root\");\n }\n return \"/\" + path;\n}\n/**\n* Recursively checks whether an object has any undefined values inside.\n*/\nexport function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (obj) {\n if (Array.isArray(obj)) {\n for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {\n if (hasUndefined(obj[i_1])) {\n return true;\n }\n }\n }\n else if (typeof obj === \"object\") {\n var objKeys = _objectKeys(obj);\n var objKeysLength = objKeys.length;\n for (var i = 0; i < objKeysLength; i++) {\n if (hasUndefined(obj[objKeys[i]])) {\n return true;\n }\n }\n }\n }\n return false;\n}\nfunction patchErrorMessageFormatter(message, args) {\n var messageParts = [message];\n for (var key in args) {\n var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print\n if (typeof value !== 'undefined') {\n messageParts.push(key + \": \" + value);\n }\n }\n return messageParts.join('\\n');\n}\nvar PatchError = /** @class */ (function (_super) {\n __extends(PatchError, _super);\n function PatchError(message, name, index, operation, tree) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this;\n _this.name = name;\n _this.index = index;\n _this.operation = operation;\n _this.tree = tree;\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359\n _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree });\n return _this;\n }\n return PatchError;\n}(Error));\nexport { PatchError };\n","import { PatchError, _deepClone, isInteger, unescapePathComponent, hasUndefined } from './helpers.mjs';\nexport var JsonPatchError = PatchError;\nexport var deepClone = _deepClone;\n/* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n/* The operations applicable to an object */\nvar objOps = {\n add: function (obj, key, document) {\n obj[key] = this.value;\n return { newDocument: document };\n },\n remove: function (obj, key, document) {\n var removed = obj[key];\n delete obj[key];\n return { newDocument: document, removed: removed };\n },\n replace: function (obj, key, document) {\n var removed = obj[key];\n obj[key] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: function (obj, key, document) {\n /* in case move target overwrites an existing value,\n return the removed value, this can be taxing performance-wise,\n and is potentially unneeded */\n var removed = getValueByPointer(document, this.path);\n if (removed) {\n removed = _deepClone(removed);\n }\n var originalValue = applyOperation(document, { op: \"remove\", path: this.from }).removed;\n applyOperation(document, { op: \"add\", path: this.path, value: originalValue });\n return { newDocument: document, removed: removed };\n },\n copy: function (obj, key, document) {\n var valueToCopy = getValueByPointer(document, this.from);\n // enforce copy by value so further operations don't affect source (see issue #177)\n applyOperation(document, { op: \"add\", path: this.path, value: _deepClone(valueToCopy) });\n return { newDocument: document };\n },\n test: function (obj, key, document) {\n return { newDocument: document, test: _areEquals(obj[key], this.value) };\n },\n _get: function (obj, key, document) {\n this.value = obj[key];\n return { newDocument: document };\n }\n};\n/* The operations applicable to an array. Many are the same as for the object */\nvar arrOps = {\n add: function (arr, i, document) {\n if (isInteger(i)) {\n arr.splice(i, 0, this.value);\n }\n else { // array props\n arr[i] = this.value;\n }\n // this may be needed when using '-' in an array\n return { newDocument: document, index: i };\n },\n remove: function (arr, i, document) {\n var removedList = arr.splice(i, 1);\n return { newDocument: document, removed: removedList[0] };\n },\n replace: function (arr, i, document) {\n var removed = arr[i];\n arr[i] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n};\n/**\n * Retrieves a value from a JSON document by a JSON pointer.\n * Returns the value.\n *\n * @param document The document to get the value from\n * @param pointer an escaped JSON pointer\n * @return The retrieved value\n */\nexport function getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = { op: \"_get\", path: pointer };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the {newDocument, result} of the operation.\n * It modifies the `document` and `operation` objects - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return `{newDocument, result}` after the operation\n */\nexport function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {\n if (validateOperation === void 0) { validateOperation = false; }\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (index === void 0) { index = 0; }\n if (validateOperation) {\n if (typeof validateOperation == 'function') {\n validateOperation(operation, 0, document, operation.path);\n }\n else {\n validator(operation, 0);\n }\n }\n /* ROOT OPERATIONS */\n if (operation.path === \"\") {\n var returnValue = { newDocument: document };\n if (operation.op === 'add') {\n returnValue.newDocument = operation.value;\n return returnValue;\n }\n else if (operation.op === 'replace') {\n returnValue.newDocument = operation.value;\n returnValue.removed = document; //document we removed\n return returnValue;\n }\n else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root\n returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field\n if (operation.op === 'move') { // report removed item\n returnValue.removed = document;\n }\n return returnValue;\n }\n else if (operation.op === 'test') {\n returnValue.test = _areEquals(document, operation.value);\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n returnValue.newDocument = document;\n return returnValue;\n }\n else if (operation.op === 'remove') { // a remove on root\n returnValue.removed = document;\n returnValue.newDocument = null;\n return returnValue;\n }\n else if (operation.op === '_get') {\n operation.value = document;\n return returnValue;\n }\n else { /* bad operation */\n if (validateOperation) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else {\n return returnValue;\n }\n }\n } /* END ROOT OPERATIONS */\n else {\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var path = operation.path || \"\";\n var keys = path.split('/');\n var obj = document;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n var key = void 0;\n var validateFunction = void 0;\n if (typeof validateOperation == 'function') {\n validateFunction = validateOperation;\n }\n else {\n validateFunction = validator;\n }\n while (true) {\n key = keys[t];\n if (key && key.indexOf('~') != -1) {\n key = unescapePathComponent(key);\n }\n if (banPrototypeModifications &&\n (key == '__proto__' ||\n (key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {\n throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');\n }\n if (validateOperation) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n }\n else if (t == len - 1) {\n existingPathFragment = operation.path;\n }\n if (existingPathFragment !== undefined) {\n validateFunction(operation, 0, document, existingPathFragment);\n }\n }\n }\n t++;\n if (Array.isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n }\n else {\n if (validateOperation && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", index, operation, document);\n } // only parse key when it's an integer for `arr.prop` to work\n else if (isInteger(key)) {\n key = ~~key;\n }\n }\n if (t >= len) {\n if (validateOperation && operation.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", index, operation, document);\n }\n var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n else {\n if (t >= len) {\n var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n obj = obj[key];\n // If we have more keys in the path, but the next value isn't a non-null object,\n // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.\n if (validateOperation && t < len && (!obj || typeof obj !== \"object\")) {\n throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Apply a full JSON Patch array on a JSON document.\n * Returns the {newDocument, result} of the patch.\n * It modifies the `document` object and `patch` - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.\n *\n * @param document The document to patch\n * @param patch The patch to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return An array of `{newDocument, result}` after the patch\n */\nexport function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (validateOperation) {\n if (!Array.isArray(patch)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n }\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var results = new Array(patch.length);\n for (var i = 0, length_1 = patch.length; i < length_1; i++) {\n // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`\n results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);\n document = results[i].newDocument; // in case root was replaced\n }\n results.newDocument = document;\n return results;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the updated document.\n * Suitable as a reducer.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @return The updated document\n */\nexport function applyReducer(document, operation, index) {\n var operationResult = applyOperation(document, operation);\n if (operationResult.test === false) { // failed test\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return operationResult.newDocument;\n}\n/**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [document] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `document`\n */\nexport function validator(operation, index, document, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);\n }\n else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {\n // paths that aren't empty string should start with \"/\"\n throw new JsonPatchError('Operation `path` property must start with \"/\"', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);\n }\n else if (document) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);\n }\n }\n else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = validate([existingValue], document);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param document\n * @returns {JsonPatchError|undefined}\n */\nexport function validate(sequence, document, externalValidator) {\n try {\n if (!Array.isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (document) {\n //clone document and sequence so that we can safely try applying operations\n applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);\n }\n else {\n externalValidator = externalValidator || validator;\n for (var i = 0; i < sequence.length; i++) {\n externalValidator(sequence[i], i, document, undefined);\n }\n }\n }\n catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n }\n else {\n throw e;\n }\n }\n}\n// based on https://github.com/epoberezkin/fast-deep-equal\n// MIT License\n// Copyright (c) 2017 Evgeny Poberezkin\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\nexport function _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n}\n;\n","/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\nimport { _deepClone, _objectKeys, escapePathComponent, hasOwnProperty } from './helpers.mjs';\nimport { applyPatch } from './core.mjs';\nvar beforeDict = new WeakMap();\nvar Mirror = /** @class */ (function () {\n function Mirror(obj) {\n this.observers = new Map();\n this.obj = obj;\n }\n return Mirror;\n}());\nvar ObserverInfo = /** @class */ (function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n}());\nfunction getMirror(obj) {\n return beforeDict.get(obj);\n}\nfunction getObserverFromMirror(mirror, callback) {\n return mirror.observers.get(callback);\n}\nfunction removeObserverFromMirror(mirror, observer) {\n mirror.observers.delete(observer.callback);\n}\n/**\n * Detach an observer from an object\n */\nexport function unobserve(root, observer) {\n observer.unobserve();\n}\n/**\n * Observes changes made to an object, which can then be retrieved using generate\n */\nexport function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n }\n else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = _deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') { //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n}\n/**\n * Generate an array of patches from an observer\n */\nexport function generate(observer, invertible) {\n if (invertible === void 0) { invertible = false; }\n var mirror = beforeDict.get(observer.object);\n _generate(mirror.value, observer.object, observer.patches, \"\", invertible);\n if (observer.patches.length) {\n applyPatch(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n}\n// Dirty check if obj is different from mirror, generate patches and update mirror\nfunction _generate(mirror, obj, patches, path, invertible) {\n if (obj === mirror) {\n return;\n }\n if (typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key), invertible);\n }\n else {\n if (oldVal !== newVal) {\n changed = true;\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(oldVal) });\n }\n patches.push({ op: \"replace\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(newVal) });\n }\n }\n }\n else if (Array.isArray(mirror) === Array.isArray(obj)) {\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(oldVal) });\n }\n patches.push({ op: \"remove\", path: path + \"/\" + escapePathComponent(key) });\n deleted = true; // property has been deleted\n }\n else {\n if (invertible) {\n patches.push({ op: \"test\", path: path, value: mirror });\n }\n patches.push({ op: \"replace\", path: path, value: obj });\n changed = true;\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!hasOwnProperty(mirror, key) && obj[key] !== undefined) {\n patches.push({ op: \"add\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(obj[key]) });\n }\n }\n}\n/**\n * Create an array of patches from the differences in two objects\n */\nexport function compare(tree1, tree2, invertible) {\n if (invertible === void 0) { invertible = false; }\n var patches = [];\n _generate(tree1, tree2, patches, '', invertible);\n return patches;\n}\n","export * from './module/core.mjs';\nexport * from './module/duplex.mjs';\nexport {\n PatchError as JsonPatchError,\n _deepClone as deepClone,\n escapePathComponent,\n unescapePathComponent\n} from './module/helpers.mjs';\n\n\n/**\n * Default export for backwards compat\n */\n\nimport * as core from './module/core.mjs';\nimport * as duplex from './module/duplex.mjs';\nimport {\n PatchError as JsonPatchError,\n _deepClone as deepClone,\n escapePathComponent,\n unescapePathComponent\n} from './module/helpers.mjs';\n\nexport default Object.assign({}, core, duplex, {\n JsonPatchError,\n deepClone,\n escapePathComponent,\n unescapePathComponent\n});","import jsonpatch from 'fast-json-patch';\nimport type { Operation as JSONPatchOperation } from 'fast-json-patch/module/core';\nimport type { IPatchItem } from './interface';\n\nconst FLAG_VALIDATE_PATCH = true;\nconst FLAG_MUTATE_DOCUMENT = false;\n\nfunction apply, Source = Record>(\n patchData: IPatchItem[],\n source: Source,\n): Promise {\n const result = jsonpatch.applyPatch(\n source,\n patchData as JSONPatchOperation[],\n FLAG_VALIDATE_PATCH,\n FLAG_MUTATE_DOCUMENT,\n ).newDocument;\n\n return Promise.resolve(result as unknown as Result);\n}\n\nexport default apply;\n","import DB from '../../../private/db';\nimport type { IDB } from '../../../private/db/interface';\nimport type { IPatchStorage, IPatchStorageOptions } from './interface';\n\nconst TABLE_NAME = 'IPatchStorage';\nconst TABLE_MAPPINGS = '++name, hash, data';\n\nfunction _isPatchStorage(object: unknown): object is IPatchStorage {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Record;\n\n return (\n !isNullOrUndefined(record.name) &&\n !isNullOrUndefined(record.hash) &&\n !isNullOrUndefined(record.data)\n );\n}\n\nfunction _db(options: IPatchStorageOptions = {}): Promise {\n const db = DB().open(options.name ?? TABLE_NAME, {\n version: 1,\n mappings: {\n [TABLE_NAME]: TABLE_MAPPINGS,\n },\n });\n\n return db;\n}\n\nasync function load(name: string, options: IPatchStorageOptions = {}): Promise {\n const db = await _db(options);\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n\n const result = await table.get(name).catch(() => undefined);\n\n db.close();\n\n if (!result) {\n throw new Error(`Unable to find patch-storage named: ${name}`);\n } else if (!_isPatchStorage(result)) {\n throw new Error(\n `Object returned is not patch-storage type: ${name}, ${JSON.stringify(result)}`,\n );\n }\n\n return result;\n}\n\nasync function save(data: IPatchStorage, options: IPatchStorageOptions = {}) {\n const db = await _db(options);\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n\n const result = await table.addOrUpdate(data.name, data);\n\n db.close();\n\n if (!result) {\n throw new Error('Failed to save data into patch-storage table');\n }\n}\n\nasync function remove(name: string, options: IPatchStorageOptions = {}) {\n const db = await _db(options);\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n\n await table.delete(name);\n\n db.close();\n}\n\nexport default Object.freeze({\n load,\n save,\n remove,\n});\n","import apply from './apply';\nimport storage from './storage';\n\nexport default Object.freeze({\n apply,\n storage,\n});\n","import type { IProgressPromise, IProgressPromiseGenerator } from '@monofe/util';\nimport type { IWorkspaceDB } from '../../../db/interface/db';\nimport type { INSTANTIATOR_INTERFACES } from '../../../model/interface';\nimport type { SourceApiDataArray, SourceApiRecord } from './interfaces';\n\nfunction _addItems(\n database: IWorkspaceDB,\n entityName: Interface,\n items: SourceApiDataArray,\n): Promise {\n const promise = entityName\n ? database.table(entityName).bulkAddOrUpdate(items)\n : Promise.reject(new Error(`Unable to find table name for unnamed entity`));\n\n return promise;\n}\n\nfunction update(\n promiser: IProgressPromiseGenerator,\n database: IWorkspaceDB,\n source: Partial,\n): IProgressPromise {\n return promiser.async(async progressCallback => {\n const shouldOpenClose = !database.isOpen();\n\n if (shouldOpenClose) {\n await database.open();\n }\n\n const patchPaths = Object.keys(source) as (keyof INSTANTIATOR_INTERFACES)[];\n const progressPerPath = 1 / patchPaths.length;\n\n for (const [index, patchPath] of patchPaths.entries()) {\n const items = source[patchPath];\n\n if (!items) {\n continue; /* No data */\n }\n\n const promise = _addItems(database, patchPath, items);\n\n await promise;\n\n progressCallback(index * progressPerPath);\n }\n\n if (shouldOpenClose) {\n database.close();\n }\n });\n}\n\nexport default update;\n","import type { INSTANTIATOR_INTERFACES } from '../../../model/interface/instantiator';\n\n/* Typing this was gives up type safety, that we will always find a match for every INSTANTIATOR_INTERFACE */\nconst ENTITY_MAPPING: Record = {\n IBackgroundModeDto: ['backgroundmodes', 'backgroundmode', 'backgroundmodedto'],\n IBeaconDto: ['beacons', 'beacon', 'beacondto'],\n IBeaconSensitivityDto: ['beaconsensitivities', 'beaconsensitivity', 'beaconsensitivitydto'],\n ICountryDto: ['country', 'countries', 'countrydto'],\n IDeviceAccountDto: ['deviceaccount', 'deviceaccounts', 'deviceaccountdto'],\n IFloorPlanDto: ['floorplans', 'floorplan', 'floorplandto'],\n IFloorPlanTourDto: ['floorplantours', 'floorplantour', 'floorplantourdto'],\n IFontAlignmentDto: ['fontalignments', 'fontalignment', 'fontalignmentdto'],\n IFontFamilyDto: ['fontfamilies', 'fontfamily', 'fontfamilydto'],\n IFontSizeUnitDto: ['fontsizeunits', 'fontsizeunit', 'fontsizeunitdto'],\n IFontStyleDto: ['fontstyles', 'fontstyle', 'fontstyledto'],\n IFloorPlanTranslationDto: [\n 'floorplantranslation',\n 'floorplantranslations',\n 'floorplantranslationdto',\n ],\n ILanguageDto: ['languages', 'language', 'languagedto'],\n IMediumDto: ['media', 'medium', 'mediumdto'],\n IMenuItemKeywordDto: ['menuitemkeyword', 'menuitemkeywords', 'menuitemkeyworddto'],\n IMenuItemDto: ['menuitems', 'menuitem', 'menuitemdto'],\n IMenuItemTranslationDto: [\n 'menuitemtranslations',\n 'menuitemtranslation',\n 'menuitemtranslationdto',\n ],\n IPinTypeDto: ['pintypes', 'pintype', 'pintypedto'],\n IRoleDto: ['role', 'roles', 'roledto'],\n IScreenOrientationDto: ['screenorientations', 'screenorientation', 'screenorientationdto'],\n ISiteDto: ['sites', 'site', 'sitedto'],\n ISiteObjectOnFloorPlanDto: [\n 'siteobjectonfloorplans',\n 'siteobjectonfloorplan',\n 'siteobjectonfloorplandto',\n ],\n ISiteObjectDto: ['siteobjects', 'siteobject', 'siteobjectdto'],\n ISiteObjectKeywordDto: ['siteobjectkeywords', 'siteobjectkeyword', 'siteobjectkeyworddto'],\n ISiteObjectTranslationDto: [\n 'siteobjecttranslations',\n 'siteobjecttranslation',\n 'siteobjecttranslationdto',\n ],\n ISiteObjectTypeDto: ['siteobjecttypes', 'siteobjecttype', 'siteobjecttypedto'],\n ISiteSupportedLanguageDto: [\n 'sitesupportedlanguages',\n 'sitesupportedlanguage',\n 'sitesupportedlanguagedto',\n ],\n IStyleDto: ['styles', 'style', 'styledto'],\n ITourRelatedSiteObjectDto: [\n 'tourrelatedsiteobjects',\n 'tourrelatedsiteobject',\n 'tourrelatedsiteobjectdto',\n ],\n ITourDto: ['tours', 'tour', 'tourdto'],\n ITourMenuItemDto: ['tourmenuitem', 'tourmenuitems', 'tourmenuitemdto'],\n ITourStatusDto: ['tourstatuses', 'tourstatus', 'tourstatusdto'],\n ITourSubTypeDto: ['toursubtypes', 'toursubtype', 'toursubtypedto'],\n ITourSupportedLanguageDto: [\n 'toursupportedlanguages',\n 'toursupportedlanguage',\n 'toursupportedlanguagedto',\n ],\n ITourTranslationDto: ['tourtranslations', 'tourtranslation', 'tourtranslationdto'],\n ITourTypeDto: ['tourtypes', 'tourtype', 'tourtypedto'],\n IUserDto: ['users', 'user', 'userdto'],\n\n ILegacy_FloorPlanDto: ['legacy_floorplan', 'legacy_floorplans', 'legacy_floorplandto'],\n};\n\n/* However rebuild at runtime (swap k->v) for quicker lookup times */\nconst LOOKUP_MAP: Record = {};\nlet LOOKUP_MAP_BUILT = false;\n\nfunction _buildMap() {\n for (const entityname of Object.keys(ENTITY_MAPPING) as (keyof INSTANTIATOR_INTERFACES)[]) {\n const patchPaths = ENTITY_MAPPING[entityname];\n\n for (const path of patchPaths) {\n LOOKUP_MAP[path] = entityname;\n }\n }\n}\n\nfunction entityNameFromPatchPath(path: string): keyof INSTANTIATOR_INTERFACES | null {\n if (!LOOKUP_MAP_BUILT) {\n LOOKUP_MAP_BUILT = true;\n _buildMap();\n }\n\n let pathCompare = path.toLowerCase();\n\n if (path.startsWith('/')) {\n pathCompare = pathCompare.slice(1);\n }\n\n return LOOKUP_MAP[pathCompare] ?? null;\n}\n\nexport default entityNameFromPatchPath;\n","import type { SourceApiRecord } from './interfaces';\nimport entityNameFromPatchPath from './patchMap';\n\nfunction _isObject(object: unknown): object is Record[] {\n if (!object || typeof object !== 'object') {\n return false;\n }\n return true;\n}\n\nfunction _isArrayRecords(object: unknown): object is Record[] {\n if (!object || !Array.isArray(object)) {\n return false;\n }\n\n const records: unknown[] = object;\n\n for (const record of records) {\n if (!_isObject(record)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function siteDataResponseToEntityMap(patchData: Record): SourceApiRecord {\n const applicator: Partial = {};\n const keys = Object.keys(patchData);\n for (const patchPath of keys) {\n if (patchPath === 'hash') {\n continue;\n }\n\n let items = patchData[patchPath];\n\n /* '/site' comes back as an Object, not an array. make sure all added are arrays */\n if (!Array.isArray(items)) {\n items = [items];\n }\n\n if (!_isArrayRecords(items)) {\n throw new Error(\n `Unexpected data, expecting array of records, ${JSON.stringify(items)}`,\n );\n }\n\n const entityName = entityNameFromPatchPath(patchPath);\n\n if (!entityName) {\n continue;\n }\n\n applicator[entityName] = items;\n }\n\n return applicator as SourceApiRecord;\n}\n","import type { IConfigAPI, IProgressPromise, IProgressPromiseGenerator } from '@monofe/util';\nimport type { ISiteData, ISiteDataAPI } from '../../../api/interface/siteData';\nimport type { IAuthenticationManager } from '../../../controller/interface/auth';\nimport type { IWorkspaceDB } from '../../../db/interface/db';\nimport { log } from '../../../private';\nimport type { IPatchStorage } from '../../private';\nimport { patch } from '../../private';\nimport load from './dbupdate';\nimport { siteDataResponseToEntityMap } from './util';\n\nfunction update(\n configAPI: IConfigAPI,\n siteAPI: ISiteDataAPI,\n promiser: IProgressPromiseGenerator,\n name: string,\n db: IWorkspaceDB,\n auth: IAuthenticationManager,\n): IProgressPromise {\n return promiser.promise(async (resolve, reject, progress) => {\n try {\n await db.open();\n\n progress(0.1);\n\n const token = await auth.renew();\n\n progress(0.2);\n\n const existingPatch: IPatchStorage = await patch.storage.load(name).catch(error => ({\n name: name,\n hash: '',\n data: {},\n }));\n\n progress(0.3);\n\n const urls = [configAPI].map(config => config.url).filter(url => url);\n\n let siteData: ISiteData | null = null;\n\n for (const urlAPI of urls) {\n const siteFetcher = siteAPI.getSiteData(urlAPI, token, existingPatch.hash);\n\n siteFetcher.onProgress((data: number) => {\n progress(0.3 + data * 0.3);\n });\n\n progress(0.6);\n\n siteData = await siteFetcher.catch((error: Error) => {\n log.error(`Failed to fetch api-url: ${urlAPI}, error:${error.message}`);\n return null;\n });\n\n if (siteData) {\n break;\n }\n }\n\n if (!siteData) {\n throw new Error(`Unable to find any site data`);\n } else if (siteData.patch.length > 0) {\n /* Only bother if there is something in the patch */\n const newPatch: IPatchStorage = { ...existingPatch };\n newPatch.data = await patch.apply(siteData.patch, existingPatch.data);\n newPatch.hash = siteData.currentHash;\n\n await patch.storage.save(newPatch);\n\n const applicator = siteDataResponseToEntityMap(newPatch.data);\n\n await load(promiser, db, db.preInsertCleanup(applicator));\n }\n\n progress(0.8);\n\n db.close();\n\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport default update;\n","import type { IContainer } from '@monofe/di';\nimport { injectConfigAPI, injectProgressPromise } from '@monofe/util';\nimport { injectSiteDataAPI } from '../../../api/interface/bind';\nimport type { IAuthenticationManager } from '../../../controller/interface';\nimport type { IWorkspaceDB } from '../../../db/interface';\nimport updateSite from './updateSite';\n\nfunction bind(\n container: IContainer,\n): (name: string, db: IWorkspaceDB, auth: IAuthenticationManager) => ReturnType {\n const configAPI = injectConfigAPI(container);\n const siteAPI = injectSiteDataAPI(container);\n const promiser = injectProgressPromise(container);\n return (name: string, db: IWorkspaceDB, auth: IAuthenticationManager) =>\n updateSite(configAPI, siteAPI, promiser, name, db, auth);\n}\n\nexport default bind;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { TYPES as UTIL_TYPES } from '@monofe/util';\nimport { TYPES as API_TYPES } from '../../api/interface/bind';\nimport type { IJobs } from '../interface';\nimport { bindJobs, injectJobs, TYPES, unbindJobs } from '../interface/bind';\nimport deleteBinder from './delete.bind';\nimport downloadBinder from './download.bind';\nimport updateSiteBinder from './updateSite/updateSite.bind';\n\nfunction _build(container: IContainer): Readonly {\n const tasks: IJobs = {\n updateSite: updateSiteBinder(container),\n downloadMedia: downloadBinder.downloadMedia(container),\n downloadMediaNoResponse: downloadBinder.downloadMediaNoResponse(container),\n deleteMedia: deleteBinder(container),\n };\n\n return Object.freeze(tasks);\n}\n\nexport default buildBindable({\n id: TYPES.IJobs,\n dependencies: [\n UTIL_TYPES.IProgressPromiseGenerator,\n API_TYPES.IMediaAPI,\n API_TYPES.ISiteDataAPI,\n UTIL_TYPES.IConfigAPI,\n ],\n bind: bindJobs,\n remove: unbindJobs,\n build: container => Promise.resolve(_build(container)),\n inject: injectJobs,\n});\n","import { buildBinderListings } from '@monofe/di';\nimport jobsInst from '../impl/index';\n\nexport default buildBinderListings([jobsInst]);\n","import { buildBindable } from '@monofe/di';\nimport {\n bindModelInstantiator,\n injectModelInstantiator,\n TYPES,\n unbindModelInstantiator,\n} from '../interface/bind';\nimport type { IModelInstantiator } from '../interface/instantiator';\nimport modelInstantiator from './instantiator';\n\nexport default buildBindable({\n id: TYPES.IModelInstantiator,\n dependencies: [],\n bind: bindModelInstantiator,\n remove: unbindModelInstantiator,\n build: () => Promise.resolve(modelInstantiator),\n inject: injectModelInstantiator,\n});\n","import { buildBinderListings } from '@monofe/di';\nimport modelInstBinder from './util/instantiator.bind';\n\nexport default buildBinderListings([modelInstBinder]);\n","import DB from '../../private/db';\nimport type { IDB } from '../../private/db/interface';\n\nconst TABLE_NAME = 'ISession';\nconst TABLE_MAPPINGS = {\n [TABLE_NAME]: 'name, grouping, languageId, tourId, auth',\n};\n\nexport interface ISessionData extends Record {\n name: string;\n userState: string;\n auth: string;\n}\n\nconst DEFAULT_ISESSIONDATA: ISessionData = {\n name: '',\n userState: '',\n auth: '',\n};\n\nfunction _instantiate(name: string = TABLE_NAME): Promise {\n const db = DB().open(name, {\n version: 1,\n mappings: TABLE_MAPPINGS,\n });\n\n return db;\n}\n\nasync function exists(key: string): Promise {\n const db = await _instantiate();\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n const result = await table.get(key).catch(() => undefined);\n\n db.close();\n\n return Boolean(result);\n}\n\nasync function load(key: string): Promise {\n const db = await _instantiate();\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n const result = await table.get(key).catch(error => undefined);\n\n db.close();\n\n if (result === undefined) {\n throw new Error(`Unable to find data named: ${key}`);\n }\n\n return result as ISessionData;\n}\n\nasync function save(name: string, session: ISessionData): Promise {\n const db = await _instantiate();\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n\n const result = await table.addOrUpdate(name, session);\n\n db.close();\n\n if (!result) {\n throw new Error('Failed to save data into patch-storage table');\n }\n}\n\nasync function remove(name: string): Promise {\n const db = await _instantiate();\n\n await db.open();\n\n const table = db.table(TABLE_NAME);\n\n await table.delete(name);\n\n db.close();\n}\n\nfunction constructor(data: Partial): ISessionData {\n return {\n ...DEFAULT_ISESSIONDATA,\n ...data,\n };\n}\n\nexport default Object.freeze({\n load,\n save,\n exists,\n remove,\n constructor,\n});\n","import type { ISession } from '../interface/session';\nimport type { ISessionData } from '../private/db';\n\nfunction captureState(session: ISession): ISessionData {\n return {\n name: session.name,\n userState: session.state.flatten(),\n auth: session.auth.serialize(),\n };\n}\n\nfunction isSessionData(object: unknown): object is ISessionData {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.name) &&\n !isNullOrUndefined(record.userState) &&\n !isNullOrUndefined(record.auth)\n );\n}\n\nfunction flatten(session: ISession): string {\n return JSON.stringify(captureState(session));\n}\n\nfunction expand(data: string): ISessionData {\n const obj = JSON.parse(data);\n\n if (!isSessionData(obj)) {\n throw new Error(`Invalid object, not ISessionData: ${JSON.stringify(obj)}`);\n }\n\n return obj;\n}\n\nexport default Object.freeze({\n captureState,\n isSessionData,\n expand,\n flatten,\n});\n","import type { IConfigAPI } from '@monofe/util';\nimport type { IAuthManagerInstantiator } from '../../controller/interface/auth';\nimport type { IMediaManagerInstantiator } from '../../controller/interface/media';\nimport type { IUserStateInstantiator } from '../../controller/interface/userstate';\nimport type { IWorkspaceDBInstantiator } from '../../db/interface';\nimport type { ISession, ISessionArgs } from '../interface/session';\nimport type { ISessionData } from '../private/db';\nimport sessionDB from '../private/db';\nimport sessionSerialize from './session.serialize';\n\nconst _remove = async (session: ISession) => {\n const hasSession = await sessionDB.exists(session.name);\n\n if (!hasSession) {\n throw new Error(`Session ${session.name}, does not exist, cannot remove`);\n }\n\n await sessionDB.remove(session.name);\n};\n\nconst _save = async (session: ISession) => {\n await sessionDB.save(session.name, sessionSerialize.captureState(session));\n};\n\nasync function buildFromSessionData(\n authInst: IAuthManagerInstantiator,\n mediaInst: IMediaManagerInstantiator,\n userInst: IUserStateInstantiator,\n dbInst: IWorkspaceDBInstantiator,\n data: ISessionData,\n): Promise {\n const authArgs = authInst.expand(data.auth);\n const auth = authInst.open(authArgs);\n\n const db = await dbInst.open({ name: data.name });\n\n const media = mediaInst.open(db, auth);\n const state = userInst.expand(data.userState);\n\n const session: ISession = {\n name: data.name,\n\n auth,\n db,\n media,\n state,\n\n save: function (this: ISession) {\n return _save(this);\n },\n remove: function (this: ISession) {\n return _remove(this);\n },\n };\n\n return session;\n}\n\nasync function buildFromArgs(\n configAPI: IConfigAPI,\n authInst: IAuthManagerInstantiator,\n mediaInst: IMediaManagerInstantiator,\n userInst: IUserStateInstantiator,\n dbInst: IWorkspaceDBInstantiator,\n nameIn: string,\n args: ISessionArgs,\n): Promise {\n const name = nameIn ?? args.apiUsername ?? configAPI.auth.username;\n\n const auth = authInst.open({\n apiUrl: args.apiUrl ?? configAPI.url,\n apiExtension: configAPI.extension.auth,\n clientId: configAPI.auth.clientId,\n clientSecret: configAPI.auth.clientSecret,\n grantType: configAPI.auth.grantType,\n username: args.apiUsername ?? configAPI.auth.username,\n password: args.apiPassword ?? configAPI.auth.password,\n });\n\n const db = await dbInst.open({ name });\n\n const media = mediaInst.open(db, auth);\n const state = userInst.open(name);\n\n const session: ISession = {\n name,\n\n auth,\n db,\n media,\n state,\n\n save: function (this: ISession) {\n return _save(this);\n },\n remove: function (this: ISession) {\n return _remove(this);\n },\n };\n\n return session;\n}\n\nexport default Object.freeze({\n buildFromArgs,\n buildFromSessionData,\n});\n","import { log } from '../../private';\nimport type { ISession } from '../interface/session';\n\nlet memoryCache: ISession[] = [];\n\nconst get = (name: string) => memoryCache.find(session => session.name === name);\n\nconst save = (session: ISession) => {\n /* Only add if it's missing */\n if (!get(session.name)) {\n memoryCache.push(session);\n } else {\n log.error(`Already exists, ignoring add to cache for session: ${JSON.stringify(session)}`);\n }\n};\n\nconst remove = (sessionDelete: ISession) => {\n memoryCache = memoryCache.filter(session => session.name !== sessionDelete.name);\n};\n\nconst all = () => memoryCache;\n\nexport default Object.freeze({\n get,\n save,\n remove,\n all,\n});\n","import type { ISession, ISessionActiveCallback } from '../interface/session';\n\ninterface ISessionActiveRecord {\n name: string;\n callback: ISessionActiveCallback;\n}\n\nlet activeSession: ISession | null = null;\nlet activeRecords: ISessionActiveRecord[] = [];\n\nconst active = () => activeSession;\n\nconst setActive = (sessionNew: ISession | null) => {\n activeSession = sessionNew;\n for (const record of activeRecords) {\n record.callback(sessionNew);\n }\n};\n\nconst subscribeActiveChanged = (callback: ISessionActiveCallback, key?: string): void => {\n activeRecords.push({ name: key ?? `callback-${activeRecords.length}`, callback });\n};\n\nconst unsubscribeActiveChanged = (callback: ISessionActiveCallback): void => {\n activeRecords = activeRecords.filter(callback_ => callback_.callback !== callback);\n};\n\nconst subscriber = (subscriberKey: string): ISessionActiveCallback | undefined =>\n activeRecords.find(record => record.name === subscriberKey)?.callback;\n\nexport default Object.freeze({\n active,\n setActive,\n subscribeActiveChanged,\n unsubscribeActiveChanged,\n subscriber,\n});\n","import type { IConfigAPI } from '@monofe/util';\nimport type { IAuthManagerInstantiator } from '../../controller/interface/auth';\nimport type { IMediaManagerInstantiator } from '../../controller/interface/media';\nimport type { IUserStateInstantiator } from '../../controller/interface/userstate';\nimport type { IWorkspaceDBInstantiator } from '../../db/interface';\nimport type { ISession, ISessionArgs } from '../interface/session';\nimport sessionDB from '../private/db';\nimport sessionBuilder from './session.build';\nimport sessionCache from './session.cache';\nimport sessionCallback from './session.callback';\n\nasync function open(\n configAPI: IConfigAPI,\n authInst: IAuthManagerInstantiator,\n mediaInst: IMediaManagerInstantiator,\n userInst: IUserStateInstantiator,\n dbInst: IWorkspaceDBInstantiator,\n name: string,\n args?: ISessionArgs,\n): Promise {\n const existing = sessionCache.get(name);\n\n if (existing) {\n return Promise.resolve(existing);\n }\n\n let sessionObj: ISession | null = null;\n\n if (args) {\n sessionObj = await sessionBuilder.buildFromArgs(\n configAPI,\n authInst,\n mediaInst,\n userInst,\n dbInst,\n name,\n args,\n );\n } else {\n /* Ignore throw errors */\n const sessionData = await sessionDB.load(name).catch(() => undefined);\n\n if (sessionData) {\n sessionObj = await sessionBuilder.buildFromSessionData(\n authInst,\n mediaInst,\n userInst,\n dbInst,\n sessionData,\n );\n }\n }\n\n if (!sessionObj) {\n throw new Error(`Cannot find/load session: ${name}/${JSON.stringify(args)}`);\n }\n\n return sessionObj;\n}\n\nasync function exists(name: string): Promise {\n /* Ignore throw errors */\n const sessionData = await sessionDB.load(name).catch(() => undefined);\n const cached = sessionCache.get(name);\n\n return Boolean(cached || sessionData);\n}\n\nexport default Object.freeze({\n open,\n exists,\n ...sessionCallback,\n});\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectConfigAPI, TYPES as UTIL_TYPES } from '@monofe/util';\nimport {\n injectAuthManager,\n injectMediaManager,\n injectUserStateManager,\n TYPES as CONTROLLER_TYPES,\n} from '../../controller/interface/bind';\nimport { injectWorkspaceDB, TYPES as DB_TYPES } from '../../db/interface/bind';\nimport { bindAPISession, injectAPISession, TYPES, unbindAPISession } from '../interface/bind';\nimport type { ISession, ISessionArgs, ISessionInstantiator } from '../interface/session';\nimport sessionInst from './session';\nimport sessionBuilder from './session.build';\nimport sessionSerialize from './session.serialize';\n\nfunction _build(container: IContainer): Readonly {\n const authInst = injectAuthManager(container);\n const mediaInst = injectMediaManager(container);\n const userInst = injectUserStateManager(container);\n const dbInst = injectWorkspaceDB(container);\n const configAPI = injectConfigAPI(container);\n\n const sessionObject: ISessionInstantiator = {\n ...sessionInst,\n restore: (dataStr: string) => {\n const sessionData = sessionSerialize.expand(dataStr);\n return sessionBuilder.buildFromSessionData(\n authInst,\n mediaInst,\n userInst,\n dbInst,\n sessionData,\n );\n },\n serialize: (sessionIn: ISession) => Promise.resolve(sessionSerialize.flatten(sessionIn)),\n open: (name: string, args?: ISessionArgs) =>\n sessionInst.open(configAPI, authInst, mediaInst, userInst, dbInst, name, args),\n exists: (name: string) => sessionInst.exists(name),\n };\n\n return Object.freeze(sessionObject);\n}\n\nexport default buildBindable({\n id: TYPES.ISessionInstantiator,\n dependencies: [\n CONTROLLER_TYPES.IAuthenticationManager,\n CONTROLLER_TYPES.IMediaManager,\n CONTROLLER_TYPES.IUserStateManager,\n DB_TYPES.IWorkspaceDBInstantiate,\n UTIL_TYPES.IConfigAPI,\n ],\n bind: bindAPISession,\n remove: unbindAPISession,\n inject: injectAPISession,\n build: container => Promise.resolve(_build(container)),\n});\n","import { buildBinderListings } from '@monofe/di';\nimport sessionInst from '../impl/session.bind';\n\nexport default buildBinderListings([sessionInst]);\n","import type { MediumPathResolver } from './cache.source';\n\nconst CACHE_SEARCH_PARAMS = {\n ignoreMethod: true,\n ignoreSearch: true,\n ignoreVary: true,\n};\n\nconst openCache = (name: string): Promise =>\n window.caches === undefined ? Promise.reject('No caches available') : caches.open(name);\n\nconst mediaRequestList = (mediaId: string, urlResolver: MediumPathResolver): Promise => {\n const urlFetchList = urlResolver(mediaId);\n const requestList = urlFetchList.map(urlFetch => new Request(urlFetch));\n return Promise.resolve(requestList);\n};\n\nconst cacheResponsesForRequests = async (\n requests: Request[],\n cache: Cache,\n): Promise => {\n const responses = await Promise.all(\n requests.map(request => cache.match(request, CACHE_SEARCH_PARAMS)),\n );\n return responses.filter(response => response !== undefined) as Response[];\n};\n\nconst deleteMediaIdsFromCache = async (\n cache: Cache,\n mediaIds: string[],\n urlResolver: MediumPathResolver,\n): Promise => {\n const allRequests = await Promise.all(\n mediaIds.map(mediaId => mediaRequestList(mediaId, urlResolver)),\n );\n\n return Promise.all(\n allRequests.flat().map(request => cache.delete(request, CACHE_SEARCH_PARAMS)),\n );\n};\n\nexport default Object.freeze({\n openCache,\n mediaRequestList,\n cacheResponsesForRequests,\n deleteMediaIdsFromCache,\n});\n","import type { IMediaURLResolverParameters, MediaBinaryStorageTypeMap } from '../interface/cache';\nimport cacheUtil from './cache.util';\n\nexport type CacheResolver = () => Promise;\n\n/* To save on effort on repeated slow-downs opening cache, save the output & re-use each time it is requested */\nconst cachedCacheResolver = (cacheName: string): CacheResolver => {\n let cacheHandle: Cache | null = null;\n\n const resolver = async () => {\n const handle = cacheHandle ?? (await cacheUtil.openCache(cacheName));\n if (!cacheHandle) {\n cacheHandle = handle;\n }\n return cacheHandle;\n };\n\n return resolver;\n};\n\nasync function _isCachedItem(\n cacheResolver: CacheResolver,\n mediaId: string,\n urlResolver: MediumPathResolver,\n): Promise {\n const cache = await cacheResolver();\n\n const allRequests = await cacheUtil.mediaRequestList(mediaId, urlResolver);\n\n /* Early exit when we get a hit */\n for (const request of allRequests) {\n const responses = await cacheUtil.cacheResponsesForRequests([request], cache);\n\n if (responses.length > 0) {\n return true;\n }\n }\n\n return false;\n}\n\nasync function _isCached(\n cacheResolver: CacheResolver,\n mediaIdArgument: string | string[],\n urlResolver: MediumPathResolver,\n): Promise {\n const mediaIds = Array.isArray(mediaIdArgument) ? mediaIdArgument : [mediaIdArgument];\n\n const cacheResponses = await Promise.all(\n mediaIds.map(mediaId => _isCachedItem(cacheResolver, mediaId, urlResolver)),\n );\n\n const missingCacheValues = cacheResponses.some(isCached => !isCached);\n\n const isAllCached = !missingCacheValues;\n\n return isAllCached;\n}\n\nasync function _removeFromCache(\n cacheResolver: CacheResolver,\n mediaIdIArgument: string | string[],\n urlResolver: MediumPathResolver,\n): Promise {\n const cache = await cacheResolver();\n\n const mediaIds = Array.isArray(mediaIdIArgument) ? mediaIdIArgument : [mediaIdIArgument];\n\n await cacheUtil.deleteMediaIdsFromCache(cache, mediaIds, urlResolver);\n}\n\nasync function _addToCache(\n cacheResolver: CacheResolver,\n request: RequestInfo,\n response: Response,\n): Promise {\n const cache = await cacheResolver();\n\n await cache.put(request, response);\n}\n\nasync function _cachedResponse<\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n>(\n cacheResolver: CacheResolver,\n mediaId: string,\n urlResolver: MediumPathResolver,\n type: T,\n): Promise {\n const cache = await cacheResolver();\n\n const allRequests = await cacheUtil.mediaRequestList(mediaId, urlResolver);\n\n for (const request of allRequests) {\n const responseList = await cacheUtil.cacheResponsesForRequests([request], cache);\n\n const response = responseList.at(-1);\n\n if (!response) {\n continue;\n }\n\n switch (type) {\n case 'Blob':\n return (await response.blob()) as U;\n\n case 'ArrayBuffer':\n return (await response.arrayBuffer()) as U;\n\n case 'none':\n return undefined as U;\n\n default:\n throw new Error(`Unknown type for cache search: ${type}`);\n }\n }\n\n throw new Error(`Unable to find id: ${mediaId} in cache`);\n}\n\nexport interface IMediaCacheSource {\n cacheName: () => string;\n isCached: (mediaId: string | string[]) => Promise;\n removeFromCache: (mediaId: string) => Promise;\n addToCache: (request: RequestInfo, response: Response) => Promise;\n cachedResponse: <\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n >(\n mediaId: string,\n type: T,\n ) => Promise;\n}\n\nexport type MediumPathResolver = (\n mediaId: string,\n parameters?: IMediaURLResolverParameters,\n) => string[];\n\nfunction cacheSource(cacheName: string, mediaIdResolver: MediumPathResolver): IMediaCacheSource {\n const cacheResolver = cachedCacheResolver(cacheName);\n\n const controller: IMediaCacheSource = {\n cacheName: () => cacheName,\n isCached: (mediaId: string | string[]) =>\n _isCached(cacheResolver, mediaId, mediaIdResolver),\n removeFromCache: (mediaId: string) =>\n _removeFromCache(cacheResolver, mediaId, mediaIdResolver),\n addToCache: (request: RequestInfo, response: Response) =>\n _addToCache(cacheResolver, request, response),\n cachedResponse: <\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n >(\n mediaId: string,\n type: T,\n ) => _cachedResponse(cacheResolver, mediaId, mediaIdResolver, type),\n };\n\n return controller;\n}\n\nexport default cacheSource;\n","import type {\n IMediaCacheController,\n IMediaURLResolver,\n MediaBinaryStorageTypeMap,\n} from '../interface/cache';\nimport type { IMediaCacheSource } from './cache.source';\nimport cacheSource from './cache.source';\n\nasync function _isCachedMedium(mediaId: string, cacheList: IMediaCacheSource[]): Promise {\n for (const cc of cacheList) {\n const isCached = await cc.isCached(mediaId);\n if (isCached) {\n return true;\n }\n }\n\n return false;\n}\n\nasync function _isCachedMedia(\n mediaIds: string[],\n cacheList: IMediaCacheSource[],\n): Promise {\n for (const mediaId of mediaIds) {\n const isCached = await _isCachedMedium(mediaId, cacheList);\n if (!isCached) {\n return false;\n }\n }\n\n return true;\n}\n\nasync function _cachedResponseMedium<\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n>(mediaId: string, cacheList: IMediaCacheSource[], type: T): Promise {\n for (const cacheSource of cacheList) {\n const hasAsset = await cacheSource.isCached(mediaId);\n\n if (hasAsset) {\n return cacheSource.cachedResponse(mediaId, type);\n }\n }\n\n throw new Error(`No media item found for id: ${mediaId}`);\n}\n\nfunction cacheController(): IMediaCacheController {\n let cacheList: IMediaCacheSource[] = [];\n\n return {\n addCacheResolver: (id: string, resolver: IMediaURLResolver) => {\n cacheList.push(cacheSource(id, resolver));\n },\n removeCacheResolver: (id: string) => {\n const matchingControllers = cacheList.filter(\n cacheController => cacheController.cacheName() === id,\n );\n cacheList = cacheList.filter(cacheItem => !matchingControllers.includes(cacheItem));\n },\n isMediumCached: (mediaId: string) => _isCachedMedium(mediaId, cacheList),\n isAllMediaCached: (mediaIds: string[]) => _isCachedMedia(mediaIds, cacheList),\n removeMediumCache: async (mediaId: string) => {\n await Promise.all(cacheList.map(cc => cc.removeFromCache(mediaId)));\n },\n cachedResponse: <\n T extends keyof MediaBinaryStorageTypeMap,\n U extends MediaBinaryStorageTypeMap[T],\n >(\n mediaId: string,\n type: T,\n ): Promise => _cachedResponseMedium(mediaId, cacheList, type),\n };\n}\n\nexport default cacheController;\n","import { buildBindable } from '@monofe/di';\nimport {\n bindMediaCacheController,\n injectMediaCacheController,\n TYPES,\n unbindMediaCacheController,\n} from '../interface/bind';\nimport type { IMediaCacheController } from '../interface/cache';\nimport cacheImpl from './cache';\n\nexport default buildBindable({\n id: TYPES.IMediaCacheController,\n bind: bindMediaCacheController,\n remove: unbindMediaCacheController,\n build: () => Promise.resolve(cacheImpl()),\n inject: injectMediaCacheController,\n});\n","import { buildBinderListings } from '@monofe/di';\nimport bindApi from './api/private/bind';\nimport bindController from './controller/private/bind';\nimport bindDB from './db/private/bind';\nimport bindJobs from './jobs/private/bind';\nimport bindModel from './model/bind';\nimport bindSession from './session/private/bind';\nimport bindUtil from './util/private/bind';\n\n/* List of binders sorted in order of installation */\nconst bindablesPrivate = [bindUtil, bindApi, bindDB, bindController];\nconst bindablesPublic = [bindSession, bindModel, bindJobs];\n\nconst listings = buildBinderListings([...bindablesPublic, ...bindablesPrivate]);\nexport default listings;\n","import { buildBinderListings } from '@monofe/di';\nimport cacheInst from '../impl/cache.bind';\n\nexport default buildBinderListings([cacheInst]);\n","export enum IUserProperties {\n LanguageId = 'LanguageId',\n TourId = 'TourId',\n Grouping = 'Grouping',\n}\n\nexport type IUserStateCallback = (name: string, newValue: T) => void;\n\nexport interface IUserState {\n getProperty: (name: IUserProperties | string) => T | undefined;\n getPropertyWithDefault: (\n name: IUserProperties | string,\n defaultValue: T,\n ) => T;\n setProperty: (name: IUserProperties | string, value: unknown | undefined) => void;\n subscribeChanges: (\n name: IUserProperties | string,\n callback: IUserStateCallback,\n subscriberKey?: string,\n ) => void;\n unsubscribeChanges: (\n name: IUserProperties | string,\n callback: IUserStateCallback,\n ) => void;\n subscriber: (subscriberKey: string) => IUserStateCallback | undefined;\n flatten: () => string;\n}\n\nexport interface IUserStateInstantiator {\n open: (name: string) => IUserState;\n expand: (data: string) => IUserState;\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IWorkspaceDBInstantiator } from './instantiator';\n\nexport const TYPES = {\n IWorkspaceDBInstantiate: Symbol.for('IWorkspaceDBInstantiate'),\n};\n\nexport function injectWorkspaceDB(\n container: IContainer = injectOrBuildContainer(),\n): IWorkspaceDBInstantiator {\n return container.get(TYPES.IWorkspaceDBInstantiate);\n}\n\nexport function bindWorkspaceDB(\n val: IWorkspaceDBInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IWorkspaceDBInstantiate, val);\n}\n\nexport function unbindWorkspaceDB(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IWorkspaceDBInstantiate);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IJobs } from './jobs';\n\nexport const TYPES = {\n IJobs: Symbol.for('IJobs'),\n};\n\nexport function injectJobs(container: IContainer = injectOrBuildContainer()): IJobs {\n return container.get(TYPES.IJobs);\n}\n\nexport function bindJobs(val: IJobs, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IJobs, val);\n}\n\nexport function unbindJobs(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IJobs);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IModelInstantiator } from './instantiator';\n\nexport const TYPES = {\n IModelInstantiator: Symbol.for('IModelInstantiator'),\n};\n\nexport function injectModelInstantiator(\n container: IContainer = injectOrBuildContainer(),\n): IModelInstantiator {\n return container.get(TYPES.IModelInstantiator);\n}\n\nexport function bindModelInstantiator(\n val: IModelInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IModelInstantiator, val);\n}\n\nexport function unbindModelInstantiator(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IModelInstantiator);\n}\n","export async function filterAsync(\n arr: T[],\n promiser: (val: T) => Promise,\n): Promise {\n const arrayOrig = arr;\n\n const newArray: T[] = [];\n\n for (const val of arrayOrig) {\n const shouldAdd = await promiser(val);\n if (shouldAdd) {\n newArray.push(val);\n }\n }\n\n return newArray;\n}\n\nexport default Object.freeze({\n filterAsync,\n});\n","import type { IWorkspaceDB } from '../../db/interface';\nimport type { ILanguageDto, IModelSource, ISiteDto } from '../../model/interface';\n\nasync function SiteSupportedLanguages(\n database: IWorkspaceDB,\n site?: ISiteDto,\n): Promise {\n const siteLookup = site ?? (await database.first('ISiteDto'));\n\n const siteSupportedLanguages = await database.all('ISiteSupportedLanguageDto');\n\n const languageIds = siteSupportedLanguages\n .filter(ssl => ssl.siteId === siteLookup.id)\n .map(ssl => ssl.languageId);\n\n const languages = await Promise.all(languageIds.map(id => database.get('ILanguageDto', id)));\n\n return languages;\n}\n\nasync function allLanguagesUsedInTours(database: IWorkspaceDB): Promise {\n const tours = await database.all('ITourDto');\n const tourLanguages = await Promise.all(\n tours.map(tour => tour.tourSupportedLanguages(database as IModelSource)),\n );\n const allSiteSupportedLanguages = await Promise.all(\n tourLanguages.flat().map(tsl => tsl.siteSupportedLanguage(database as IModelSource)),\n );\n\n const allSiteSupportedLanguageIds: number[] = [];\n const siteSupportedLanguages = allSiteSupportedLanguages.filter(ssl => {\n if (allSiteSupportedLanguageIds.includes(ssl.id)) {\n return false;\n } else {\n allSiteSupportedLanguageIds.push(ssl.id);\n return true;\n }\n });\n\n const languages = await Promise.all(\n siteSupportedLanguages.map(siteSupportedLanguage =>\n siteSupportedLanguage.language(database as IModelSource),\n ),\n );\n\n return languages;\n}\n\nexport default Object.freeze({\n SiteSupportedLanguages,\n allLanguagesUsedInTours,\n});\n","export function invertResult(promise: Promise): Promise {\n const origPromise = promise;\n\n return new Promise((resolve, reject) => {\n origPromise\n .then(val => {\n resolve(!val);\n })\n .catch(error => {\n reject(error);\n });\n });\n}\n\nexport default Object.freeze({\n invertResult,\n});\n","import type { IWorkspaceDB } from '../../db/interface';\nimport type { ILanguageDto, ISiteDto, ITourDto } from '../../model/interface';\n\nasync function ToursForLanguage(\n db: IWorkspaceDB,\n language: ILanguageDto,\n site?: ISiteDto,\n): Promise {\n /* To get the list of tours we can show based on the language selected we need ITourDto.tourSupportedLanguage.siteSupportedLanguage.language === language */\n const sslMatch = await db\n .all('ISiteSupportedLanguageDto')\n .then(ssl => ssl.filter(x => x.languageId === language.id));\n const sslMatchIds = sslMatch.map(x => x.id);\n\n const tslMatch = await db\n .all('ITourSupportedLanguageDto')\n .then(tsl =>\n tsl.filter(\n x =>\n sslMatchIds.includes(x.siteSupportedLanguageId) /* Workspace 1.0 */ ||\n x.languageId === language.id /* Workspace 2.0 */,\n ),\n );\n const tslMatchTourIds = tslMatch.map(x => x.tourId);\n\n const tours: ITourDto[] = await db\n .all('ITourDto')\n .then(tours => tours.filter(tour => tslMatchTourIds.includes(tour.id)));\n\n return tours;\n}\n\nexport default Object.freeze({\n ToursForLanguage,\n});\n","import array from './array';\nimport languages from './languages';\nimport promise from './promise';\nimport tours from './tours';\n\nexport default Object.freeze({\n array,\n promise,\n languages,\n tours,\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { ISessionInstantiator } from './session';\n\nexport const TYPES = {\n ISessionInstantiator: Symbol.for('ISessionInstantiator'),\n};\n\nexport function injectAPISession(\n container: IContainer = injectOrBuildContainer(),\n): ISessionInstantiator {\n return container.get(TYPES.ISessionInstantiator);\n}\n\nexport function bindAPISession(\n val: ISessionInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ISessionInstantiator, val);\n}\n\nexport function unbindAPISession(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ISessionInstantiator);\n}\n","import { useEffect, useState } from 'react';\nimport { IUserProperties } from '../../controller/interface/userstate';\nimport type { ILanguageDto, ITourDto } from '../../model/interface';\nimport type { ISession } from '../interface';\nimport { injectAPISession } from '../interface';\n\nfunction useActiveSession(): ISession | null {\n const sessionFetcher = injectAPISession();\n\n const [session, setSession] = useState(sessionFetcher.active);\n\n useEffect(() => {\n const callback = (newValue: ISession | null) => {\n setSession(newValue);\n };\n\n sessionFetcher.subscribeActiveChanged(callback);\n\n return () => {\n sessionFetcher.unsubscribeActiveChanged(callback);\n };\n }, [sessionFetcher]);\n\n return session;\n}\n\nfunction _useActiveSessionUserStateValue(\n session: ISession | null,\n key: string,\n defaultValue: T,\n): T {\n const [saveVal, setSaveVal] = useState(\n session?.state.getPropertyWithDefault(key, defaultValue) ?? defaultValue,\n );\n\n useEffect(() => {\n const callback = (name: string, newValue: T) => {\n setSaveVal(newValue);\n };\n\n session?.state.subscribeChanges(key, callback);\n\n return () => {\n session?.state.unsubscribeChanges(key, callback);\n };\n }, [session, key]);\n\n return saveVal;\n}\n\nfunction useActiveSessionLanguageId(): number {\n return _useActiveSessionUserStateValue(useActiveSession(), IUserProperties.LanguageId, -1);\n}\n\nfunction useActiveSessionTourId(): number {\n return _useActiveSessionUserStateValue(useActiveSession(), IUserProperties.TourId, -1);\n}\n\nfunction useActiveSessionLanguage(): ILanguageDto | null {\n const [saveVal, setSaveVal] = useState(null);\n\n const session = useActiveSession();\n const languageId = _useActiveSessionUserStateValue(session, IUserProperties.LanguageId, -1);\n\n useEffect(() => {\n if (session && languageId && languageId > 0) {\n session.db\n .open()\n .then(db => db.get('ILanguageDto', languageId))\n .then(language => {\n setSaveVal(language);\n session.db.close();\n })\n .catch(error => {\n throw error;\n });\n }\n }, [session, languageId]);\n\n return saveVal;\n}\n\nfunction useActiveSessionTour(): ITourDto | null {\n const [saveVal, setSaveVal] = useState(null);\n\n const session = useActiveSession();\n const tourId = _useActiveSessionUserStateValue(session, IUserProperties.TourId, -1);\n\n useEffect(() => {\n if (session && tourId && tourId > 0) {\n session.db\n .open()\n .then(db => db.get('ITourDto', tourId))\n .then(tour => {\n setSaveVal(tour);\n session.db.close();\n })\n .catch(error => {\n throw error;\n });\n }\n }, [session, tourId]);\n\n return saveVal;\n}\n\nexport default Object.freeze({\n useActiveSession,\n useActiveSessionLanguageId,\n useActiveSessionTourId,\n useActiveSessionLanguage,\n useActiveSessionTour,\n});\n","import { useEffect, useState } from 'react';\nimport type { ISession } from '../interface/session';\n\nfunction useSiteName(userSession: ISession | null): string | null {\n const [siteName, setSiteName] = useState(null);\n\n useEffect(() => {\n if (!userSession) {\n return;\n }\n const updateTranslation = async () => {\n const db = await userSession.db.open();\n const site = await db.first('ISiteDto');\n db.close();\n setSiteName(site.name ?? '');\n };\n updateTranslation().catch(error => {\n throw error;\n });\n }, [userSession, setSiteName]);\n\n return siteName;\n}\n\nexport default Object.freeze({\n useSiteName,\n});\n","import type { IMediumDto } from '../model/interface/model';\n\nconst EXTENSIONS_IMAGE = new Set(['avif', 'jpeg', 'jpg', 'png', 'webp']);\nconst EXTENSIONS_VIDEO = new Set(['ts', 'mp4']);\nconst EXTENSIONS_AUDIO = new Set([\n 'aac',\n 'aiff',\n 'alac',\n 'flac',\n 'mp3',\n 'mp4a',\n 'ogg',\n 'opus',\n 'pcm',\n 'wav',\n 'wma',\n]);\nconst EXTENSIONS_ZIP = new Set(['.zip']);\n\nconst MIME_TYPES_ZIP = new Set(['application/x-zip-compressed', 'application/zip']);\n\nconst _fileExtension = (medium: IMediumDto) =>\n medium.fileName.toLowerCase().split('.').at(-1) ?? '';\n\nfunction isImage(medium: IMediumDto): boolean {\n return medium.mimeType.startsWith('image/') || EXTENSIONS_IMAGE.has(_fileExtension(medium));\n}\n\nfunction isAudio(medium: IMediumDto): boolean {\n return medium.mimeType.startsWith('audio/') || EXTENSIONS_AUDIO.has(_fileExtension(medium));\n}\n\nfunction isVideo(medium: IMediumDto): boolean {\n return medium.mimeType.startsWith('video/') || EXTENSIONS_VIDEO.has(_fileExtension(medium));\n}\n\nfunction isZip(medium: IMediumDto): boolean {\n return MIME_TYPES_ZIP.has(medium.mimeType) || EXTENSIONS_ZIP.has(_fileExtension(medium));\n}\n\nexport default Object.freeze({\n isImage,\n isAudio,\n isVideo,\n isZip,\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IMediaCacheController } from './cache';\n\nexport const TYPES = {\n IMediaCacheController: Symbol.for('IMediaCacheController'),\n};\n\nexport function injectMediaCacheController(\n container: IContainer = injectOrBuildContainer(),\n): IMediaCacheController {\n return container.get(TYPES.IMediaCacheController);\n}\n\nexport function bindMediaCacheController(\n val: IMediaCacheController,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IMediaCacheController, val);\n}\n\nexport function unbindMediaCacheController(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IMediaCacheController);\n}\n","import type { CSSProperties } from 'react';\nimport type { ICookieViewProps } from './CookieView.interface';\nimport styles from './CookieView.module.css';\n\nexport enum StyleElem {\n BackgroundOverlay = 'BackgroundOverlay',\n Container = 'Container',\n TitleContainer = 'TitleContainer',\n BodyContainer = 'BodyContainer',\n ButtonContainer = 'ButtonContainer',\n ButtonAccept = 'ButtonAccept',\n ButtonDecline = 'ButtonDecline',\n ButtonPrivacyPolicy = 'ButtonPrivacyPolicy',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.BackgroundOverlay]: {},\n [StyleElem.Container]: {},\n [StyleElem.TitleContainer]: {},\n [StyleElem.BodyContainer]: {},\n [StyleElem.ButtonContainer]: {},\n [StyleElem.ButtonAccept]: {},\n [StyleElem.ButtonDecline]: {},\n [StyleElem.ButtonPrivacyPolicy]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.BackgroundOverlay]: (props: ICookieViewProps) => ({}),\n [StyleElem.Container]: (props: ICookieViewProps) => ({}),\n [StyleElem.TitleContainer]: (props: ICookieViewProps) => ({}),\n [StyleElem.BodyContainer]: (props: ICookieViewProps) => ({}),\n [StyleElem.ButtonContainer]: (props: ICookieViewProps) => ({}),\n [StyleElem.ButtonAccept]: (props: ICookieViewProps) => ({}),\n [StyleElem.ButtonDecline]: (props: ICookieViewProps) => ({}),\n [StyleElem.ButtonPrivacyPolicy]: (props: ICookieViewProps) => ({}),\n};\n\nexport function classNameForElement(element: StyleElem, props: ICookieViewProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(element: StyleElem, props: ICookieViewProps): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props) };\n\n return style;\n}\n","import { AnimatePresence, m } from 'framer-motion';\nimport { useCallback } from 'react';\nimport type { ICookieViewProps } from './CookieView.interface';\nimport { classNameForElement, StyleElem, styleForElement } from './CookieView.style';\n\nconst STYLE_HIDDEN: { opacity: number } = { opacity: 0 };\nconst STYLE_VISIBLE: { opacity: number } = { opacity: 1 };\n\nfunction OverlayView(props: ICookieViewProps): JSX.Element {\n return (\n \n );\n}\n\nfunction CookieView(props: ICookieViewProps): JSX.Element {\n const style = useCallback((elem: StyleElem) => styleForElement(elem, props), [props]);\n const className = useCallback((elem: StyleElem) => classNameForElement(elem, props), [props]);\n\n return (\n \n \n {props.translations.headingText}\n \n \n {props.translations.bodyText}\n

\n \n \n {props.translations.declineText}\n \n \n {props.translations.acceptText}\n \n \n {props.translations.privacyPolicyText}\n
\n \n \n );\n}\n\nfunction MainView(props: ICookieViewProps) {\n return (\n \n \n \n \n );\n}\n\nexport default MainView;\n","import type { IKVStorage } from '@monofe/util';\n\nexport enum UserCookieStateValue {\n Unset = 0,\n Accepted = 1,\n Declined = 2,\n}\n\nconst KEY_UserDownloadRequestState = 'UserCookieState';\n\nconst _GetKey = (\n storage: IKVStorage,\n key: string,\n fallback: T,\n): Promise =>\n new Promise((resolve, reject) => {\n storage\n .getItem(key)\n .then(result => {\n resolve((result as T) ?? fallback);\n })\n .catch((error: Error) => {\n reject(error);\n });\n });\n\nconst _SetKey = (\n storage: IKVStorage,\n key: string,\n value: T,\n): Promise =>\n new Promise((resolve, reject) => {\n storage\n .setItem(key, value)\n .then(() => {\n resolve();\n })\n .catch((error: Error) => {\n reject(error);\n });\n });\n\nconst UserCookieState = (storage: IKVStorage) =>\n _GetKey(\n storage,\n KEY_UserDownloadRequestState,\n UserCookieStateValue.Unset,\n );\n\nconst SetUserCookieState = (storage: IKVStorage, newVal: UserCookieStateValue) =>\n _SetKey(storage, KEY_UserDownloadRequestState, newVal);\n\nconst module = {\n UserCookieState,\n SetUserCookieState,\n};\n\nexport default module;\n","import type { IConfigManifest, ITranslationStorage, LANGUAGE_CODE } from '@monofe/util';\nimport type { ICookieViewText } from './CookieView.interface';\n\n/* Override the global window to access the doNotTrack property */\ndeclare global {\n interface Window {\n doNotTrack: string | null | undefined;\n }\n}\n\nfunction convertToBoolean(value: T): boolean {\n switch (typeof value) {\n case 'boolean':\n return value;\n\n case 'string':\n return (\n value.toLowerCase() === 'yes' ||\n value.toLowerCase() === 'on' ||\n value.toLowerCase() === '1' ||\n value.toLowerCase() === 'true'\n );\n\n case 'bigint':\n case 'number':\n return value !== 0;\n\n default:\n return false;\n }\n}\n\n/* Check if Do Not Track flag is set in browse to prevent analytics tracking */\nconst isDoNotTrackEnabled = () =>\n convertToBoolean(navigator.doNotTrack ?? window.doNotTrack ?? false);\n\nexport function canEnableAnalytics(): boolean {\n const isLocalHost = window.location.href.includes('localhost');\n return !isLocalHost && !isDoNotTrackEnabled();\n}\n\nexport enum TranslationKey {\n COOKIE_HEADING_TEXT = 'Cookie consent',\n COOKIE_BODY_TEXT = 'We use cookies to understand your activities on %@ only. We take your privacy very seriously and use this information to serve you better. Please see our privacy policy for details and any questions.',\n COOKIE_ACCEPT_TEXT = 'Accept All',\n COOKIE_DECLINE_TEXT = 'Reject All',\n COOKIE_PRIVACY_TEXT = 'Privacy Policy',\n}\n\nexport function generateTranslatedText(\n manifest: IConfigManifest,\n language: LANGUAGE_CODE,\n translater: ITranslationStorage,\n) {\n const translate = (originalText: string, params: string[] = []) =>\n translater.translation(language, originalText, params, originalText);\n\n const translations: ICookieViewText = {\n headingText: translate(TranslationKey.COOKIE_HEADING_TEXT),\n bodyText: translate(TranslationKey.COOKIE_BODY_TEXT, [manifest.name]),\n acceptText: translate(TranslationKey.COOKIE_ACCEPT_TEXT),\n declineText: translate(TranslationKey.COOKIE_DECLINE_TEXT),\n privacyPolicyText: translate(TranslationKey.COOKIE_PRIVACY_TEXT),\n };\n\n return translations;\n}\n","import { useCallback, useEffect, useState } from 'react';\nimport ga4 from 'react-ga4';\nimport type { IAnalyticsProps } from './Analytics.interface';\nimport CookieView from './CookieView';\nimport settings, { UserCookieStateValue } from './settings';\nimport { generateTranslatedText } from './util';\n\nconst DEFAULT_PRIVACY_POLICY_URL = 'https://www.ats-heritage.co.uk/privacy-policy';\nconst DEFAULT_TRACKING_ID = 'G-QRCSFP10H5';\n\nfunction Analytics({ storage, logger, env, language, translater, manifest }: IAnalyticsProps) {\n const privacyPolicyHref = env.getString('privacy-policy-url', DEFAULT_PRIVACY_POLICY_URL);\n\n const [showDialog, setShowDialog] = useState(false);\n const [shouldTrack, setShouldTrack] = useState(false);\n const [hasInitializedPageTracker, setHasInitializedPageTracker] = useState(false);\n\n useEffect(() => {\n if (!storage) {\n return;\n }\n settings\n .UserCookieState(storage)\n .then(cookieState => {\n setShowDialog(cookieState === UserCookieStateValue.Unset);\n setShouldTrack(cookieState === UserCookieStateValue.Accepted);\n })\n .catch((error: Error) => {\n logger.error(`Failed to set cookie state with error: ${JSON.stringify(error)}`);\n });\n }, [storage, logger]);\n\n const onAccept = useCallback(() => {\n if (!storage) {\n return;\n }\n settings.SetUserCookieState(storage, UserCookieStateValue.Accepted).catch(error => {\n logger.error(`Failed to set cookie state with error: ${JSON.stringify(error)}`);\n });\n setShouldTrack(true);\n setShowDialog(false);\n }, [storage, logger]);\n\n const onDecline = useCallback(() => {\n if (!storage) {\n return;\n }\n settings\n .SetUserCookieState(storage, UserCookieStateValue.Accepted)\n .catch((error: Error) => {\n logger.error(`Failed to set cookie state with error: ${JSON.stringify(error)}`);\n });\n setShouldTrack(false);\n setShowDialog(false);\n }, [logger, storage]);\n\n useEffect(() => {\n if (!shouldTrack) {\n return;\n }\n\n if (!hasInitializedPageTracker) {\n const trackingId = env.getString('google-analytics-tracking-id', DEFAULT_TRACKING_ID);\n ga4.initialize(trackingId);\n setHasInitializedPageTracker(true);\n }\n }, [hasInitializedPageTracker, shouldTrack, env]);\n\n return /* CanEnableAnalytics() &&*/ showDialog && language && translater ? (\n \n ) : null;\n}\n\nexport default Analytics;\n","import type { BrowserHistory } from '@remix-run/router/history';\nimport type { IHistoryAction } from './interface';\n\nfunction action(history: BrowserHistory | undefined): IHistoryAction {\n return {\n go: (count: number) => history?.go(count),\n goBack: () => history?.go(-1),\n goForward: () => history?.go(1),\n push: (path: string) => history?.push(path),\n replace: (path: string) => history?.replace(path),\n };\n}\n\nexport default action;\n","export const TYPES = {\n IHistory: Symbol.for('IHistory'),\n};\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { BrowserHistory, Location } from '@remix-run/router/history';\nimport { TYPES } from './private';\n\nexport type IHistoryTransitionType = 'POP' | 'PUSH' | 'REPLACE';\nexport interface IHistoryEvent {\n action: IHistoryTransitionType;\n pathname: string;\n search: string;\n hash: string;\n}\n\nexport interface IHistoryAction {\n go: (count: number) => void;\n goForward: () => void;\n goBack: () => void;\n push: (path: string) => void;\n replace: (path: string) => void;\n}\n\nexport interface IHistoryTracking {\n length: () => number;\n history: () => Readonly[]>;\n lastEvent: () => Readonly | undefined;\n previousLocation: () => Location | undefined;\n findFirstPathPrefix: (pathPrefix: string[]) => number;\n findPathPrefix: (pathPrefix: string) => number;\n}\n\nexport interface IBrowserHistory {\n browserHistory: () => BrowserHistory | undefined;\n}\n\nexport interface IHistory extends IBrowserHistory, IHistoryAction, IHistoryTracking {}\n\nexport function injectHistory(container: IContainer = injectOrBuildContainer()): IHistory {\n return container.get(TYPES.IHistory);\n}\n\nexport function bindHistory(\n history: IHistory,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IHistory, history);\n}\n\nexport function unbindHistory(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IHistory);\n}\n","import type { BrowserHistory, Location, Update } from '@remix-run/router/history';\nimport type { IHistoryEvent, IHistoryTracking, IHistoryTransitionType } from './interface';\n\nfunction LocationHistory(history: BrowserHistory | undefined): IHistoryTracking {\n const stack: Readonly[] = [];\n let lastEvent: Readonly | undefined;\n\n history?.listen((update: Update) => {\n lastEvent = Object.freeze({\n action: update.action,\n pathname: update.location.pathname,\n search: update.location.search,\n hash: update.location.hash,\n });\n\n const actions: Record void> = {\n PUSH: () => {\n stack.push(Object.freeze(update.location));\n },\n POP: () => {\n stack.splice(-1, 1);\n },\n REPLACE: () => {\n stack.splice(-1, 1, update.location);\n },\n };\n\n actions[update.action]();\n });\n\n function _findPathPrefixIndex(locations: Location[], pathPrefix: string): number {\n for (const location of locations) {\n if (location.pathname.startsWith(pathPrefix)) {\n return locations.indexOf(location);\n }\n }\n return -1;\n }\n\n return {\n length: () => stack.length,\n history: () => Object.freeze(stack),\n lastEvent: () => lastEvent,\n previousLocation: () => stack.at(-1),\n findFirstPathPrefix: function (pathPrefixes: string[]) {\n for (const [index, path] of pathPrefixes.entries()) {\n const indexSearch = _findPathPrefixIndex(stack, path);\n if (indexSearch >= 0) {\n return index;\n }\n }\n return -1;\n },\n findPathPrefix: (pathPrefix: string) => _findPathPrefixIndex(stack, pathPrefix),\n };\n}\n\nexport default LocationHistory;\n","import { buildBindable } from '@monofe/di';\nimport { createBrowserHistory } from '@remix-run/router'; /* Make sure to import the correct version of #history (react-router) */\nimport type { Listener } from '@remix-run/router/history';\nimport action from './action';\nimport type { IHistory } from './interface';\nimport { bindHistory, injectHistory, unbindHistory } from './interface';\nimport { TYPES } from './private';\nimport tracking from './tracking';\n\nconst isRunningOnNodeJS = typeof window === 'undefined';\n\ntype BrowserHistory = ReturnType;\n\n/* Both #BrowserHistory & './tracking' listen to history events, the built-in #BrowserHistory only allows for a single callback\n Replace #listen function for multiple callback support */\nfunction _addMultipleCallbackSupport(history: BrowserHistory): BrowserHistory {\n const callbacks: Listener[] = [];\n\n history.listen(update => {\n callbacks.forEach(callback => {\n callback(update);\n });\n });\n\n return Object.freeze({\n ...history,\n listen: (listener: Listener) => {\n callbacks.push(listener);\n },\n }) as BrowserHistory;\n}\n\nfunction _build(): Promise> {\n const history = isRunningOnNodeJS\n ? undefined\n : _addMultipleCallbackSupport(createBrowserHistory({ window, v5Compat: true }));\n\n return Promise.resolve(\n Object.freeze({\n ...history,\n ...action(history),\n ...tracking(history),\n browserHistory: () => history,\n }),\n );\n}\n\nexport default buildBindable({\n id: TYPES.IHistory,\n bind: bindHistory,\n remove: unbindHistory,\n inject: injectHistory,\n build: _build,\n});\n","export const TYPES = {\n IRouter: Symbol.for('IRouter'),\n};\n","import type { ILog, IQueryURL } from '@monofe/util';\nimport type { IHistory } from '../history/interface';\nimport type { IRoute, IRouter } from './interface';\n\nfunction Router(query: IQueryURL, history: IHistory, log: ILog): IRouter {\n const routes: Record> = {};\n\n const actionPopCount = (popCount: number): boolean => {\n const canPop = popCount <= (history.length() ?? -1);\n\n if (canPop) {\n history.go(-popCount);\n }\n\n return canPop;\n };\n\n const actionPush = (name: string, args: unknown, options?: { replace?: boolean }) => {\n const route = routes[name];\n\n if (!route) {\n return;\n }\n\n route\n .push(history, args)\n .then(result => {\n if (result.didLaunchAction && route) {\n /* Done */\n } else if (result.alternativeRouteSuggested) {\n actionPush(\n result.alternativeRouteSuggested,\n result.alternativeRoutePayload ?? {},\n options,\n );\n }\n })\n .catch((error: Error) => {\n log.error(`Route push failed: ${error.message}`);\n });\n };\n\n return {\n registerRoute: (name: string, route: IRoute) => (routes[name] = route),\n unregisterRoute: (name: string) => delete routes[name],\n push: (name: string, args: unknown, options?: { replace?: boolean }) => {\n actionPush(name, args, options);\n },\n\n popTo: function (name: string): boolean {\n const routeTarget = routes[name];\n\n if (!routeTarget) {\n return false;\n }\n\n const curIdx = history.findFirstPathPrefix(routeTarget.paths) ?? -1;\n\n if (curIdx >= 0) {\n actionPopCount(-curIdx);\n }\n\n const didPop = curIdx >= 0;\n return didPop;\n },\n\n pop: () => actionPopCount(1),\n\n popCount: (popCount: number) => actionPopCount(popCount),\n\n allRoutes: () => Object.values(routes),\n };\n}\n\nexport default Router;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectLog, injectQueryURL, TYPES as UTIL_TYPES } from '@monofe/util';\nimport { injectHistory } from '../history/interface';\nimport { TYPES as HISTORY_TYPES } from '../history/private';\nimport type { IRouter } from './interface';\nimport { bindRouter, injectRouter, unbindRouter } from './interface';\nimport { TYPES as ROUTER_TYPES } from './private';\nimport Router from './router';\n\nfunction _build(container: IContainer): Promise> {\n const query = injectQueryURL(container);\n const history = injectHistory(container);\n const log = injectLog(container);\n const router = Router(query, history, log);\n return Promise.resolve(Object.freeze(router));\n}\n\nexport default buildBindable({\n id: ROUTER_TYPES.IRouter,\n dependencies: [UTIL_TYPES.IQueryURL, HISTORY_TYPES.IHistory, UTIL_TYPES.ILog],\n bind: bindRouter,\n remove: unbindRouter,\n inject: injectRouter,\n build: container => _build(container),\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { ComponentType } from 'react';\nimport type { IHistory } from '../history';\nimport { TYPES } from './private';\n\nexport interface IRouteActionResult {\n didLaunchAction: boolean;\n alternativeRouteSuggested?: string;\n alternativeRoutePayload?: Record;\n}\n\nexport interface IRoute {\n paths: string[];\n push: (history: IHistory, props: T) => Promise;\n replace: (history: IHistory, props: T) => Promise;\n component: ComponentType;\n}\n\nexport interface IRouter {\n registerRoute: (name: string, route: IRoute) => void;\n unregisterRoute: (name: string) => void;\n push: (name: string, args: unknown, options?: { replace?: boolean }) => void;\n popTo: (name: string) => boolean;\n pop: () => boolean;\n popCount: (num: number) => boolean;\n allRoutes: () => IRoute[];\n}\n\nexport function injectRouter(container: IContainer = injectOrBuildContainer()): IRouter {\n return container.get(TYPES.IRouter);\n}\n\nexport function bindRouter(\n router: IRouter,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IRouter, router);\n}\n\nexport function unbindRouter(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IRouter);\n}\n","import { buildBinderListings } from '@monofe/di';\nimport buildA2HS from './a2hs/bind';\nimport buildHistory from './history/bind';\nimport buildRouter from './router/bind';\n\nexport default buildBinderListings([buildHistory, buildRouter, buildA2HS]);\n","import type { A2HSStorage } from './interface';\n\nexport const STORE_NAME = 'A2HSStore';\n\nexport const initialState: A2HSStorage = {\n heading: {\n text: 'Install',\n fontFamily: 'Gill Sans',\n fontSize: 'min(8vmin, 28pt)',\n fontWeight: 500,\n color: '#000',\n visible: true,\n },\n subheading: {\n text: 'Install this app on your home screen for quick access?',\n fontFamily: 'Gill Sans',\n fontSize: 'min(5vmin, 18pt)',\n fontWeight: 500,\n color: '#000',\n visible: true,\n },\n appIconUrl: 'img/AppIcon192.png',\n};\n","import type { PayloadAction } from '@reduxjs/toolkit';\nimport { initialState } from './constants';\nimport type { A2HSStorage } from './interface';\n\nconst reset = (state: A2HSStorage, action: PayloadAction): A2HSStorage => ({\n ...initialState,\n});\n\nconst updateHeadingText = (state: A2HSStorage, newText: PayloadAction): A2HSStorage => ({\n ...state,\n heading: {\n ...state.heading,\n text: String(newText.payload),\n },\n});\n\nconst updateSubHeadingText = (state: A2HSStorage, newText: PayloadAction): A2HSStorage => ({\n ...state,\n heading: {\n ...state.heading,\n text: String(newText.payload),\n },\n});\n\nexport type NamedTypes = keyof typeof module;\n\nexport default Object.freeze({\n reset,\n updateHeadingText,\n updateSubHeadingText,\n});\n","import { createSlice } from '@reduxjs/toolkit';\nimport { initialState, STORE_NAME } from './constants';\nimport reducers from './reducers';\n\nexport const slice = createSlice({\n name: STORE_NAME,\n initialState,\n reducers,\n});\n\nexport default slice.actions;\n","import { injectStoresData, injectStoresReducer } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { AnyAction } from '@reduxjs/toolkit';\nimport { useSelector } from 'react-redux';\nimport { initialState, STORE_NAME } from './constants';\nimport type { A2HSStorage } from './interface';\nimport { slice } from './slice';\n\nexport function isDataStore(object: unknown): object is A2HSStorage {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n const record = object as Partial;\n\n return (\n !isNullOrUndefined(record.heading) &&\n !isNullOrUndefined(record.subheading) &&\n !isNullOrUndefined(record.appIconUrl)\n );\n}\n\nexport function dataFromGlobalStore(globalStore: unknown): A2HSStorage | undefined {\n if (globalStore === undefined || globalStore === null || typeof globalStore !== 'object') {\n return undefined;\n }\n\n const data = (globalStore as Record)[STORE_NAME];\n\n return isDataStore(data) ? data : undefined;\n}\n\nexport function getStore(): A2HSStorage {\n const globalStore = injectStoresData().store.getState() as unknown;\n return dataFromGlobalStore(globalStore) ?? initialState;\n}\n\nexport function useStore(): A2HSStorage {\n const data = useSelector(globalStore => dataFromGlobalStore(globalStore));\n return data ?? initialState;\n}\n\nexport function setupStore(container: IContainer = injectOrBuildContainer()) {\n const reducerRegister = injectStoresReducer(container);\n reducerRegister.addSlice(slice);\n}\n\nexport function dispatchAction(action: AnyAction) {\n const store = injectStoresData();\n store.dispatch(action);\n}\n","import type { IModuleAction } from './interface';\nimport actions from './slice';\nimport { dispatchAction as dispatch } from './store';\n\nfunction Action(): IModuleAction {\n return {\n reset: () => {\n dispatch(actions.reset());\n },\n updateHeadingText: (newText: string) => {\n dispatch(actions.updateHeadingText(newText));\n },\n updateSubHeadingText: (newText: string) => {\n dispatch(actions.updateSubHeadingText(newText));\n },\n };\n}\n\nexport default Action;\n","import action from './actions';\nimport type { IModuleState } from './interface';\nimport { getStore as getState, setupStore as initialize, useStore } from './store';\n\nfunction ModuleState(): IModuleState {\n initialize();\n\n return {\n useState: useStore,\n getState,\n action: action(),\n };\n}\n\nexport default ModuleState;\n","export default function AppIconView(props: { url: string; description?: string }): JSX.Element {\n return (\n \n );\n}\n","import type { CSSProperties } from 'react';\nimport type { IInstallBannerView } from './InstallBannerView.interface';\nimport styles from './InstallBannerView.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n Heading = 'Heading',\n SubHeading = 'SubHeading',\n Footer = 'Footer',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n [StyleElem.Heading]: {},\n [StyleElem.SubHeading]: {},\n [StyleElem.Footer]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IInstallBannerView) => ({}),\n [StyleElem.Heading]: (props: IInstallBannerView) => ({\n color: props.heading.color,\n fontWeight: props.heading.fontWeight,\n fontFamily: props.heading.fontFamily,\n fontSize: props.heading.fontSize,\n lineHeight: props.heading.fontSize,\n opacity: props.heading.visible ? 1 : 0,\n }),\n [StyleElem.SubHeading]: (props: IInstallBannerView) => ({\n color: props.subheading.color,\n fontWeight: props.subheading.fontWeight,\n fontFamily: props.subheading.fontFamily,\n fontSize: props.subheading.fontSize,\n lineHeight: props.subheading.fontSize,\n opacity: props.subheading.visible ? 1 : 0,\n }),\n [StyleElem.Footer]: (props: IInstallBannerView) => ({}),\n};\n\nexport function classNameForElement(element: StyleElem, props: IInstallBannerView): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(element: StyleElem, props: IInstallBannerView): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props) };\n\n return style;\n}\n","import type { CSSProperties } from 'react';\n\nexport default function HeadingView(props: {\n text: string;\n style?: CSSProperties;\n className?: string;\n}): JSX.Element {\n return (\n

\n {props.text}\n

\n );\n}\n","import { IconAppleShare } from '@monofe/ui-common/icon';\nimport type { CSSProperties, ReactNode } from 'react';\nimport AppIconView from './AppIconView';\nimport type { IInstallBannerView } from './InstallBannerView.interface';\nimport { classNameForElement, StyleElem, styleForElement } from './InstallBannerView.style';\nimport { default as HeadingView, default as SubHeadingView } from './SubHeadingView';\n\ninterface StyleProps {\n style?: CSSProperties;\n className?: string;\n}\n\nfunction FooterView(props: StyleProps): JSX.Element {\n return (\n

\n Just tap\n \n & 'add to home screen'\n

\n );\n}\n\nfunction InnerDiv(props: { children?: ReactNode } & StyleProps): JSX.Element {\n return (\n \n {props.children}\n \n );\n}\n\nfunction InstallBannerView(props: IInstallBannerView): JSX.Element {\n const style = (element: StyleElem) => styleForElement(element, props);\n const className = (element: StyleElem) => classNameForElement(element, props);\n\n return (\n \n \n \n \n \n \n \n {props.children}\n \n );\n}\n\nexport default InstallBannerView;\n","import type { CSSProperties } from 'react';\nimport type { IA2HSState } from '../interface';\nimport styles from './MainView.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n InstallBanner = 'InstallBanner',\n IconCross = 'IconCross',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n [StyleElem.InstallBanner]: {},\n [StyleElem.IconCross]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IA2HSState) => ({}),\n [StyleElem.InstallBanner]: (props: IA2HSState) => ({}),\n [StyleElem.IconCross]: (props: IA2HSState) => ({}),\n};\n\nexport function classNameForElement(element: StyleElem, props: IA2HSState): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(element: StyleElem, props: IA2HSState): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props) };\n\n return style;\n}\n","import { IconCross } from '@monofe/ui-common/icon';\nimport type { IA2HSState } from '../interface';\nimport InstallBannerView from './InstallBannerView';\nimport { classNameForElement, StyleElem, styleForElement } from './MainView.style';\n\nfunction MainView(props: IA2HSState): JSX.Element {\n const style = (element: StyleElem) => styleForElement(element, props);\n const className = (element: StyleElem) => classNameForElement(element, props);\n\n return (\n
\n \n \n \n
\n );\n}\n\nexport default MainView;\n","import { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { IA2HS } from './interface';\nimport { bindA2HS, injectA2HS, unbindA2HS } from './interface';\nimport { TYPES } from './private';\nimport store from './state';\nimport type { IModuleState } from './state/interface';\nimport { useNeedsPopUp, useStateHasShown } from './util/hook';\nimport MainView from './views/MainView';\n\nfunction _buildLocalDependencies(container: IContainer) {\n return Promise.resolve({\n store: store(),\n });\n}\n\nfunction _buildModule(deps: { store: IModuleState }): IA2HS {\n let hasSetSiteName = false;\n const Render = (): JSX.Element | null => {\n const store = deps.store.useState();\n const [hasShown, setHasShown] = useStateHasShown();\n const canShow = useNeedsPopUp();\n\n if (!hasSetSiteName || hasShown || !canShow) {\n return null;\n }\n\n return (\n {\n setHasShown(true);\n }}\n style={{ width: '100%', height: '100%' }}\n >\n \n \n );\n };\n\n const alert: IA2HS = {\n renderer: Render,\n setSiteName: (siteName: string) => {\n deps.store.action.updateHeadingText(`Install ${siteName || 'site'}`);\n hasSetSiteName = true;\n },\n };\n\n return alert;\n}\n\nasync function binder(container: IContainer): Promise> {\n const deps = await _buildLocalDependencies(container);\n\n const module = _buildModule(deps);\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: TYPES.IA2HS,\n dependencies: [APPSTATE_TYPES.IStoresReducer],\n bind: bindA2HS,\n remove: unbindA2HS,\n inject: injectA2HS,\n build: container => binder(container),\n});\n","import { IBrowserPlatform, injectKVStorage, useBrowser, useKVState } from '@monofe/util';\n\nexport const useStateHasShown = (): [boolean, (newValue: boolean) => void] =>\n useKVState('InstallBannerShown', Promise.resolve(injectKVStorage()), false);\n\nexport function useNeedsPopUp(): boolean {\n const browser = useBrowser();\n return browser?.platform === IBrowserPlatform.MobileiOS && !browser.isInstalled;\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport { TYPES } from './private';\n\nexport interface IA2HSState {\n appIconUrl: string;\n heading: ITextProps;\n subheading: ITextProps;\n}\n\nexport interface ITextProps {\n text: string;\n fontFamily: string;\n fontSize: string;\n fontWeight: number;\n color: string;\n visible: boolean;\n}\n\nexport interface IA2HS {\n renderer: () => JSX.Element | null;\n setSiteName: (newName: string) => void;\n}\n\nexport function injectA2HS(container: IContainer = injectOrBuildContainer()): IA2HS {\n return container.get(TYPES.IA2HS);\n}\n\nexport function bindA2HS(A2HS: IA2HS, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IA2HS, A2HS);\n}\n\nexport function unbindA2HS(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IA2HS);\n}\n","export const TYPES = {\n IA2HS: Symbol.for('IA2HS'),\n};\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type {\n Action,\n AnyAction,\n EnhancedStore,\n ListenerMiddlewareInstance,\n Middleware,\n PayloadAction,\n Reducer,\n Slice,\n SliceCaseReducers,\n ThunkDispatch,\n} from '@reduxjs/toolkit';\nimport type { ReactNode } from 'react';\n\nexport enum IStoreMiddlewareType {\n Undef = 0,\n Logger = 1,\n SideEffect = 2,\n Other = 3,\n LastValue = 4,\n}\n\nexport type MiddlewareSideEffect = ListenerMiddlewareInstance<\n unknown,\n ThunkDispatch\n>;\n\nexport interface IStoreMiddlewareMap {\n [IStoreMiddlewareType.Logger]: Middleware;\n [IStoreMiddlewareType.SideEffect]: MiddlewareSideEffect;\n}\n\nexport interface IStoreMiddlewares {\n get: (\n type: Type,\n ) => Value | undefined;\n add: (middleware: Middleware) => void;\n remove: (middleware: Middleware) => void;\n all: () => Middleware[];\n}\n\nexport type ReducerUnknown = Reducer>;\nexport type ReducerActionReset = (state: any, payload: PayloadAction) => void;\nexport type ReducerSlice = Slice & { reset: ReducerActionReset }>;\n\nexport type CallbackEmpty = () => void;\n\nexport interface ReducerManagerEventMap {\n SliceAdded: (slice: ReducerSlice) => void;\n ReducersChanged: CallbackEmpty;\n}\n\nexport type SubscriberList = {\n [key in keyof ReducerManagerEventMap]: ReducerManagerEventMap[key][];\n};\n\nexport interface IReducerRegister {\n getReducerMap: () => Record;\n reduce: (state: any, action: Action) => void;\n addSlice: (slice: ReducerSlice) => void;\n add: (key: string, reducer: ReducerUnknown) => void;\n remove: (key: string) => void;\n subscribe: (\n event: K,\n callback: ReducerManagerEventMap[K],\n ) => void;\n unsubscribe: (\n event: K,\n callback: ReducerManagerEventMap[K],\n ) => void;\n}\n\nexport interface IStoresData {\n store: EnhancedStore;\n dispatch: (action: T) => T;\n}\n\nexport interface IStoresRenderer {\n render: (props: { children?: ReactNode }) => JSX.Element;\n}\n\nexport const TYPES = {\n IStoreMiddlewares: Symbol.for('IStoreMiddlewares'),\n IStoresReducer: Symbol.for('IStoresReducer'),\n IStoresData: Symbol.for('IStoresData'),\n IStoresRenderer: Symbol.for('IStoresRenderer'),\n};\n\nexport function injectStoresMiddleware(\n container: IContainer = injectOrBuildContainer(),\n): IStoreMiddlewares {\n return container.get(TYPES.IStoreMiddlewares);\n}\n\nexport function bindStoresMiddleware(\n val: IStoreMiddlewares,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IStoreMiddlewares, val);\n}\n\nexport function unbindStoresMiddleware(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IStoreMiddlewares);\n}\n\nexport function injectStoresData(container: IContainer = injectOrBuildContainer()): IStoresData {\n return container.get(TYPES.IStoresData);\n}\n\nexport function bindStoresReducer(\n val: IReducerRegister,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IStoresReducer, val);\n}\n\nexport function unbindStoresReducer(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IStoresReducer);\n}\n\nexport function injectStoresReducer(\n container: IContainer = injectOrBuildContainer(),\n): IReducerRegister {\n return container.get(TYPES.IStoresReducer);\n}\n\nexport function bindStoresData(\n val: IStoresData,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IStoresData, val);\n}\n\nexport function unbindStoresData(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IStoresData);\n}\n\nexport function injectStoresRenderer(\n container: IContainer = injectOrBuildContainer(),\n): IStoresRenderer {\n return container.get(TYPES.IStoresRenderer);\n}\n\nexport function bindStoresRenderer(\n val: IStoresRenderer,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IStoresRenderer, val);\n}\n\nexport function unbindStoresRenderer(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IStoresRenderer);\n}\n","import { createListenerMiddleware } from '@reduxjs/toolkit';\n\nconst builderListenerMiddleware = () => {\n const listenerMiddleware = createListenerMiddleware();\n\n return listenerMiddleware;\n};\n\nexport default builderListenerMiddleware;\n","import type { Dispatch, Middleware, MiddlewareAPI } from '@reduxjs/toolkit';\nimport { compose } from 'redux';\n\nexport interface IInterceptorMiddleware {\n all: () => Middleware[];\n add: (mw: Middleware) => void;\n remove: (mw: Middleware) => void;\n middleware: () => Middleware;\n}\n\nconst builderInterceptorMiddleware = (): IInterceptorMiddleware => {\n const middlewares: Middleware[] = [];\n\n const interceptorMiddleware: Middleware =\n ({ getState, dispatch }: MiddlewareAPI) =>\n (next: Dispatch) =>\n (action: MiddlewareAPI) => {\n const middlewareAPI: MiddlewareAPI = {\n getState,\n dispatch,\n };\n\n const chain = middlewares.map(middleware => middleware(middlewareAPI));\n\n compose<(action: MiddlewareAPI) => void>(...chain)(next)(action);\n };\n\n const middleware: IInterceptorMiddleware = {\n all: () => middlewares,\n add: (mw: Middleware) => middlewares.push(mw),\n remove: (mw: Middleware) => {\n const index = middlewares.indexOf(mw);\n if (index >= 0) {\n middlewares.splice(index);\n }\n },\n middleware: () => interceptorMiddleware,\n };\n\n return middleware;\n};\n\nexport default builderInterceptorMiddleware;\n","import type { ILog } from '@monofe/util';\nimport type { Dispatch, Middleware, MiddlewareAPI } from '@reduxjs/toolkit';\n\nconst builderLoggerMiddleware = (logger: ILog) => {\n const loggerMiddleware: Middleware =\n ({ getState }: MiddlewareAPI) =>\n (next: Dispatch) =>\n action => {\n logger.verbose(`Dispatching ${JSON.stringify(action)}`);\n\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */\n const returnValue = next(action);\n\n logger.verbose(`State post dispatch ${JSON.stringify(getState())}`);\n\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-return */\n return returnValue;\n };\n\n return loggerMiddleware;\n};\n\nexport default builderLoggerMiddleware;\n","import type { IEnv, ILog } from '@monofe/util';\nimport type { Middleware } from '@reduxjs/toolkit';\nimport type { IStoreMiddlewareMap, IStoreMiddlewares } from '../interface';\nimport { IStoreMiddlewareType } from '../interface';\nimport effect from './effect';\nimport interceptor from './interceptor';\nimport logger from './logger';\n\nconst buildMiddlewares = (log: ILog, env: IEnv): IStoreMiddlewares => {\n const isProduction = env.getString('NODE_ENV', 'production') === 'production';\n\n const middlewareLogger = !isProduction ? logger(log) : undefined;\n const middlewareEffect = effect();\n\n const middlewareInterceptor = interceptor();\n\n if (middlewareLogger) {\n middlewareInterceptor.add(middlewareLogger);\n }\n\n middlewareInterceptor.add(middlewareEffect.middleware);\n\n const middlewareMap: Partial = {\n [IStoreMiddlewareType.Logger]: middlewareLogger,\n [IStoreMiddlewareType.SideEffect]: middlewareEffect,\n } as const;\n\n const middlewares: IStoreMiddlewares = {\n get: (\n type: Type,\n ) => middlewareMap[type] as Value | undefined,\n add: (middleware: Middleware) => {\n middlewareInterceptor.add(middleware);\n },\n remove: (middleware: Middleware) => {\n middlewareInterceptor.remove(middleware);\n },\n all: () => [middlewareInterceptor.middleware()],\n };\n\n return middlewares;\n};\n\nexport default buildMiddlewares;\n","import { buildBindable } from '@monofe/di';\nimport { injectENV, injectLog, TYPES as UTIL_TYPES } from '@monofe/util';\nimport type { IStoreMiddlewares } from '../interface';\nimport {\n bindStoresMiddleware,\n injectStoresMiddleware,\n TYPES,\n unbindStoresMiddleware,\n} from '../interface';\nimport buildMiddlewares from './builder';\n\nexport default buildBindable({\n id: TYPES.IStoreMiddlewares,\n dependencies: [UTIL_TYPES.ILog, UTIL_TYPES.IEnv],\n bind: bindStoresMiddleware,\n remove: unbindStoresMiddleware,\n build: container => {\n const logger = injectLog(container);\n const env = injectENV(container);\n return Promise.resolve(buildMiddlewares(logger, env));\n },\n inject: injectStoresMiddleware,\n});\n","import type { Action } from '@reduxjs/toolkit';\nimport { combineReducers } from '@reduxjs/toolkit';\nimport type {\n CallbackEmpty,\n IReducerRegister,\n ReducerManagerEventMap,\n ReducerSlice,\n ReducerUnknown,\n SubscriberList,\n} from '../interface';\n\nconst _defaultReducer: ReducerUnknown = (state, action) => state;\n\nexport default function registry(initialReducers?: Record) {\n /* Create an object which maps keys to reducers */\n const reducers: Record = { ...(initialReducers ?? {}) };\n\n const subscribers: SubscriberList = {\n SliceAdded: [],\n ReducersChanged: [],\n };\n\n /* Create the initial combinedReducer */\n let combinedReducer = initialReducers ? combineReducers(reducers) : _defaultReducer;\n\n /* An array which is used to delete state keys when reducers are removed */\n let keysToRemove: string[] = [];\n\n const manager: IReducerRegister = {\n getReducerMap: () => ({ ...reducers }),\n\n /* The root reducer function exposed by this object\n This will be passed to the store */\n reduce: (stateIn: Record, action: Action) => {\n let newState = stateIn;\n\n /* If any reducers have been removed, clean up their state first */\n if (keysToRemove.length > 0) {\n newState = { ...stateIn };\n for (const key of keysToRemove) {\n delete newState[key];\n }\n keysToRemove = [];\n }\n\n /* Delegate to the combined reducer */\n return combinedReducer(newState, action);\n },\n\n addSlice: (slice: ReducerSlice) => {\n if (!slice.name || reducers[slice.name]) {\n return;\n }\n\n reducers[slice.name] = slice.reducer;\n\n combinedReducer = combineReducers(reducers);\n\n subscribers.ReducersChanged.forEach(cb => {\n cb();\n });\n subscribers.SliceAdded.forEach(cb => {\n cb(slice);\n });\n },\n\n /* Adds a new reducer with the specified key */\n add: (key: string, reducer: ReducerUnknown) => {\n if (!key || reducers[key]) {\n return;\n }\n\n /* Add the reducer to the reducer mapping */\n reducers[key] = reducer;\n\n /* Generate a new combined reducer */\n combinedReducer = combineReducers(reducers);\n\n subscribers.ReducersChanged.forEach(cb => {\n cb();\n });\n },\n\n /* Removes a reducer with the specified key */\n remove: (key: string) => {\n if (!key || !reducers[key]) {\n return;\n }\n\n /* Remove it from the reducer mapping */\n delete reducers[key];\n\n /* Add the key to the list of keys to clean up */\n keysToRemove.push(key);\n\n /* Generate a new combined reducer */\n combinedReducer = combineReducers(reducers);\n\n subscribers.ReducersChanged.forEach(cb => {\n cb();\n });\n },\n\n subscribe: (\n event: K,\n callback: ReducerManagerEventMap[K],\n ) => {\n const callbacks = subscribers[event];\n callbacks.push(callback as CallbackEmpty);\n subscribers[event] = callbacks;\n },\n\n unsubscribe: (\n event: K,\n callback: ReducerManagerEventMap[K],\n ) => {\n const callbacks = subscribers[event].filter(cb => cb !== callback);\n subscribers[event] = callbacks as SubscriberList[K];\n },\n };\n\n return manager;\n}\n","import { buildBindable } from '@monofe/di';\nimport type { IReducerRegister } from '../interface';\nimport { bindStoresReducer, injectStoresReducer, TYPES, unbindStoresReducer } from '../interface';\nimport register from './register';\n\nexport default buildBindable({\n id: TYPES.IStoresReducer,\n bind: bindStoresReducer,\n remove: unbindStoresReducer,\n build: () => Promise.resolve(register()),\n inject: injectStoresReducer,\n});\n","import type { ReactNode } from 'react';\nimport { Provider } from 'react-redux';\nimport type { IStoresData, IStoresRenderer } from '../interface';\n\nfunction renderer(store: IStoresData): IStoresRenderer {\n const StoreRender = (props: { children?: ReactNode }): JSX.Element => (\n {props.children}\n );\n\n const storeRender: IStoresRenderer = {\n render: StoreRender,\n };\n\n return storeRender;\n}\n\nexport default renderer;\n","import { buildBindable } from '@monofe/di';\nimport type { IStoresRenderer } from '../interface';\nimport {\n bindStoresRenderer,\n injectStoresData,\n injectStoresRenderer,\n TYPES,\n unbindStoresRenderer,\n} from '../interface';\nimport renderer from './StoreRender';\n\nexport default buildBindable({\n id: TYPES.IStoresRenderer,\n dependencies: [TYPES.IStoresData],\n bind: bindStoresRenderer,\n remove: unbindStoresRenderer,\n inject: injectStoresRenderer,\n build: container => {\n const stores = injectStoresData(container);\n return Promise.resolve(renderer(stores));\n },\n});\n","import { configureStore } from '@reduxjs/toolkit';\nimport type { IReducerRegister, IStoreMiddlewares, IStoresData, ReducerSlice } from '../interface';\n\nfunction buildStore(\n reducerRegister: IReducerRegister,\n middlewares: IStoreMiddlewares,\n): IStoresData {\n const store = configureStore({\n reducer: reducerRegister.reduce,\n devTools: true,\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware({\n serializableCheck: false,\n }).concat(middlewares.all()),\n });\n\n const newSliceAdded = (slice: ReducerSlice) => {\n store.replaceReducer(reducerRegister.reduce);\n\n /* Initialize slice-state */\n slice.actions.reset();\n };\n\n reducerRegister.subscribe('SliceAdded', newSliceAdded);\n\n const data: IStoresData = {\n store,\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-return */\n dispatch: (action: any) => store.dispatch(action),\n };\n\n return data;\n}\n\nexport default buildStore;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { IStoresData } from '../interface';\nimport {\n bindStoresData,\n injectStoresData,\n injectStoresMiddleware,\n injectStoresReducer,\n TYPES,\n unbindStoresData,\n} from '../interface';\nimport store from './store';\n\nexport default buildBindable({\n id: TYPES.IStoresData,\n dependencies: [TYPES.IStoresReducer, TYPES.IStoreMiddlewares],\n bind: bindStoresData,\n remove: unbindStoresData,\n inject: injectStoresData,\n build: (container: IContainer) => {\n const registry = injectStoresReducer(container);\n const middleware = injectStoresMiddleware(container);\n return Promise.resolve(store(registry, middleware));\n },\n});\n","import { buildBinderListings } from '@monofe/di';\nimport bindMiddleware from '../middleware/binder';\nimport bindReducer from '../reducer/binder';\nimport bindRender from '../render/binder';\nimport bindStores from '../store/binder';\n\nexport default buildBinderListings([bindMiddleware, bindReducer, bindStores, bindRender]);\n","/* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/dot-notation */\nconst BUILD_ENVIRONMENT = String(process.env['NODE_ENV']) || 'unknown';\n\nconst _isProduction = (): boolean => {\n try {\n /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */\n return BUILD_ENVIRONMENT === 'production';\n } catch (error: unknown) {\n return true;\n }\n};\n\nexport default Object.freeze({\n isProduction: _isProduction(),\n});\n","import env from './env';\n\nconst settings = {\n loggingEnabled: env.isProduction,\n};\n\nexport default Object.freeze({\n logging: {\n enable: () => {\n settings.loggingEnabled = true;\n },\n disable: () => {\n settings.loggingEnabled = false;\n },\n isEnabled: () => settings.loggingEnabled,\n },\n});\n","import settings from './settings';\n\nconst _logWarn = (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.warn(message);\n};\n\nconst _logError = (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.error(message);\n};\n\nconst _noop = (message: string): void => {\n /* Nothing to do */\n};\n\nexport default Object.freeze({\n warn: settings.logging.isEnabled() ? _logWarn : _noop,\n error: settings.logging.isEnabled() ? _logError : _noop,\n});\n","import type { IBinderRegistry } from '../interface';\nimport type { IContainer } from '../interface/container';\nimport log from './log';\n\n/* eslint-disable-next-line no-restricted-globals */\nconst globalStorage: Record = typeof window === 'undefined' ? globalThis : window;\n\nconst KEY_CONTAINER = 'container';\nconst KEY_REGISTRY = 'binder';\n\nexport default Object.freeze({\n getContainerMap: () => {\n let value = globalStorage[KEY_CONTAINER] as\n | Record\n | undefined;\n\n if (!value) {\n log.warn('No containers found! Creating new');\n value = {};\n globalStorage[KEY_CONTAINER] = value;\n }\n\n return value;\n },\n setContainerMap: (newValue: Record | undefined) =>\n (globalStorage[KEY_CONTAINER] = newValue),\n\n getBinderMap: () => {\n let value = globalStorage[KEY_REGISTRY] as\n | Record\n | undefined;\n\n if (!value) {\n log.warn('No binders found! Creating new');\n value = {};\n globalStorage[KEY_REGISTRY] = value;\n }\n\n return value;\n },\n setBinderMap: (newValue: Record | undefined) =>\n (globalStorage[KEY_REGISTRY] = newValue),\n});\n","import globalStorage from './globalStorage';\nimport log from './log';\nimport settings from './settings';\n\nexport default Object.freeze({\n globalStorage,\n log,\n settings,\n});\n","import type { IBinder } from '../interface/binder';\nimport type { IContainer } from '../interface/container';\nimport util from '../private';\n\nexport function isBinder(object: unknown): object is IBinder {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial> = object as Partial>;\n\n return (\n !isNullOrUndefined(record.id) &&\n !isNullOrUndefined(record.dependencies) &&\n !isNullOrUndefined(record.bind) &&\n !isNullOrUndefined(record.remove) &&\n !isNullOrUndefined(record.expose) &&\n !isNullOrUndefined(record.inject) &&\n !isNullOrUndefined(record.build)\n );\n}\n\nexport function buildBindable(\n args: Readonly<{\n id: Readonly;\n dependencies?: symbol[];\n bind: (value: T, container: IContainer) => void;\n remove: (container: IContainer) => void;\n inject: (container: IContainer) => T;\n build: (container: IContainer) => Promise;\n }>,\n): Readonly> {\n const binder: IBinder = {\n id: args.id,\n dependencies: args.dependencies ?? [],\n bind: async container => {\n /* Make sure we don't recreate it, if it already exists */\n if (container.exists(args.id)) {\n util.log.warn(`Attempted to re-build ${args.id.toString()} (already in container)`);\n } else {\n const builderResult = await args.build(container);\n args.bind(builderResult, container);\n }\n },\n remove: container => {\n args.remove(container);\n },\n expose: (srcContainer: IContainer, dstContainer: IContainer) => {\n const existingModule = args.inject(srcContainer);\n args.bind(existingModule, dstContainer);\n },\n inject: async container => {\n const value: T | undefined = args.inject(container);\n\n if (value !== undefined) {\n return value;\n }\n\n const build = await args.build(container);\n\n args.bind(build, container);\n\n return build;\n },\n build: args.build,\n };\n\n return Object.freeze(binder);\n}\n","import type { IBinder } from '../interface/binder';\nimport type { IBinderListings } from '../interface/binderListings';\n\nexport function isBinderListings(object: unknown): object is IBinderListings {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.id) &&\n !isNullOrUndefined(record.bindersForSymbol) &&\n !isNullOrUndefined(record.bindersForSymbols) &&\n !isNullOrUndefined(record.exists) &&\n !isNullOrUndefined(record.allKeys) &&\n !isNullOrUndefined(record.allBinders)\n );\n}\n\nexport function buildBinderListings(\n listings: (IBinder | IBinderListings)[],\n id?: symbol,\n): Readonly {\n const allListings = listings.flatMap(listing =>\n isBinderListings(listing) ? listing.allBinders() : listing,\n );\n\n return Object.freeze({\n id: id ?? Symbol('binder-listings'),\n bindersForSymbol: (search: symbol) => allListings.find(item => item.id === search),\n bindersForSymbols: (search: symbol[]) =>\n allListings.filter(item => search.includes(item.id)),\n exists: (key: symbol[] | symbol) => allListings.some(item => item.id === key),\n allKeys: () => allListings.map(item => item.id),\n allBinders: () => allListings,\n });\n}\n","import type { IContainer } from '../interface/container';\n\ninterface IContainerPrv extends IContainer {\n _map: Map;\n _parents: IContainer[];\n}\n\nexport function buildObjectContainer(parents: IContainer[] = []): IContainer {\n const container: IContainerPrv = {\n _map: new Map(),\n _parents: parents,\n exists(key: symbol) {\n const valueMap =\n this._map.get(key) ??\n this._parents.find(containerSearch => containerSearch.get(key))?.get(key);\n\n return Boolean(valueMap);\n },\n get(this: IContainerPrv, key: symbol): T {\n const valueMap = (this._map.get(key) ??\n this._parents.find(containerSearch => containerSearch.get(key))?.get(key)) as\n | T\n | undefined;\n\n if (valueMap === undefined || valueMap === null) {\n const values = Array.from(this._map.keys()).map(entry => entry.toString());\n throw new Error(\n `Failed to resolve symbol:${String(key)} in container:${values.toString()}:${\n values.length\n }`,\n );\n }\n\n return valueMap;\n },\n bind(this: IContainerPrv, key: symbol, value: unknown) {\n this._map.set(key, value);\n },\n importBindings(this: IContainerPrv, containerImport: IContainer) {\n this._parents.unshift(containerImport);\n },\n remove(this: IContainerPrv, key: symbol) {\n this._map.delete(key);\n },\n };\n\n return container as IContainer;\n}\n","import type { IBinderListings, IBinderRegistry, IContainer } from '../interface';\nimport type { IBinder } from '../interface/binder';\nimport { isBinder } from './binder';\nimport { buildBinderListings, isBinderListings } from './binderListings';\nimport { buildObjectContainer } from './container';\n\nconst _findBindable = (listings: IBinderListings[], key: symbol): IBinder | undefined => {\n for (const listing of listings) {\n const item = listing.bindersForSymbol(key);\n\n if (item) {\n return item;\n }\n }\n\n return undefined;\n};\n\nconst _indexOfListing = (listings: IBinderListings[], id: symbol): number => {\n const item = listings.find(itemSearch => itemSearch.id === id);\n return item ? listings.indexOf(item) : -1;\n};\n\nasync function _resolve(\n listings: IBinderListings[],\n container: IContainer,\n key: symbol,\n): Promise {\n const binder = _findBindable(listings, key);\n\n if (binder) {\n await Promise.all(\n binder.dependencies.map(dependencyKey => _resolve(listings, container, dependencyKey)),\n );\n await binder.bind(container);\n const value = await binder.inject(container);\n return value as T;\n }\n\n return undefined;\n}\n\nexport function isBinderRegistry(object: unknown): object is IBinderRegistry {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.exists) &&\n !isNullOrUndefined(record.get) &&\n !isNullOrUndefined(record.addListing) &&\n !isNullOrUndefined(record.removeListing) &&\n !isNullOrUndefined(record.listings) &&\n !isNullOrUndefined(record.addListings) &&\n !isNullOrUndefined(record.removeListings) &&\n !isNullOrUndefined(record.addBindable) &&\n !isNullOrUndefined(record.removeBindable) &&\n !isNullOrUndefined(record.container) &&\n !isNullOrUndefined(record.resolve) &&\n !isNullOrUndefined(record.resolveAll)\n );\n}\n\nexport function buildBinderRegistry(parents: IBinderRegistry[] = []): Readonly {\n const parentContainers = parents.map(parent => parent.container());\n const container = buildObjectContainer(parentContainers);\n\n const publicListings: IBinderListings[] = [];\n const privateListings: IBinderListings[] = [];\n const _parents: IBinderRegistry[] = parents;\n\n const binderRegistry: IBinderRegistry = {\n exists: (key: symbol) => _findBindable(publicListings, key) !== undefined,\n\n async get(this: IBinderRegistry, key: symbol) {\n const isPrivate = _findBindable(privateListings, key) !== undefined;\n\n if (isPrivate) {\n return undefined;\n }\n\n if (container.exists(key)) {\n return container.get(key);\n }\n\n for (const parent of _parents) {\n if (!parent.exists(key)) {\n continue;\n }\n\n const result = await parent.get(key).catch(() => undefined);\n\n if (result) {\n return result;\n }\n }\n\n /* Don't allow explicit dereferencing of symbols declared as private, however expose \n it to #_resolve as it may be needed as part of the dependency graph to resolve */\n const result = await _resolve(\n [...publicListings, ...privateListings],\n container,\n key,\n );\n\n if (!result) {\n throw new Error(`Unable to resolve symbol:${String(key)}`);\n }\n\n return result;\n },\n addListing: (listing: IBinderListings, hidden?: boolean): void => {\n const list = hidden ?? false ? privateListings : publicListings;\n list.push(listing);\n },\n removeListing: (listing: IBinderListings): void => {\n publicListings.slice(publicListings.indexOf(listing), 1);\n privateListings.slice(publicListings.indexOf(listing), 1);\n },\n addListings: (listings: Readonly[]>, hidden?: boolean): void => {\n const list = hidden ?? false ? privateListings : publicListings;\n list.push(...listings);\n },\n removeListings: (listings: Readonly[]>): void => {\n listings.forEach(listing => publicListings.slice(publicListings.indexOf(listing), 1));\n listings.forEach(listing => privateListings.slice(privateListings.indexOf(listing), 1));\n },\n listings: () => publicListings,\n addBindable: (binder: IBinder, hidden?: boolean) => {\n const list = hidden ?? false ? privateListings : publicListings;\n list.push(buildBinderListings([binder], binder.id));\n },\n removeBindable: (binder: IBinder) => {\n privateListings.splice(_indexOfListing(privateListings, binder.id), 1);\n publicListings.splice(_indexOfListing(publicListings, binder.id), 1);\n },\n container: () => container,\n async resolve(\n this: IBinderRegistry,\n items: Readonly<(IBinder | IBinderListings | symbol)[]>,\n ): Promise {\n const allKeys = items.flatMap(item => {\n if (typeof item === 'symbol') {\n return [item];\n } else if (isBinder(item)) {\n return [item.id];\n } else if (isBinderListings(item)) {\n return item.allKeys();\n }\n return [undefined];\n });\n\n const resolvers = allKeys\n .filter(item => item !== undefined)\n .map(item => (item ? this.get(item) : Promise.resolve()));\n\n await Promise.all(resolvers);\n },\n async resolveAll(this: IBinderRegistry) {\n const allKeys = [...privateListings, ...publicListings].flatMap(listing =>\n listing.allKeys(),\n );\n\n for (const key of allKeys) {\n await this.get(key);\n }\n },\n };\n\n return Object.freeze(binderRegistry);\n}\n","import type { IContainer } from '../interface/container';\nimport utils from '../private';\n\nexport function injectContainer(name = 'default'): IContainer | undefined {\n const containers = utils.globalStorage.getContainerMap();\n\n const container = containers[name];\n\n return container;\n}\n\nexport function bindContainer(container: IContainer, name = 'default'): void {\n const containers = utils.globalStorage.getContainerMap();\n\n if (containers[name] !== undefined) {\n utils.log.warn(`Overwriting container: ${name}`);\n }\n\n containers[name] = container;\n}\n\nexport function removeContainer(name = 'default'): void {\n const containers = utils.globalStorage.getContainerMap();\n\n if (containers[name] !== undefined) {\n delete containers[name];\n }\n}\n","import { bindContainer, buildObjectContainer, injectContainer } from '../impl';\nimport type { IContainer } from '../interface';\n\nexport function injectOrBuildContainer(name = 'default'): IContainer {\n let container = injectContainer(name);\n\n if (!container) {\n container = buildObjectContainer();\n bindContainer(container, name);\n }\n\n return container;\n}\n","import type { CSSProperties } from 'react';\nimport type { IPopUpViewProps } from './PopUpView';\nimport styles from './PopUpView.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n AlertContainer = 'AlertContainer',\n AlertTitle = 'AlertTitle',\n AlertOptionYes = 'AlertOptionYes',\n AlertOptionNo = 'AlertOptionNo',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n [StyleElem.AlertContainer]: {},\n [StyleElem.AlertTitle]: {},\n [StyleElem.AlertOptionYes]: {},\n [StyleElem.AlertOptionNo]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IPopUpViewProps) => ({\n opacity: props.show ?? false ? 1 : 0,\n pointerEvents: props.show ?? false ? 'auto' : 'none',\n }),\n [StyleElem.AlertContainer]: (props: IPopUpViewProps) => ({}),\n [StyleElem.AlertTitle]: (props: IPopUpViewProps) => ({}),\n [StyleElem.AlertOptionYes]: (props: IPopUpViewProps) => ({}),\n [StyleElem.AlertOptionNo]: (props: IPopUpViewProps) => ({}),\n};\n\nexport function classNameForElement(element: StyleElem, props: IPopUpViewProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(element: StyleElem, props: IPopUpViewProps): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props) };\n\n return style;\n}\n","import type { UIEvent } from 'react';\nimport { useCallback } from 'react';\nimport Button from '../button/HighlightableButton';\nimport { classNameForElement, StyleElem, styleForElement } from './PopUpView.style';\n\nexport interface IPopUpViewProps {\n show?: boolean;\n title: string;\n textAccept: string;\n textDecline: string;\n onAccept?: () => void;\n onDecline?: () => void;\n}\n\nfunction PopUpView(props: IPopUpViewProps): JSX.Element {\n const style = (elem: StyleElem) => styleForElement(elem, props);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n const { onAccept, onDecline, title, textAccept, textDecline } = props;\n\n const onClickYes = useCallback(\n (event: UIEvent) => {\n event.preventDefault();\n onAccept?.();\n },\n [onAccept],\n );\n\n const onClickNo = useCallback(\n (event: UIEvent) => {\n event.preventDefault();\n onDecline?.();\n },\n [onDecline],\n );\n\n return (\n
\n \n \n {title}\n
\n \n {textAccept}\n \n \n {textDecline}\n \n \n \n );\n}\n\nexport default PopUpView;\n","import type { CSSProperties } from 'react';\nimport type { IToastProps } from './Toast';\nimport { IToastIcon } from './Toast';\nimport styles from './Toast.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n Icon = 'Icon',\n Text = 'Text',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n [StyleElem.Icon]: {},\n [StyleElem.Text]: {},\n};\n\nfunction MapBackgroundColor(inIcon: IToastIcon): string {\n switch (inIcon) {\n case IToastIcon.Error:\n return '#cc0000';\n\n case IToastIcon.Warning:\n return '#f0ad4e';\n\n case IToastIcon.Success:\n return '#339900';\n\n case IToastIcon.Information:\n return '#000';\n\n default:\n throw Error(`Unrecognised type: ${inIcon}`);\n }\n}\n\nfunction MapTextColor(inIcon: IToastIcon): string {\n switch (inIcon) {\n case IToastIcon.Error:\n return '#fff';\n\n case IToastIcon.Warning:\n return '#fff';\n\n case IToastIcon.Success:\n return '#fff';\n\n case IToastIcon.Information:\n return '#fff';\n\n default:\n throw Error(`Unrecognised type: ${inIcon}`);\n }\n}\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IToastProps) => ({\n backgroundColor: MapBackgroundColor(props.icon),\n }),\n [StyleElem.Icon]: (props: IToastProps) => ({\n color: MapTextColor(props.icon),\n }),\n [StyleElem.Text]: (props: IToastProps) => ({\n color: MapTextColor(props.icon),\n }),\n};\n\nexport function classNameForElement(element: StyleElem, props: IToastProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(element: StyleElem, props: IToastProps): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props) };\n\n return style;\n}\n","import type { CSSProperties } from 'react';\nimport { lazy, Suspense } from 'react';\nimport { classNameForElement, StyleElem, styleForElement } from './Toast.style';\nconst IconExclamation = lazy(() => import('../icon/IconExclamation'));\nconst IconQuestionMark = lazy(() => import('../icon/IconQuestionMark'));\nconst IconTick = lazy(() => import('../icon/IconTick'));\nconst IconInfo = lazy(() => import('../icon/IconInfo'));\n\nexport enum IToastIcon {\n Undef = 0,\n Information = 1,\n Success = 2,\n Warning = 3,\n Error = 4,\n LastValue = 5,\n}\n\nexport interface IToastProps {\n text: string;\n icon: IToastIcon;\n style?: CSSProperties;\n}\n\nfunction Toast(props: IToastProps): JSX.Element {\n const style = (elem: StyleElem) => styleForElement(elem, props);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n\n return (\n
\n {props.icon === IToastIcon.Error && (\n }>\n \n \n )}\n {props.icon === IToastIcon.Success && (\n }>\n \n \n )}\n {props.icon === IToastIcon.Warning && (\n }>\n \n \n )}\n {props.icon === IToastIcon.Information && (\n }>\n \n \n )}\n \n {props.text}\n \n
\n );\n}\n\nexport default Toast;\n","import type { CSSProperties } from 'react';\nimport type { IHighlightingButton } from './HighlightableButton.interface';\nimport styles from './HighlightableButton.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IHighlightingButton) => ({}),\n};\n\nexport function classNameForElement(element: StyleElem, props: IHighlightingButton): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(\n element: StyleElem,\n props: IHighlightingButton,\n overrides: CSSProperties = {},\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props), ...overrides };\n\n return style;\n}\n","import { m } from 'framer-motion';\nimport Link from 'next/link';\nimport type { CSSProperties, ReactNode, RefObject, UIEvent } from 'react';\nimport { useState } from 'react';\nimport type { IHighlightingButton } from './HighlightableButton.interface';\nimport { StyleElem, classNameForElement, styleForElement } from './HighlightableButton.style';\n\nexport interface IHighlightingButtonPrv {\n children?: ReactNode;\n style?: CSSProperties;\n isHighlightable?: boolean;\n onClick?: (event: UIEvent) => void;\n onHighlight?: () => void;\n onRestore?: () => void;\n}\n\nconst withNextLink =

>(\n renderer: (props: P) => JSX.Element,\n props: P,\n) =>\n props.href ? (\n \n {renderer(props)}\n \n ) : (\n renderer(props)\n );\n\nfunction useHighlightRestore(opacityRestore: string | number = 1): {\n setHighlighted: () => void;\n setDefault: () => void;\n isHighlighted: boolean;\n opacity: string | number;\n} {\n const [isHighlighted, setIsHighlighted] = useState(false);\n\n /* Try and get dim by 30% value from #opacityIn otherwise fall back to 70% */\n const opacityDim = !Number.isNaN(Number(opacityRestore))\n ? Math.max(Number(opacityRestore) - 0.3, 0.0)\n : 0.7;\n\n return {\n setHighlighted: () => {\n setIsHighlighted(true);\n },\n setDefault: () => {\n setIsHighlighted(false);\n },\n isHighlighted,\n opacity: isHighlighted ? opacityDim : opacityRestore,\n };\n}\n\nfunction HighlightableButton(props: Omit) {\n const style = (e: StyleElem, overrides?: CSSProperties) => styleForElement(e, props, overrides);\n const className = (element: StyleElem) => classNameForElement(element, props);\n const { setHighlighted, setDefault, opacity } = useHighlightRestore(props.style?.opacity ?? 1);\n\n const highlightCallbacks = props.highlightable && {\n onTouchStart: setHighlighted,\n onTouchEnd: setDefault,\n onTouchCancel: setDefault,\n onMouseDown: setHighlighted,\n onMouseUp: setDefault,\n onMouseLeave: setDefault,\n };\n\n return (\n | undefined}\n animate={props.animate}\n variants={props.variants}\n className={`${props.className ?? ''} ${className(StyleElem.Container)}`}\n style={{ ...style(StyleElem.Container, { opacity }), ...props.style }}\n {...highlightCallbacks}\n onClick={props.onClick}\n >\n {props.children}\n \n );\n}\n\nfunction HighlightableLink(props: Omit) {\n const style = (e: StyleElem, overrides?: CSSProperties) => styleForElement(e, props, overrides);\n const className = (element: StyleElem) => classNameForElement(element, props);\n const { setHighlighted, setDefault, opacity } = useHighlightRestore(props.style?.opacity);\n\n const highlightCallbacks = props.highlightable && {\n onTouchStart: setHighlighted,\n onTouchEnd: setDefault,\n onTouchCancel: setDefault,\n onMouseDown: setHighlighted,\n onMouseUp: setDefault,\n onMouseLeave: setDefault,\n };\n\n return (\n | undefined}\n animate={props.animate}\n variants={props.variants}\n className={`${props.className ?? ''} ${className(StyleElem.Container)}`}\n style={{ ...style(StyleElem.Container, { opacity }), ...props.style }}\n {...highlightCallbacks}\n onClick={props.onClick}\n >\n {props.children}\n \n );\n}\n\nfunction HighlightableButtonLink(props: IHighlightingButton): JSX.Element {\n return props.isLink ? withNextLink(HighlightableLink, props) : HighlightableButton(props);\n}\n\nexport default HighlightableButtonLink;\n","import type { CSSProperties } from 'react';\nimport type { IToggleSwitch } from './ToggleSwitch.interface';\nimport styles from './ToggleSwitch.module.css';\n\nconst DEFAULT_TOGGLE_ON = '#FFFFFF';\nconst DEFAULT_TOGGLE_OFF = '#FFFFFF';\nconst DEFAULT_BACKGROUND_ON = '#2CD057';\nconst DEFAULT_BACKGROUND_OFF = '#D3D2D6';\n\nexport enum StyleElement {\n Container = 'Container',\n Checkbox = 'Checkbox',\n Label = 'Label',\n}\n\nconst DEFAULTS: Record = {\n [StyleElement.Container]: {},\n [StyleElement.Checkbox]: {},\n [StyleElement.Label]: {},\n};\n\nexport function classNameForElement(\n element: StyleElement,\n model: IToggleSwitch,\n overrides?: string,\n): string {\n const name = element.toString();\n const classLoad = styles[name];\n if (classLoad === undefined) throw new Error(`Couldn't find style class for element: ${name}`);\n let returnClassName = classLoad;\n\n if ((overrides?.length ?? 0) > 0) {\n returnClassName += ` ${overrides ?? ''}`;\n }\n\n return returnClassName;\n}\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElement.Container]: (properties: IToggleSwitch) => {\n const isOn = properties.isOn ?? false;\n const color = isOn ? DEFAULT_TOGGLE_ON : DEFAULT_TOGGLE_OFF;\n const elements = document.querySelectorAll(\n `.${classNameForElement(StyleElement.Container, properties)}`,\n );\n /* The variable `elements` is of type `NodeListOf` which is a really weird\n * type that technically fulfils the Iterable interface, but also can't\n * actually be iterated over which really confuses unicorn and eslint.\n * Passing it through `Array.from` ensures that it is definitely an actually iterable type\n */\n /* eslint-disable-next-line unicorn/prefer-spread */\n for (const element of Array.from(elements)) {\n element.style.setProperty('--dot-color', color);\n }\n\n return {};\n },\n [StyleElement.Checkbox]: (properties: IToggleSwitch) => ({}),\n [StyleElement.Label]: (properties: IToggleSwitch) => ({\n backgroundColor:\n properties.backgroundColor ??\n (properties.isOn ?? false ? DEFAULT_BACKGROUND_ON : DEFAULT_BACKGROUND_OFF),\n }),\n};\n\nexport function styleForElement(\n element: StyleElement,\n properties: IToggleSwitch,\n overrides: CSSProperties = {},\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](properties), ...overrides };\n\n return style;\n}\n","import type { ChangeEvent, CSSProperties } from 'react';\nimport type { IToggleSwitch } from './ToggleSwitch.interface';\nimport { classNameForElement, StyleElement, styleForElement } from './ToggleSwitch.style';\n\nfunction ToggleSwitch(properties: IToggleSwitch): JSX.Element {\n const style = (element: StyleElement, overrides?: CSSProperties) =>\n styleForElement(element, properties, overrides);\n const className = (element: StyleElement, overrides?: string) =>\n classNameForElement(element, properties, overrides);\n\n const onChange = (event: ChangeEvent) => {\n properties.onCheck?.(event.target.checked);\n };\n\n return (\n \n \n \n {properties.description ?? ''}\n \n \n );\n}\n\nexport default ToggleSwitch;\n","import storage from '../private/storage';\nimport type { ScrollPosition } from './withScrollRestore.interface';\n\nconst STORAGE_KEY = 'position';\n\nexport interface IScrollPositionStorage {\n id: string;\n get: () => ScrollPosition;\n set: (position: ScrollPosition) => void;\n}\n\nconst DEFAULT_SCROLL_POSITION: ScrollPosition = Object.freeze({ top: 0, left: 0 });\n\nfunction _isScrollPosition(object: unknown): object is ScrollPosition {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const item = object as Partial;\n\n return !isNullOrUndefined(item.left) && !isNullOrUndefined(item.top);\n}\n\nfunction _sanitizeScrollPosition(object: ScrollPosition): ScrollPosition {\n return {\n top: Number.isNaN(object.top) ? 0 : Math.round(object.top),\n left: Number.isNaN(object.left) ? 0 : Math.round(object.left),\n };\n}\n\nfunction builder(key: string): IScrollPositionStorage {\n const store = storage(`SCROLL-STATE-${key}`);\n\n return Object.freeze({\n id: key,\n get: () => {\n const value = store.get(STORAGE_KEY);\n return _isScrollPosition(value)\n ? _sanitizeScrollPosition(value)\n : DEFAULT_SCROLL_POSITION;\n },\n set: (position: ScrollPosition) => {\n store.set(STORAGE_KEY, position);\n },\n });\n}\n\nexport default builder;\n","import type { ForwardRefExoticComponent } from 'react';\nimport { Component as ReactComponent, createRef } from 'react';\nimport isEqual from 'react-fast-compare';\nimport type { ScrollRestoreState } from './withScrollRestore.interface';\nimport scrollStorage from './withScrollRestore.store';\n\nconst DEFAULT_STORAGE_KEY = 'scroll-save';\nconst TIME_TO_LOAD_PAGE_MS = 300; /* Time to wait for page load */\n\nfunction _awaitUserScroll(reference: HTMLElement, callback: () => void) {\n const onScroll = function () {\n reference.removeEventListener('scroll', onScroll);\n callback();\n };\n\n reference.addEventListener('scroll', onScroll);\n}\n\nfunction withScrollRestore(\n Component: ForwardRefExoticComponent

,\n) {\n class WithScrollRestore extends ReactComponent

{\n static displayName = `withScrollRestore(${Component.displayName ?? ''})`;\n\n constructor(properties: P & { saveKey: string }) {\n super(properties);\n this.state = {\n didSetInitialPosition: false,\n refComponent: createRef(),\n positionSetTimeout: null,\n didScroll: false,\n storage: scrollStorage(properties.saveKey),\n };\n }\n\n updateState(stateNew: Partial) {\n this.setState({\n ...this.state,\n ...stateNew,\n });\n }\n\n storageKey() {\n return this.state.storage.id;\n }\n\n setStorageKey(key: string) {\n if (this.state.storage.id !== key) {\n this.updateState({ storage: scrollStorage(key || DEFAULT_STORAGE_KEY) });\n }\n }\n\n override componentDidMount() {\n const reference = this.state.refComponent.current;\n\n if (!reference) {\n return;\n }\n\n const triggerUpdate = this.updateState.bind(this);\n\n const position = this.state.storage.get();\n reference.scroll(position.left, position.top);\n\n triggerUpdate({\n didSetInitialPosition: true,\n positionSetTimeout: null,\n });\n\n setTimeout(() => {\n _awaitUserScroll(reference, () => {\n triggerUpdate({ didScroll: true });\n });\n }, TIME_TO_LOAD_PAGE_MS); /* Wait for the rest of the page to load, before we start checking for user movement */\n }\n\n override componentWillUnmount() {\n const reference = this.state.refComponent.current;\n if (!reference) {\n return;\n }\n if (!this.state.didScroll) {\n return;\n }\n\n /* Only update the position saved, if the user scrolled, otherwise we may be in a position, where the saved-scroll-position was loaded, but not yet applied */\n this.state.storage.set({\n top: reference.scrollTop,\n left: reference.scrollLeft,\n });\n\n if (this.state.positionSetTimeout) {\n clearTimeout(this.state.positionSetTimeout);\n }\n }\n\n override shouldComponentUpdate(nextProperties: P, nextState: ScrollRestoreState): boolean {\n const needsRerender =\n !isEqual(nextProperties, this.props) ||\n nextState.refComponent !== this.state.refComponent;\n\n return needsRerender;\n }\n\n override render() {\n const properties = this.props;\n const { refComponent } = this.state;\n\n return ;\n }\n }\n\n return WithScrollRestore;\n}\n\nexport default withScrollRestore;\n","import { useEffect, useState } from 'react';\n\nconst EVENT_ONLINE = 'online' as const;\nconst EVENT_OFFLINE = 'offline' as const;\n\nfunction _window(): Window | undefined {\n return globalThis.window ?? undefined;\n}\n\nfunction _subscribeOnlineStatusChange(callback: (event: Event) => void) {\n const globalWindow = _window();\n\n globalWindow?.addEventListener(EVENT_ONLINE, callback);\n globalWindow?.addEventListener(EVENT_OFFLINE, callback);\n}\n\nfunction _unsubscribeOnlineStatusChange(callback: (event: Event) => void) {\n const globalWindow = _window();\n\n globalWindow?.removeEventListener(EVENT_ONLINE, callback);\n globalWindow?.removeEventListener(EVENT_OFFLINE, callback);\n}\n\nconst _isOnline = () => (navigator ? navigator.onLine : false);\n\nfunction useIsOnline(): boolean {\n const [isOnline, setIsOnline] = useState(_isOnline());\n\n useEffect(() => {\n if (isOnline) {\n return;\n }\n\n const callback = () => {\n const newStatus = isOnline || _isOnline();\n setIsOnline(newStatus);\n };\n\n _subscribeOnlineStatusChange(callback);\n\n return () => {\n _unsubscribeOnlineStatusChange(callback);\n };\n });\n\n return isOnline;\n}\n\nexport default useIsOnline;\n","import { useEffect, useState } from 'react';\n\nfunction useWindowSize(): { width: number; height: number } {\n /* If the user rotates the device/resizes, we want to redraw. So any changes to windowSize below will trigger a render & reset rubaway state */\n const [windowSize, setWindowSize] = useState<{ width: number; height: number }>({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n\n useEffect(() => {\n const updateWindowSize = () => {\n setWindowSize({ width: window.innerWidth, height: window.innerHeight });\n };\n\n window.addEventListener('resize', updateWindowSize);\n\n return () => {\n window.removeEventListener('resize', updateWindowSize);\n };\n }, []);\n\n return windowSize;\n}\n\nexport default useWindowSize;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconExclamation(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconExclamation;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconInfo(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconInfo;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconPlay(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconPlay;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconQuestionMark(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconQuestionMark;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconTick(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconTick;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconAppleShare(props: IIconProps): JSX.Element {\n return (\n \n \n \n \n \n \n \n );\n}\n\nexport default IconAppleShare;\n","import type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconChevronLeft(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconChevronLeft;\n","import type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconChevronRight(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconChevronRight;\n","import type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconCross(props: IIconProps): JSX.Element {\n return (\n \n \n \n \n );\n}\n\nexport default IconCross;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconDot(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconDot;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconHamburger(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconHamburger;\n","import type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconMapMarker(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconMapMarker;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconMinus(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconMinus;\n","import React from 'react';\nimport type { CSSProperties } from 'react';\n\nexport interface IIconProps {\n className?: string;\n style?: CSSProperties;\n}\n\nfunction IconPlus(props: IIconProps): JSX.Element {\n return (\n \n \n \n );\n}\n\nexport default IconPlus;\n","import type { ReactNode } from 'react';\nimport { useEffect, useState } from 'react';\nimport { useIsOnline } from '../hooks';\n\n/**\n * Await to become online before triggering render, after which *always* render\n * @param props.children children to render\n * @param props.whileAwaitRender render function to show while offline\n * @returns renderer\n */\nfunction AwaitOnlineRender(props: {\n fallback?: () => JSX.Element;\n children?: ReactNode;\n}): JSX.Element | null {\n const isOnline = useIsOnline();\n const [show, setShow] = useState(isOnline);\n\n useEffect(() => {\n if (isOnline) {\n setShow(true);\n }\n }, [isOnline]);\n\n const fallback = props.fallback?.() ?? null;\n\n return <>{show ? props.children : fallback};\n}\n\nexport default AwaitOnlineRender;\n","import type { ReactNode } from 'react';\nimport { useEffect, useState } from 'react';\n\nfunction DelayedRender(props: { delay?: number; children?: ReactNode }): JSX.Element | null {\n const [show, setShow] = useState(false);\n\n useEffect(() => {\n if (show) {\n return;\n }\n setTimeout(() => {\n setShow(true);\n }, props.delay ?? 0);\n });\n\n return show ? <>{props.children} : null;\n}\n\nexport default DelayedRender;\n","import type { Variants } from 'framer-motion';\nimport type { CSSProperties } from 'react';\nimport type { IDimOverlayProps } from './DimOverlay.interface';\nimport styles from './DimOverlay.module.css';\n\nconst DEFAULT_ANIMATION_PERIOD_SHOW = 0.4;\nconst DEFAULT_ANIMATION_PERIOD_HIDE = 0.3;\n\nexport enum StyleElem {\n Container = 'Container',\n}\n\nexport enum IDimOverlayState {\n Dimmed = 'Dimmed',\n Hidden = 'Hidden',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n};\n\nconst RUNTIME: Record> = {\n [StyleElem.Container]: {\n [IDimOverlayState.Dimmed]: {\n backgroundColor: 'rgba(0,0,0,0.7)',\n },\n [IDimOverlayState.Hidden]: {\n backgroundColor: 'rgba(0,0,0,0.)',\n },\n },\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IDimOverlayProps) => ({\n ...RUNTIME[StyleElem.Container][\n props.isDim ? IDimOverlayState.Dimmed : IDimOverlayState.Hidden\n ],\n zIndex: props.zIndex ?? 0,\n pointerEvents: props.isDim ? 'auto' : 'none',\n }),\n};\n\nexport function animationVariantsForElement(elem: StyleElem): Variants {\n const variants = {\n [IDimOverlayState.Dimmed]: {\n ...RUNTIME[elem][IDimOverlayState.Dimmed],\n transition: { type: 'tween', duration: DEFAULT_ANIMATION_PERIOD_SHOW },\n },\n [IDimOverlayState.Hidden]: {\n ...RUNTIME[elem][IDimOverlayState.Hidden],\n transition: { type: 'tween', duration: DEFAULT_ANIMATION_PERIOD_HIDE },\n },\n };\n\n /* Cannot Pass CSSProperties to Variants due to 'Omit' in CSSPropertiesWithoutTransitionOrSingleTransforms */\n return variants as Variants;\n}\n\nexport function animationStateForElement(elem: StyleElem, props: IDimOverlayProps): string {\n return props.isDim ?? false ? IDimOverlayState.Dimmed : IDimOverlayState.Hidden;\n}\n\nexport function classNameForElement(element: StyleElem, model: IDimOverlayProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(\n element: StyleElem,\n props: IDimOverlayProps,\n overrides: CSSProperties = {},\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props), ...overrides };\n\n return style;\n}\n","import { domAnimation, LazyMotion, m } from 'framer-motion';\nimport type { CSSProperties } from 'react';\nimport type { IDimOverlayProps } from './DimOverlay.interface';\nimport {\n animationStateForElement,\n animationVariantsForElement,\n classNameForElement,\n StyleElem,\n styleForElement,\n} from './DimOverlay.style';\n\nfunction DimOverlay(props: IDimOverlayProps): JSX.Element {\n const style = (elem: StyleElem, overrides: CSSProperties = {}) =>\n styleForElement(elem, props, overrides);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n\n const onClick = () => props.onClick?.(props.isDim);\n\n return (\n \n \n {props.children}\n \n \n );\n}\n\nexport default DimOverlay;\n","import type { IAssetSource } from '@monofe/util';\nimport type { CSSProperties, ReactNode } from 'react';\n\nexport enum ImageLoadingStrategy {\n Undef = 0,\n Lazy = 1,\n Eager = 2,\n}\n\nexport interface IImageProperties {\n urls: Readonly[] /* List of src files. Should be ordered in priority to display */;\n mode?: 'contain' | 'cover';\n description?: string /* Alt text of image (screen reader */;\n style?: CSSProperties;\n className?: string;\n loading?: ImageLoadingStrategy /* Default to Lazy */;\n children?: ReactNode;\n onLoaded?: () => void;\n}\n\n/* Expose original interface until refactor complete */\n/* eslint-disable-next-line @typescript-eslint/no-empty-interface, unicorn/prevent-abbreviations */\nexport interface IImageProps extends IImageProperties {}\n","import type { CSSProperties } from 'react';\nimport type { IImageProps } from './Image.interface';\nimport styles from './Image.module.css';\n\nexport enum StyleElem {\n Picture = 'Picture',\n Image = 'Image',\n}\n\nconst DEFAULT: Record = {\n [StyleElem.Picture]: {},\n [StyleElem.Image]: {},\n};\n\nexport function classNameForElement(element: StyleElem, model: IImageProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Picture]: (props: IImageProps) => ({\n ...props.style,\n }),\n [StyleElem.Image]: (props: IImageProps) => ({\n objectFit: props.mode ?? 'contain',\n }),\n};\n\nexport function styleForElement(element: StyleElem, props: IImageProps, overrides?: CSSProperties) {\n const style = { ...DEFAULT[element], ...PROPS_APPLICATOR[element](props), ...overrides };\n\n return style;\n}\n","import settings from './settings';\n\nconst loggingEnabled = settings.logging.isEnabled();\n\n/* eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */\nconst _noop = (message: string): void => {};\n\nconst _logInfo = loggingEnabled\n ? (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.info(message);\n }\n : _noop;\n\nconst _logWarn = loggingEnabled\n ? (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.warn(message);\n }\n : _noop;\n\nconst _logError = loggingEnabled\n ? (message: string): void => {\n /* eslint-disable-next-line no-console */\n console.error(message);\n }\n : _noop;\n\nconst _logAssert = (condition: unknown, message?: string): void => {\n /* eslint-disable-next-line no-extra-boolean-cast */\n if (Boolean(condition)) {\n _logError(`Condition failed, ${message ?? ''}`);\n }\n};\n\nexport default Object.freeze({\n info: _logInfo,\n warn: _logWarn,\n error: _logError,\n assert: _logAssert,\n});\n","import type { IAssetSource } from '@monofe/util';\nimport type { DetailedHTMLProps, SourceHTMLAttributes, UIEvent } from 'react';\nimport { log } from '../private';\nimport type { IImageProperties } from './Image.interface';\nimport { ImageLoadingStrategy } from './Image.interface';\nimport { StyleElem as StyleElement, classNameForElement, styleForElement } from './Image.style';\n\nconst DEFAULT_LOADING_STRATEGY = ImageLoadingStrategy.Lazy;\nconst LOADING_STRATEGY: Record = Object.freeze({\n [ImageLoadingStrategy.Undef]: 'lazy',\n [ImageLoadingStrategy.Lazy]: 'lazy',\n [ImageLoadingStrategy.Eager]: 'eager',\n});\n\nconst sourceElement = (\n properties: IAssetSource,\n): DetailedHTMLProps, HTMLSourceElement> => (\n \n);\n\nconst _hideElementOnError = (event: UIEvent & { target: HTMLImageElement }) => {\n log.error(`Failed to load image url: '${event.target.src}'`);\n event.target.style.opacity = '0';\n};\n\nconst _showElementOnLoad = (event: UIEvent & { target: HTMLImageElement }) => {\n event.target.style.opacity = '1';\n};\n\nfunction Image(properties: Readonly): JSX.Element | null {\n const style = (element: StyleElement) => styleForElement(element, properties);\n const className = (element: StyleElement) => classNameForElement(element, properties);\n\n const onLoadCallback = () => {\n properties.onLoaded?.();\n };\n\n const fallbackImageAsset =\n properties.urls.length > 0 ? properties.urls[properties.urls.length - 1] : null;\n const sourceElementUrls = properties.urls.length > 0 ? properties.urls.slice(0, -1) : [];\n\n /* Nothing to render */\n if (properties.urls.length <= 0 || !fallbackImageAsset) {\n return null;\n }\n\n return (\n \n {sourceElementUrls\n .filter(source => Boolean(source))\n .map(source => sourceElement(source))}\n \n {properties.children}\n \n );\n}\n\nexport default Image;\n","import type { ReactChild, ReactFragment, ReactNode, ReactPortal } from 'react';\nimport { Suspense } from 'react';\nimport settings from '../private/settings';\n\nexport interface ISuspenseProps {\n fallback: boolean | ReactChild | ReactFragment | ReactPortal | null;\n children: ReactNode;\n}\n\nfunction SuspenseWrapper(props: ISuspenseProps): JSX.Element {\n return settings.isSuspenseSupported ? (\n {props.children}\n ) : (\n <>{props.children}\n );\n}\n\nexport default SuspenseWrapper;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,"import type { ILog } from '@monofe/util';\nimport { injectLog } from '@monofe/util';\nimport type {\n ForwardRefExoticComponent,\n MutableRefObject,\n PropsWithoutRef,\n RefAttributes,\n RefObject,\n} from 'react';\nimport { forwardRef } from 'react';\nimport type { ReactZoomPanPinchRef } from 'react-zoom-pan-pinch';\nimport { TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch';\nimport type {\n IZoomPanPinch,\n IZoomPanPinchRef as IZoomPanPinchReference,\n} from './ZoomPanPinch.interface';\nimport styles from './ZoomPanPinch.module.css';\n\ntype ForwardReferenceObjectType =\n | ((instance: IZoomPanPinchReference | null) => void)\n | MutableRefObject\n | null;\n\n/* We don't want to expose our dependency so cast between IZoomPanPinchRef to ReactZoomPanPinchRef when possible & error out when not */\nfunction isInternalReference(\n reference: ForwardReferenceObjectType,\n): reference is RefObject {\n const referenceCast = (reference as MutableRefObject).current;\n return reference === null || referenceCast === null || referenceCast.zoomToElement !== null;\n}\n\ntype ReturnType = ForwardRefExoticComponent<\n PropsWithoutRef & RefAttributes\n>;\n\nfunction _className(name: 'Wrapper' | 'Content'): string {\n const style = styles[name];\n if (style === undefined) throw new Error(`Couldn't find style class: ${name}`);\n return style;\n}\n\nfunction _ZoomPanPinch(logger?: ILog): ReturnType {\n return forwardRef>(\n (properties, reference) => {\n const isValidReference = isInternalReference(reference);\n if (!isValidReference) {\n logger?.error(`Invalid ref for ZoomPanPinch: ${JSON.stringify(reference)}`);\n return null;\n }\n\n return (\n \n \n {properties.children}\n \n \n );\n },\n );\n}\n\nfunction ZoomPanPinch(): ReturnType {\n return _ZoomPanPinch(injectLog());\n}\n\nexport default ZoomPanPinch;\n","import type { CSSProperties } from 'react';\nimport type { IBackLinkProps, IBackLinkState } from './BackLink.interface';\nimport styles from './BackLink.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n Div = 'Div',\n Icon = 'Icon',\n SVG = 'SVG',\n}\n\nconst DEFAULT: Record = {\n [StyleElem.Container]: {},\n [StyleElem.Div]: {},\n [StyleElem.Icon]: {},\n [StyleElem.SVG]: {},\n};\n\nexport function classNameForElement(element: StyleElem, model: IBackLinkProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nconst PROPSSTATE_APPLICATOR: Record<\n StyleElem,\n (props: IBackLinkProps, state: IBackLinkState) => CSSProperties\n> = {\n [StyleElem.Container]: (props: IBackLinkProps, state: IBackLinkState) => ({\n opacity: state.isHighlighted ?? false ? 0.7 : 1.0,\n }),\n [StyleElem.Div]: (props: IBackLinkProps, state: IBackLinkState) => ({\n backgroundColor: props.backgroundColor,\n borderColor: props.strokeColor,\n borderWidth: props.strokeSize,\n }),\n [StyleElem.Icon]: (props: IBackLinkProps, state: IBackLinkState) => ({}),\n [StyleElem.SVG]: (props: IBackLinkProps, state: IBackLinkState) => ({\n color: props.arrowColor ?? 'white',\n }),\n};\n\nexport function styleForElement(\n element: StyleElem,\n props: IBackLinkProps,\n state: IBackLinkState,\n overrides: CSSProperties,\n) {\n const style = {\n ...DEFAULT[element],\n ...PROPSSTATE_APPLICATOR[element](props, state),\n ...overrides,\n };\n\n return style;\n}\n","import type { CSSProperties, UIEvent } from 'react';\nimport { useCallback, useState } from 'react';\nimport { IconChevronLeft, IconCross } from '../icon';\nimport type { IBackLinkProps, IBackLinkState } from './BackLink.interface';\nimport { classNameForElement, StyleElem, styleForElement } from './BackLink.style';\n\nfunction BackLink(props: IBackLinkProps): JSX.Element {\n const [state, setState] = useState({ isHighlighted: false });\n\n const IconView = props.icon === 'cross' ? IconCross : IconChevronLeft;\n\n const onHighlight = useCallback(() => {\n setState(stateOld => ({\n ...stateOld,\n isHighlighted: true,\n }));\n }, [setState]);\n\n const onRestore = useCallback(() => {\n setState(stateOld => ({\n ...stateOld,\n isHighlighted: false,\n }));\n }, [setState]);\n\n const onClick = (event: UIEvent) => {\n event.preventDefault();\n event.stopPropagation();\n event.nativeEvent.stopImmediatePropagation();\n props.onClick?.(props);\n return false;\n };\n\n const style = (elem: StyleElem, overrides: CSSProperties = {}) =>\n styleForElement(elem, props, state, overrides);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n\n return (\n \n

\n \n
\n \n );\n}\n\nexport default BackLink;\n","import type { CSSProperties } from 'react';\nimport type { IPageControl } from './PageControl.interface';\nimport styles from './PageControl.module.css';\n\nconst ARROW_WIDTH_PC = 30;\n\n/* (100pc - 2x ARROW_WIDTH_PC) / MAX(number_of_pages,1) \n use up all remaining space for dots making sure to prevent divide by 0 errors */\nconst DEFAULT_BUTTON_SIZE = (props: IPageControl) =>\n `${(100 - ARROW_WIDTH_PC - ARROW_WIDTH_PC) / Math.max(props.totalPages, 1)}%`;\n\nexport enum StyleElem {\n Container = 'Container',\n\n ButtonArrowLeft = 'ButtonArrowLeft',\n ButtonArrowRight = 'ButtonArrowRight',\n ButtonDot = 'ButtonDot',\n\n IconArrowLeft = 'IconArrowLeft',\n IconArrowRight = 'IconArrowRight',\n IconDot = 'IconDot',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n\n [StyleElem.ButtonArrowLeft]: {},\n [StyleElem.ButtonArrowRight]: {},\n [StyleElem.ButtonDot]: {\n marginLeft: '1.2vmin',\n marginRight: '1.2vmin',\n },\n\n [StyleElem.IconArrowLeft]: {},\n [StyleElem.IconArrowRight]: {},\n [StyleElem.IconDot]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IPageControl) => ({\n backgroundColor: props.backgroundColor ?? 'transparent',\n }),\n\n [StyleElem.ButtonArrowLeft]: (props: IPageControl) => ({\n opacity: props.activeIndex > 0 ? 1 : 0.7,\n width: `${ARROW_WIDTH_PC}%`,\n display: 'inline-flex',\n }),\n [StyleElem.ButtonArrowRight]: (props: IPageControl) => ({\n opacity: props.activeIndex < props.totalPages - 1 ? 1 : 0.7,\n width: `${ARROW_WIDTH_PC}%`,\n display: 'inline-flex',\n }),\n [StyleElem.ButtonDot]: (props: IPageControl) => ({\n width: props.dotSize ?? DEFAULT_BUTTON_SIZE(props),\n marginLeft: props.dotSpacing ?? DEFAULTS.ButtonDot.marginLeft,\n marginRight: props.dotSpacing ?? DEFAULTS.ButtonDot.marginRight,\n display: 'inline-flex',\n }),\n\n [StyleElem.IconArrowLeft]: (props: IPageControl) => ({\n color: props.tintColor ?? '#fff',\n }),\n [StyleElem.IconArrowRight]: (props: IPageControl) => ({\n color: props.tintColor ?? '#fff',\n }),\n [StyleElem.IconDot]: (props: IPageControl) => ({\n color: props.tintColor ?? '#fff',\n }),\n};\n\nexport function classNameForElement(element: StyleElem, props: IPageControl): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(\n elem: StyleElem,\n props: IPageControl,\n overrides: CSSProperties,\n): CSSProperties {\n const style = { ...DEFAULTS[elem], ...PROPS_APPLICATOR[elem](props), ...overrides };\n\n return style;\n}\n","import type { CSSProperties } from 'react';\nimport { HighlightableButton } from '../button';\nimport { IconChevronLeft, IconChevronRight, IconDot } from '../icon';\nimport type { IPageControl } from './PageControl.interface';\nimport { classNameForElement, StyleElem, styleForElement } from './PageControl.style';\n\nfunction PageControl(props: IPageControl): JSX.Element {\n const style = (elem: StyleElem, overrides: CSSProperties = {}) =>\n styleForElement(elem, props, overrides);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n\n const pageCountIterator = Array(props.totalPages).fill(1);\n\n return (\n \n {props.showArrowButtons && (\n 0}\n onClick={props.onLeftClick}\n className={className(StyleElem.ButtonArrowLeft)}\n style={style(StyleElem.ButtonArrowLeft)}\n >\n \n \n )}\n {pageCountIterator.map((_, idx) => (\n props.onIndexClick?.(idx)}\n className={className(StyleElem.ButtonDot)}\n style={style(StyleElem.ButtonDot, {\n opacity: idx !== props.activeIndex ? 0.5 : 1,\n })}\n >\n \n \n ))}\n {props.showArrowButtons && (\n \n \n \n )}\n \n );\n}\n\nexport default PageControl;\n","const _isProduction = (): boolean => {\n try {\n /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */\n return Boolean(process !== undefined && process.env['NODE_ENV'] === 'production');\n } catch (error: unknown) {\n return true;\n }\n};\n\nconst _isSuspenseSupported = (): boolean => {\n try {\n /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */\n return process !== undefined && Boolean(process.env['NEXT_PUBLIC_IS_NEXTJS']);\n } catch (error: unknown) {\n return true;\n }\n};\n\nexport default Object.freeze({\n isProduction: _isProduction(),\n isSuspenseSupported: _isSuspenseSupported(),\n});\n","import env from './env';\n\nconst settings = {\n loggingEnabled: env.isProduction,\n isSuspenseSupported: env.isSuspenseSupported,\n};\n\nexport default Object.freeze({\n logging: {\n enable: () => {\n settings.loggingEnabled = true;\n },\n disable: () => {\n settings.loggingEnabled = false;\n },\n isEnabled: () => settings.loggingEnabled,\n },\n isSuspenseSupported: settings.isSuspenseSupported,\n});\n","export interface IStorage {\n get: (key: string) => unknown;\n set: (key: string, value: unknown) => void;\n}\n\nconst GLOBAL_KEY = '__STORAGE_UI_COMMON';\nconst DEFAULT_DOMAIN = 'default';\n\nfunction _buildGlobalStorage(globalKey: string) {\n const globalObject: Record =\n typeof window === 'undefined' ? globalThis : window;\n const storageObject =\n (globalObject[globalKey] as Record> | undefined) ?? {};\n globalObject[globalKey] = storageObject;\n\n return {\n get: (key: string) => {\n const storage = storageObject[key] ?? {};\n storageObject[key] = storage;\n return storage;\n },\n update: (key: string, value: Record) => {\n storageObject[key] = value;\n },\n };\n}\n\nconst globalStorage = _buildGlobalStorage(GLOBAL_KEY);\n\nfunction builder(domain: string = DEFAULT_DOMAIN): Readonly {\n return Object.freeze({\n get: (key: string) => {\n const storage = globalStorage.get(domain);\n return storage[key];\n },\n set: (key: string, value: unknown) => {\n const storage = globalStorage.get(domain);\n storage[key] = value;\n globalStorage.update(domain, storage);\n },\n });\n}\n\nexport default builder;\n","import type { CSSProperties } from 'react';\nimport type { IBufferingWheelProps } from './BufferingWheel.interface';\nimport styles from './BufferingWheel.module.css';\n\n/* MUST match --spinner-width defined in BufferingWheel.module.css */\nconst SPINNER_WIDTH = '10vmin';\n\nexport enum StyleElem {\n Container = 'Container',\n Spinner = 'Spinner',\n Text = 'Text',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n [StyleElem.Spinner]: {},\n [StyleElem.Text]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: () => ({}),\n [StyleElem.Spinner]: (props: IBufferingWheelProps) => ({\n borderBottom: `0.8vmin solid ${props.spinnerColor}`,\n top: props.isVideo\n ? `calc(50% - ${SPINNER_WIDTH} / 2)`\n : `calc(70% - ${SPINNER_WIDTH} / 2)`,\n }),\n [StyleElem.Text]: (props: IBufferingWheelProps) => ({\n color: props.bufferingText?.color,\n fontWeight: props.bufferingText?.fontWeight,\n fontFamily: props.bufferingText?.fontFamily,\n fontSize: props.bufferingText?.fontSize,\n lineHeight: props.bufferingText?.fontSize,\n }),\n};\n\nexport function classNameForElement(element: StyleElem, props: IBufferingWheelProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(element: StyleElem, props: IBufferingWheelProps): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](props) };\n\n return style;\n}\n","import { useEffect, useState } from 'react';\nimport type { IBufferingWheelProps } from './BufferingWheel.interface';\nimport { classNameForElement, StyleElem, styleForElement } from './BufferingWheel.style';\n\nconst DELAY_BETWEEN_UPDATES_MS = 800;\nconst MAX_DOT_COUNT = 2;\n\nfunction _BufferingText(index: number) {\n let text = 'Buffering';\n\n for (let count = 0; count < index; count++) {\n text += '.';\n }\n\n return text;\n}\n\nfunction BufferingWheel(props: IBufferingWheelProps): JSX.Element {\n const style = (elem: StyleElem) => styleForElement(elem, props);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n const [bufferingCounter, setBufferingCounter] = useState(0);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setBufferingCounter(val => (val > MAX_DOT_COUNT ? 0 : val + 1));\n }, DELAY_BETWEEN_UPDATES_MS);\n\n return () => {\n clearTimeout(timeout);\n };\n });\n\n return (\n \n \n {!props.isVideo && (\n

\n {_BufferingText(bufferingCounter)}\n

\n )}\n \n );\n}\n\nexport default BufferingWheel;\n","import type { CSSProperties } from 'react';\nimport { createRef, useEffect, useState } from 'react';\nimport type { ILoadingProps } from './Loading.interface';\nimport styles from './Loading.module.css';\n\nenum StyleElem {\n Container = 'Container',\n Text = 'Text',\n}\n\nconst DEFAULTS: Record = {\n [StyleElem.Container]: {},\n [StyleElem.Text]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: ILoadingProps) => ({\n ...props.styleOverrides,\n }),\n [StyleElem.Text]: (props: ILoadingProps) => ({}),\n};\n\nexport function classNameForElement(element: StyleElem, props: ILoadingProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(elem: StyleElem, props: ILoadingProps): CSSProperties {\n const style = { ...DEFAULTS[elem], ...PROPS_APPLICATOR[elem](props) };\n\n return style;\n}\n\nfunction _LoadingText(index: number) {\n let text = 'Loading';\n\n for (let i = 0; i < index; i++) {\n text += '.';\n }\n\n return text;\n}\n\nfunction Loading(props: ILoadingProps): JSX.Element {\n const style = (elem: StyleElem) => styleForElement(elem, props);\n const className = (elem: StyleElem) => classNameForElement(elem, props);\n const [loadCounter, setLoadCounter] = useState(0);\n\n const ref = createRef();\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setLoadCounter(val => (val > 8 ? 0 : val + 1));\n }, 800);\n\n return () => {\n clearTimeout(timeout);\n };\n });\n\n return (\n
\n \n {_LoadingText(loadCounter)}\n \n
\n );\n}\n\nexport default Loading;\n","import type { CSSProperties } from 'react';\nimport { useCallback } from 'react';\nimport type { ILoadingAnimationViewProps as ILoadingAnimationViewProperties } from './LoadingAnimationView.interface';\nimport styles from './LoadingAnimationView.module.css';\n\nenum StyleElement {\n Container = 'Container',\n SegmentItem1 = 'SegmentItem1',\n SegmentItem2 = 'SegmentItem2',\n SegmentItem3 = 'SegmentItem3',\n SegmentItem4 = 'SegmentItem4',\n SegmentItem5 = 'SegmentItem5',\n SegmentItem6 = 'SegmentItem6',\n SegmentItem7 = 'SegmentItem7',\n SegmentItem8 = 'SegmentItem8',\n SegmentItem9 = 'SegmentItem9',\n SegmentItem10 = 'SegmentItem10',\n SegmentItem11 = 'SegmentItem11',\n SegmentItem12 = 'SegmentItem12',\n SegmentContainer1 = 'SegmentContainer1',\n SegmentContainer2 = 'SegmentContainer2',\n SegmentContainer3 = 'SegmentContainer3',\n SegmentContainer4 = 'SegmentContainer4',\n SegmentContainer5 = 'SegmentContainer5',\n SegmentContainer6 = 'SegmentContainer6',\n SegmentContainer7 = 'SegmentContainer7',\n SegmentContainer8 = 'SegmentContainer8',\n SegmentContainer9 = 'SegmentContainer9',\n SegmentContainer10 = 'SegmentContainer10',\n SegmentContainer11 = 'SegmentContainer11',\n SegmentContainer12 = 'SegmentContainer12',\n}\n\nconst SegmentItems = new Set([\n StyleElement.SegmentItem1,\n StyleElement.SegmentItem2,\n StyleElement.SegmentItem3,\n StyleElement.SegmentItem4,\n StyleElement.SegmentItem5,\n StyleElement.SegmentItem6,\n StyleElement.SegmentItem7,\n StyleElement.SegmentItem8,\n StyleElement.SegmentItem9,\n StyleElement.SegmentItem10,\n StyleElement.SegmentItem11,\n StyleElement.SegmentItem12,\n]);\n\nconst SegmentContainers = new Set([\n StyleElement.SegmentContainer1,\n StyleElement.SegmentContainer2,\n StyleElement.SegmentContainer3,\n StyleElement.SegmentContainer4,\n StyleElement.SegmentContainer5,\n StyleElement.SegmentContainer6,\n StyleElement.SegmentContainer7,\n StyleElement.SegmentContainer8,\n StyleElement.SegmentContainer9,\n StyleElement.SegmentContainer10,\n StyleElement.SegmentContainer11,\n StyleElement.SegmentContainer12,\n]);\n\nexport function classNameForElement(\n element: StyleElement,\n properties: ILoadingAnimationViewProperties,\n): string {\n const name = element.toString();\n const classLoads = [];\n classLoads.push(styles[name]);\n\n if (SegmentItems.has(element)) {\n classLoads.push(styles['SegmentItem']);\n }\n\n if (SegmentContainers.has(element)) {\n classLoads.push(styles['SegmentContainer']);\n }\n\n return classLoads.join(' ');\n}\n\nconst _ITEM_APPLICATOR = (properties: ILoadingAnimationViewProperties) => ({\n backgroundColor: properties.color,\n});\n\nconst _NOOP_APPLICATOR = (properties: ILoadingAnimationViewProperties) => ({});\n\nconst PROPS_APPLICATOR: Record<\n StyleElement,\n (properties: ILoadingAnimationViewProperties) => CSSProperties\n> = {\n [StyleElement.Container]: (properties: ILoadingAnimationViewProperties) => ({\n opacity: properties.isAnimating ? 1 : 0,\n width: properties.size,\n height: properties.size,\n ...properties.style,\n }),\n [StyleElement.SegmentItem1]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem2]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem3]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem4]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem5]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem6]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem7]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem8]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem9]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem10]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem11]: _ITEM_APPLICATOR,\n [StyleElement.SegmentItem12]: _ITEM_APPLICATOR,\n [StyleElement.SegmentContainer1]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer2]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer3]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer4]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer5]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer6]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer7]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer8]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer9]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer10]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer11]: _NOOP_APPLICATOR,\n [StyleElement.SegmentContainer12]: _NOOP_APPLICATOR,\n};\n\nfunction styleForElement(\n element: StyleElement,\n properties: ILoadingAnimationViewProperties,\n): CSSProperties {\n const style = { ...PROPS_APPLICATOR[element](properties) };\n\n return style;\n}\n\n/* Pairings of sub-items for looping over during render */\nconst _SubItemPairings = [\n [StyleElement.SegmentContainer1, StyleElement.SegmentItem1],\n [StyleElement.SegmentContainer2, StyleElement.SegmentItem2],\n [StyleElement.SegmentContainer3, StyleElement.SegmentItem3],\n [StyleElement.SegmentContainer4, StyleElement.SegmentItem4],\n [StyleElement.SegmentContainer5, StyleElement.SegmentItem5],\n [StyleElement.SegmentContainer6, StyleElement.SegmentItem6],\n [StyleElement.SegmentContainer7, StyleElement.SegmentItem7],\n [StyleElement.SegmentContainer8, StyleElement.SegmentItem8],\n [StyleElement.SegmentContainer9, StyleElement.SegmentItem9],\n [StyleElement.SegmentContainer10, StyleElement.SegmentItem10],\n [StyleElement.SegmentContainer11, StyleElement.SegmentItem11],\n [StyleElement.SegmentContainer12, StyleElement.SegmentItem12],\n] as const;\n\nfunction LoadingAnimationView(properties: ILoadingAnimationViewProperties): JSX.Element {\n const style = useCallback(\n (element: StyleElement) => styleForElement(element, properties),\n [properties],\n );\n const className = useCallback(\n (element: StyleElement) => classNameForElement(element, properties),\n [properties],\n );\n\n return (\n \n {_SubItemPairings.map(([elementContainer, elementItem], index) => (\n \n
\n \n ))}\n \n );\n}\n\nexport default LoadingAnimationView;\n","import type { CSSProperties } from 'react';\nimport type { IProgressBarProps } from './ProgressBar.interface';\nimport styles from './ProgressBar.module.css';\n\nexport enum StyleElem {\n Container = 'Container',\n Bar = 'Bar',\n Text = 'Text',\n}\n\nconst DEFAULT_PROPS: Required = {\n progress: 0,\n textColor: '#FFFFFF',\n barColor: '#3bb1dc',\n borderRadius: 0,\n style: {},\n className: '',\n description: '',\n};\n\nconst DEFAULT_STYLES: Record = {\n [StyleElem.Container]: {},\n [StyleElem.Bar]: {},\n [StyleElem.Text]: {},\n};\n\n/* Cap #progress to >0 & <1, multiply up to 0->100 range, round number, then append '%' */\nexport function progressToText(progress: number) {\n return `${Math.round(Math.min(Math.max(progress, 0), 1) * 100)}%`;\n}\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElem.Container]: (props: IProgressBarProps) => ({\n borderRadius: props.borderRadius ?? DEFAULT_PROPS.borderRadius,\n }),\n [StyleElem.Bar]: (props: IProgressBarProps) => ({\n width: progressToText(props.progress),\n backgroundColor: props.barColor ?? DEFAULT_PROPS.barColor,\n borderRadius: props.borderRadius ?? DEFAULT_PROPS.borderRadius,\n }),\n [StyleElem.Text]: (props: IProgressBarProps) => ({\n color: props.textColor ?? DEFAULT_PROPS.textColor,\n }),\n};\n\nexport function classNameForElement(element: StyleElem, props: IProgressBarProps): string {\n const name = element.toString();\n const classLoad = styles[name];\n return classLoad || '';\n}\n\nexport function styleForElement(\n element: StyleElem,\n props: IProgressBarProps,\n overrides?: CSSProperties,\n): CSSProperties {\n const style = { ...DEFAULT_STYLES[element], ...PROPS_APPLICATOR[element](props), ...overrides };\n\n return style;\n}\n","import type { CSSProperties } from 'react';\nimport type { IProgressBarProps } from './ProgressBar.interface';\nimport {\n classNameForElement,\n progressToText,\n StyleElem,\n styleForElement,\n} from './ProgressBar.style';\n\nfunction ProgressBar(props: IProgressBarProps): JSX.Element {\n const style = (element: StyleElem, overrides?: CSSProperties) =>\n styleForElement(element, props, overrides);\n const className = (element: StyleElem) => classNameForElement(element, props);\n\n const progressDescription = progressToText(props.progress);\n\n return (\n \n \n \n {progressDescription}\n \n \n );\n}\n\nexport default ProgressBar;\n","import { m } from 'framer-motion';\nimport type { CSSProperties, ReactNode, UIEvent } from 'react';\n\nexport interface IFadeTransition {\n className: string;\n style: CSSProperties;\n children?: ReactNode;\n onClick?: (event: UIEvent) => void;\n}\n\nconst TRANSITION = { ease: 'easeIn', duration: 0.2 };\nconst MINOPACITY = { opacity: 0, transition: TRANSITION };\nconst MAXOPACITY = { opacity: 1, transition: TRANSITION };\n\nfunction FadeTransition(props: IFadeTransition): JSX.Element {\n return (\n \n {props.children}\n \n );\n}\n\nexport default FadeTransition;\n","export default function byteSizeToDescription(byteSize: number): string {\n if (byteSize < 0) throw new Error(`byteSize = ${byteSize}. Can't have a byteSize less than 0`);\n if (byteSize === 0) return '0B';\n const sizeDivisor = Math.floor(Math.log(byteSize) / Math.log(1000));\n const decimalPlaces = sizeDivisor > 2 ? 1 : 0;\n const units = ['B', 'KB', 'MB', 'GB', 'TB'];\n const unit = units[sizeDivisor];\n if (unit === undefined)\n throw new Error(\n `Size Divisor '${sizeDivisor}' was outside the expected range of 0-${units.length} caused by a byteSize of '${byteSize}'`,\n );\n const sizeValue = (byteSize / 1000 ** sizeDivisor).toFixed(decimalPlaces);\n const text = `${sizeValue} ${unit}`;\n return text;\n}\n","import type { ComponentType, LazyExoticComponent } from 'react';\nimport { lazy } from 'react';\n\n/* Definition for Module factory should look like #import */\nexport type ModuleFactoryAsync

= () => Promise<{ default: ComponentType

}>;\n\n/* Definition of Module loader, argument is the factory & return a react component, \n should mimic #next/dynamic & React.lazy */\nexport type ModuleLoaderAsync

= (\n factory: ModuleFactoryAsync

,\n) => ComponentType

| LazyExoticComponent>;\n\n/* Define the loader, by default use React.lazy */\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\ntype ModuleLoaderType = ModuleLoaderAsync; /* (React.lazy uses #any definition) */\nlet moduleLoader: ModuleLoaderType = lazy;\n\n/* Override the default loader, i.e. next/dynamic */\nexport function setModuleLoader

(loader: ModuleLoaderAsync

): void {\n moduleLoader = loader;\n}\n\n/* Called throughout ui-workspace to resolve dynamic components, needed as we don't want to\n import next/dynamic here as if there are projects importing ui-workspace & we are rendering\n to the browser, including next/dynamic will result in '__dirname missing' errors, as such,\n we need to ensure all next imports remain in the Next projects only, hence the #setModuleLoader */\nfunction dynamicModuleLoader

(factory: ModuleFactoryAsync

): ReturnType> {\n const result = moduleLoader(factory);\n return result;\n}\n\nexport default dynamicModuleLoader;\n","import { injectKVStorage } from '@monofe/util';\nimport type { RefObject } from 'react';\nimport { useCallback } from 'react';\n\ninterface PositionStorage {\n scrollX: number;\n scrollY: number;\n}\n\nconst _isPositionStorage = (object: unknown): object is PositionStorage => {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n const record: Partial = object as Partial;\n\n return !isNullOrUndefined(record.scrollX) && !isNullOrUndefined(record.scrollY);\n};\n\nconst _readFromStorage = async (key: string): Promise => {\n const storage = injectKVStorage();\n const value = await storage.getItem(key);\n const position = _isPositionStorage(value) ? value : { scrollX: 0, scrollY: 0 };\n return position;\n};\n\nconst _saveToStorage = async (key: string, position: PositionStorage) => {\n const storage = injectKVStorage();\n await storage.setItem(key, position);\n};\n\nconst _deleteFromStorage = async (key: string) => {\n const storage = injectKVStorage();\n await storage.removeItem(key);\n};\n\nfunction usePreviousPosition(rowViewRef: RefObject, location: string) {\n const saveCurrentScrollPosition = useCallback(async () => {\n await _saveToStorage(location, {\n scrollX: rowViewRef.current?.scrollLeft ?? 0,\n scrollY: rowViewRef.current?.scrollTop ?? 0,\n });\n }, [rowViewRef, location]);\n\n const restoreScrollPosition = useCallback(async () => {\n const position = await _readFromStorage(location);\n rowViewRef.current?.scrollTo({\n left: position.scrollX,\n top: position.scrollY,\n behavior: 'auto',\n });\n }, [rowViewRef, location]);\n\n const clearScrollPosition = useCallback(async () => {\n await _deleteFromStorage(location);\n }, [location]);\n\n return { saveCurrentScrollPosition, restoreScrollPosition, clearScrollPosition };\n}\n\nexport default usePreviousPosition;\n","import type { DeleteTourStorage } from './interface';\n\nexport const STORE_NAME = 'DeleteTour';\n\nexport const initialState: DeleteTourStorage = {\n userSession: '',\n languageId: -1,\n tourId: -1,\n progressBar: -1,\n progressVisible: false,\n};\n","import type { PayloadAction } from '@reduxjs/toolkit';\nimport { initialState } from './constants';\nimport type { IDeleteTourState } from './interface';\n\nconst reset = (state: IDeleteTourState, action: PayloadAction) => ({ ...initialState });\n\nconst updateSession = (\n state: IDeleteTourState,\n action: PayloadAction<{ userSession?: string }>,\n) => ({\n ...state,\n userSession: action.payload.userSession ?? '',\n});\n\nconst updateLanguageId = (\n state: IDeleteTourState,\n action: PayloadAction<{ languageId?: number }>,\n) => ({\n ...state,\n languageId: action.payload.languageId ?? -1,\n});\n\nconst updateTourId = (state: IDeleteTourState, action: PayloadAction<{ tourId?: number }>) => ({\n ...state,\n tourId: action.payload.tourId ?? -1,\n});\n\nconst hideProgressBar = (state: IDeleteTourState, action: PayloadAction) => ({\n ...state,\n progressVisible: false,\n});\n\nconst showProgressBar = (state: IDeleteTourState, action: PayloadAction) => ({\n ...state,\n progressVisible: true,\n});\n\nconst setProgress = (state: IDeleteTourState, action: PayloadAction<{ progress: number }>) => ({\n ...state,\n progressBar: action.payload.progress,\n});\n\nexport default Object.freeze({\n reset,\n updateSession,\n updateLanguageId,\n updateTourId,\n hideProgressBar,\n showProgressBar,\n setProgress,\n});\n","import { createSlice } from '@reduxjs/toolkit';\nimport { initialState, STORE_NAME } from './constants';\nimport reducers from './reducer';\n\nexport const slice = createSlice({\n name: STORE_NAME,\n initialState,\n reducers,\n});\n\nexport default slice.actions;\n","import type { AnyAction } from '@reduxjs/toolkit';\nimport type { IModuleAction } from './interface';\nimport actions from './slice';\n\nfunction Action(dispatcher: (action: AnyAction) => void): IModuleAction {\n return {\n reset: () => {\n dispatcher(actions.reset());\n },\n updateSession: userSession => {\n dispatcher(actions.updateSession({ userSession }));\n },\n updateLanguageId: languageId => {\n dispatcher(actions.updateLanguageId({ languageId }));\n },\n updateTourId: tourId => {\n dispatcher(actions.updateTourId({ tourId }));\n },\n hideProgressBar: () => {\n dispatcher(actions.hideProgressBar());\n },\n showProgressBar: () => {\n dispatcher(actions.showProgressBar());\n },\n setProgress: (progress: number) => {\n dispatcher(actions.setProgress({ progress }));\n },\n };\n}\n\nexport default Action;\n","import {\n injectStoresData,\n injectStoresMiddleware,\n injectStoresReducer,\n IStoreMiddlewareType,\n} from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport type { AnyAction } from '@reduxjs/toolkit';\nimport { useSelector } from 'react-redux';\nimport { initialState, STORE_NAME } from './constants';\nimport { setupEffects } from './effects';\nimport type { DeleteTourStorage } from './interface';\nimport { slice } from './slice';\n\nfunction isDataStore(object: unknown): object is DeleteTourStorage {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.userSession) &&\n !isNullOrUndefined(record.languageId) &&\n !isNullOrUndefined(record.tourId) &&\n !isNullOrUndefined(record.progressBar) &&\n !isNullOrUndefined(record.progressVisible)\n );\n}\n\nfunction dataFromGlobalStore(globalStore: unknown): DeleteTourStorage | undefined {\n if (!globalStore || typeof globalStore !== 'object') {\n return undefined;\n }\n\n const data = (globalStore as Record)[STORE_NAME];\n\n return isDataStore(data) ? data : undefined;\n}\n\nfunction getStore(container: IContainer): DeleteTourStorage {\n const globalStore = injectStoresData().store.getState();\n return dataFromGlobalStore(globalStore) ?? initialState;\n}\n\nfunction useStore(): DeleteTourStorage {\n const data = useSelector(globalStore => dataFromGlobalStore(globalStore));\n return data ?? initialState;\n}\n\nfunction setup(container: IContainer) {\n const reducerRegister = injectStoresReducer(container);\n reducerRegister.addSlice(slice);\n\n const middlewareManager = injectStoresMiddleware(container);\n const middleware = middlewareManager.get(IStoreMiddlewareType.SideEffect);\n if (middleware) {\n setupEffects(middleware);\n }\n}\n\nfunction dispatchAction(container: IContainer, action: AnyAction) {\n const store = injectStoresData(container);\n store.dispatch(action);\n}\n\nexport default function Store(container: IContainer) {\n return {\n dataFromGlobalStore,\n getStore: () => getStore(container),\n useStore,\n isDataStore,\n setup: () => {\n setup(container);\n },\n dispatchAction: (action: AnyAction) => {\n dispatchAction(container, action);\n },\n };\n}\n","import type { IContainer } from '@monofe/di';\nimport action from './actions';\nimport type { IModuleState } from './interface';\nimport store from './store';\nexport * from './interface';\n\nfunction ModuleState(container: IContainer): IModuleState {\n const state = store(container);\n\n state.setup();\n\n return {\n useStore: state.useStore,\n getState: state.getStore,\n action: action(state.dispatchAction),\n };\n}\n\nexport default ModuleState;\n","import type { IDialog, IDialogMessage } from '../../dialog/interface';\n\nexport interface IModuleDialog {\n isShowing: () => boolean;\n show: () => void;\n hide: () => void;\n updateCallbacks: (args: { onAccept?: () => void; onDecline?: () => void }) => void;\n updateText: (args: { title?: string; textAccept?: string; textDecline?: string }) => void;\n}\n\nconst DEFAULTS_MESSAGE: Required = {\n id: 'Dialog-Message',\n show: true,\n title: '',\n textAccept: '',\n textDecline: '',\n onAccept: () => {\n /* No-Op */\n },\n onDecline: () => {\n /* No-Op */\n },\n options: { removeOnHide: true },\n};\n\nfunction ModuleDialog(defaults: Partial, dialog: IDialog): IModuleDialog {\n if (!dialog) {\n throw new Error(`DeleteTour: Missing dialog object`);\n }\n\n const message: Required = {\n ...DEFAULTS_MESSAGE,\n ...defaults,\n };\n\n return {\n show: () => {\n dialog.show(message);\n },\n hide: () => {\n if (dialog.isShowing(message)) {\n dialog.hide(message);\n }\n },\n isShowing: () => dialog.isShowing(message),\n updateText: args => {\n Object.assign(message, args);\n },\n updateCallbacks: args => {\n Object.assign(message, args);\n },\n };\n}\n\nexport default ModuleDialog;\n","import type { ITranslationStorage, LANGUAGE_CODE } from '@monofe/util';\n\nexport enum TranslationKey {\n DELETE_COMPLETE = 'Tour removal completed',\n DELETE_FAILURE = 'Tour removal error (%@)',\n DELETE_POPUP_DESCRIPTION = \"Do you want to delete '%@'. (%@)\",\n DELETE_POPUP_ACCEPT = 'Delete',\n DELETE_POPUP_DECLINE = 'Cancel',\n}\n\nexport type TranslateSubscriberCallback = (\n module: IModuleTranslate,\n newLanguage: LANGUAGE_CODE,\n) => void;\n\nexport interface IModuleTranslate {\n translate: (key: TranslationKey, params?: string[]) => string;\n updateLanguage: (languageCode: LANGUAGE_CODE) => void;\n language: () => LANGUAGE_CODE;\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n updateDefaultParams: (key: TranslationKey, params: string[]) => void;\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n}\n\nconst DEFAULT_PARAMS: Record = {\n [TranslationKey.DELETE_COMPLETE]: [],\n [TranslationKey.DELETE_FAILURE]: [],\n [TranslationKey.DELETE_POPUP_DESCRIPTION]: ['site'],\n [TranslationKey.DELETE_POPUP_ACCEPT]: [],\n [TranslationKey.DELETE_POPUP_DECLINE]: [],\n};\n\nfunction ModuleTranslator(translator: ITranslationStorage): IModuleTranslate {\n let activeLanguage: LANGUAGE_CODE = 'en';\n const languageChangeCallbacks: TranslateSubscriberCallback[] = [];\n const translationChangeCallbacks: Partial<\n Record\n > = {};\n const defaultParams = { ...DEFAULT_PARAMS };\n\n const module: IModuleTranslate = {\n translate: (key: TranslationKey, params?: string[]) =>\n translator.translation(activeLanguage, key, params ?? defaultParams[key]),\n updateLanguage: (languageCode: LANGUAGE_CODE) => {\n activeLanguage = languageCode;\n languageChangeCallbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n language: () => activeLanguage,\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) =>\n languageChangeCallbacks.push(cb),\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => {\n const idx = languageChangeCallbacks.indexOf(cb);\n if (idx >= 0) {\n languageChangeCallbacks.splice(idx, 1);\n }\n },\n updateDefaultParams: (key: TranslationKey, params: string[]) => {\n defaultParams[key] = params;\n\n const callbacks = translationChangeCallbacks[key] ?? [];\n\n callbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n arr.push(cb);\n translationChangeCallbacks[key] = arr;\n },\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n const idx = arr.indexOf(cb);\n if (idx >= 0) {\n arr.splice(idx, 1);\n }\n translationChangeCallbacks[key] = arr;\n },\n };\n\n return module;\n}\n\nexport default ModuleTranslator;\n","import type { IToast, IToastMessage } from '../../toast/interface';\nimport type { IModuleTranslate } from './translate';\nimport { TranslationKey } from './translate';\n\nexport enum Message {\n DeletionCompleted = 1,\n DeletionFailed_UnexpectedError = 2,\n}\n\nexport interface IModuleToast {\n isShowing: (message: Message) => boolean;\n isAnyShowing: () => boolean;\n show: (message: Message, parameters?: string[]) => void;\n hide: (message: Message) => void;\n hideAll: () => void;\n}\n\nconst MessageTranslationKey: Record = {\n [Message.DeletionCompleted]: TranslationKey.DELETE_COMPLETE,\n [Message.DeletionFailed_UnexpectedError]: TranslationKey.DELETE_FAILURE,\n};\n\nconst KEY_PREFIX = 'DeleteTour-';\n\nexport const DEFAULT_MESSAGE: Record, 'text'>> = {\n [Message.DeletionCompleted]: {\n id: `${KEY_PREFIX}-Completed`,\n type: 'success',\n },\n [Message.DeletionFailed_UnexpectedError]: {\n id: `${KEY_PREFIX}-Err-Unknown`,\n type: 'error',\n },\n};\n\nconst _isShowingToast = (toast: IToast, id: string) => toast.isShowing({ id });\nconst _showToast = (toast: IToast, message: Required) => {\n !_isShowingToast(toast, message.id) && toast.show(message);\n};\nconst _hideToast = (toast: IToast, id: string) => {\n toast.hide({ id });\n};\n\nfunction ModuleToast(translater: IModuleTranslate, toast: IToast): IModuleToast {\n if (!translater) {\n throw new Error(`Delete-Tour: Missing translater object`);\n }\n\n if (!toast) {\n throw new Error(`Delete-Tour: Missing toast object`);\n }\n\n return {\n isShowing: (message: Message) => _isShowingToast(toast, DEFAULT_MESSAGE[message].id),\n isAnyShowing: () => {\n const messageShow = Object.values(Message).map(message => {\n const messageDetails = DEFAULT_MESSAGE[message as Message];\n return _isShowingToast(toast, messageDetails.id ?? '');\n });\n const showCount = messageShow.reduce((count, value) => count + (value ? 1 : 0), 0);\n return showCount > 0;\n },\n show: (message, parameters) => {\n const text = translater.translate(MessageTranslationKey[message], parameters);\n\n _showToast(toast, {\n ...DEFAULT_MESSAGE[message],\n text,\n });\n },\n hide: (type: Message) => {\n _hideToast(toast, DEFAULT_MESSAGE[type].id);\n },\n hideAll: () => {\n for (const message of Object.values(DEFAULT_MESSAGE)) {\n _hideToast(toast, message.id);\n }\n },\n };\n}\n\nexport default ModuleToast;\n","import type { IJobs } from '@monofe/apiservice';\nimport type { IServiceWorkerController } from '@monofe/worker';\nimport type { IDataResolver } from '../interface';\nimport type { IModuleState } from '../state/interface';\nimport type { IModuleDialog } from './dialog';\nimport type { IModuleSession } from './session';\nimport type { IModuleToast } from './toast';\nimport { Message } from './toast';\n\nconst _hideViews = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.dialog.hide();\n deps.store.action.hideProgressBar();\n deps.store.action.setProgress(0);\n};\n\nconst _showProgress = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.store.action.setProgress(0);\n deps.store.action.showProgressBar();\n};\n\nconst onAccept = async (deps: {\n session: IModuleSession;\n toast: IModuleToast;\n store: IModuleState;\n dialog: IModuleDialog;\n serviceWorker: IServiceWorkerController;\n resolver: IDataResolver;\n jobs: IJobs;\n}) => {\n _hideViews(deps);\n\n const state = deps.store.getState();\n const { userSession, languageId, tourId } = state;\n if (!userSession || !languageId || !tourId || languageId < 1 || tourId < 1) {\n return;\n }\n\n const session = await deps.session.session(userSession);\n\n const deletionList = await deps.resolver.downloadList();\n\n _showProgress(deps);\n\n const promise = deps.jobs.deleteMedia(session.media, deletionList);\n\n if (promise) {\n promise.onProgress(progress => {\n const newBarProgress = Math.round(progress * 100) / 100; /* 2dp accuracy */\n deps.store.action.setProgress(newBarProgress);\n });\n\n await promise\n .then(() => {\n deps.toast.show(Message.DeletionCompleted);\n })\n .catch(() => {\n deps.toast.show(Message.DeletionFailed_UnexpectedError);\n });\n } else {\n deps.toast.show(Message.DeletionFailed_UnexpectedError, ['Unknown error']);\n }\n\n deps.store.action.hideProgressBar();\n};\n\nexport default onAccept;\n","import type { IModuleState } from '../state/interface';\nimport type { IModuleDialog } from './dialog';\n\nconst onDecline = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.store.action.hideProgressBar();\n deps.dialog.hide();\n return Promise.resolve();\n};\n\nexport default onDecline;\n","import type { ISession, ISessionInstantiator } from '@monofe/apiservice';\nimport { injectAPISession, IUserProperties } from '@monofe/apiservice';\nimport { STORE_NAME } from '../state/constants';\n\nexport interface IModuleSession {\n subscribeOnLanguageChange: (callback: (languageId: number) => void) => void;\n subscribeOnTourChange: (callback: (languageId: number) => void) => void;\n subscribeOnSessionChange: (callback: (session: ISession | null) => void) => void;\n session: (name: string) => Promise;\n active: () => ISession | undefined;\n}\n\nfunction _subscribeOnLanguageChange(\n instantiator: ISessionInstantiator,\n callback: (languageId: number) => void,\n) {\n const sessionChanged = (newValue: ISession | null) => {\n callback(newValue?.state.getProperty(IUserProperties.LanguageId) ?? -1);\n\n newValue?.state.subscribeChanges(\n IUserProperties.LanguageId,\n (key: string, languageId: number) => {\n callback(languageId);\n },\n STORE_NAME,\n );\n };\n instantiator.subscribeActiveChanged(sessionChanged, STORE_NAME);\n}\n\nfunction _subscribeOnTourChange(\n instantiator: ISessionInstantiator,\n callback: (languageId: number) => void,\n) {\n const sessionFetcher = injectAPISession();\n\n const sessionChanged = (newValue: ISession | null) => {\n callback(newValue?.state.getProperty(IUserProperties.TourId) ?? -1);\n\n newValue?.state.subscribeChanges(\n IUserProperties.TourId,\n (key: string, tourId: number) => {\n callback(tourId);\n },\n STORE_NAME,\n );\n };\n sessionFetcher.subscribeActiveChanged(sessionChanged, STORE_NAME);\n}\n\nfunction _subscribeOnSessionChange(\n instantiator: ISessionInstantiator,\n callback: (session: ISession | null) => void,\n) {\n instantiator.subscribeActiveChanged(callback, STORE_NAME);\n}\n\nfunction _session(instantiator: ISessionInstantiator, name: string): Promise {\n const session = instantiator.open(name);\n return session;\n}\n\nfunction _active(instantiator: ISessionInstantiator): ISession | undefined {\n const session = instantiator.active();\n return session ?? undefined;\n}\n\nfunction ModuleSession(instantiator: ISessionInstantiator): IModuleSession {\n return {\n subscribeOnLanguageChange: callback => {\n _subscribeOnLanguageChange(instantiator, callback);\n },\n subscribeOnTourChange: callback => {\n _subscribeOnTourChange(instantiator, callback);\n },\n subscribeOnSessionChange: callback => {\n _subscribeOnSessionChange(instantiator, callback);\n },\n session: callback => _session(instantiator, callback),\n active: () => _active(instantiator),\n };\n}\n\nexport default ModuleSession;\n","import type { IProgressBarProps } from '@monofe/ui-common';\nimport { ProgressBar } from '@monofe/ui-common';\nimport type { CSSProperties } from 'react';\nimport { Suspense } from 'react';\n\nconst STYLING_DEFAULT: CSSProperties = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n height: '0.5vh',\n zIndex: 4,\n pointerEvents: 'none',\n transitionDuration: '500ms',\n opacity: 0,\n};\n\nconst PROPS_DEFAULT: IProgressBarProps = {\n progress: 0.0,\n borderRadius: 0,\n textColor: 'transparent',\n};\n\nfunction DownloadProgressBar(props: { progress: number; visible?: boolean }): JSX.Element {\n /* If the progress prop given use, otherwise set to visible if progress is >0 & <1 aka in progress */\n const opacity = props.visible || (props.progress > 0.0 && props.progress < 1.0) ? 1.0 : 0.0;\n\n return (\n \n {props.visible && (\n \n )}\n \n );\n}\n\nexport default DownloadProgressBar;\n","import { injectAPISession, injectJobs, IUserProperties } from '@monofe/apiservice';\nimport { TYPES as API_TYPES } from '@monofe/apiservice/session/interface/bind';\nimport { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { ILog, LANGUAGE_CODE } from '@monofe/util';\nimport { injectLog, injectTranslationStorage, TYPES as UTIL_TYPES } from '@monofe/util';\nimport { injectServiceWorkerController, TYPES as WORKER_TYPES } from '@monofe/worker';\nimport { TYPES as DIALOG_TYPES, injectDialog } from '../dialog/interface';\nimport { IMediaType } from '../download-tour';\nimport { injectToast, TYPES as TOAST_TYPES } from '../toast/interface';\nimport type { IDataResolver, IDeleteTour } from './interface';\nimport {\n bindDeleteTour,\n TYPES as DELETETOUR_TYPES,\n IDeleteState,\n injectDeleteTour,\n unbindDeleteTour,\n} from './interface';\nimport type { IModuleState } from './state';\nimport state from './state';\nimport byteSizeToDescription from '../common/byteSizeToDescription';\nimport type { IModuleDialog } from './util/dialog';\nimport dialog from './util/dialog';\nimport onAccept from './util/onAccept';\nimport onDecline from './util/onDecline';\nimport type { IModuleSession } from './util/session';\nimport session from './util/session';\nimport type { IModuleToast } from './util/toast';\nimport toast from './util/toast';\nimport type { IModuleTranslate } from './util/translate';\nimport translate, { TranslationKey } from './util/translate';\nimport ProgressBar from './views/ProgressBar';\n\nasync function _updateDeleteText(translater: IModuleTranslate, resolver: IDataResolver) {\n const sites = await resolver.all('ISiteDto');\n\n const downloadList = await resolver.downloadList();\n const downloadUrls = (\n await Promise.all(\n downloadList.map(item => resolver.urlsForMedium(item, [IMediaType.Download])),\n )\n ).flat();\n\n const requiredSizes = await Promise.all(\n downloadUrls.map(url => resolver.urlContentLength(url)),\n );\n const requiredSize = requiredSizes.reduce((previous, current) => previous + current, 0);\n\n const sizeDesc = byteSizeToDescription(requiredSize);\n\n translater.updateDefaultParams(TranslationKey.DELETE_POPUP_DESCRIPTION, [\n sites.at(0)?.name ?? 'Unknown',\n sizeDesc,\n ]);\n}\n\ninterface IModuleDependencies {\n session: IModuleSession;\n dialog: IModuleDialog;\n store: IModuleState;\n toast: IModuleToast;\n translate: IModuleTranslate;\n log: ILog;\n resolver: IDataResolver;\n}\n\nfunction _buildLocalDependencies(\n container: IContainer,\n dependencies: Partial & Pick,\n): Promise {\n const translationStorage = injectTranslationStorage(container);\n const sessionFetcher = injectAPISession(container);\n const serviceWorkerController = injectServiceWorkerController(container);\n const log = injectLog(container);\n const toastModule = injectToast(container);\n\n const sessionModule = dependencies.session ?? session(sessionFetcher);\n const translater = dependencies.translate ?? translate(translationStorage);\n const toaster = dependencies.toast ?? toast(translater, toastModule);\n const store = dependencies.store ?? state(container);\n const resolver = dependencies.resolver;\n\n const dialogue = dialog(\n {\n id: 'Delete-Tour',\n onAccept: () =>\n onAccept({\n session: sessionModule,\n toast: toaster,\n dialog: dialogue,\n serviceWorker: serviceWorkerController,\n store,\n resolver,\n jobs: injectJobs(container),\n }),\n onDecline: () => onDecline({ store, dialog: dialogue }),\n },\n injectDialog(container),\n );\n\n return Promise.resolve({\n session: sessionModule,\n dialog: dialogue,\n store,\n toast: toaster,\n translate: translater,\n log,\n resolver,\n });\n}\n\nfunction _buildModule(deps: IModuleDependencies): IDeleteTour {\n const Renderer = (): JSX.Element | null => {\n const { progressBar, progressVisible } = deps.store.useStore();\n return ;\n };\n\n return {\n renderer: Renderer,\n show: () => {\n deps.dialog.show();\n },\n hide: () => {\n deps.dialog.hide();\n deps.store.action.hideProgressBar();\n deps.toast.hideAll();\n },\n isShowing: () =>\n deps.dialog.isShowing() ||\n deps.toast.isAnyShowing() ||\n deps.store.getState().progressVisible,\n isShowable: () => {\n const { userSession, languageId, tourId } = deps.store.getState();\n return userSession.length > 0 && languageId > 0 && tourId > 0;\n },\n progress: () => {\n const store = deps.store.getState();\n return store.progressBar;\n },\n state: () => {\n let newState = IDeleteState.Undef;\n\n const { languageId, tourId, progressVisible } = deps.store.getState();\n\n if (languageId <= 0 || tourId <= 0) {\n newState = IDeleteState.AwaitingLanguageTour;\n } else if (deps.dialog.isShowing()) {\n newState = IDeleteState.PopUpAsk;\n } else if (progressVisible) {\n newState = IDeleteState.Deleting;\n } else {\n newState = IDeleteState.Idle;\n }\n\n return newState;\n },\n dataResolver: () => deps.resolver,\n };\n}\n\nfunction _initializeState(deps: IModuleDependencies) {\n const activeSession = deps.session.active();\n\n if (activeSession) {\n /* Default to 1=English */\n const languageId = activeSession.state.getPropertyWithDefault(\n IUserProperties.LanguageId,\n 1,\n );\n const tourId = activeSession.state.getPropertyWithDefault(\n IUserProperties.TourId,\n -1,\n );\n deps.store.action.updateSession(activeSession.name);\n deps.store.action.updateLanguageId(languageId);\n deps.store.action.updateTourId(tourId);\n const languageCode: () => Promise = async function () {\n if (languageId <= 0) {\n return 'EN' as LANGUAGE_CODE;\n }\n\n const language = await deps.resolver.get('ILanguageDto', languageId);\n return language.name as LANGUAGE_CODE;\n };\n\n languageCode()\n .then(code => {\n deps.translate.updateLanguage(code);\n })\n .catch((error: Error) => {\n deps.log.error(`Failed to update translation: ${error.message}`);\n });\n }\n\n /* Force translation update */\n deps.translate.updateLanguage(deps.translate.language());\n}\n\nfunction _addEffects(deps: IModuleDependencies) {\n const updateTranslations = () => {\n deps.dialog.updateText({\n title: deps.translate.translate(TranslationKey.DELETE_POPUP_DESCRIPTION),\n textAccept: deps.translate.translate(TranslationKey.DELETE_POPUP_ACCEPT),\n textDecline: deps.translate.translate(TranslationKey.DELETE_POPUP_DECLINE),\n });\n };\n\n deps.translate.subscribeLanguageChanged(updateTranslations);\n\n deps.translate.subscribeTranslationChanged(\n TranslationKey.DELETE_POPUP_DESCRIPTION,\n (module: IModuleTranslate, language: LANGUAGE_CODE) => {\n updateTranslations();\n },\n );\n\n deps.session.subscribeOnSessionChange(session => {\n deps.store.action.updateSession(session?.name ?? '');\n });\n\n deps.session.subscribeOnLanguageChange(async languageId => {\n deps.store.action.updateLanguageId(languageId);\n const languageCode =\n languageId > 0 ? (await deps.resolver.get('ILanguageDto', languageId)).name : 'EN';\n\n deps.translate.updateLanguage(languageCode.toLowerCase() as LANGUAGE_CODE);\n });\n\n deps.session.subscribeOnTourChange(async tourId => {\n deps.store.action.updateTourId(tourId);\n await _updateDeleteText(deps.translate, deps.resolver);\n });\n}\n\nexport async function binder(\n container: IContainer,\n dependencies: Partial,\n): Promise> {\n const buildDefaultResolver = async () => {\n const module = await import('./defaultResolver');\n const sessionModule = session(injectAPISession(container));\n return module.default(sessionModule);\n };\n\n const deps = await _buildLocalDependencies(container, {\n ...dependencies,\n resolver: dependencies.resolver ?? (await buildDefaultResolver()),\n });\n\n const module = _buildModule(deps);\n\n _addEffects(deps);\n _initializeState(deps);\n\n return Object.freeze(module);\n}\n\nexport default (function () {\n let localDependencies: Partial = {};\n\n const result = buildBindable({\n id: DELETETOUR_TYPES.IDeleteTour,\n dependencies: [\n APPSTATE_TYPES.IStoresReducer,\n DIALOG_TYPES.IDialog,\n TOAST_TYPES.IToast,\n UTIL_TYPES.ITranslationStorage,\n WORKER_TYPES.IServiceWorkerController,\n UTIL_TYPES.ILog,\n API_TYPES.ISessionInstantiator,\n ],\n bind: bindDeleteTour,\n remove: unbindDeleteTour,\n inject: injectDeleteTour,\n build: container => binder(container, localDependencies),\n });\n\n return Object.freeze({\n ...result,\n setBuildDependencies: (deps: Readonly>) =>\n (localDependencies = deps),\n });\n})();\n","import type { IMediumDto } from '@monofe/apiservice';\nimport type { INSTANTIATOR_INTERFACES } from '@monofe/apiservice/model/interface/instantiator';\nimport type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport enum IDeleteState {\n Undef = 0,\n LoadingDependencies = 1,\n AwaitingLanguageTour = 2,\n Idle = 3,\n PopUpAsk = 4,\n Deleting = 5,\n LastValue = 6,\n}\n\nexport enum IMediaType {\n Stream = 1,\n Download = 2,\n}\n\nexport interface IDataResolver {\n get: <\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n PrimaryKey extends ReturnType,\n >(\n name: Interface,\n pk: PrimaryKey,\n ) => Promise;\n all: <\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n >(\n name: Interface,\n ) => Promise;\n downloadList: () => Promise;\n urlsForMedium: (medium: IMediumDto, types?: IMediaType[]) => Promise;\n urlContentLength: (url: URL) => Promise;\n}\n\nexport interface IDeleteTour {\n renderer: () => JSX.Element | null;\n show: () => void;\n hide: () => void;\n isShowing: () => boolean;\n isShowable: () => boolean;\n progress: () => number;\n state: () => IDeleteState;\n dataResolver: () => IDataResolver;\n}\n\nexport const TYPES = {\n IDeleteTour: Symbol.for('IDeleteTour'),\n};\n\nexport function injectDeleteTour(\n container: IContainer = injectOrBuildContainer(),\n): Readonly {\n return container.get(TYPES.IDeleteTour);\n}\n\nexport function bindDeleteTour(\n value: IDeleteTour,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IDeleteTour, value);\n}\n\nexport function unbindDeleteTour(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IDeleteTour);\n}\n","import type { DialogStorage } from './interface';\n\nexport const STORE_NAME = 'DialogStore';\n\nexport const initialState: DialogStorage = [];\n","import type { IDialogMessage } from '../interface';\n\nexport const MESSAGE_DEFAULTS: Omit, 'id'> = {\n title: '',\n show: false,\n textAccept: 'OK',\n textDecline: 'Cancel',\n onAccept: () => {\n /* No-Op */\n },\n onDecline: () => {\n /* No-Op */\n },\n options: { removeOnHide: true },\n};\n","import { nanoid } from '@reduxjs/toolkit';\nimport type { IDialogMessage } from '../interface';\nimport { MESSAGE_DEFAULTS } from './constants';\n\nexport function constructMessage(\n message: Partial,\n defaults?: Partial,\n): IDialogMessage {\n const newItem: Required = {\n id: message.id ?? defaults?.id ?? nanoid(),\n show: message.show ?? defaults?.show ?? MESSAGE_DEFAULTS.show,\n title: message.title ?? defaults?.title ?? MESSAGE_DEFAULTS.title,\n textAccept: message.textAccept ?? defaults?.textAccept ?? MESSAGE_DEFAULTS.textAccept,\n textDecline: message.textDecline ?? defaults?.textDecline ?? MESSAGE_DEFAULTS.textDecline,\n onAccept: message.onAccept ?? defaults?.onAccept ?? MESSAGE_DEFAULTS.onAccept,\n onDecline: message.onDecline ?? defaults?.onDecline ?? MESSAGE_DEFAULTS.onDecline,\n options: message.options ?? defaults?.options ?? MESSAGE_DEFAULTS.options,\n };\n\n return newItem;\n}\n","import type { PayloadAction } from '@reduxjs/toolkit';\nimport type { IDialogMessage } from '../interface';\nimport { constructMessage } from '../util/message';\nimport type { DialogStorage } from './interface';\n\nconst reset = (state: DialogStorage, action: PayloadAction) => [];\n\nconst _indexesInStore = (state: DialogStorage, search: Partial): number[] => {\n const matchingIndexes = state\n .map((item, index) => (item.id === search.id ? index : -1))\n .filter(index => index >= 0);\n return matchingIndexes;\n};\n\nconst _updateStore = (state: DialogStorage, newData: Partial): DialogStorage => {\n let stateReturn = [...state];\n\n const matchingIndexes = _indexesInStore(state, newData);\n\n if (matchingIndexes.length > 0) {\n stateReturn = stateReturn.map((item, index) =>\n matchingIndexes.includes(index) ? { ...item, ...newData } : item,\n );\n } else {\n stateReturn.push(constructMessage(newData));\n }\n\n return stateReturn;\n};\n\nconst showPopUp = (state: DialogStorage, action: PayloadAction>) =>\n _updateStore(state, {\n ...action.payload,\n show: true,\n });\n\nconst hidePopUp = (state: DialogStorage, action: PayloadAction>) =>\n _updateStore(state, {\n ...action.payload,\n show: false,\n });\n\nconst removePopUp = (state: DialogStorage, action: PayloadAction>) => {\n const matchingIndexes = _indexesInStore(state, action.payload);\n const newState = state.filter((_, index) => !matchingIndexes.includes(index));\n return newState;\n};\n\nconst updatePopUp = (state: DialogStorage, action: PayloadAction>) =>\n _updateStore(state, action.payload);\n\nexport default Object.freeze({\n reset,\n showPopUp,\n hidePopUp,\n removePopUp,\n updatePopUp,\n});\n","import { createSlice } from '@reduxjs/toolkit';\nimport { STORE_NAME } from './constants';\nimport type { DialogStorage } from './interface';\nimport reducers from './reducers';\n\nconst initialState: DialogStorage = [];\n\nexport const slice = createSlice({\n name: STORE_NAME,\n initialState,\n reducers,\n});\n\nexport default slice.actions;\n","import { injectStoresData, injectStoresReducer } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { AnyAction } from '@reduxjs/toolkit';\nimport { useSelector } from 'react-redux';\nimport type { IDialogMessage } from '../interface';\nimport { initialState, STORE_NAME } from './constants';\nimport type { DialogStorage } from './interface';\nimport { slice } from './slice';\n\nexport function isDialogMessage(object: unknown): object is IDialogMessage {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n const record = object as Partial;\n\n return !isNullOrUndefined(record.id) && !isNullOrUndefined(record.title);\n}\n\nexport function isDataStore(object: unknown): object is DialogStorage {\n if (!Array.isArray(object)) {\n return false;\n }\n\n const items = object as unknown[];\n\n for (const message of items) {\n if (!isDialogMessage(message)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function dataFromGlobalStore(globalStore: unknown): DialogStorage | undefined {\n if (globalStore === undefined || globalStore === null || typeof globalStore !== 'object') {\n return undefined;\n }\n\n const data = (globalStore as Record)[STORE_NAME];\n\n return isDataStore(data) ? data : undefined;\n}\n\nexport function getStore(): DialogStorage {\n const globalStore = injectStoresData().store.getState() as unknown;\n return dataFromGlobalStore(globalStore) ?? initialState;\n}\n\nexport function useStore(): DialogStorage {\n const data = useSelector(globalStore => dataFromGlobalStore(globalStore));\n return data ?? initialState;\n}\n\nexport function setupStore(container: IContainer = injectOrBuildContainer()) {\n const reducerRegister = injectStoresReducer(container);\n reducerRegister.addSlice(slice);\n}\n\nexport function dispatchAction(action: AnyAction) {\n const store = injectStoresData();\n store.dispatch(action);\n}\n","import type { IModuleAction } from './interface';\nimport actions from './slice';\nimport { dispatchAction as dispatch } from './store';\n\nfunction Action(): IModuleAction {\n return {\n reset: () => {\n dispatch(actions.reset());\n },\n showPopUp: message => {\n dispatch(actions.showPopUp(message));\n },\n hidePopUp: message => {\n dispatch(actions.hidePopUp(message));\n },\n removePopUp: message => {\n dispatch(actions.removePopUp(message));\n },\n updatePopUp: message => {\n dispatch(actions.updatePopUp(message));\n },\n };\n}\n\nexport default Action;\n","import action from './actions';\nimport type { IModuleState } from './interface';\nimport { getStore as getState, setupStore as initialize, useStore } from './store';\n\nfunction ModuleState(): IModuleState {\n initialize();\n\n return {\n useState: useStore,\n getState,\n action: action(),\n };\n}\n\nexport default ModuleState;\n","import PopUpView from '@monofe/ui-common/alert/PopUpView';\nimport { Suspense } from 'react';\nimport type { IDialogMessage } from '../interface';\nimport actions from '../state/slice';\nimport { dispatchAction } from '../state/store';\nimport { MESSAGE_DEFAULTS } from '../util/constants';\n\nfunction AlertView(props: { messages: IDialogMessage[] }): JSX.Element {\n const onAccept = (item: IDialogMessage) => () => {\n const shouldDelete = item.options?.removeOnHide ?? true;\n dispatchAction(shouldDelete ? actions.removePopUp(item) : actions.hidePopUp(item));\n item.onAccept?.();\n };\n\n const onDecline = (item: IDialogMessage) => () => {\n const shouldDelete = item.options?.removeOnHide ?? true;\n dispatchAction(shouldDelete ? actions.removePopUp(item) : actions.hidePopUp(item));\n item.onDecline?.();\n };\n\n return (\n \n {props.messages\n .filter(item => item.show ?? false)\n .map(item => (\n \n ))}\n \n );\n}\n\nexport default AlertView;\n","import { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { IDialog, IDialogMessage } from './interface';\nimport { TYPES as DIALOG_TYPES, bindDialog, injectDialog, unbindDialog } from './interface';\nimport store from './state';\nimport type { IModuleState } from './state/interface';\nimport { constructMessage } from './util/message';\nimport AlertView from './views/RootView';\n\nfunction _buildLocalDependencies(container: IContainer) {\n return Promise.resolve({\n store: store(),\n });\n}\n\nfunction _buildModule(deps: { store: IModuleState }): IDialog {\n const Render = (): JSX.Element => {\n const store = deps.store.useState();\n return ;\n };\n\n const alert: IDialog = {\n renderer: Render,\n show: function (this: IDialog, message: Partial) {\n const _defaultAction = () => {\n alert.hide(message);\n };\n\n const newItem = constructMessage(message, {\n onAccept: _defaultAction,\n onDecline: _defaultAction,\n });\n\n deps.store.action.showPopUp(newItem);\n },\n hide: (message: Partial) => {\n deps.store.action.hidePopUp(message);\n },\n isShowing: (message: Partial) => {\n const results = deps.store\n .getState()\n .filter(item => item.id === message.id)\n .filter(item => item.show ?? true);\n\n return results.length > 0;\n },\n alert: (id: string) => deps.store.getState().find(item => item.id === id),\n update: (message: Partial & Required<{ id: string }>) => {\n deps.store.action.updatePopUp(message);\n },\n };\n\n return alert;\n}\n\nasync function binder(container: IContainer): Promise> {\n const deps = await _buildLocalDependencies(container);\n\n const module = _buildModule(deps);\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: DIALOG_TYPES.IDialog,\n dependencies: [APPSTATE_TYPES.IStoresReducer],\n bind: bindDialog,\n remove: unbindDialog,\n inject: injectDialog,\n build: container => binder(container),\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport interface IDisplayOptions {\n removeOnHide: boolean;\n}\n\nexport interface IDialogMessage {\n id: string;\n title: string;\n show?: boolean;\n textAccept?: string;\n textDecline?: string;\n onAccept?: () => void;\n onDecline?: () => void;\n options?: IDisplayOptions;\n}\n\nexport interface IDialog {\n renderer: () => JSX.Element | null;\n show: (message: Partial) => void;\n hide: (message: Partial) => void;\n isShowing: (message: Partial & Required<{ id: string }>) => boolean;\n alert: (id: string) => IDialogMessage | undefined;\n update: (message: Partial & { id: string }) => void;\n}\n\nexport const TYPES = {\n IDialog: Symbol.for('IDialog'),\n};\n\nexport function injectDialog(container: IContainer = injectOrBuildContainer()): Readonly {\n return container.get(TYPES.IDialog);\n}\n\nexport function bindDialog(val: IDialog, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IDialog, val);\n}\n\nexport function unbindDialog(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IDialog);\n}\n","import type { DownloadLanguageStorage } from './interface';\n\nexport const STORE_NAME = 'DownloadTour';\n\nexport const initialState: DownloadLanguageStorage = {\n userSession: '',\n languageId: -1,\n tourId: -1,\n progressBar: -1,\n progressVisible: false,\n};\n","import type { PayloadAction } from '@reduxjs/toolkit';\nimport { initialState } from './constants';\nimport type { IDownloadLanguageState } from './interface';\n\nconst reset = (state: IDownloadLanguageState, action: PayloadAction) => ({ ...initialState });\n\nconst updateSession = (\n state: IDownloadLanguageState,\n action: PayloadAction<{ userSession?: string }>,\n) => ({\n ...state,\n userSession: action.payload.userSession ?? '',\n});\n\nconst updateLanguageId = (\n state: IDownloadLanguageState,\n action: PayloadAction<{ languageId?: number }>,\n) => ({\n ...state,\n languageId: action.payload.languageId ?? -1,\n});\n\nconst updateTourId = (\n state: IDownloadLanguageState,\n action: PayloadAction<{ tourId?: number }>,\n) => ({\n ...state,\n tourId: action.payload.tourId ?? -1,\n});\n\nconst hideProgressBar = (state: IDownloadLanguageState, action: PayloadAction) => ({\n ...state,\n progressVisible: false,\n});\n\nconst showProgressBar = (state: IDownloadLanguageState, action: PayloadAction) => ({\n ...state,\n progressVisible: true,\n});\n\nconst setProgress = (\n state: IDownloadLanguageState,\n action: PayloadAction<{ progress: number }>,\n) => ({\n ...state,\n progressBar: action.payload.progress,\n});\n\nexport default Object.freeze({\n reset,\n updateSession,\n updateLanguageId,\n updateTourId,\n hideProgressBar,\n showProgressBar,\n setProgress,\n});\n","import { createSlice } from '@reduxjs/toolkit';\nimport { initialState, STORE_NAME } from './constants';\nimport reducers from './reducer';\n\nexport const slice = createSlice({\n name: STORE_NAME,\n initialState,\n reducers,\n});\n\nexport default slice.actions;\n","import type { AnyAction } from '@reduxjs/toolkit';\nimport type { IModuleAction } from './interface';\nimport actions from './slice';\n\nfunction Action(dispatcher: (action: AnyAction) => void): IModuleAction {\n return {\n reset: () => {\n dispatcher(actions.reset());\n },\n updateSession: userSession => {\n dispatcher(actions.updateSession({ userSession }));\n },\n updateLanguageId: languageId => {\n dispatcher(actions.updateLanguageId({ languageId }));\n },\n updateTourId: tourId => {\n dispatcher(actions.updateTourId({ tourId }));\n },\n hideProgressBar: () => {\n dispatcher(actions.hideProgressBar());\n },\n showProgressBar: () => {\n dispatcher(actions.showProgressBar());\n },\n setProgress: (progress: number) => {\n dispatcher(actions.setProgress({ progress }));\n },\n };\n}\n\nexport default Action;\n","import {\n injectStoresData,\n injectStoresMiddleware,\n injectStoresReducer,\n IStoreMiddlewareType,\n} from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport type { AnyAction } from '@reduxjs/toolkit';\nimport { useSelector } from 'react-redux';\nimport { initialState, STORE_NAME } from './constants';\nimport { setupEffects } from './effects';\nimport type { DownloadLanguageStorage } from './interface';\nimport { slice } from './slice';\n\nfunction isDataStore(object: unknown): object is DownloadLanguageStorage {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.userSession) &&\n !isNullOrUndefined(record.languageId) &&\n !isNullOrUndefined(record.tourId) &&\n !isNullOrUndefined(record.progressBar) &&\n !isNullOrUndefined(record.progressVisible)\n );\n}\n\nfunction dataFromGlobalStore(globalStore: unknown): DownloadLanguageStorage | undefined {\n if (!globalStore || typeof globalStore !== 'object') {\n return undefined;\n }\n\n const data = (globalStore as Record)[STORE_NAME];\n\n return isDataStore(data) ? data : undefined;\n}\n\nfunction getStore(container: IContainer): DownloadLanguageStorage {\n const globalStore = injectStoresData(container).store.getState();\n const data = dataFromGlobalStore(globalStore);\n return isDataStore(data) ? data : initialState;\n}\n\nfunction useStore(): DownloadLanguageStorage {\n const store = useSelector(globalStore => dataFromGlobalStore(globalStore));\n return store ?? initialState;\n}\n\nfunction setup(container: IContainer) {\n const reducerRegister = injectStoresReducer(container);\n reducerRegister.addSlice(slice);\n\n const middlewareManager = injectStoresMiddleware(container);\n const middleware = middlewareManager.get(IStoreMiddlewareType.SideEffect);\n if (middleware) {\n setupEffects(middleware);\n }\n}\n\nfunction dispatchAction(container: IContainer, action: AnyAction) {\n const store = injectStoresData();\n store.dispatch(action);\n}\n\nexport default function Store(container: IContainer) {\n return {\n dataFromGlobalStore,\n getStore: () => getStore(container),\n useStore,\n isDataStore,\n setup: () => {\n setup(container);\n },\n dispatchAction: (action: AnyAction) => {\n dispatchAction(container, action);\n },\n };\n}\n","import type { IContainer } from '@monofe/di';\nimport action from './actions';\nimport type { IModuleState } from './interface';\nimport store from './store';\nexport * from './interface';\n\nfunction ModuleState(container: IContainer): IModuleState {\n const state = store(container);\n\n state.setup();\n\n return {\n useState: state.useStore,\n getState: state.getStore,\n action: action(state.dispatchAction),\n };\n}\n\nexport default ModuleState;\n","import type { IDialog, IDialogMessage } from '../../dialog/interface';\n\nexport interface IModuleDialog {\n isShowing: () => boolean;\n show: () => void;\n hide: () => void;\n updateCallbacks: (args: { onAccept?: () => void; onDecline?: () => void }) => void;\n updateText: (args: { title?: string; textAccept?: string; textDecline?: string }) => void;\n}\n\nconst DEFAULTS_MESSAGE: Required = {\n id: 'Dialog-Message',\n show: true,\n title: '',\n textAccept: '',\n textDecline: '',\n onAccept: () => {\n /* No-Op */\n },\n onDecline: () => {\n /* No-Op */\n },\n options: { removeOnHide: true },\n};\n\nfunction ModuleDialog(defaults: Partial, dialog: IDialog): IModuleDialog {\n if (!dialog) {\n throw new Error(`Download-Language: Missing dialog object`);\n }\n\n const message: Required = {\n ...DEFAULTS_MESSAGE,\n ...defaults,\n };\n\n return {\n show: () => {\n dialog.show(message);\n },\n hide: () => {\n if (dialog.isShowing(message)) {\n dialog.hide(message);\n }\n },\n isShowing: () => dialog.isShowing(message),\n updateText: args => {\n Object.assign(message, args);\n },\n updateCallbacks: args => {\n Object.assign(message, args);\n },\n };\n}\n\nexport default ModuleDialog;\n","import type { ITranslationStorage, LANGUAGE_CODE } from '@monofe/util';\n\nexport enum TranslationKey {\n DOWNLOAD_COMPLETE = 'Download completed',\n DOWNLOAD_FAILED_OFFLINE = 'Currently offline, unable to start download',\n DOWNLOAD_FAILED = 'Download failed: %@',\n DOWNLOAD_FAILED_NOT_ENOUGH_SPACE = 'Insufficient free space for install. %@ requires an additional %@ to download for offline usage',\n DOWNLOAD_POPUP_DESCRIPTION = \"Do you want to download '%@'. %@ space required\",\n DOWNLOAD_POPUP_ACCEPT = 'Download',\n DOWNLOAD_POPUP_DECLINE = 'Cancel',\n}\n\nexport type TranslateSubscriberCallback = (\n module: IModuleTranslate,\n newLanguage: LANGUAGE_CODE,\n) => void;\n\nexport interface IModuleTranslate {\n translate: (key: TranslationKey, params?: string[]) => string;\n updateLanguage: (languageCode: LANGUAGE_CODE) => void;\n language: () => LANGUAGE_CODE;\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n updateDefaultParams: (key: TranslationKey, params: string[]) => void;\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n}\n\nconst DEFAULT_PARAMS: Record = {\n [TranslationKey.DOWNLOAD_COMPLETE]: [],\n [TranslationKey.DOWNLOAD_FAILED_OFFLINE]: [],\n [TranslationKey.DOWNLOAD_FAILED]: ['Unexpected error'],\n [TranslationKey.DOWNLOAD_FAILED_NOT_ENOUGH_SPACE]: ['site', '*unknown*'],\n [TranslationKey.DOWNLOAD_POPUP_DESCRIPTION]: ['site', '*unknown*'],\n [TranslationKey.DOWNLOAD_POPUP_ACCEPT]: [],\n [TranslationKey.DOWNLOAD_POPUP_DECLINE]: [],\n};\n\nfunction ModuleTranslator(translator: ITranslationStorage): IModuleTranslate {\n let activeLanguage: LANGUAGE_CODE = 'en';\n const languageChangeCallbacks: TranslateSubscriberCallback[] = [];\n const translationChangeCallbacks: Partial<\n Record\n > = {};\n const defaultParams = { ...DEFAULT_PARAMS };\n\n const module: IModuleTranslate = {\n translate: (key: TranslationKey, params?: string[]) =>\n translator.translation(activeLanguage, key, params ?? defaultParams[key]),\n updateLanguage: (languageCode: LANGUAGE_CODE) => {\n activeLanguage = languageCode;\n languageChangeCallbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n language: () => activeLanguage,\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) =>\n languageChangeCallbacks.push(cb),\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => {\n const idx = languageChangeCallbacks.indexOf(cb);\n if (idx >= 0) {\n languageChangeCallbacks.splice(idx, 1);\n }\n },\n updateDefaultParams: (key: TranslationKey, params: string[]) => {\n defaultParams[key] = params;\n\n const callbacks = translationChangeCallbacks[key] ?? [];\n\n callbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n arr.push(cb);\n translationChangeCallbacks[key] = arr;\n },\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n const idx = arr.indexOf(cb);\n if (idx >= 0) {\n arr.splice(idx, 1);\n }\n translationChangeCallbacks[key] = arr;\n },\n };\n\n return module;\n}\n\nexport default ModuleTranslator;\n","import type { IMediumDto, ISession } from '@monofe/apiservice';\n\nconst downloadSize = (list: IMediumDto[]) =>\n Promise.resolve(\n list\n .map(medium => medium.mediumSize)\n .reduce((count, currentSize) => count + currentSize, 0),\n );\n\nconst downloadList = async (\n session: ISession,\n languageId: number,\n tourId: number,\n): Promise => {\n if (!languageId || languageId <= 0) {\n return [];\n }\n\n if (!tourId || tourId <= 0) {\n return [];\n }\n\n const database = await session.db.open();\n const language = await database.get('ILanguageDto', languageId);\n const tour = await database.get('ITourDto', tourId);\n const allDownloadList = await session.media.mediaForLanguageWithTour(language, tour);\n database.close();\n\n const isCachedStatus = await Promise.all(\n allDownloadList.map(medium => session.media.isMediumCached(medium.id)),\n );\n\n const missingDownloadList = allDownloadList.filter(\n (_, index) => !(isCachedStatus[index] ?? false),\n );\n\n return missingDownloadList;\n};\n\nexport default {\n downloadList,\n downloadSize,\n};\n","export default async function storageQuota(): Promise {\n if (!('storage' in navigator)) {\n throw new Error(`No navigator.storage api, cannot query for quota`);\n }\n\n if (!('estimate' in navigator.storage)) {\n throw new Error(`No navigator.storage api, cannot query for quota`);\n }\n\n const estimate = await navigator.storage.estimate();\n\n if (!estimate.quota || !estimate.usage) {\n throw new Error(`No valid quota response form StorageManager`);\n }\n\n const freeSpace = estimate.quota - estimate.usage;\n\n return freeSpace;\n}\n","import type { IToast, IToastMessage } from '../../toast/interface';\nimport type { IModuleTranslate } from './translate';\nimport { TranslationKey } from './translate';\n\nexport enum Message {\n DownloadCompleted = 1,\n DownloadFailed_Offline = 2,\n DownloadFailed_UnexpectedError = 3,\n DownloadFailed_NotEnoughSpace = 4,\n}\n\nexport interface IModuleToast {\n isShowing: (message: Message) => boolean;\n isAnyShowing: () => boolean;\n show: (message: Message, parameters?: string[]) => void;\n hide: (message: Message) => void;\n hideAll: () => void;\n}\n\nconst MessageTranslationKey: Record = {\n [Message.DownloadCompleted]: TranslationKey.DOWNLOAD_COMPLETE,\n [Message.DownloadFailed_Offline]: TranslationKey.DOWNLOAD_FAILED_OFFLINE,\n [Message.DownloadFailed_UnexpectedError]: TranslationKey.DOWNLOAD_FAILED,\n [Message.DownloadFailed_NotEnoughSpace]: TranslationKey.DOWNLOAD_FAILED_NOT_ENOUGH_SPACE,\n};\n\nconst KEY_PREFIX = 'DownloadLanguage-';\n\nexport const DEFAULT_MESSAGE: Record, 'text'>> = {\n [Message.DownloadCompleted]: {\n id: `${KEY_PREFIX}-Completed`,\n type: 'success',\n },\n [Message.DownloadFailed_Offline]: {\n id: `${KEY_PREFIX}-Err-Offline`,\n type: 'warn',\n },\n [Message.DownloadFailed_UnexpectedError]: {\n id: `${KEY_PREFIX}-Err-Unknown`,\n type: 'error',\n },\n [Message.DownloadFailed_NotEnoughSpace]: {\n id: `${KEY_PREFIX}-Err-Space`,\n type: 'error',\n },\n};\n\nconst _isShowingToast = (toast: IToast, id: string) => toast.isShowing({ id });\nconst _showToast = (toast: IToast, message: Required) => {\n !_isShowingToast(toast, message.id) && toast.show(message);\n};\nconst _hideToast = (toast: IToast, id: string) => {\n toast.hide({ id });\n};\n\nfunction ModuleToast(translater: IModuleTranslate, toast: IToast): IModuleToast {\n if (!translater) {\n throw new Error(`Download-Language: Missing translater object`);\n }\n\n if (!toast) {\n throw new Error(`Download-Language: Missing toast object`);\n }\n\n return {\n isShowing: (message: Message) => _isShowingToast(toast, DEFAULT_MESSAGE[message].id),\n isAnyShowing: () => {\n const messageShow = Object.values(Message).map(message => {\n const messageDetails = DEFAULT_MESSAGE[message as Message];\n return _isShowingToast(toast, messageDetails.id ?? '');\n });\n const showCount = messageShow.reduce((count, value) => count + (value ? 1 : 0), 0);\n return showCount > 0;\n },\n show: (message, parameters) => {\n const text = translater.translate(MessageTranslationKey[message], parameters);\n\n _showToast(toast, {\n ...DEFAULT_MESSAGE[message],\n text,\n });\n },\n hide: (type: Message) => {\n _hideToast(toast, DEFAULT_MESSAGE[type].id);\n },\n hideAll: () => {\n for (const message of Object.values(DEFAULT_MESSAGE)) {\n _hideToast(toast, message.id);\n }\n },\n };\n}\n\nexport default ModuleToast;\n","import type { ILog } from '@monofe/util';\nimport type { IServiceWorkerController } from '@monofe/worker';\nimport type { IDataResolver } from '../interface';\nimport { IMediaType } from '../interface';\nimport type { IModuleState } from '../state/interface';\nimport storageQuota from '../util/quota';\nimport type { IModuleDialog } from './dialog';\nimport media from './media';\nimport type { IModuleSession } from './session';\nimport type { IModuleToast } from './toast';\nimport { Message } from './toast';\n\nconst _hideViews = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.dialog.hide();\n deps.store.action.hideProgressBar();\n deps.store.action.setProgress(0);\n};\n\nconst _showProgress = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.store.action.setProgress(0);\n deps.store.action.showProgressBar();\n};\n\nconst onAccept = async (deps: {\n session: IModuleSession;\n toast: IModuleToast;\n store: IModuleState;\n dialog: IModuleDialog;\n serviceWorker: IServiceWorkerController;\n resolver: IDataResolver;\n log: ILog;\n}) => {\n _hideViews(deps);\n\n const state = deps.store.getState();\n const { languageId, tourId } = state;\n if (!languageId || !tourId || languageId < 1 || tourId < 1) {\n return;\n }\n\n if (!navigator.onLine) {\n deps.toast.show(Message.DownloadFailed_Offline);\n return;\n }\n\n const downloadList = await deps.resolver.downloadList();\n const requiredSize = await media.downloadSize(downloadList);\n\n const availableSpace = await storageQuota().catch(error => Number.MAX_SAFE_INTEGER);\n\n if (requiredSize > availableSpace) {\n deps.toast.show(Message.DownloadFailed_NotEnoughSpace);\n return;\n }\n\n _showProgress(deps);\n\n const downloadURLs = (\n await Promise.all(\n downloadList.map(medium => deps.resolver.urlsForMedium(medium, [IMediaType.Download])),\n )\n ).flat();\n\n const downloadRequests = downloadURLs.map(url => ({ url: url.toString() }));\n\n const promise = deps.serviceWorker.active()?.addRequestsToCache(downloadRequests);\n\n if (promise) {\n promise.onProgress(progress => {\n const newBarProgress = Math.round(progress * 100) / 100; /* 2dp accuracy */\n deps.store.action.setProgress(newBarProgress);\n });\n\n await promise\n .then(() => {\n deps.toast.show(Message.DownloadCompleted);\n })\n .catch(() => {\n deps.toast.show(Message.DownloadFailed_UnexpectedError);\n });\n } else {\n deps.log.error(\n `Failed to send requests to service worker, worker:${JSON.stringify(\n deps.serviceWorker,\n )} active:${JSON.stringify(deps.serviceWorker.active())}`,\n );\n deps.toast.show(Message.DownloadFailed_UnexpectedError, ['Service Worker not running']);\n }\n\n _hideViews(deps);\n};\n\nexport default onAccept;\n","import type { IModuleState } from '../state/interface';\nimport type { IModuleDialog } from './dialog';\n\nconst onDecline = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.store.action.hideProgressBar();\n deps.dialog.hide();\n};\n\nexport default onDecline;\n","import type { ISession, ISessionInstantiator } from '@monofe/apiservice';\nimport { IUserProperties } from '@monofe/apiservice';\nimport { STORE_NAME } from '../state/constants';\n\nexport interface IModuleSession {\n subscribeOnLanguageChange: (callback: (languageId: number) => void) => void;\n subscribeOnTourChange: (callback: (languageId: number) => void) => void;\n subscribeOnSessionChange: (callback: (session: ISession | null) => void) => void;\n session: (name: string) => Promise;\n active: () => ISession | undefined;\n}\n\nfunction _subscribeOnLanguageChange(\n instantiator: ISessionInstantiator,\n callback: (languageId: number) => void,\n) {\n const subscribe = (session: ISession) => {\n session.state.subscribeChanges(\n IUserProperties.LanguageId,\n (key: string, languageId: number) => {\n callback(languageId);\n },\n STORE_NAME,\n );\n };\n\n const sessionChanged = (newValue: ISession | null) => {\n callback(newValue?.state.getPropertyWithDefault(IUserProperties.LanguageId, -1) ?? -1);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n };\n\n instantiator.subscribeActiveChanged(sessionChanged, STORE_NAME);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n}\n\nfunction _subscribeOnTourChange(\n instantiator: ISessionInstantiator,\n callback: (languageId: number) => void,\n) {\n const subscribe = (session: ISession) => {\n session.state.subscribeChanges(\n IUserProperties.TourId,\n (key: string, tourId: number) => {\n callback(tourId);\n },\n STORE_NAME,\n );\n };\n\n const sessionChanged = (newValue: ISession | null) => {\n callback(newValue?.state.getProperty(IUserProperties.TourId) ?? -1);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n };\n\n instantiator.subscribeActiveChanged(sessionChanged, STORE_NAME);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n}\n\nfunction _subscribeOnSessionChange(\n instantiator: ISessionInstantiator,\n callback: (session: ISession | null) => void,\n) {\n instantiator.subscribeActiveChanged(callback, STORE_NAME);\n}\n\nfunction _session(instantiator: ISessionInstantiator, name: string): Promise {\n const session = instantiator.open(name);\n return session;\n}\n\nfunction _active(instantiator: ISessionInstantiator): ISession | undefined {\n const session = instantiator.active();\n return session ?? undefined;\n}\n\nfunction ModuleSession(instantiator: ISessionInstantiator): IModuleSession {\n return {\n subscribeOnLanguageChange: callback => {\n _subscribeOnLanguageChange(instantiator, callback);\n },\n subscribeOnTourChange: callback => {\n _subscribeOnTourChange(instantiator, callback);\n },\n subscribeOnSessionChange: callback => {\n _subscribeOnSessionChange(instantiator, callback);\n },\n session: callback => _session(instantiator, callback),\n active: () => _active(instantiator),\n };\n}\n\nexport default ModuleSession;\n","import type { IProgressBarProps } from '@monofe/ui-common';\nimport { ProgressBar } from '@monofe/ui-common';\nimport type { CSSProperties } from 'react';\n\nconst STYLING_DEFAULT: CSSProperties = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n height: '0.5vh',\n zIndex: 4,\n pointerEvents: 'none',\n transitionDuration: '500ms',\n opacity: 0,\n};\n\nconst PROPS_DEFAULT: IProgressBarProps = {\n progress: 0.0,\n borderRadius: 0,\n textColor: 'transparent',\n};\n\nfunction DownloadProgressBar(props: { progress: number; visible?: boolean }): JSX.Element | null {\n /* If the progress prop given use, otherwise set to visible if progress is >0 & <1 aka in progress */\n const opacity = props.visible || (props.progress > 0.0 && props.progress < 1.0) ? 1.0 : 0.0;\n\n return props.visible ? (\n \n ) : null;\n}\n\nexport default DownloadProgressBar;\n","import { injectAPISession, IUserProperties } from '@monofe/apiservice';\nimport { TYPES as API_TYPES } from '@monofe/apiservice/session/interface/bind';\nimport { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { ILog, LANGUAGE_CODE } from '@monofe/util';\nimport { injectLog, injectTranslationStorage, TYPES as UTIL_TYPES } from '@monofe/util';\nimport { injectServiceWorkerController, TYPES as WORKER_TYPES } from '@monofe/worker';\nimport byteSizeToDescription from '../common/byteSizeToDescription';\nimport { injectDialog } from '../dialog';\nimport { TYPES as DIALOG_TYPES } from '../dialog/interface';\nimport { injectToast, TYPES as TOAST_TYPES } from '../toast/interface';\nimport type { IDataResolver, IDownloadLanguage } from './interface';\nimport {\n bindDownloadLanguage,\n TYPES as DOWNLOADLANGUAGE_TYPES,\n IDownloadState,\n injectDownloadLanguage,\n unbindDownloadLanguage,\n} from './interface';\nimport type { IModuleState } from './state';\nimport state from './state';\nimport type { IModuleDialog } from './util/dialog';\nimport dialog from './util/dialog';\nimport media from './util/media';\nimport onAccept from './util/onAccept';\nimport onDecline from './util/onDecline';\nimport type { IModuleSession } from './util/session';\nimport session from './util/session';\nimport type { IModuleToast } from './util/toast';\nimport toast from './util/toast';\nimport type { IModuleTranslate } from './util/translate';\nimport translate, { TranslationKey } from './util/translate';\nimport ProgressBar from './views/ProgressBar';\n\nasync function _updateDownloadSizeText(translater: IModuleTranslate, resolver: IDataResolver) {\n const sites = await resolver.all('ISiteDto');\n\n const downloadList = await resolver.downloadList();\n\n const requiredSize = await media.downloadSize(downloadList);\n\n const sizeDesc = byteSizeToDescription(requiredSize);\n\n translater.updateDefaultParams(TranslationKey.DOWNLOAD_FAILED_NOT_ENOUGH_SPACE, [\n sites.at(0)?.name ?? 'Unknown',\n sizeDesc,\n ]);\n\n translater.updateDefaultParams(TranslationKey.DOWNLOAD_POPUP_DESCRIPTION, [\n sites.at(0)?.name ?? 'Unknown',\n sizeDesc,\n ]);\n}\n\nexport interface IModuleDependencies {\n session: Readonly;\n dialog: Readonly;\n store: Readonly;\n toast: Readonly;\n translate: Readonly;\n log: Readonly;\n resolver: Readonly;\n}\n\nfunction _buildLocalDependencies(\n container: IContainer,\n dependencies: Partial & Pick,\n): Promise {\n const translationStorage = injectTranslationStorage(container);\n const serviceWorkerController = injectServiceWorkerController(container);\n const log = injectLog(container);\n const sessionFetcher = injectAPISession(container);\n const dialogModule = injectDialog(container);\n const toastModule = injectToast(container);\n\n const sessionModule = dependencies.session ?? session(sessionFetcher);\n const translater = dependencies.translate ?? translate(translationStorage);\n const toaster = dependencies.toast ?? toast(translater, toastModule);\n const store = dependencies.store ?? state(container);\n const resolver = dependencies.resolver;\n\n const dialogue = dialog(\n {\n id: 'Download-Language',\n onAccept: () =>\n onAccept({\n session: sessionModule,\n toast: toaster,\n dialog: dialogue,\n serviceWorker: serviceWorkerController,\n store,\n resolver,\n log,\n }),\n onDecline: () => {\n onDecline({ store, dialog: dialogue });\n },\n },\n dialogModule,\n );\n\n return Promise.resolve({\n session: sessionModule,\n dialog: dialogue,\n store,\n toast: toaster,\n translate: translater,\n log,\n resolver,\n });\n}\n\nfunction _buildModule(deps: IModuleDependencies): IDownloadLanguage {\n const Renderer = (): JSX.Element | null => {\n const { progressVisible, progressBar } = deps.store.useState();\n return ;\n };\n\n return {\n renderer: Renderer,\n show: () => {\n deps.dialog.show();\n },\n hide: () => {\n deps.dialog.hide();\n deps.store.action.hideProgressBar();\n deps.toast.hideAll();\n },\n isShowing: () =>\n deps.dialog.isShowing() ||\n deps.toast.isAnyShowing() ||\n deps.store.getState().progressVisible,\n isShowable: () => {\n const { userSession, languageId, tourId } = deps.store.getState();\n return userSession.length > 0 && languageId > 0 && tourId > 0;\n },\n state: () => {\n let newState = IDownloadState.Undef;\n\n if (deps.store.getState().languageId <= 0 || deps.store.getState().tourId <= 0) {\n newState = IDownloadState.AwaitingLanguageTour;\n } else if (deps.dialog.isShowing()) {\n newState = IDownloadState.PopUpAsk;\n } else if (deps.store.getState().progressVisible) {\n newState = IDownloadState.Downloading;\n } else {\n newState = IDownloadState.Idle;\n }\n\n return newState;\n },\n dataResolver: () => deps.resolver,\n };\n}\n\nfunction _initializeState(deps: IModuleDependencies) {\n const activeSession = deps.session.active();\n\n if (activeSession) {\n /* Default to 1=English */\n const languageId = activeSession.state.getProperty(IUserProperties.LanguageId) ?? 1;\n const tourId = activeSession.state.getProperty(IUserProperties.TourId) ?? -1;\n deps.store.action.updateSession(activeSession.name);\n deps.store.action.updateLanguageId(languageId);\n deps.store.action.updateTourId(tourId);\n\n if (tourId > 0) {\n _updateDownloadSizeText(deps.translate, deps.resolver).catch((error: Error) => {\n deps.log.error(`Failed to update translation: ${error.message}`);\n });\n }\n }\n\n /* Force translation update */\n deps.translate.updateLanguage(deps.translate.language());\n}\n\nfunction _addEffects(deps: IModuleDependencies) {\n const updateTranslations = () => {\n deps.dialog.updateText({\n title: deps.translate.translate(TranslationKey.DOWNLOAD_POPUP_DESCRIPTION),\n textAccept: deps.translate.translate(TranslationKey.DOWNLOAD_POPUP_ACCEPT),\n textDecline: deps.translate.translate(TranslationKey.DOWNLOAD_POPUP_DECLINE),\n });\n };\n\n deps.translate.subscribeLanguageChanged(updateTranslations);\n\n deps.translate.subscribeTranslationChanged(\n TranslationKey.DOWNLOAD_POPUP_DESCRIPTION,\n (module: IModuleTranslate, language: LANGUAGE_CODE) => {\n updateTranslations();\n },\n );\n\n deps.session.subscribeOnSessionChange(session => {\n deps.store.action.updateSession(session?.name ?? '');\n });\n\n deps.session.subscribeOnLanguageChange(async languageId => {\n deps.store.action.updateLanguageId(languageId);\n const languageCode =\n languageId > 0 ? (await deps.resolver.get('ILanguageDto', languageId)).name : 'EN';\n\n deps.translate.updateLanguage(languageCode.toLowerCase() as LANGUAGE_CODE);\n });\n\n deps.session.subscribeOnTourChange(async tourId => {\n deps.store.action.updateTourId(tourId);\n await _updateDownloadSizeText(deps.translate, deps.resolver);\n });\n}\n\nexport async function binder(\n container: IContainer,\n dependencies: Partial,\n): Promise> {\n const buildDefaultResolver = async () => {\n const module = await import('./defaultResolver');\n const sessionModule = session(injectAPISession(container));\n return module.default(sessionModule);\n };\n\n const deps = await _buildLocalDependencies(container, {\n ...dependencies,\n resolver: dependencies.resolver ?? (await buildDefaultResolver()),\n });\n\n const module = _buildModule(deps);\n\n _addEffects(deps);\n _initializeState(deps);\n\n return Object.freeze(module);\n}\n\nexport default (function () {\n let localDependencies: Partial = {};\n\n const result = buildBindable({\n id: DOWNLOADLANGUAGE_TYPES.IDownloadLanguage,\n dependencies: [\n APPSTATE_TYPES.IStoresReducer,\n DIALOG_TYPES.IDialog,\n TOAST_TYPES.IToast,\n UTIL_TYPES.ITranslationStorage,\n WORKER_TYPES.IServiceWorkerController,\n UTIL_TYPES.ILog,\n API_TYPES.ISessionInstantiator,\n ],\n bind: bindDownloadLanguage,\n remove: unbindDownloadLanguage,\n inject: injectDownloadLanguage,\n build: container => binder(container, localDependencies),\n });\n\n return Object.freeze({\n ...result,\n setBuildDependencies: (deps: Readonly>) =>\n (localDependencies = deps),\n });\n})();\n","import type { IMediumDto } from '@monofe/apiservice';\nimport type { INSTANTIATOR_INTERFACES } from '@monofe/apiservice/model/interface/instantiator';\nimport type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport enum IDownloadState {\n Undef = 0,\n LoadingDependencies = 1,\n AwaitingLanguageTour = 2,\n Idle = 3,\n PopUpAsk = 4,\n Downloading = 5,\n LastValue = 6,\n}\n\nexport enum IMediaType {\n Stream = 1,\n Download = 2,\n}\n\nexport interface IDataResolver {\n get: <\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n PrimaryKey extends ReturnType,\n >(\n name: Interface,\n pk: PrimaryKey,\n ) => Promise;\n all: <\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n >(\n name: Interface,\n ) => Promise;\n downloadList: () => Promise;\n urlsForMedium: (medium: IMediumDto, types?: IMediaType[]) => Promise;\n}\n\nexport interface IDownloadLanguage {\n renderer: () => JSX.Element | null;\n show: () => void;\n hide: () => void;\n isShowing: () => boolean;\n isShowable: () => boolean;\n state: () => IDownloadState;\n dataResolver: () => IDataResolver;\n}\n\nexport const TYPES = {\n IDownloadLanguage: Symbol.for('IDownloadLanguage'),\n};\n\nexport function injectDownloadLanguage(\n container: IContainer = injectOrBuildContainer(),\n): Readonly {\n return container.get(TYPES.IDownloadLanguage);\n}\n\nexport function bindDownloadLanguage(\n value: IDownloadLanguage,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IDownloadLanguage, value);\n}\n\nexport function unbindDownloadLanguage(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IDownloadLanguage);\n}\n","import type { DownloadTourStorage } from './interface';\n\nexport const STORE_NAME = 'DownloadTour';\n\nexport const initialState: DownloadTourStorage = {\n userSession: '',\n languageId: -1,\n tourId: -1,\n progressBar: -1,\n progressVisible: false,\n};\n","import type { PayloadAction } from '@reduxjs/toolkit';\nimport { initialState } from './constants';\nimport type { IDownloadTourState } from './interface';\n\nconst reset = (state: IDownloadTourState, action: PayloadAction) => ({ ...initialState });\n\nconst updateSession = (\n state: IDownloadTourState,\n action: PayloadAction<{ userSession?: string }>,\n) => ({\n ...state,\n userSession: action.payload.userSession ?? '',\n});\n\nconst updateLanguageId = (\n state: IDownloadTourState,\n action: PayloadAction<{ languageId?: number }>,\n) => ({\n ...state,\n languageId: action.payload.languageId ?? -1,\n});\n\nconst updateTourId = (state: IDownloadTourState, action: PayloadAction<{ tourId?: number }>) => ({\n ...state,\n tourId: action.payload.tourId ?? -1,\n});\n\nconst hideProgressBar = (state: IDownloadTourState, action: PayloadAction) => ({\n ...state,\n progressVisible: false,\n});\n\nconst showProgressBar = (state: IDownloadTourState, action: PayloadAction) => ({\n ...state,\n progressVisible: true,\n});\n\nconst setProgress = (state: IDownloadTourState, action: PayloadAction<{ progress: number }>) => ({\n ...state,\n progressBar: action.payload.progress,\n});\n\nexport default Object.freeze({\n reset,\n updateSession,\n updateLanguageId,\n updateTourId,\n hideProgressBar,\n showProgressBar,\n setProgress,\n});\n","import { createSlice } from '@reduxjs/toolkit';\nimport { initialState, STORE_NAME } from './constants';\nimport reducers from './reducer';\n\nexport const slice = createSlice({\n name: STORE_NAME,\n initialState,\n reducers,\n});\n\nexport default slice.actions;\n","import type { AnyAction } from '@reduxjs/toolkit';\nimport type { IModuleAction } from './interface';\nimport actions from './slice';\n\nfunction Action(dispatcher: (action: AnyAction) => void): IModuleAction {\n return {\n reset: () => {\n dispatcher(actions.reset());\n },\n updateSession: userSession => {\n dispatcher(actions.updateSession({ userSession }));\n },\n updateLanguageId: languageId => {\n dispatcher(actions.updateLanguageId({ languageId }));\n },\n updateTourId: tourId => {\n dispatcher(actions.updateTourId({ tourId }));\n },\n hideProgressBar: () => {\n dispatcher(actions.hideProgressBar());\n },\n showProgressBar: () => {\n dispatcher(actions.showProgressBar());\n },\n setProgress: (progress: number) => {\n dispatcher(actions.setProgress({ progress }));\n },\n };\n}\n\nexport default Action;\n","import {\n injectStoresData,\n injectStoresMiddleware,\n injectStoresReducer,\n IStoreMiddlewareType,\n} from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport type { AnyAction } from '@reduxjs/toolkit';\nimport { useSelector } from 'react-redux';\nimport { initialState, STORE_NAME } from './constants';\nimport { setupEffects } from './effects';\nimport type { DownloadTourStorage } from './interface';\nimport { slice } from './slice';\n\nfunction isDataStore(object: unknown): object is DownloadTourStorage {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.userSession) &&\n !isNullOrUndefined(record.languageId) &&\n !isNullOrUndefined(record.tourId) &&\n !isNullOrUndefined(record.progressBar) &&\n !isNullOrUndefined(record.progressVisible)\n );\n}\n\nfunction dataFromGlobalStore(globalStore: unknown): DownloadTourStorage | undefined {\n if (!globalStore || typeof globalStore !== 'object') {\n return undefined;\n }\n\n const data = (globalStore as Record)[STORE_NAME];\n\n return isDataStore(data) ? data : undefined;\n}\n\nfunction getStore(container: IContainer): DownloadTourStorage {\n const globalStore = injectStoresData(container).store.getState();\n const data = dataFromGlobalStore(globalStore);\n return isDataStore(data) ? data : initialState;\n}\n\nfunction useStore(): DownloadTourStorage {\n const store = useSelector(globalStore => dataFromGlobalStore(globalStore));\n return store ?? initialState;\n}\n\nfunction setup(container: IContainer) {\n const reducerRegister = injectStoresReducer(container);\n reducerRegister.addSlice(slice);\n\n const middlewareManager = injectStoresMiddleware(container);\n const middleware = middlewareManager.get(IStoreMiddlewareType.SideEffect);\n if (middleware) {\n setupEffects(middleware);\n }\n}\n\nfunction dispatchAction(container: IContainer, action: AnyAction) {\n const store = injectStoresData();\n store.dispatch(action);\n}\n\nexport default function Store(container: IContainer) {\n return {\n dataFromGlobalStore,\n getStore: () => getStore(container),\n useStore,\n isDataStore,\n setup: () => {\n setup(container);\n },\n dispatchAction: (action: AnyAction) => {\n dispatchAction(container, action);\n },\n };\n}\n","import type { IContainer } from '@monofe/di';\nimport action from './actions';\nimport type { IModuleState } from './interface';\nimport store from './store';\nexport * from './interface';\n\nfunction ModuleState(container: IContainer): IModuleState {\n const state = store(container);\n\n state.setup();\n\n return {\n useState: state.useStore,\n getState: state.getStore,\n action: action(state.dispatchAction),\n };\n}\n\nexport default ModuleState;\n","import type { IDialog, IDialogMessage } from '../../dialog/interface';\n\nexport interface IModuleDialog {\n isShowing: () => boolean;\n show: () => void;\n hide: () => void;\n updateCallbacks: (args: { onAccept?: () => void; onDecline?: () => void }) => void;\n updateText: (args: { title?: string; textAccept?: string; textDecline?: string }) => void;\n}\n\nconst DEFAULTS_MESSAGE: Required = {\n id: 'Dialog-Message',\n show: true,\n title: '',\n textAccept: '',\n textDecline: '',\n onAccept: () => {\n /* No-Op */\n },\n onDecline: () => {\n /* No-Op */\n },\n options: { removeOnHide: true },\n};\n\nfunction ModuleDialog(defaults: Partial, dialog: IDialog): IModuleDialog {\n if (!dialog) {\n throw new Error(`Download-Tour: Missing dialog object`);\n }\n\n const message: Required = {\n ...DEFAULTS_MESSAGE,\n ...defaults,\n };\n\n return {\n show: () => {\n dialog.show(message);\n },\n hide: () => {\n if (dialog.isShowing(message)) {\n dialog.hide(message);\n }\n },\n isShowing: () => dialog.isShowing(message),\n updateText: args => {\n Object.assign(message, args);\n },\n updateCallbacks: args => {\n Object.assign(message, args);\n },\n };\n}\n\nexport default ModuleDialog;\n","export default async function storageQuota(): Promise {\n if (!('storage' in navigator)) {\n throw new Error(`No navigator.storage api, cannot query for quota`);\n }\n\n if (!('estimate' in navigator.storage)) {\n throw new Error(`No navigator.storage api, cannot query for quota`);\n }\n\n const estimate = await navigator.storage.estimate();\n\n if (!estimate.quota || !estimate.usage) {\n throw new Error(`No valid quota response form StorageManager`);\n }\n\n const freeSpace = estimate.quota - estimate.usage;\n\n return freeSpace;\n}\n","import type { IMediumDto, ISession } from '@monofe/apiservice';\n\nconst downloadSize = (list: IMediumDto[]) =>\n Promise.resolve(\n list\n .map(medium => medium.mediumSize)\n .reduce((count, currentSize) => count + currentSize, 0),\n );\n\nconst downloadList = async (\n session: ISession,\n languageId: number,\n tourId: number,\n): Promise => {\n if (!languageId || languageId <= 0) {\n return [];\n }\n\n if (!tourId || tourId <= 0) {\n return [];\n }\n\n const database = await session.db.open();\n const language = await database.get('ILanguageDto', languageId);\n const tour = await database.get('ITourDto', tourId);\n const allDownloadList = await session.media.mediaForLanguageWithTour(language, tour);\n database.close();\n\n const isCachedStatus = await Promise.all(\n allDownloadList.map(medium => session.media.isMediumCached(medium.id)),\n );\n\n const missingDownloadList = allDownloadList.filter(\n (value, index) => !(isCachedStatus[index] ?? false),\n );\n\n return missingDownloadList;\n};\n\nexport default Object.freeze({\n downloadList,\n downloadSize,\n});\n","import type { ITranslationStorage, LANGUAGE_CODE } from '@monofe/util';\n\nexport enum TranslationKey {\n DOWNLOAD_COMPLETE = 'Download completed',\n DOWNLOAD_FAILED_OFFLINE = 'Currently offline, unable to start download',\n DOWNLOAD_FAILED = 'Download failed: %@',\n DOWNLOAD_FAILED_NOT_ENOUGH_SPACE = 'Insufficient free space for install. %@ requires an additional %@ to download for offline usage',\n DOWNLOAD_POPUP_DESCRIPTION = \"Do you want to download '%@'. %@ space required\",\n DOWNLOAD_POPUP_ACCEPT = 'Download',\n DOWNLOAD_POPUP_DECLINE = 'Cancel',\n}\n\nexport type TranslateSubscriberCallback = (\n module: IModuleTranslate,\n newLanguage: LANGUAGE_CODE,\n) => void;\n\nexport interface IModuleTranslate {\n translate: (key: TranslationKey, params?: string[]) => string;\n updateLanguage: (languageCode: LANGUAGE_CODE) => void;\n language: () => LANGUAGE_CODE;\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n updateDefaultParams: (key: TranslationKey, params: string[]) => void;\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n}\n\nconst DEFAULT_PARAMS: Record = {\n [TranslationKey.DOWNLOAD_COMPLETE]: [],\n [TranslationKey.DOWNLOAD_FAILED_OFFLINE]: [],\n [TranslationKey.DOWNLOAD_FAILED]: ['Unexpected error'],\n [TranslationKey.DOWNLOAD_FAILED_NOT_ENOUGH_SPACE]: ['site', '*unknown*'],\n [TranslationKey.DOWNLOAD_POPUP_DESCRIPTION]: ['site', '*unknown*'],\n [TranslationKey.DOWNLOAD_POPUP_ACCEPT]: [],\n [TranslationKey.DOWNLOAD_POPUP_DECLINE]: [],\n};\n\nfunction ModuleTranslator(translator: ITranslationStorage): IModuleTranslate {\n let activeLanguage: LANGUAGE_CODE = 'en';\n const languageChangeCallbacks: TranslateSubscriberCallback[] = [];\n const translationChangeCallbacks: Partial<\n Record\n > = {};\n const defaultParams = { ...DEFAULT_PARAMS };\n\n const module: IModuleTranslate = {\n translate: (key: TranslationKey, params?: string[]) =>\n translator.translation(activeLanguage, key, params ?? defaultParams[key]),\n updateLanguage: (languageCode: LANGUAGE_CODE) => {\n activeLanguage = languageCode;\n languageChangeCallbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n language: () => activeLanguage,\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) =>\n languageChangeCallbacks.push(cb),\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => {\n const idx = languageChangeCallbacks.indexOf(cb);\n if (idx >= 0) {\n languageChangeCallbacks.splice(idx, 1);\n }\n },\n updateDefaultParams: (key: TranslationKey, params: string[]) => {\n defaultParams[key] = params;\n\n const callbacks = translationChangeCallbacks[key] ?? [];\n\n callbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n arr.push(cb);\n translationChangeCallbacks[key] = arr;\n },\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n const idx = arr.indexOf(cb);\n if (idx >= 0) {\n arr.splice(idx, 1);\n }\n translationChangeCallbacks[key] = arr;\n },\n };\n\n return module;\n}\n\nexport default ModuleTranslator;\n","import type { IToast, IToastMessage } from '../../toast/interface';\nimport type { IModuleTranslate } from './translate';\nimport { TranslationKey } from './translate';\n\nexport enum Message {\n DownloadCompleted = 1,\n DownloadFailed_Offline = 2,\n DownloadFailed_UnexpectedError = 3,\n DownloadFailed_NotEnoughSpace = 4,\n}\n\nexport interface IModuleToast {\n isShowing: (message: Message) => boolean;\n isAnyShowing: () => boolean;\n show: (message: Message, parameters?: string[]) => void;\n hide: (message: Message) => void;\n hideAll: () => void;\n}\n\nconst MessageTranslationKey: Record = {\n [Message.DownloadCompleted]: TranslationKey.DOWNLOAD_COMPLETE,\n [Message.DownloadFailed_Offline]: TranslationKey.DOWNLOAD_FAILED_OFFLINE,\n [Message.DownloadFailed_UnexpectedError]: TranslationKey.DOWNLOAD_FAILED,\n [Message.DownloadFailed_NotEnoughSpace]: TranslationKey.DOWNLOAD_FAILED_NOT_ENOUGH_SPACE,\n};\n\nconst KEY_PREFIX = 'DownloadTour-';\n\nexport const DEFAULT_MESSAGE: Record, 'text'>> = {\n [Message.DownloadCompleted]: {\n id: `${KEY_PREFIX}-Completed`,\n type: 'success',\n },\n [Message.DownloadFailed_Offline]: {\n id: `${KEY_PREFIX}-Err-Offline`,\n type: 'warn',\n },\n [Message.DownloadFailed_UnexpectedError]: {\n id: `${KEY_PREFIX}-Err-Unknown`,\n type: 'error',\n },\n [Message.DownloadFailed_NotEnoughSpace]: {\n id: `${KEY_PREFIX}-Err-Space`,\n type: 'error',\n },\n};\n\nconst _isShowingToast = (toast: IToast, id: string) => toast.isShowing({ id });\nconst _showToast = (toast: IToast, message: Required) => {\n !_isShowingToast(toast, message.id) && toast.show(message);\n};\nconst _hideToast = (toast: IToast, id: string) => {\n toast.hide({ id });\n};\n\nfunction ModuleToast(translater: IModuleTranslate, toast: IToast): IModuleToast {\n if (!translater) {\n throw new Error(`Download-Tour: Missing translater object`);\n }\n\n if (!toast) {\n throw new Error(`Download-Tour: Missing toast object`);\n }\n\n return {\n isShowing: (message: Message) => _isShowingToast(toast, DEFAULT_MESSAGE[message].id),\n isAnyShowing: () => {\n const messageShow = Object.values(Message).map(message => {\n const messageDetails = DEFAULT_MESSAGE[message as Message];\n return _isShowingToast(toast, messageDetails.id ?? '');\n });\n const showCount = messageShow.reduce((count, value) => count + (value ? 1 : 0), 0);\n return showCount > 0;\n },\n show: (message, parameters) => {\n const text = translater.translate(MessageTranslationKey[message], parameters);\n\n _showToast(toast, {\n ...DEFAULT_MESSAGE[message],\n text,\n });\n },\n hide: (type: Message) => {\n _hideToast(toast, DEFAULT_MESSAGE[type].id);\n },\n hideAll: () => {\n for (const message of Object.values(DEFAULT_MESSAGE)) {\n _hideToast(toast, message.id);\n }\n },\n };\n}\n\nexport default ModuleToast;\n","import type { ILog } from '@monofe/util';\nimport type { IServiceWorkerController } from '@monofe/worker';\nimport type { IDataResolver } from '../interface';\nimport { IMediaType } from '../interface';\nimport type { IModuleState } from '../state/interface';\nimport storageQuota from '../util/quota';\nimport type { IModuleDialog } from './dialog';\nimport media from './media';\nimport type { IModuleSession } from './session';\nimport type { IModuleToast } from './toast';\nimport { Message } from './toast';\n\nconst _hideViews = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.dialog.hide();\n deps.store.action.hideProgressBar();\n deps.store.action.setProgress(0);\n};\n\nconst _showProgress = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.store.action.setProgress(0);\n deps.store.action.showProgressBar();\n};\n\nconst onAccept = async (deps: {\n session: IModuleSession;\n toast: IModuleToast;\n store: IModuleState;\n dialog: IModuleDialog;\n serviceWorker: IServiceWorkerController;\n resolver: IDataResolver;\n log: ILog;\n}) => {\n _hideViews(deps);\n\n const state = deps.store.getState();\n const { languageId, tourId } = state;\n if (!languageId || !tourId || languageId < 1 || tourId < 1) {\n return;\n }\n\n if (!navigator.onLine) {\n deps.toast.show(Message.DownloadFailed_Offline);\n return;\n }\n\n const downloadList = await deps.resolver.downloadList();\n const requiredSize = await media.downloadSize(downloadList);\n\n const availableSpace = await storageQuota().catch(error => Number.MAX_SAFE_INTEGER);\n\n if (requiredSize > availableSpace) {\n deps.toast.show(Message.DownloadFailed_NotEnoughSpace);\n return;\n }\n\n _showProgress(deps);\n\n const allUrls = await Promise.all(\n downloadList.map(medium => deps.resolver.urlsForMedium(medium, [IMediaType.Download])),\n );\n\n /* Remove any duplicates */\n const downloadURLs = [...new Set(allUrls.flat())];\n\n const downloadRequests = downloadURLs.map(url => ({ url: url.toString() }));\n\n const promise = deps.serviceWorker.active()?.addRequestsToCache(downloadRequests);\n\n if (promise) {\n promise.onProgress(progress => {\n const newBarProgress = Math.round(progress * 100) / 100; /* 2dp accuracy */\n deps.store.action.setProgress(newBarProgress);\n });\n\n await promise\n .then(() => {\n deps.toast.show(Message.DownloadCompleted);\n })\n .catch(() => {\n deps.toast.show(Message.DownloadFailed_UnexpectedError);\n });\n } else {\n deps.log.error(\n `Failed to send requests to service worker, worker:${JSON.stringify(\n deps.serviceWorker,\n )} active:${JSON.stringify(deps.serviceWorker.active())}`,\n );\n deps.toast.show(Message.DownloadFailed_UnexpectedError, ['Service Worker not running']);\n }\n\n _hideViews(deps);\n};\n\nexport default onAccept;\n","import type { IModuleState } from '../state/interface';\nimport type { IModuleDialog } from './dialog';\n\nconst onDecline = (deps: { store: IModuleState; dialog: IModuleDialog }) => {\n deps.store.action.hideProgressBar();\n deps.dialog.hide();\n};\n\nexport default onDecline;\n","import type { ISession, ISessionInstantiator } from '@monofe/apiservice';\nimport { IUserProperties } from '@monofe/apiservice';\nimport { STORE_NAME } from '../state/constants';\n\nexport interface IModuleSession {\n subscribeOnLanguageChange: (callback: (languageId: number) => void) => void;\n subscribeOnTourChange: (callback: (languageId: number) => void) => void;\n subscribeOnSessionChange: (callback: (session: ISession | null) => void) => void;\n session: (name: string) => Promise;\n active: () => ISession | undefined;\n}\n\nfunction _subscribeOnLanguageChange(\n instantiator: ISessionInstantiator,\n callback: (languageId: number) => void,\n) {\n const subscribe = (session: ISession) => {\n session.state.subscribeChanges(\n IUserProperties.LanguageId,\n (key: string, languageId: number) => {\n callback(languageId);\n },\n STORE_NAME,\n );\n };\n\n const sessionChanged = (newValue: ISession | null) => {\n callback(newValue?.state.getProperty(IUserProperties.LanguageId) ?? -1);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n };\n\n instantiator.subscribeActiveChanged(sessionChanged, STORE_NAME);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n}\n\nfunction _subscribeOnTourChange(\n instantiator: ISessionInstantiator,\n callback: (languageId: number) => void,\n) {\n const subscribe = (session: ISession) => {\n session.state.subscribeChanges(\n IUserProperties.TourId,\n (key: string, tourId: number) => {\n callback(tourId);\n },\n STORE_NAME,\n );\n };\n\n const sessionChanged = (newValue: ISession | null) => {\n callback(newValue?.state.getProperty(IUserProperties.TourId) ?? -1);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n };\n\n instantiator.subscribeActiveChanged(sessionChanged, STORE_NAME);\n\n const activeSession = instantiator.active();\n\n if (activeSession) {\n subscribe(activeSession);\n }\n}\n\nfunction _subscribeOnSessionChange(\n instantiator: ISessionInstantiator,\n callback: (session: ISession | null) => void,\n) {\n instantiator.subscribeActiveChanged(callback, STORE_NAME);\n}\n\nfunction _session(instantiator: ISessionInstantiator, name: string): Promise {\n const session = instantiator.open(name);\n return session;\n}\n\nfunction _active(instantiator: ISessionInstantiator): ISession | undefined {\n const session = instantiator.active();\n return session ?? undefined;\n}\n\nfunction ModuleSession(instantiator: ISessionInstantiator): IModuleSession {\n return {\n subscribeOnLanguageChange: callback => {\n _subscribeOnLanguageChange(instantiator, callback);\n },\n subscribeOnTourChange: callback => {\n _subscribeOnTourChange(instantiator, callback);\n },\n subscribeOnSessionChange: callback => {\n _subscribeOnSessionChange(instantiator, callback);\n },\n session: callback => _session(instantiator, callback),\n active: () => _active(instantiator),\n };\n}\n\nexport default ModuleSession;\n","import type { IProgressBarProps } from '@monofe/ui-common';\nimport { ProgressBar } from '@monofe/ui-common';\nimport type { CSSProperties } from 'react';\n\nconst STYLING_DEFAULT: CSSProperties = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n height: '0.5vh',\n zIndex: 4,\n pointerEvents: 'none',\n transitionDuration: '500ms',\n opacity: 0,\n};\n\nconst PROPS_DEFAULT: IProgressBarProps = {\n progress: 0.0,\n borderRadius: 0,\n textColor: 'transparent',\n};\n\nfunction DownloadProgressBar(props: { progress: number; visible?: boolean }): JSX.Element | null {\n /* If the progress prop given use, otherwise set to visible if progress is >0 & <1 aka in progress */\n const opacity = props.visible || (props.progress > 0.0 && props.progress < 1.0) ? 1.0 : 0.0;\n\n return props.visible ? (\n \n ) : null;\n}\n\nexport default DownloadProgressBar;\n","import { injectAPISession, IUserProperties } from '@monofe/apiservice';\nimport { TYPES as API_TYPES } from '@monofe/apiservice/session/interface/bind';\nimport { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { ILog, LANGUAGE_CODE } from '@monofe/util';\nimport { injectLog, injectTranslationStorage, TYPES as UTIL_TYPES } from '@monofe/util';\nimport type { IServiceWorkerController } from '@monofe/worker';\nimport {\n injectServiceWorkerController,\n IServiceWorkerStatus,\n TYPES as WORKER_TYPES,\n} from '@monofe/worker';\nimport byteSizeToDescription from '../common/byteSizeToDescription';\nimport { injectDialog } from '../dialog';\nimport { TYPES as DIALOG_TYPES } from '../dialog/interface';\nimport { injectToast, TYPES as TOAST_TYPES } from '../toast/interface';\nimport type { IDataResolver, IDownloadTour } from './interface';\nimport {\n bindDownloadTour,\n TYPES as DOWNLOADTOUR_TYPES,\n IDownloadState,\n IMediaType,\n injectDownloadTour,\n unbindDownloadTour,\n} from './interface';\nimport type { IModuleState } from './state';\nimport state from './state';\nimport type { IModuleDialog } from './util/dialog';\nimport dialog from './util/dialog';\nimport onAccept from './util/onAccept';\nimport onDecline from './util/onDecline';\nimport type { IModuleSession } from './util/session';\nimport session from './util/session';\nimport type { IModuleToast } from './util/toast';\nimport toast from './util/toast';\nimport type { IModuleTranslate } from './util/translate';\nimport translate, { TranslationKey } from './util/translate';\nimport ProgressBar from './views/ProgressBar';\n\nconst DEFAULT_LANGUAGE_ID = 1; /* Default to English=1 */\nconst DEFAULT_LANGUAGE_CODE = 'EN'; /* As above */\n\nasync function _updateDownloadSizeText(translater: IModuleTranslate, resolver: IDataResolver) {\n const sites = await resolver.all('ISiteDto');\n\n const downloadList = await resolver.downloadList();\n\n const allUrls = await Promise.all(\n downloadList.map(medium => resolver.urlsForMedium(medium, [IMediaType.Download])),\n );\n\n /* Remove any duplicates */\n const downloadUrls = [...new Set(allUrls.flat())];\n\n const requiredSizes = await Promise.all(\n downloadUrls.map(url => resolver.urlContentLength(url)),\n );\n const requiredSize = requiredSizes.reduce((previous, current) => previous + current, 0);\n\n const sizeDesc = byteSizeToDescription(requiredSize);\n\n translater.updateDefaultParams(TranslationKey.DOWNLOAD_FAILED_NOT_ENOUGH_SPACE, [\n sites.at(0)?.name ?? 'Unknown',\n sizeDesc,\n ]);\n\n translater.updateDefaultParams(TranslationKey.DOWNLOAD_POPUP_DESCRIPTION, [\n sites.at(0)?.name ?? 'Unknown',\n sizeDesc,\n ]);\n}\n\nexport interface IModuleDependencies {\n session: Readonly;\n dialog: Readonly;\n store: Readonly;\n toast: Readonly;\n translate: Readonly;\n log: Readonly;\n workerController: Readonly;\n resolver: Readonly;\n}\n\nfunction _buildLocalDependencies(\n container: IContainer,\n dependencies: Partial & Pick,\n): Promise {\n const translationStorage = injectTranslationStorage(container);\n const workerController = injectServiceWorkerController(container);\n const log = injectLog(container);\n const sessionFetcher = injectAPISession(container);\n const dialogModule = injectDialog(container);\n const toastModule = injectToast(container);\n\n const sessionModule = dependencies.session ?? session(sessionFetcher);\n const translater = dependencies.translate ?? translate(translationStorage);\n const toaster = dependencies.toast ?? toast(translater, toastModule);\n const store = dependencies.store ?? state(container);\n const resolver = dependencies.resolver;\n\n const dialogue = dialog(\n {\n id: 'Download-Tour',\n onAccept: () =>\n onAccept({\n session: sessionModule,\n toast: toaster,\n dialog: dialogue,\n serviceWorker: workerController,\n store,\n resolver,\n log,\n }),\n onDecline: () => {\n onDecline({ store, dialog: dialogue });\n },\n },\n dialogModule,\n );\n\n return Promise.resolve({\n session: sessionModule,\n dialog: dialogue,\n store,\n toast: toaster,\n translate: translater,\n log,\n workerController,\n resolver,\n });\n}\n\nfunction _buildModule(deps: IModuleDependencies): IDownloadTour {\n const Renderer = (): JSX.Element | null => {\n const { progressVisible, progressBar } = deps.store.useState();\n return ;\n };\n\n return {\n renderer: Renderer,\n show: () => {\n deps.dialog.show();\n },\n hide: () => {\n deps.dialog.hide();\n deps.store.action.hideProgressBar();\n deps.toast.hideAll();\n },\n isShowing: () =>\n deps.dialog.isShowing() ||\n deps.toast.isAnyShowing() ||\n deps.store.getState().progressVisible,\n isShowable: () => {\n const { userSession, languageId, tourId } = deps.store.getState();\n const worker = deps.workerController.active();\n return (\n userSession.length > 0 &&\n languageId > 0 &&\n tourId > 0 &&\n (worker?.status === IServiceWorkerStatus.Ready ||\n worker?.status === IServiceWorkerStatus.Running)\n );\n },\n state: () => {\n let newState = IDownloadState.Undef;\n\n if (deps.store.getState().languageId <= 0 || deps.store.getState().tourId <= 0) {\n newState = IDownloadState.AwaitingLanguageTour;\n } else if (deps.dialog.isShowing()) {\n newState = IDownloadState.PopUpAsk;\n } else if (deps.store.getState().progressVisible) {\n newState = IDownloadState.Downloading;\n } else {\n newState = IDownloadState.Idle;\n }\n\n return newState;\n },\n dataResolver: () => deps.resolver,\n };\n}\n\nfunction _initializeState(deps: IModuleDependencies) {\n const activeSession = deps.session.active();\n\n if (activeSession) {\n const languageId =\n activeSession.state.getProperty(IUserProperties.LanguageId) ??\n DEFAULT_LANGUAGE_ID;\n const tourId = activeSession.state.getProperty(IUserProperties.TourId) ?? -1;\n deps.store.action.updateSession(activeSession.name);\n deps.store.action.updateLanguageId(languageId);\n deps.store.action.updateTourId(tourId);\n\n if (tourId > 0) {\n _updateDownloadSizeText(deps.translate, deps.resolver).catch((error: Error) => {\n deps.log.error(`Failed to update translation: ${error.message}`);\n });\n }\n }\n\n /* Force translation update */\n deps.translate.updateLanguage(deps.translate.language());\n}\n\nfunction _addEffects(deps: IModuleDependencies) {\n const updateTranslations = () => {\n deps.dialog.updateText({\n title: deps.translate.translate(TranslationKey.DOWNLOAD_POPUP_DESCRIPTION),\n textAccept: deps.translate.translate(TranslationKey.DOWNLOAD_POPUP_ACCEPT),\n textDecline: deps.translate.translate(TranslationKey.DOWNLOAD_POPUP_DECLINE),\n });\n };\n\n deps.translate.subscribeLanguageChanged(updateTranslations);\n\n deps.translate.subscribeTranslationChanged(\n TranslationKey.DOWNLOAD_POPUP_DESCRIPTION,\n (module: IModuleTranslate, language: LANGUAGE_CODE) => {\n updateTranslations();\n },\n );\n\n deps.session.subscribeOnSessionChange(sessionCallback => {\n deps.store.action.updateSession(sessionCallback?.name ?? '');\n });\n\n deps.session.subscribeOnLanguageChange(async languageId => {\n deps.store.action.updateLanguageId(languageId);\n const languageCode =\n languageId > 0\n ? (await deps.resolver.get('ILanguageDto', languageId)).name\n : DEFAULT_LANGUAGE_CODE;\n\n deps.translate.updateLanguage(languageCode.toLowerCase() as LANGUAGE_CODE);\n });\n\n deps.session.subscribeOnTourChange(async tourId => {\n deps.store.action.updateTourId(tourId);\n await _updateDownloadSizeText(deps.translate, deps.resolver);\n });\n}\n\nexport async function binder(\n container: IContainer,\n dependencies: Partial,\n): Promise> {\n const buildDefaultResolver = async () => {\n const module = await import('./defaultResolver');\n const sessionModule = session(injectAPISession(container));\n return module.default(sessionModule);\n };\n\n const deps = await _buildLocalDependencies(container, {\n ...dependencies,\n resolver: dependencies.resolver ?? (await buildDefaultResolver()),\n });\n\n const module = _buildModule(deps);\n\n _addEffects(deps);\n _initializeState(deps);\n\n return Object.freeze(module);\n}\n\nexport default (function () {\n let localDependencies: Partial = {};\n\n const result = buildBindable({\n id: DOWNLOADTOUR_TYPES.IDownloadTour,\n dependencies: [\n APPSTATE_TYPES.IStoresReducer,\n DIALOG_TYPES.IDialog,\n TOAST_TYPES.IToast,\n UTIL_TYPES.ITranslationStorage,\n WORKER_TYPES.IServiceWorkerController,\n UTIL_TYPES.ILog,\n API_TYPES.ISessionInstantiator,\n ],\n bind: bindDownloadTour,\n remove: unbindDownloadTour,\n inject: injectDownloadTour,\n build: container => binder(container, localDependencies),\n });\n\n return Object.freeze({\n ...result,\n setBuildDependencies: (deps: Readonly>) =>\n (localDependencies = deps),\n });\n})();\n","import type { IMediumDto } from '@monofe/apiservice';\nimport type { INSTANTIATOR_INTERFACES } from '@monofe/apiservice/model/interface/instantiator';\nimport type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport enum IDownloadState {\n Undef = 0,\n LoadingDependencies = 1,\n AwaitingLanguageTour = 2,\n Idle = 3,\n PopUpAsk = 4,\n Downloading = 5,\n LastValue = 6,\n}\n\nexport enum IMediaType {\n Stream = 1,\n Download = 2,\n}\n\nexport interface IDataResolver {\n get: <\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n PrimaryKey extends ReturnType,\n >(\n name: Interface,\n pk: PrimaryKey,\n ) => Promise;\n all: <\n Interface extends keyof INSTANTIATOR_INTERFACES,\n Entity extends ReturnType,\n >(\n name: Interface,\n ) => Promise;\n downloadList: () => Promise;\n urlsForMedium: (medium: IMediumDto, types?: IMediaType[]) => Promise;\n urlContentLength: (url: URL) => Promise;\n}\n\nexport interface IDownloadTour {\n renderer: () => JSX.Element | null;\n show: () => void;\n hide: () => void;\n isShowing: () => boolean;\n isShowable: () => boolean;\n state: () => IDownloadState;\n dataResolver: () => IDataResolver;\n}\n\nexport const TYPES = {\n IDownloadTour: Symbol.for('IDownloadTour'),\n};\n\nexport function injectDownloadTour(\n container: IContainer = injectOrBuildContainer(),\n): Readonly {\n return container.get(TYPES.IDownloadTour);\n}\n\nexport function bindDownloadTour(\n value: IDownloadTour,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IDownloadTour, value);\n}\n\nexport function unbindDownloadTour(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IDownloadTour);\n}\n","import type { CSSProperties } from 'react';\nimport styles from './ItemView.module.css';\nimport type { IFloorplanItemViewModel } from './interface';\n\nexport enum StyleElement {\n Container = 'Container',\n Image = 'Image',\n MarkerContainer = 'MarkerContainer',\n}\n\nconst DEFAULTS: Record = {\n [StyleElement.Container]: {},\n [StyleElement.Image]: {},\n [StyleElement.MarkerContainer]: {},\n};\n\nconst PROPS_APPLICATOR: Record<\n StyleElement,\n (properties: IFloorplanItemViewModel) => CSSProperties\n> = {\n [StyleElement.Container]: (properties: IFloorplanItemViewModel) => ({}),\n [StyleElement.Image]: (properties: IFloorplanItemViewModel) => ({}),\n [StyleElement.MarkerContainer]: (properties: IFloorplanItemViewModel) => ({}),\n};\n\nexport function classNameForElement(\n element: StyleElement,\n properties: IFloorplanItemViewModel,\n): string {\n const name = element.toString();\n return styles[name] ?? '';\n}\n\nexport function styleForElement(\n element: StyleElement,\n properties: IFloorplanItemViewModel,\n overrides?: CSSProperties,\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](properties), ...overrides };\n\n return style;\n}\n","import { HighlightableButton } from '@monofe/ui-common';\nimport { IconMapMarker } from '@monofe/ui-common/icon';\nimport type { CSSProperties } from 'react';\nimport { useCallback } from 'react';\nimport type { ITextProps } from './interface';\n\nconst STYLING: CSSProperties = {\n position: 'absolute',\n cursor: 'pointer',\n width: '12vmin',\n height: '12vmin',\n marginTop: '-6vmin',\n marginLeft: '-6vmin',\n};\n\nexport interface IMarkerItem {\n title: ITextProps;\n positionX: string;\n positionY: string;\n isVisible?: boolean;\n color?: string;\n style?: CSSProperties;\n onClick?: string | ((item: IMarkerItem) => void);\n}\n\nfunction useOnClick(props: IMarkerItem) {\n return useCallback(() => {\n if (typeof props.onClick === 'function') {\n props.onClick(props);\n }\n }, [props]);\n}\n\nfunction MarkerView(props: IMarkerItem): JSX.Element {\n const handleClick = useOnClick(props);\n const href = typeof props.onClick === 'string' ? props.onClick : undefined;\n\n return (\n \n \n \n );\n}\n\nexport default MarkerView;\n","import type { IZoomPanPinchRef } from '@monofe/ui-common';\nimport { Image as WSImage, ZoomPanPinch } from '@monofe/ui-common';\nimport type { IAssetSource } from '@monofe/util';\nimport type { CSSProperties, RefObject } from 'react';\nimport { memo, useEffect, useState } from 'react';\nimport { StyleElement, classNameForElement, styleForElement } from './ItemView.style';\nimport MarkerView from './MarkerView';\nimport type { IFloorplanItemViewModel, IFloorplanMarkerViewModel } from './interface';\n\ninterface ISize {\n width: number;\n height: number;\n}\n\nconst SIZE_ZERO: ISize = Object.freeze({ width: 0, height: 0 });\n\nfunction useImageSize(imageUrls: IAssetSource[]): ISize {\n const [imageSize, setImageSize] = useState(SIZE_ZERO);\n\n useEffect(() => {\n if (imageUrls.length <= 0) {\n setImageSize(SIZE_ZERO);\n return;\n }\n\n const promise: Promise = new Promise((resolve, reject) => {\n const picture = document.createElement('picture');\n const image = document.createElement('img');\n\n for (const url of imageUrls) {\n const source = document.createElement('source');\n\n source.srcset = url.src;\n source.type = url.type ?? '';\n\n picture.append(source);\n }\n\n image.addEventListener('load', () => {\n resolve({\n width: image.width,\n height: image.height,\n });\n });\n\n picture.append(image);\n\n image.addEventListener('error', () => {\n reject(`Failed to load image for floorplan`);\n });\n });\n\n promise\n .then(sizeNew => {\n setImageSize(sizeNew);\n })\n .catch((error: Error) => {\n throw new Error(\n `Failed to set ImageSize, urls:${JSON.stringify(\n imageUrls,\n )}, error:${JSON.stringify(error)}`,\n );\n });\n }, [imageUrls]);\n\n return imageSize;\n}\n\nfunction _markerStylePositionX(item: IFloorplanMarkerViewModel, size: ISize): string {\n const pos = Math.round((item.positionX / size.width) * 100);\n return `${pos.toString()}%`;\n}\n\nfunction _markerStylePositionY(item: IFloorplanMarkerViewModel, size: ISize): string {\n const pos = Math.round((item.positionY / size.height) * 100);\n return `${pos.toString()}%`;\n}\n\n/* Changes to useState values will trigger re-render */\nfunction useForceUpdate(): () => void {\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n const [value, setValue] = useState(0);\n return () => {\n setValue(value => value + 1);\n };\n}\n\nfunction ItemView(\n properties: IFloorplanItemViewModel & {\n imageRef: RefObject;\n className: string;\n style?: CSSProperties;\n },\n): JSX.Element {\n const style = (element: StyleElement, overrides?: CSSProperties) =>\n styleForElement(element, properties, overrides);\n const className = (element: StyleElement) => classNameForElement(element, properties);\n\n const imageSize = useImageSize(properties.imageUrls);\n const triggerRender = useForceUpdate();\n\n const hasLoadedImage = imageSize.width > 0 && imageSize.height > 0;\n const imageScale = properties.imageRef.current?.state.scale ?? 1;\n const markerStyle: CSSProperties = {\n transform: `scale(${1 / imageScale})`,\n opacity: 1,\n };\n\n const ZoomView = memo(ZoomPanPinch());\n\n return (\n \n \n \n \n {hasLoadedImage &&\n properties.markers.map((item, index) => (\n {\n typeof item.onClick === 'function' &&\n item.onClick(item);\n }\n }\n positionX={_markerStylePositionX(item, imageSize)}\n positionY={_markerStylePositionY(item, imageSize)}\n />\n ))}\n \n \n \n );\n}\n\nexport default memo(ItemView, (a, b) => Object.is(a, b));\n","import type { CSSProperties } from 'react';\nimport styles from './MainView.module.css';\nimport type { IFloorplanViewModel } from './interface';\n\nexport enum StyleElement {\n Container = 'Container',\n ItemContainer = 'ItemContainer',\n Item = 'Item',\n PageControl = 'PageControl',\n ButtonPlus = 'ButtonPlus',\n ButtonMinus = 'ButtonMinus',\n IconPlus = 'IconPlus',\n IconMinus = 'IconMinus',\n}\n\nconst DEFAULTS: Record = {\n [StyleElement.Container]: {},\n [StyleElement.ItemContainer]: {},\n [StyleElement.Item]: {},\n [StyleElement.PageControl]: {},\n [StyleElement.ButtonPlus]: {},\n [StyleElement.ButtonMinus]: {},\n [StyleElement.IconPlus]: {},\n [StyleElement.IconMinus]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElement.Container]: (properties: IFloorplanViewModel) => ({\n backgroundColor: properties.backgroundColor,\n }),\n [StyleElement.ItemContainer]: (properties: IFloorplanViewModel) => ({\n width: `${properties.items.length * 100}vw`,\n }),\n [StyleElement.Item]: (properties: IFloorplanViewModel) => ({}),\n [StyleElement.PageControl]: (properties: IFloorplanViewModel) => ({\n display: properties.items.length > 1 ? 'auto' : 'none',\n /* Grow the width (to a max 60vmin) to cater for more 'dots' */\n width: `${Math.min(properties.items.length * 5 + 24, 60)}vmin`,\n }),\n [StyleElement.ButtonPlus]: (properties: IFloorplanViewModel) => ({}),\n [StyleElement.ButtonMinus]: (properties: IFloorplanViewModel) => ({}),\n [StyleElement.IconMinus]: (properties: IFloorplanViewModel) => ({\n color: properties.zoomControlsBackgroundColor,\n borderColor: properties.zoomControlsTintColor,\n backgroundColor: properties.zoomControlsTintColor,\n }),\n [StyleElement.IconPlus]: (properties: IFloorplanViewModel) => ({\n color: properties.zoomControlsBackgroundColor,\n borderColor: properties.zoomControlsTintColor,\n backgroundColor: properties.zoomControlsTintColor,\n }),\n};\n\nexport function classNameForElement(\n element: StyleElement,\n properties: IFloorplanViewModel,\n): string {\n const name = element.toString();\n return styles[name] ?? '';\n}\n\nexport function styleForElement(\n element: StyleElement,\n properties: IFloorplanViewModel,\n overrides?: CSSProperties,\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](properties), ...overrides };\n\n return style;\n}\n","import { injectHistory } from '@monofe/app-common';\nimport type { IZoomPanPinchRef } from '@monofe/ui-common';\nimport { HighlightableButton, IconMinus, IconPlus, PageControl } from '@monofe/ui-common';\nimport { BackLink } from '@monofe/ui-common/nav';\nimport FadeTransition from '@monofe/ui-common/transition/FadeTransition';\nimport type { CSSProperties, RefObject } from 'react';\nimport { createRef, useEffect, useState } from 'react';\nimport ItemView from './ItemView';\nimport { StyleElement, classNameForElement, styleForElement } from './MainView.style';\nimport type {\n IFloorplanIndexProps as IFloorplanIndexProperties,\n IFloorplanItemViewModel,\n} from './interface';\n\nconst _referencesFromItems = (itemsIn: IFloorplanItemViewModel[]) =>\n itemsIn.map(() => createRef());\n\nfunction useItemReferences(items: IFloorplanItemViewModel[]): RefObject[] {\n const [references, setReferences] = useState[]>(\n _referencesFromItems(items),\n );\n\n useEffect(() => {\n setReferences(_referencesFromItems(items));\n }, [setReferences, items]);\n\n return references;\n}\n\nfunction MainView(properties: IFloorplanIndexProperties): JSX.Element {\n const history = injectHistory();\n\n const style = (element: StyleElement, overrides?: CSSProperties) =>\n styleForElement(element, properties.model, overrides);\n const className = (element: StyleElement) => classNameForElement(element, properties.model);\n\n const [pageIndex, setPageIndex] = useState(0);\n const itemReferences = useItemReferences(properties.model.items);\n\n const handleZoomIn = () => itemReferences[pageIndex]?.current?.zoomIn();\n\n const handleZoomOut = () => itemReferences[pageIndex]?.current?.zoomOut();\n\n const handlePreviousPage = () => {\n setPageIndex(index => Math.max(index - 1, 0));\n };\n\n const handleNextPage = () => {\n setPageIndex(index => Math.min(index + 1, properties.model.items.length - 1));\n };\n\n const ItemViews = properties.model.items.map((item, index) => {\n const itemReference = itemReferences[index];\n if (itemReference === undefined)\n throw new Error(`No ref object for item with index ${index}`);\n return (\n \n );\n });\n\n return (\n \n \n \n {ItemViews}\n \n {properties.model.items.length > 1 && (\n \n )}\n \n \n \n \n \n \n \n );\n}\n\nexport default MainView;\n","import MainView from './MainView';\n\nexport default MainView;\n","import SuspenseWrapper from '@monofe/ui-common/misc/SuspenseWrapper';\nimport { injectLog } from '@monofe/util';\nimport loader from '../common/loader';\nimport type { ILanguageSelectIndexProps } from './interface';\nimport { ILanguageSelectType } from './interface';\n\nconst MainViewList = loader(() => import('./list'));\n\nfunction IndexView(props: ILanguageSelectIndexProps): JSX.Element {\n const log = injectLog();\n\n switch (props.type) {\n case ILanguageSelectType.List:\n break;\n\n case ILanguageSelectType.GridFlag:\n log.error('Unsupported Language Selection Type grid flag, falling back to list type');\n break;\n\n case ILanguageSelectType.GridTile:\n log.error('Unsupported Language Selection Type grid tile, falling back to list type');\n break;\n\n default:\n return Unknown Language Selection Type {props.type};\n }\n\n // TODO: replace #type with props.type, when other types are supported\n const type = ILanguageSelectType.List;\n\n return (\n \n {type === ILanguageSelectType.List && }\n \n );\n}\n\nexport default IndexView;\n","import type { IAssetSource } from '@monofe/util';\nimport type { ICycler } from './cycler/cycler.if';\n\nexport interface ITextProps {\n text: string;\n fontFamily: string;\n fontSize: string;\n fontAlignment: 'left' | 'center' | 'right' | 'justify';\n fontWeight: number;\n color: string;\n visible: boolean;\n}\n\nexport interface IImageProps {\n urls: IAssetSource[];\n mode: 'contain' | 'cover';\n}\n\nexport enum ILanguageSelectType {\n Undef = 0,\n List = 1,\n GridFlag = 2,\n GridTile = 3,\n LastValue = 4,\n}\n\nexport interface ILanguageSelectItemViewModel {\n title: ITextProps;\n iconUrl: string;\n topSeparatorVisible: boolean;\n topSeparatorColor: string;\n bottomSeparatorVisible: boolean;\n bottomSeparatorColor: string;\n backgroundColor: string;\n cornerRadius: number;\n\n data?: unknown;\n onClick: string | ((item: ILanguageSelectItemViewModel) => void);\n}\n\nexport interface ILanguageSelectViewModel {\n title: ITextProps;\n backgroundColor: string;\n backgroundImage: IImageProps;\n\n items: ILanguageSelectItemViewModel[];\n}\n\nexport interface ILanguageSelectMainProps {\n model: ILanguageSelectViewModel;\n}\n\nexport interface ILanguageSelectItemProps {\n model: ILanguageSelectItemViewModel;\n}\n\nexport interface ILanguageSelectIndexProps {\n model: ILanguageSelectViewModel;\n type: ILanguageSelectType;\n}\n\nexport interface ILanguageSelectController {\n model: ILanguageSelectControllerModel;\n type: ILanguageSelectType;\n titleCyclerTimeout: ReturnType | null;\n isLoading: boolean;\n}\n\nexport interface ILanguageSelectControllerModel extends ILanguageSelectViewModel {\n cycler?: ICycler;\n activeTitle: () => string;\n nextTitle: () => string;\n delayBetweenChangingTitle: number;\n}\n","import type { IToastMessage } from '../../toast/interface';\n\nconst TOAST_KEY = 'ToastMessage-OfflineNotification';\nconst TOAST_TEXT = 'Currently offline, no internet connection';\nconst TOAST_TYPE = 'warn';\n\nexport const TOAST_MESSAGE: Required = {\n id: TOAST_KEY,\n text: TOAST_TEXT,\n type: TOAST_TYPE,\n};\n","import type { IToast } from '../../toast/interface';\nimport { injectToast } from '../../toast/interface';\nimport { TOAST_MESSAGE } from './constants';\n\n/* Cast as optional as we may be executing before toast has been injected */\nconst _toaster = () => injectToast() as IToast | undefined;\n\nconst show = () => !isShowing() && _toaster()?.show(TOAST_MESSAGE);\nconst hide = () => _toaster()?.hide(TOAST_MESSAGE);\nconst isShowing = () => _toaster()?.isShowing(TOAST_MESSAGE) ?? false;\n\nexport default Object.freeze({\n show,\n hide,\n isShowing,\n});\n","const EVENT_ONLINE = 'online' as const;\nconst EVENT_OFFLINE = 'offline' as const;\n\ntype Callback = (event: Event) => void;\n\nfunction _window(): Window | undefined {\n return globalThis.window ?? undefined;\n}\n\nfunction subscribeOnlineStatusChange(callback: Callback) {\n const globalWindow = _window();\n\n globalWindow?.addEventListener(EVENT_ONLINE, callback);\n globalWindow?.addEventListener(EVENT_OFFLINE, callback);\n}\n\nfunction unsubscribeOnlineStatusChange(callback: Callback) {\n const globalWindow = _window();\n\n globalWindow?.removeEventListener(EVENT_ONLINE, callback);\n globalWindow?.removeEventListener(EVENT_OFFLINE, callback);\n}\n\nexport default {\n subscribeOnlineStatusChange,\n unsubscribeOnlineStatusChange,\n};\n","import type { ITranslationStorage, LANGUAGE_CODE } from '@monofe/util';\n\nexport enum TranslationKey {\n OFFLINE_DESCRIPTION = 'Currently offline, no internet connection',\n}\n\nexport type TranslateSubscriberCallback = (\n module: IModuleTranslate,\n newLanguage: LANGUAGE_CODE,\n) => void;\n\nexport interface IModuleTranslate {\n translate: (key: TranslationKey, params?: string[]) => string;\n updateLanguage: (languageCode: LANGUAGE_CODE) => void;\n language: () => LANGUAGE_CODE;\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => void;\n updateDefaultParams: (key: TranslationKey, params: string[]) => void;\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => void;\n}\n\nconst DEFAULT_PARAMS: Record = {\n [TranslationKey.OFFLINE_DESCRIPTION]: [],\n};\n\nfunction ModuleTranslator(translator: ITranslationStorage): IModuleTranslate {\n let activeLanguage: LANGUAGE_CODE = 'en';\n const languageChangeCallbacks: TranslateSubscriberCallback[] = [];\n const translationChangeCallbacks: Partial<\n Record\n > = {};\n const defaultParams = { ...DEFAULT_PARAMS };\n\n const module: IModuleTranslate = {\n translate: (key: TranslationKey, params?: string[]) =>\n translator.translation(activeLanguage, key, params ?? defaultParams[key]),\n updateLanguage: (languageCode: LANGUAGE_CODE) => {\n activeLanguage = languageCode;\n languageChangeCallbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n language: () => activeLanguage,\n subscribeLanguageChanged: (cb: TranslateSubscriberCallback) =>\n languageChangeCallbacks.push(cb),\n unsubscribeLanguageChanged: (cb: TranslateSubscriberCallback) => {\n const idx = languageChangeCallbacks.indexOf(cb);\n if (idx >= 0) {\n languageChangeCallbacks.splice(idx, 1);\n }\n },\n updateDefaultParams: (key: TranslationKey, params: string[]) => {\n defaultParams[key] = params;\n\n const callbacks = translationChangeCallbacks[key] ?? [];\n\n callbacks.forEach(cb => {\n cb(module, activeLanguage);\n });\n },\n subscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n arr.push(cb);\n translationChangeCallbacks[key] = arr;\n },\n unsubscribeTranslationChanged: (key: TranslationKey, cb: TranslateSubscriberCallback) => {\n const arr = translationChangeCallbacks[key] ?? [];\n const idx = arr.indexOf(cb);\n if (idx >= 0) {\n arr.splice(idx, 1);\n }\n translationChangeCallbacks[key] = arr;\n },\n };\n\n return module;\n}\n\nexport default ModuleTranslator;\n","import type { IToast, IToastMessage } from '../../toast/interface';\nimport type { IModuleTranslate } from './translate';\nimport { TranslationKey } from './translate';\n\nexport enum Message {\n IsOffline = 1,\n}\n\nexport interface IModuleToast {\n isShowing: (message: Message) => boolean;\n isAnyShowing: () => boolean;\n show: (message: Message, parameters?: string[]) => void;\n hide: (message: Message) => void;\n hideAll: () => void;\n}\n\nconst MessageTranslationKey: Record = {\n [Message.IsOffline]: TranslationKey.OFFLINE_DESCRIPTION,\n};\n\nconst KEY_PREFIX = 'OfflineAlert-';\n\nexport const DEFAULT_MESSAGE: Record, 'text'>> = {\n [Message.IsOffline]: {\n id: `${KEY_PREFIX}-Warn-Offline`,\n type: 'warn',\n },\n};\n\nconst _isShowingToast = (toast: IToast, id: string) => toast.isShowing({ id });\nconst _showToast = (toast: IToast, message: Required) => {\n !_isShowingToast(toast, message.id) && toast.show(message);\n};\nconst _hideToast = (toast: IToast, id: string) => {\n toast.hide({ id });\n};\n\nfunction ModuleToast(translater: IModuleTranslate, toast: IToast): IModuleToast {\n if (!translater) {\n throw new Error(`Offline-Alert: Missing translater object`);\n }\n\n if (!toast) {\n throw new Error(`Offline-Alert: Missing toast object`);\n }\n\n return {\n isShowing: (message: Message) => _isShowingToast(toast, DEFAULT_MESSAGE[message].id),\n isAnyShowing: () => {\n const messageShow = Object.values(Message).map(message => {\n const messageDetails = DEFAULT_MESSAGE[message as Message];\n return _isShowingToast(toast, messageDetails.id ?? '');\n });\n const showCount = messageShow.reduce((count, value) => count + (value ? 1 : 0), 0);\n return showCount > 0;\n },\n show: (message, parameters) => {\n const text = translater.translate(MessageTranslationKey[message], parameters);\n\n _showToast(toast, {\n ...DEFAULT_MESSAGE[message],\n text,\n });\n },\n hide: (type: Message) => {\n _hideToast(toast, DEFAULT_MESSAGE[type].id);\n },\n hideAll: () => {\n for (const message of Object.values(DEFAULT_MESSAGE)) {\n _hideToast(toast, message.id);\n }\n },\n };\n}\n\nexport default ModuleToast;\n","import { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { ILog } from '@monofe/util';\nimport { injectLog, injectTranslationStorage, TYPES as UTIL_TYPES } from '@monofe/util';\nimport { injectToast, TYPES as TOAST_TYPES } from '../toast/interface';\nimport type { IOfflineAlert } from './interface';\nimport { bindOfflineAlert, injectOfflineAlert, TYPES, unbindOfflineAlert } from './interface';\nimport state from './state';\nimport events from './util/events';\nimport type { IModuleToast } from './util/toast';\nimport toast from './util/toast';\nimport type { IModuleTranslate } from './util/translate';\nimport translate from './util/translate';\n\nexport interface IModuleDependencies {\n toast: Readonly;\n translate: Readonly;\n log: Readonly;\n}\n\nfunction _buildLocalDependencies(\n container: IContainer,\n dependencies: Partial,\n): Promise {\n const translationStorage = injectTranslationStorage(container);\n const log = injectLog(container);\n const toastModule = injectToast(container);\n\n const translater = dependencies.translate ?? translate(translationStorage);\n const toaster = dependencies.toast ?? toast(translater, toastModule);\n\n return Promise.resolve({\n toast: toaster,\n translate: translater,\n log,\n });\n}\n\nfunction _buildModule(deps: IModuleDependencies): IOfflineAlert {\n const callback = () => {\n const isOnline = navigator.onLine;\n\n const shouldShow = !isOnline;\n\n if (state.isShowing() !== shouldShow) {\n shouldShow ? state.show() : state.hide();\n }\n };\n\n /* Remove duplicate callbacks & (re)subscribe */\n events.unsubscribeOnlineStatusChange(callback);\n events.subscribeOnlineStatusChange(callback);\n\n return {\n /* eslint-disable-next-line react/jsx-no-useless-fragment */\n renderer: () => <>,\n show: () => state.show(),\n hide: () => state.hide(),\n isShowing: () => state.isShowing(),\n };\n}\n\nexport async function binder(\n container: IContainer,\n dependencies: Partial,\n): Promise> {\n const deps = await _buildLocalDependencies(container, dependencies);\n\n const module = _buildModule(deps);\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: TYPES.IOfflineAlert,\n dependencies: [\n TOAST_TYPES.IToast,\n UTIL_TYPES.ITranslationStorage,\n UTIL_TYPES.ILog,\n APPSTATE_TYPES.IStoresReducer,\n ],\n bind: bindOfflineAlert,\n remove: unbindOfflineAlert,\n inject: injectOfflineAlert,\n build: container => binder(container, {}),\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport interface IOfflineAlert {\n renderer: () => JSX.Element | null;\n show: () => void;\n hide: () => void;\n isShowing: () => boolean;\n}\n\nexport const TYPES = {\n IOfflineAlert: Symbol.for('IOfflineAlert'),\n};\n\nexport function injectOfflineAlert(\n container: IContainer = injectOrBuildContainer(),\n): Readonly {\n return container.get(TYPES.IOfflineAlert);\n}\n\nexport function bindOfflineAlert(\n val: IOfflineAlert,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IOfflineAlert, val);\n}\n\nexport function unbindOfflineAlert(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IOfflineAlert);\n}\n","import SuspenseWrapper from '@monofe/ui-common/misc/SuspenseWrapper';\nimport { Fragment } from 'react';\nimport loader from '../common/loader';\nimport type {\n IAudioSiteObjectViewModel,\n IBrowseSiteObjectViewModel,\n IHTMLSiteObjectViewModel,\n IRubawaySiteObjectViewModel,\n ISiteObjectIndexProps as ISiteObjectIndexProperties,\n IVideoSiteObjectViewModel,\n} from './interface';\nimport { ISiteObjectType } from './interface';\n\nconst MainViewAudio = loader(() => import('./audio'));\nconst MainViewVideo = loader(() => import('./video'));\nconst MainViewHTML = loader(() => import('./html'));\nconst MainViewRubaway = loader(() => import('./rubaway'));\nconst MainViewBrowse = loader(() => import('./browse'));\n\nfunction AudioView(properties: ISiteObjectIndexProperties): JSX.Element {\n return (\n \n \n \n );\n}\n\nfunction VideoView(properties: ISiteObjectIndexProperties): JSX.Element {\n return (\n \n \n \n );\n}\n\nfunction HTMLView(properties: ISiteObjectIndexProperties): JSX.Element {\n return (\n \n \n \n );\n}\n\nfunction RubawayView(properties: ISiteObjectIndexProperties): JSX.Element {\n return (\n \n \n \n );\n}\n\nfunction BrowseView(properties: ISiteObjectIndexProperties): JSX.Element {\n return (\n \n \n \n );\n}\n\nfunction IndexView(properties: ISiteObjectIndexProperties): JSX.Element {\n return (\n \n {properties.type === ISiteObjectType.Audio && }\n {properties.type === ISiteObjectType.Video && }\n {properties.type === ISiteObjectType.Html && }\n {properties.type === ISiteObjectType.Rubaway && }\n {properties.type === ISiteObjectType.Image && }\n \n );\n}\n\nexport default IndexView;\n","import type { IAssetSource } from '@monofe/util';\n\nexport interface ITextProps {\n text: string;\n fontFamily: string;\n fontSize: string;\n fontAlignment: 'center' | 'left' | 'right' | 'end' | 'justify';\n fontWeight: number;\n color: string;\n visible: boolean;\n}\n\nexport interface IInfoLabel extends ITextProps {\n backgroundColor: string;\n visible: boolean;\n}\nexport interface IImageProps {\n urls: IAssetSource[];\n mode: 'contain' | 'cover';\n}\n\nexport enum ISiteObjectType {\n Undef = 0,\n Image = 1,\n Audio = 2,\n Video = 3,\n Html = 4,\n Rubaway = 5,\n LastValue = 6,\n}\n\nexport interface IBrowseSubItemViewModel {\n title: ITextProps;\n image: IImageProps;\n imageOutlineColor: string;\n\n shouldGrayAfterViewing: boolean;\n\n shouldLazyLoad: boolean;\n\n onClick: string | ((item: IBrowseSubItemViewModel) => void);\n}\n\nexport interface IBrowseSiteObjectViewModel extends ISiteObjectViewModel {\n title: ITextProps;\n backgroundImage: IImageProps;\n backgroundColor: string;\n subItems: IBrowseSubItemViewModel[];\n}\n\nexport interface IAudioSiteObjectViewModel extends ISiteObjectViewModel {\n foregroundImages: IImageProps[];\n foregroundImageBackgroundColor: string;\n audioDescription: ITextProps;\n audioDescriptionBackgroundColor: string;\n controlsColor: string;\n headphonesMissingViewEnabled: boolean;\n headphonesMissingVisible: boolean;\n speakerIconVisible: boolean;\n spinnerVisible: boolean;\n spinnerColor: string;\n audioUrls: IAssetSource[];\n autoPlay?: boolean;\n didSelectImageIndex?: (index: number) => void;\n}\n\nexport interface IVideoSiteObjectViewModel extends ISiteObjectViewModel {\n videoUrls: IAssetSource[];\n controlsColor: string;\n}\n\nexport interface IHTMLSiteObjectViewModel extends ISiteObjectViewModel {\n htmlUrl: IAssetSource;\n}\n\nexport interface IRubawaySiteObjectViewModel extends ISiteObjectViewModel {\n rubawayImageUrls: IAssetSource[];\n infoLabel?: ITextProps;\n infoBackgroundColor: string;\n}\n\nexport interface IRubawayViewModel extends ISiteObjectViewModel {\n foregroundImageUrl: string;\n toolTipTitle: ITextProps;\n toolTipBackgroundColor: string;\n}\n\nexport interface ISiteObjectViewModel {\n title: ITextProps;\n backgroundColor: string;\n backgroundImage: IImageProps;\n backButton: {\n backgroundColor: string;\n strokeColor: string;\n strokeSize: string;\n arrowColor: string;\n visible: boolean;\n };\n data?: unknown;\n onLoad?: (update: (model: ISiteObjectViewModel) => void) => void;\n onRemove?: (model: ISiteObjectViewModel) => ISiteObjectViewModel;\n onComplete?: (model: ISiteObjectViewModel) => void;\n}\n\nexport interface ISiteObjectMainProps {\n model: T;\n}\n\nexport interface ISiteObjectIndexProps {\n model: ISiteObjectViewModel;\n type: ISiteObjectType;\n}\n","import type { ToastStorage } from './interface';\n\nexport const STORE_NAME = 'ToastStore';\n\nexport const initialState: ToastStorage = [];\n","import type { PayloadAction } from '@reduxjs/toolkit';\nimport type { IToastMessagePrv, ToastStorage } from './interface';\n\nconst reset = (state: ToastStorage, action: PayloadAction) => [];\n\nconst updateMessage = (\n state: ToastStorage,\n action: PayloadAction & { id: string }>,\n) => {\n const matchingMessages = state.filter(message => message.id === action.payload.id);\n matchingMessages.forEach(message => {\n Object.assign(message, action.payload);\n });\n};\n\nconst displayMessage = (state: ToastStorage, action: PayloadAction) => [\n ...state,\n action.payload,\n];\n\nconst hideMessage = (\n state: ToastStorage,\n action: PayloadAction & { id: string }>,\n) => {\n const matchingIndexes = action.payload.id\n ? state\n .map((item, index) => (item.id === action.payload.id ? index : -1))\n .filter(index => index >= 0)\n : state\n .map((item, index) => (item.text === action.payload.text ? index : -1))\n .filter(index => index >= 0);\n\n const newItems = state.filter((_, idx) => !matchingIndexes.includes(idx));\n return newItems;\n};\n\nexport default Object.freeze({\n reset,\n updateMessage,\n displayMessage,\n hideMessage,\n});\n","import { createSlice } from '@reduxjs/toolkit';\nimport { initialState, STORE_NAME } from './constants';\nimport reducers from './reducers';\n\nexport const slice = createSlice({\n name: STORE_NAME,\n initialState,\n reducers,\n});\n\nexport default slice.actions;\n","import type { AnyAction } from '@reduxjs/toolkit';\nimport type { IModuleAction, IToastMessagePrv } from './interface';\nimport actions from './slice';\n\nfunction Action(dispatcher: (action: AnyAction) => void): Readonly {\n return {\n reset: () => {\n dispatcher(actions.reset());\n },\n updateMessage: (message: Partial & { id: string }) => {\n dispatcher(actions.updateMessage(message));\n },\n displayMessage: (message: IToastMessagePrv) => {\n dispatcher(actions.displayMessage(message));\n },\n hideMessage: (message: Partial & { id: string }) => {\n dispatcher(actions.hideMessage(message));\n },\n };\n}\n\nexport default Action;\n","import { injectStoresData, injectStoresReducer } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport type { AnyAction } from '@reduxjs/toolkit';\nimport { useSelector } from 'react-redux';\nimport { initialState, STORE_NAME } from './constants';\nimport type { IToastMessagePrv, ToastStorage } from './interface';\nimport { slice } from './slice';\n\nfunction isToastMessage(object: unknown): object is IToastMessagePrv {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record = object as Partial;\n\n return !isNullOrUndefined(record.id) && !isNullOrUndefined(record.text);\n}\n\nfunction isDataStore(object: unknown): object is ToastStorage {\n if (!Array.isArray(object)) {\n return false;\n }\n\n const items = object as unknown[];\n\n for (const message of items) {\n if (!isToastMessage(message)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction dataFromGlobalStore(globalStore: unknown): ToastStorage | undefined {\n if (globalStore === null || globalStore === undefined || typeof globalStore !== 'object') {\n return undefined;\n }\n\n const data = (globalStore as Record)[STORE_NAME];\n\n return isDataStore(data) ? data : undefined;\n}\n\nfunction getStore(container: IContainer): ToastStorage {\n const globalStore = injectStoresData().store.getState() as unknown;\n return dataFromGlobalStore(globalStore) ?? initialState;\n}\n\nfunction useStore(): ToastStorage {\n const data = useSelector(globalStore => dataFromGlobalStore(globalStore));\n return data ?? initialState;\n}\n\nfunction setup(container: IContainer) {\n const reducerRegister = injectStoresReducer(container);\n reducerRegister.addSlice(slice);\n}\n\nfunction dispatchAction(container: IContainer, action: AnyAction) {\n const store = injectStoresData(container);\n store.dispatch(action);\n}\n\nexport default function Store(container: IContainer) {\n return Object.freeze({\n dataFromGlobalStore,\n getStore: () => getStore(container),\n useStore,\n isDataStore,\n setup: () => {\n setup(container);\n },\n dispatchAction: (action: AnyAction) => {\n dispatchAction(container, action);\n },\n });\n}\n","import type { IContainer } from '@monofe/di';\nimport action from './actions';\nimport type { IModuleState } from './interface';\nimport store from './store';\n\nfunction ModuleState(container: IContainer): Readonly {\n const state = store(container);\n\n state.setup();\n\n return Object.freeze({\n getState: state.getStore,\n useState: state.useStore,\n action: action(state.dispatchAction),\n });\n}\n\nexport default ModuleState;\n","import styles from './AllMessages.module.css';\n\nexport enum StyleElement {\n Container = 'Container',\n}\n\nexport function classNameForElement(element: StyleElement): string {\n const name = element.toString();\n return styles[name] ?? '';\n}\n","export enum ToastBackgroundColor {\n Error = '#cc0000',\n Warning = '#f0ad4e',\n Success = '#339900',\n Information = '#000000',\n}\n\nexport enum ToastTextColor {\n Error = '#ffffff',\n Warning = '#ffffff',\n Success = '#ffffff',\n Information = '#ffffff',\n}\n","import { IToastIcon } from '@monofe/ui-common/alert/Toast';\n\nexport type ToastType = 'success' | 'error' | 'warn' | 'info';\n\nconst MAP_TOAST_TYPE_ICON: Record = {\n error: IToastIcon.Error,\n warn: IToastIcon.Warning,\n info: IToastIcon.Information,\n success: IToastIcon.Success,\n};\n\nexport const TypeToIcon = (type: ToastType | undefined): IToastIcon =>\n MAP_TOAST_TYPE_ICON[type ?? 'error'];\n","import type { CSSProperties } from 'react';\nimport type { IToastProperties } from './Toast';\nimport { IToastIcon } from './Toast';\nimport { ToastBackgroundColor, ToastTextColor } from './Toast.constants';\nimport styles from './Toast.module.css';\n\nexport enum StyleElement {\n Container = 'Container',\n Icon = 'Icon',\n Text = 'Text',\n}\n\nconst DEFAULTS: Record = {\n [StyleElement.Container]: {},\n [StyleElement.Icon]: {},\n [StyleElement.Text]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> = {\n [StyleElement.Container]: (properties: IToastProperties) => ({\n backgroundColor: MapBackgroundColor(properties.icon),\n }),\n [StyleElement.Icon]: (properties: IToastProperties) => ({\n color: MapTextColor(properties.icon),\n }),\n [StyleElement.Text]: (properties: IToastProperties) => ({\n color: MapTextColor(properties.icon),\n }),\n};\n\nfunction MapBackgroundColor(inIcon: IToastIcon): string {\n switch (inIcon) {\n case IToastIcon.Error:\n return ToastBackgroundColor.Error;\n\n case IToastIcon.Warning:\n return ToastBackgroundColor.Warning;\n\n case IToastIcon.Success:\n return ToastBackgroundColor.Success;\n\n case IToastIcon.Information:\n return ToastBackgroundColor.Information;\n\n default:\n throw new Error(`Unrecognised type: ${inIcon}`);\n }\n}\n\nfunction MapTextColor(inIcon: IToastIcon): string {\n switch (inIcon) {\n case IToastIcon.Error:\n return ToastTextColor.Error;\n\n case IToastIcon.Warning:\n return ToastTextColor.Warning;\n\n case IToastIcon.Success:\n return ToastTextColor.Success;\n\n case IToastIcon.Information:\n return ToastTextColor.Success;\n\n default:\n throw new Error(`Unrecognised type: ${inIcon}`);\n }\n}\n\nexport function classNameForElement(element: StyleElement, properties: IToastProperties): string {\n const name = element.toString();\n return styles[name] ?? '';\n}\n\nexport function styleForElement(\n element: StyleElement,\n properties: IToastProperties,\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](properties) };\n\n return style;\n}\n","import IconExclamation from '@monofe/ui-common/icon/IconExclamation';\nimport IconInfo from '@monofe/ui-common/icon/IconInfo';\nimport IconQuestionMark from '@monofe/ui-common/icon/IconQuestionMark';\nimport IconTick from '@monofe/ui-common/icon/IconTick';\nimport type { CSSProperties } from 'react';\nimport { classNameForElement, StyleElement, styleForElement } from './Toast.style';\n\nexport enum IToastIcon {\n Undef = 0,\n Information = 1,\n Success = 2,\n Warning = 3,\n Error = 4,\n LastValue = 5,\n}\n\nexport interface IToastProperties {\n text: string;\n icon: IToastIcon;\n style?: CSSProperties;\n}\n\nfunction Toast(properties: IToastProperties): JSX.Element {\n const style = (element: StyleElement) => styleForElement(element, properties);\n const className = (element: StyleElement) => classNameForElement(element, properties);\n\n return (\n \n {properties.icon === IToastIcon.Error && (\n \n )}\n {properties.icon === IToastIcon.Success && (\n \n )}\n {properties.icon === IToastIcon.Warning && (\n \n )}\n {properties.icon === IToastIcon.Information && (\n \n )}\n \n {properties.text}\n \n \n );\n}\n\nexport default Toast;\n","import type { Variants } from 'framer-motion';\nimport { AnimatePresence, m } from 'framer-motion';\nimport type { CSSProperties } from 'react';\nimport type { IToastMessagePrv } from '../state/interface';\nimport { TypeToIcon } from '../util/conversion';\nimport ToastView from './Toast';\n\nconst SIZE_CONTAINERHEIGHT_VH = 13;\nconst SIZE_SHADOWHEIGHT_VH = 6;\n\nenum ANIMATION_STATES {\n initial = 'initial',\n enter = 'enter',\n exit = 'exit',\n}\n\nconst VARIANTS: Variants = {\n [ANIMATION_STATES.initial]: {\n top: `-${\n SIZE_CONTAINERHEIGHT_VH + SIZE_SHADOWHEIGHT_VH\n }vh` /* Make sure the initial position also hides the shadow too */,\n },\n [ANIMATION_STATES.enter]: {\n top: '-1vh',\n },\n [ANIMATION_STATES.exit]: {\n top: `-${SIZE_CONTAINERHEIGHT_VH + SIZE_SHADOWHEIGHT_VH}vh`,\n },\n};\n\nconst STYLE_CONTAINER: CSSProperties = {\n zIndex: 10000,\n position: 'relative',\n top: `-${SIZE_CONTAINERHEIGHT_VH + SIZE_SHADOWHEIGHT_VH}vh`,\n width: '100vw',\n height: `${SIZE_CONTAINERHEIGHT_VH}vh`,\n};\n\nconst STYLE_VIEW: CSSProperties = {\n position: 'relative',\n width: '100%',\n height: '100%',\n};\n\nfunction ToastMessage(props: IToastMessagePrv): JSX.Element {\n return (\n \n \n \n \n \n );\n}\n\nexport default ToastMessage;\n","import type { IToastMessagePrv } from '../state/interface';\nimport { classNameForElement, StyleElement } from './AllMessages.style';\nimport Message from './Message';\n\nfunction AllMessages(props: { messages: IToastMessagePrv[] }): JSX.Element {\n const className = (elem: StyleElement) => classNameForElement(elem);\n\n if (props.messages.length <= 0) {\n /* eslint-disable-next-line react/jsx-no-useless-fragment */\n return <>;\n }\n\n return (\n

\n {props.messages.map(item => (\n \n ))}\n
\n );\n}\n\nexport default AllMessages;\n","import { TYPES as APPSTATE_TYPES } from '@monofe/appstate';\nimport type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { nanoid } from '@reduxjs/toolkit';\nimport type { IToast, IToastMessage } from './interface';\nimport { TYPES as TOAST_TYPES, bindToast, injectToast, unbindToast } from './interface';\nimport store from './state';\nimport type { IModuleState } from './state/interface';\nimport { DEFAULT_SHOW_DURATION, DEFAULT_TYPE } from './util/constants';\nimport isShowing from './util/isShowing';\nimport { AllMessagesView } from './views';\n\nexport interface IModuleDependencies {\n state: Readonly;\n}\n\nfunction _buildLocalDependencies(\n container: IContainer,\n dependencies: Partial,\n): Promise {\n return Promise.resolve({\n state: dependencies.state ?? store(container),\n });\n}\n\nfunction _buildModule(deps: IModuleDependencies): Promise {\n const Renderer = (): JSX.Element | null => {\n const messages = deps.state.useState();\n return ;\n };\n\n const module: IToast = {\n renderer: Renderer,\n show: (message: IToastMessage, duration?: number) => {\n const actionMessage = {\n text: message.text,\n id: message.id ?? nanoid(),\n type: message.type ?? DEFAULT_TYPE,\n };\n\n deps.state.action.displayMessage(actionMessage);\n\n setTimeout(() => {\n deps.state.action.hideMessage(actionMessage);\n }, duration ?? DEFAULT_SHOW_DURATION);\n },\n hide: (message: Partial) => {\n if (message.id) {\n /* Hide by id */\n deps.state.action.hideMessage({ id: message.id });\n } else if (message.text) {\n /* Hide by text content */\n for (const id of deps.state\n .getState()\n .filter(messageIn => messageIn.text === message.text)\n .map(messageIn => messageIn.id)) {\n deps.state.action.hideMessage({ id });\n }\n } else if (message.type) {\n /* Hide all matching display type */\n for (const id of deps.state\n .getState()\n .filter(messageIn => messageIn.type === message.type)\n .map(messageIn => messageIn.id)) {\n deps.state.action.hideMessage({ id });\n }\n }\n },\n update: (message: Partial & { id: string }) => {\n deps.state.action.updateMessage(message);\n },\n message: (id: string) => deps.state.getState().find(item => item.id === id),\n isShowing: message => isShowing(deps.state.getState(), message),\n allMessages: () => deps.state.getState(),\n };\n\n return Promise.resolve(module);\n}\n\nexport async function binder(\n container: IContainer,\n dependencies: Partial = {},\n): Promise> {\n const deps = await _buildLocalDependencies(container, dependencies);\n\n const module = await _buildModule(deps);\n\n return Object.freeze(module);\n}\n\nexport default buildBindable({\n id: TOAST_TYPES.IToast,\n dependencies: [APPSTATE_TYPES.IStoresReducer],\n bind: bindToast,\n remove: unbindToast,\n inject: injectToast,\n build: container => binder(container, {}),\n});\n","import type { IToastMessageType } from '../interface';\n\nexport const DEFAULT_SHOW_DURATION = 5000;\nexport const DEFAULT_TYPE: IToastMessageType = 'info';\n","import type { IToastMessage } from '../interface';\nimport type { ToastStorage } from '../state/interface';\n\nexport default function isShowing(store: ToastStorage, message: Partial) {\n const results = message.id\n ? store.filter(item => (message.id && item.id ? message.id === item.id : true))\n : store.filter(item => item.text === message.text);\n\n return results.length > 0;\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport type IToastMessageType = 'error' | 'info' | 'success' | 'warn';\n\nexport interface IToastMessage {\n id?: string;\n text: string;\n type?: IToastMessageType;\n}\n\nexport interface IToast {\n renderer: () => JSX.Element | null;\n show: (message: IToastMessage & Partial<{ id: string }>, duration?: number) => void;\n hide: (message: Partial) => void;\n update: (message: IToastMessage & { id: string }) => void;\n message: (id: string) => IToastMessage | undefined;\n isShowing: (message: Partial) => boolean;\n allMessages: () => (IToastMessage & { id: string; type: IToastMessageType })[];\n}\n\nexport const TYPES = {\n IToast: Symbol.for('IToast'),\n};\n\nexport function injectToast(container: IContainer = injectOrBuildContainer()): Readonly {\n return container.get(TYPES.IToast);\n}\n\nexport function bindToast(val: IToast, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IToast, val);\n}\n\nexport function unbindToast(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IToast);\n}\n","import SuspenseWrapper from '@monofe/ui-common/misc/SuspenseWrapper';\nimport { Fragment, memo } from 'react';\nimport loader from '../common/loader';\nimport type { ITourIndexProps as ITourIndexProperties } from './interface';\nimport { ITourType } from './interface';\n\nconst MainViewList = loader(() => import('./list'));\nconst MainViewHamburger = loader(() => import('./hamburger'));\nconst MainViewKeypad = loader(() => import('./keypad'));\n\nfunction IndexView(properties: ITourIndexProperties): JSX.Element {\n switch (properties.type) {\n case ITourType.List:\n case ITourType.Hamburger:\n case ITourType.Keypad:\n /* Nothing to do, supported */\n break;\n\n case ITourType.Cascaded:\n throw new Error('Unsupported Tour Type cascaded');\n\n default:\n throw new Error(`Unsupported.Unrecognised tour type: ${properties.type}`);\n }\n\n return (\n \n {properties.type === ITourType.List && (\n \n \n \n )}\n {properties.type === ITourType.Hamburger && (\n \n \n \n )}\n {properties.type === ITourType.Keypad && (\n \n \n \n )}\n \n );\n}\n\nexport default memo(IndexView);\n","import type { IAssetSource, ICache } from '@monofe/util';\n\nexport enum ITourType {\n Undef = 0,\n List = 1,\n Cascaded = 2,\n Keypad = 3,\n Hamburger = 4,\n LastValue = 5,\n}\n\nexport interface ITextProps {\n text: string;\n fontFamily: string;\n fontSize: string;\n lineHeight: string;\n fontAlignment: 'left' | 'center' | 'right' | 'justify';\n fontWeight: number;\n color: string;\n visible: boolean;\n}\n\nexport interface IImageProps {\n urls: IAssetSource[];\n mode: 'contain' | 'cover';\n}\n\nexport interface IBackButtonProps {\n backgroundColor: string;\n strokeColor: string;\n strokeSize: string;\n arrowColor: string;\n visible: boolean;\n}\n\nexport interface ITourSubItemViewModel {\n title: ITextProps;\n backgroundImage: IImageProps;\n backgroundColor: string;\n cornerRadius: number;\n\n shouldGrayAfterViewing: boolean;\n\n shouldLazyLoad: boolean;\n data?: unknown;\n\n onClick: string | ((item: ITourSubItemViewModel) => void);\n}\n\nexport interface ITourItemViewModel {\n title: ITextProps;\n titleBackgroundColor: string;\n\n subtitle?: ITextProps;\n subtitleBackgroundColor?: string;\n\n backgroundImage: IImageProps;\n backgroundColor: string;\n cornerRadius: number;\n\n number: ITextProps;\n numberBackgroundColor: string;\n\n shouldGrayAfterViewing: boolean;\n\n cache?: ICache;\n subItems: ITourSubItemViewModel[];\n\n link?: string;\n\n onShow?: (item: ITourItemViewModel) => void;\n onClick?: (item: ITourItemViewModel) => void;\n}\n\nexport interface ITourTopBarProps {\n title: ITextProps;\n backgroundColor: string;\n iconColor: string;\n}\n\nexport interface ITourSideMenuViewProps {\n backgroundColor: string;\n foregroundImage: IImageProps;\n items: ITourSideMenuItemViewProps[];\n}\n\nexport interface ITourSideMenuItemViewProps {\n title: ITextProps;\n backgroundColor: string;\n\n onClick: string | ((item: ITourSideMenuItemViewProps) => void);\n}\n\nexport interface ITourCollectionViewProps {\n backgroundColor: string;\n backgroundImage: IImageProps;\n\n items: ITourItemViewModel[];\n}\n\nexport interface ITourMainProps {\n backgroundColor: string;\n backgroundImage: IImageProps;\n\n backButton: IBackButtonProps;\n\n collection: ITourCollectionViewProps;\n\n sideMenu: ITourSideMenuViewProps;\n topBar: ITourTopBarProps;\n showFloorPlanIcon: boolean;\n hasContentDownloaded: boolean;\n\n onDownloadStatusRequest?: (shouldDownload: boolean) => void;\n onBack?: () => void;\n\n onFloorPlanSelect?: () => void;\n floorplanHref?: string;\n onScroll?: (position: { scrollTop: number; scrollLeft: number }) => void;\n}\n\nexport interface ITourItemProps {\n model: ITourItemViewModel;\n isExpanded: boolean;\n\n onClick?: (model: ITourItemProps) => void;\n}\n\nexport interface ITourSubItemProps {\n model: ITourSubItemViewModel;\n isSelected: boolean;\n\n onHighlight?: () => void;\n onUnhighlight?: () => void;\n onClick?: () => void;\n}\n\nexport interface ITourIndexProps {\n model: ITourMainProps;\n type: ITourType;\n}\n\nexport type ITourStateActionModifier = (model: ITourMainProps) => ITourMainProps;\n","import type { IAssetSource } from '@monofe/util';\n\nexport interface ITextProps {\n text: string;\n fontFamily: string;\n fontSize: string;\n fontAlignment: 'left' | 'center' | 'right' | 'justify';\n fontWeight: number;\n color: string;\n visible: boolean;\n opacity: number;\n}\n\nexport interface IImageProps {\n urls: IAssetSource[];\n mode: 'contain' | 'cover';\n}\n\nexport enum ITourSelectType {\n Undef = 0,\n List = 1,\n GridTile = 2,\n GridFeatured = 3,\n LastValue = 4,\n}\n\nexport interface ITourSelectItemViewModel {\n title: ITextProps;\n detail: ITextProps;\n\n topSeparatorVisible: boolean;\n topSeparatorColor: string;\n bottomSeparatorVisible: boolean;\n bottomSeparatorColor: string;\n\n backgroundImage: IImageProps;\n backgroundColor: string;\n cornerRadius: number;\n\n data?: unknown;\n onClick: string | ((item: ITourSelectItemViewModel) => void);\n}\n\nexport interface IBackButtonProps {\n backgroundColor: string;\n strokeColor: string;\n strokeSize: string;\n arrowColor: string;\n visible: boolean;\n}\n\nexport interface ITourSelectViewModel {\n title: ITextProps;\n\n backgroundColor: string;\n backgroundImage: IImageProps;\n\n backButton: IBackButtonProps;\n\n items: ITourSelectItemViewModel[];\n\n data?: unknown;\n\n onBack?: () => void;\n didScroll?: (position: { top: number; left: number }) => void;\n}\n\nexport interface ITourSelectMainProps {\n model: ITourSelectViewModel;\n}\n\nexport interface ITourSelectItemProps {\n model: ITourSelectItemViewModel;\n}\n\nexport interface ITourSelectIndexProps {\n model: ITourSelectViewModel;\n type: ITourSelectType;\n}\n\nexport type ITourSelectControllerModel = ITourSelectViewModel;\n","import SuspenseWrapper from '@monofe/ui-common/misc/SuspenseWrapper';\nimport { injectLog } from '@monofe/util';\nimport type { ComponentType, LazyExoticComponent } from 'react';\nimport loader from '../common/loader';\nimport type { ITourSelectIndexProps, ITourSelectMainProps } from './interface';\nimport { ITourSelectType } from './interface';\n\nconst MainViewList = loader(() => import('./list'));\nconst MainViewGrid = loader(() => import('./grid'));\n\nfunction IndexView(props: ITourSelectIndexProps): JSX.Element {\n const log = injectLog();\n\n let Renderer:\n | ComponentType\n | LazyExoticComponent<(props: ITourSelectMainProps) => JSX.Element>\n | null = null;\n\n switch (props.type) {\n case ITourSelectType.List:\n Renderer = MainViewList;\n break;\n\n case ITourSelectType.GridTile:\n Renderer = MainViewGrid;\n break;\n\n case ITourSelectType.GridFeatured:\n log.error('Unsupported Tour Selection Type grid-featured, falling back to grid type');\n Renderer = MainViewGrid;\n break;\n\n default:\n throw Error(`Unsupported tour type: ${props.type}`);\n }\n\n return {};\n}\n\nexport default IndexView;\n","export enum LOG_LEVEL {\n MILESTONE = 1,\n TRACE = 2,\n VERBOSE = 3,\n INFO = 4,\n WARN = 5,\n ERROR = 6,\n FATAL = 7,\n ASSERT = 8,\n}\n\nexport interface ILogger {\n assert: (condition: boolean | string | number, message: string) => void;\n log: (logLevel: LOG_LEVEL, message: string) => void;\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\nimport type { LANGUAGE_CODE } from './translationStorage';\n\nexport enum IBrowserPlatform {\n Unknown = 0,\n MobileiOS = 1,\n MobileAndroid = 2,\n}\n\nexport interface IBrowser {\n platform: IBrowserPlatform;\n isMobile: boolean;\n isInstalled: boolean;\n language: LANGUAGE_CODE;\n}\n\nexport function injectBrowser(container: IContainer = injectOrBuildContainer()): IBrowser {\n return container.get(TYPES.IBrowser);\n}\n\nexport function bindBrowser(val: IBrowser, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IBrowser, val);\n}\n\nexport function unbindBrowser(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IBrowser);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport interface ICache {\n add: (key: string | symbol, value: unknown) => void;\n get: (key: string | symbol) => unknown;\n}\n\nexport interface ICacheController {\n getAssociatedCache: (associatedObject: unknown) => ICache | null;\n getGlobalCache: () => ICache;\n}\n\nexport function injectCache(container: IContainer = injectOrBuildContainer()): ICache {\n return container.get(TYPES.ICache);\n}\n\nexport function bindCache(val: ICache, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.ICache, val);\n}\n\nexport function unbindCache(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ICache);\n}\n\nexport function injectCacheController(\n container: IContainer = injectOrBuildContainer(),\n): ICacheController {\n return container.get(TYPES.ICacheController);\n}\n\nexport function bindCacheController(\n val: ICacheController,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ICacheController, val);\n}\n\nexport function unbindCacheController(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ICacheController);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport enum IConfigLogLevel {\n Undef = 0,\n Milestone = 1,\n Trace = 2,\n Verbose = 3,\n Info = 4,\n Warn = 5,\n Error = 6,\n Fatal = 7,\n LastValue = 8,\n}\n\nexport enum IConfigLogDestination {\n Undef = 0,\n Console = 1,\n /* Deprecated: Remote_ApplicationInsights = 2, */\n LocalStorage = 3,\n Remote_Sentry = 4,\n LastValue = 5,\n}\n\n/* Remove #Undef & #LastValue from IConfigLogDestination */\nexport type IConfigLogDestination_ValidValuesOnly = Exclude<\n IConfigLogDestination,\n IConfigLogDestination.LastValue | IConfigLogDestination.Undef\n>;\n\nexport interface IConfigLogSettings {\n authorizationKey?: string;\n name?: string;\n}\n\nexport interface IConfigLog {\n loggingLevelsEnabled: IConfigLogLevel[];\n outputDestinations: IConfigLogDestination[];\n outputConfiguration: Partial>;\n}\n\nexport interface IConfigAPI {\n url: string;\n auth: {\n clientId: string;\n clientSecret: string;\n grantType: string;\n username: string;\n password: string;\n };\n extension: {\n auth: string;\n siteData: string;\n mediaDiff: string;\n media: string;\n mediaWithAccessToken: string;\n };\n}\n\nexport interface IConfigManifest extends Record {\n short_name: string;\n name: string;\n description: string;\n icons: { src: string; sizes: string; type: string }[];\n start_url: string;\n display: string;\n theme_color: string;\n background_color: string;\n orientation: string;\n categories: string[];\n}\n\nexport interface IConfigCacheAssets {\n cacheName: string;\n expiration: number;\n maxEntries: number;\n matcher: RegExp;\n ignoreSearch?: boolean;\n cacheQueryOptions?: Partial;\n fetchOptions?: Partial;\n}\n\nexport interface IConfigCacheOAuthToken {\n tokenPath: string;\n}\n\nexport function isConfigCacheAssets(object: unknown): object is IConfigCacheAssets {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.cacheName) &&\n !isNullOrUndefined(record.expiration) &&\n !isNullOrUndefined(record.maxEntries) &&\n !isNullOrUndefined(record.matcher)\n );\n}\n\nexport function isConfigCacheOAuthToken(object: unknown): object is IConfigCacheOAuthToken {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return !isNullOrUndefined(record.tokenPath);\n}\n\nexport type IConfigCache = (IConfigCacheAssets | IConfigCacheOAuthToken)[];\n\nexport function injectConfigLog(container: IContainer = injectOrBuildContainer()): IConfigLog {\n return container.get(TYPES.IConfigLog);\n}\n\nexport function bindConfigLog(val: IConfigLog, container: IContainer = injectOrBuildContainer()) {\n container.bind(TYPES.IConfigLog, val);\n}\n\nexport function unbindConfigLog(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IConfigLog);\n}\n\nexport function injectConfigAPI(container: IContainer = injectOrBuildContainer()): IConfigAPI {\n return container.get(TYPES.IConfigAPI);\n}\n\nexport function bindConfigAPI(\n val: IConfigAPI,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IConfigAPI, val);\n}\n\nexport function unbindConfigAPI(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IConfigAPI);\n}\n\nexport function injectConfigManifest(\n container: IContainer = injectOrBuildContainer(),\n): IConfigManifest {\n return container.get(TYPES.IConfigManifest);\n}\n\nexport function bindConfigManifest(\n val: IConfigManifest,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IConfigManifest, val);\n}\n\nexport function unbindConfigManifest(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IConfigManifest);\n}\n\nexport function injectConfigCache(container: IContainer = injectOrBuildContainer()): IConfigCache {\n return container.get(TYPES.IConfigCache);\n}\n\nexport function bindConfigCache(\n val: IConfigCache,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IConfigCache, val);\n}\n\nexport function unbindConfigCache(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IConfigCache);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport interface IEnv {\n getValue: (envName: string) => T | null;\n getValueWithDefault: (envName: string, defaultValue: T) => T;\n getNumber: (name: string, defaultValue?: number) => number;\n getBoolean: (name: string, defaultValue?: boolean) => boolean;\n getString: (name: string, defaultValue?: string) => string;\n allValues: () => Record;\n}\n\nexport function injectENV(container: IContainer = injectOrBuildContainer()): IEnv {\n return container.get(TYPES.IEnv);\n}\n\nexport function bindENV(val: IEnv, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IEnv, val);\n}\n\nexport function unbindENV(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IEnv);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\nimport type { MimeType } from './mimeType';\n\nexport enum IFeatureStatus {\n FeatureStatusUndef = 0,\n FeatureStatusUnsupported = 1,\n FeatureStatusUnknown = 2,\n FeatureStatusSupported = 3,\n FeatureStatusLastValue = 4,\n}\n\nexport enum IFeatureType {\n FeatureTypeUndef = 0,\n FeatureTypeSymbol = 1,\n FeatureTypeModule = 2,\n FeatureTypeIndexedDB = 3,\n FeatureTypeLastValue = 4,\n}\n\nexport interface IFeatureQuery {\n mediaSupported: (mimeTypes: MimeType[]) => Promise;\n featuresSupported: (features: IFeatureType[]) => Promise;\n}\n\nexport function injectFeatureQuery(\n container: IContainer = injectOrBuildContainer(),\n): IFeatureQuery {\n return container.get(TYPES.IFeatureQuery);\n}\n\nexport function bindFeatureQuery(\n val: IFeatureQuery,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IFeatureQuery, val);\n}\n\nexport function unbindFeatureQuery(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IFeatureQuery);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\nimport type { IProgressPromise } from './promise';\n\nexport interface IFetchHeader {\n name: string;\n value: string;\n}\n\nexport type Method = 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT';\nexport type ResponseTypes = 'arraybuffer' | 'blob' | 'json' | 'opaque' | 'text' | 'void';\n\nexport type FETCH_TYPES = ArrayBuffer | Buffer | Blob | Record;\n\nexport interface IFetchRequest {\n url: string;\n method?: Method;\n headers?: IFetchHeader[];\n body?: string;\n expectedResponseType?: ResponseTypes;\n expectedResponseSize?: number;\n}\n\nexport interface IFetchResponse {\n request: IFetchRequest;\n statusCode: number;\n isStatusOk: boolean;\n error?: Error;\n payload: T | null;\n}\n\n/**\n * IFetcher external resource resolver\n *\n * @param {string} requestPayload - Request payload contains url, method?, headers?, body? etc\n * @param {string} [timeout] - Time to wait before giving up (Milliseconds)\n * @param {string} [retryCount] - A optional string param\n * @return {IProgressPromise>} Promise with resource response\n */\nexport type IFetcher = (\n requestPayload: IFetchRequest,\n timeout?: number,\n retryCount?: number,\n) => IProgressPromise>;\n\nexport function injectFetch(container: IContainer = injectOrBuildContainer()): IFetcher {\n return container.get(TYPES.IFetch);\n}\n\nexport function bindFetch(val: IFetcher, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IFetch, val);\n}\n\nexport function unbindFetch(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IFetch);\n}\n","import type { IEnv } from './env';\nimport { injectENV } from './env';\n\nconst KEY_ALL_MODELOVERRIDES = 'REACT_APP_MODELOVERRIDES';\n\ntype ModelOverrides = Record T) | undefined>;\n\nexport function getProjectOverrides(name: string, obj: T, env: IEnv = injectENV()): T {\n const allOverrides = env.getValueWithDefault>(KEY_ALL_MODELOVERRIDES, {});\n const overrideMapper = allOverrides[name];\n const result = overrideMapper ? overrideMapper(obj) : obj;\n return result;\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport type IKVKeyType = number | string;\n\nexport interface IKVStorage {\n getItem: (key: IKVKeyType) => Promise;\n getBoolean: (key: IKVKeyType) => Promise;\n getString: (key: IKVKeyType) => Promise;\n setItem: (key: IKVKeyType, value: unknown) => Promise;\n removeItem: (key: number | string) => Promise;\n clear: () => Promise;\n length: () => Promise;\n}\n\nexport function injectKVStorage(container: IContainer = injectOrBuildContainer()): IKVStorage {\n return container.get(TYPES.IKVStorage);\n}\n\nexport function bindKVStorage(\n val: IKVStorage,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IKVStorage, val);\n}\n\nexport function unbindKVStorage(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IKVStorage);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport interface ILog {\n milestone: (msg: string) => void;\n verbose: (msg: string) => void;\n trace: (msg: string) => void;\n info: (msg: string) => void;\n warn: (msg: string) => void;\n warning: (msg: string) => void;\n error: (msg: string) => void;\n fatal: (msg: string) => void;\n assert: (condition: boolean | number | string, msg: string | undefined) => void;\n\n addMiddleware: (modifier: (message: string) => string) => void;\n removeMiddleware: (modifier: (message: string) => string) => void;\n}\n\nexport function injectLog(container: IContainer = injectOrBuildContainer()): ILog {\n return container.get(TYPES.ILog);\n}\n\nexport function bindLog(val: ILog, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.ILog, val);\n}\n\nexport function unbindLog(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ILog);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport type MimeType =\n | 'Application/xml'\n | 'application/PowerShell'\n | 'application/atom+xml'\n | 'application/directx'\n | 'application/envoy'\n | 'application/etl'\n | 'application/fractals'\n | 'application/fsharp-script'\n | 'application/futuresplash'\n | 'application/hta'\n | 'application/internet-property-stream'\n | 'application/java-archive'\n | 'application/json'\n | 'application/liquidmotion'\n | 'application/mac-binhex40'\n | 'application/ms-vsi'\n | 'application/msaccess'\n | 'application/msaccess.addin'\n | 'application/msaccess.cab'\n | 'application/msaccess.ftemplate'\n | 'application/msaccess.runtime'\n | 'application/msaccess.webapplication'\n | 'application/msword'\n | 'application/octet-stream'\n | 'application/oda'\n | 'application/oleobject'\n | 'application/olescript'\n | 'application/onenote'\n | 'application/opensearchdescription+xml'\n | 'application/pdf'\n | 'application/pics-rules'\n | 'application/pkcs10'\n | 'application/pkcs7-mime'\n | 'application/pkcs7-signature'\n | 'application/pkix-crl'\n | 'application/postscript'\n | 'application/rat-file'\n | 'application/rtf'\n | 'application/sdp'\n | 'application/set-payment-initiation'\n | 'application/set-registration-initiation'\n | 'application/streamingmedia'\n | 'application/vnd.adobe.air-application-installer-package+zip'\n | 'application/vnd.fdf'\n | 'application/vnd.ms-excel'\n | 'application/vnd.ms-excel.addin.macroEnabled.12'\n | 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'\n | 'application/vnd.ms-excel.sheet.macroEnabled.12'\n | 'application/vnd.ms-excel.template.macroEnabled.12'\n | 'application/vnd.ms-mediapackage'\n | 'application/vnd.ms-office.calx'\n | 'application/vnd.ms-officetheme'\n | 'application/vnd.ms-pki.certstore'\n | 'application/vnd.ms-pki.pko'\n | 'application/vnd.ms-pki.seccat'\n | 'application/vnd.ms-pki.stl'\n | 'application/vnd.ms-powerpoint'\n | 'application/vnd.ms-powerpoint.addin.macroEnabled.12'\n | 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'\n | 'application/vnd.ms-powerpoint.slide.macroEnabled.12'\n | 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12'\n | 'application/vnd.ms-powerpoint.template.macroEnabled.12'\n | 'application/vnd.ms-project'\n | 'application/vnd.ms-visio.viewer'\n | 'application/vnd.ms-word.document.macroEnabled.12'\n | 'application/vnd.ms-word.template.macroEnabled.12'\n | 'application/vnd.ms-works'\n | 'application/vnd.ms-wpl'\n | 'application/vnd.ms-xpsdocument'\n | 'application/vnd.oasis.opendocument.presentation'\n | 'application/vnd.oasis.opendocument.text'\n | 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n | 'application/vnd.openxmlformats-officedocument.presentationml.slide'\n | 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'\n | 'application/vnd.openxmlformats-officedocument.presentationml.template'\n | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n | 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'\n | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n | 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'\n | 'application/vnd.rn-realmedia'\n | 'application/vnd.rn-rn_music_package'\n | 'application/vnd.visio'\n | 'application/vnd.wap.wmlc'\n | 'application/vnd.wap.wmlscriptc'\n | 'application/vsix'\n | 'application/windows-library+xml'\n | 'application/windows-search-connector+xml'\n | 'application/winhlp'\n | 'application/wlmoviemaker'\n | 'application/x-7z-compressed'\n | 'application/x-bcpio'\n | 'application/x-bridge-url'\n | 'application/x-cdf'\n | 'application/x-compress'\n | 'application/x-compressed'\n | 'application/x-cpio'\n | 'application/x-csh'\n | 'application/x-director'\n | 'application/x-dvi'\n | 'application/x-gtar'\n | 'application/x-hdf'\n | 'application/x-internet-signup'\n | 'application/x-iphone'\n | 'application/x-itunes-ipa'\n | 'application/x-itunes-ipg'\n | 'application/x-itunes-ipsw'\n | 'application/x-itunes-ite'\n | 'application/x-itunes-itlp'\n | 'application/x-itunes-itms'\n | 'application/x-itunes-itpc'\n | 'application/x-java-applet'\n | 'application/x-java-jnlp-file'\n | 'application/x-javascript'\n | 'application/x-latex'\n | 'application/x-miva-compiled'\n | 'application/x-mmxp'\n | 'application/x-mpeg'\n | 'application/x-mpegURL'\n | 'application/x-ms-application'\n | 'application/x-ms-license'\n | 'application/x-ms-manifest'\n | 'application/x-ms-reader'\n | 'application/x-ms-vsto'\n | 'application/x-ms-wmd'\n | 'application/x-ms-xbap'\n | 'application/x-msaccess'\n | 'application/x-mscardfile'\n | 'application/x-msclip'\n | 'application/x-msdownload'\n | 'application/x-msmediaview'\n | 'application/x-msmetafile'\n | 'application/x-mspublisher'\n | 'application/x-msterminal'\n | 'application/x-mswrite'\n | 'application/x-netcdf'\n | 'application/x-oleobject'\n | 'application/x-perfmon'\n | 'application/x-pkcs12'\n | 'application/x-pkcs7-certificates'\n | 'application/x-pkcs7-certreqresp'\n | 'application/x-podcast'\n | 'application/x-quicktimeplayer'\n | 'application/x-safari-safariextz'\n | 'application/x-safari-webarchive'\n | 'application/x-sgimb'\n | 'application/x-sh'\n | 'application/x-shar'\n | 'application/x-shockwave-flash'\n | 'application/x-silverlight-app'\n | 'application/x-smaf'\n | 'application/x-stuffit'\n | 'application/x-sv4cpio'\n | 'application/x-sv4crc'\n | 'application/x-tar'\n | 'application/x-tcl'\n | 'application/x-tex'\n | 'application/x-texinfo'\n | 'application/x-troff'\n | 'application/x-troff-man'\n | 'application/x-troff-me'\n | 'application/x-troff-ms'\n | 'application/x-ustar'\n | 'application/x-wais-source'\n | 'application/x-wlpg-detect'\n | 'application/x-wlpg3-detect'\n | 'application/x-x509-ca-cert'\n | 'application/x-zip-compressed'\n | 'application/xaml+xml'\n | 'application/xhtml+xml'\n | 'application/xml'\n | 'application/zip'\n | 'audio/aac'\n | 'audio/ac3'\n | 'audio/aiff'\n | 'audio/audible'\n | 'audio/basic'\n | 'audio/m4a'\n | 'audio/m4b'\n | 'audio/m4p'\n | 'audio/mid'\n | 'audio/scpls'\n | 'audio/ogg'\n | 'audio/opus'\n | 'audio/vnd.audible.aax'\n | 'audio/vnd.dlna.adts'\n | 'audio/wav'\n | 'audio/x-aiff'\n | 'audio/x-caf'\n | 'audio/x-gsm'\n | 'audio/x-m4r'\n | 'audio/x-mpegurl'\n | 'audio/x-ms-wax'\n | 'audio/x-pn-realaudio'\n | 'audio/x-pn-realaudio-plugin'\n | 'audio/x-sd2'\n | 'audio/x-smd'\n | 'drawing/x-dwf'\n | 'application/x-gzip'\n | 'image/avif'\n | 'image/bmp'\n | 'image/cis-cod'\n | 'image/gif'\n | 'image/ief'\n | 'image/jpeg'\n | 'image/jpg'\n | 'image/pict'\n | 'image/pjpeg'\n | 'image/png'\n | 'image/tiff'\n | 'image/vnd.ms-photo'\n | 'image/vnd.rn-realflash'\n | 'image/vnd.wap.wbmp'\n | 'image/webp'\n | 'image/x-cmu-raster'\n | 'image/x-cmx'\n | 'image/x-icon'\n | 'image/x-jg'\n | 'image/x-macpaint'\n | 'image/x-portable-anymap'\n | 'image/x-portable-bitmap'\n | 'image/x-portable-graymap'\n | 'image/x-portable-pixmap'\n | 'image/x-quicktime'\n | 'image/x-rgb'\n | 'image/x-xbitmap'\n | 'image/x-xpixmap'\n | 'image/x-xwindowdump'\n | 'message/rfc822'\n | 'application/x-msmoney'\n | 'audio/mpeg'\n | 'application/x-msschedule'\n | 'text/scriptlet'\n | 'text/css'\n | 'text/csv'\n | 'text/dlm'\n | 'text/h323'\n | 'text/html'\n | 'text/iuls'\n | 'text/jscript'\n | 'text/plain'\n | 'text/richtext'\n | 'text/sgml'\n | 'text/tab-separated-values'\n | 'text/vbscript'\n | 'text/vnd.wap.wmlscript'\n | 'text/webviewhtml'\n | 'text/x-component'\n | 'text/x-hdml'\n | 'text/x-html-insertion'\n | 'text/x-ms-contact'\n | 'text/x-ms-group'\n | 'text/x-ms-iqy'\n | 'text/x-ms-odc'\n | 'text/x-ms-rqy'\n | 'text/x-setext'\n | 'text/x-vcard'\n | 'text/xml'\n | 'video/AV1'\n | 'video/vnd.dlna.mpeg-tts'\n | 'video/3gpp'\n | 'video/3gpp2'\n | 'video/quicktime'\n | 'video/mp4'\n | 'video/mpeg'\n | 'video/x-dv'\n | 'video/x-flv'\n | 'video/x-ivf'\n | 'video/x-la-asf'\n | 'video/x-m4v'\n | 'video/x-matroska'\n | 'video/x-ms-asf'\n | 'video/x-ms-wm'\n | 'video/x-ms-wmv'\n | 'video/x-ms-wvx'\n | 'video/x-msvideo'\n | 'video/x-sgi-movie'\n | 'video/webm'\n | 'audio/x-ms-wma'\n | 'text/vnd.wap.wml'\n | 'video/x-ms-wmp'\n | 'video/x-ms-wmx'\n | 'vnd.apple.mpegURL'\n | 'application/x-ms-wmz'\n | 'x-world/x-vrml';\n\nexport interface IMimeType {\n mimeTypeToFileExtension: (mimeType: MimeType) => string | null;\n fileExtensionToMimeType: (fileExtension: string) => MimeType | null;\n isMimeType: (object: unknown) => object is MimeType;\n}\n\nexport function injectMimeType(container: IContainer = injectOrBuildContainer()): IMimeType {\n return container.get(TYPES.IMimeType);\n}\n\nexport function bindMimeType(\n value: IMimeType,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IMimeType, value);\n}\n\nexport function unbindMimeType(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IMimeType);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport type ProgressNotifier = (progress: number) => void;\n\nexport interface IProgressPromise extends Promise {\n readonly progress: number;\n onProgress: (callback: ProgressNotifier) => void;\n}\n\nexport type PromiseExecutor = (\n resolve: (value?: PromiseLike | ValueType) => void,\n reject: (reason?: unknown) => void,\n progress: ProgressNotifier,\n) => PromiseLike | ValueType | undefined;\n\nexport type PromiseAsyncExecutor = (\n progress: ProgressNotifier,\n) => PromiseLike | ValueType | undefined;\n\nexport interface IProgressPromiseGenerator {\n async: (executor: PromiseAsyncExecutor) => IProgressPromise;\n promise: (executor: PromiseExecutor) => IProgressPromise;\n retry: (\n factory: () => IProgressPromise,\n delayBetweenRetries?: number,\n retryCount?: number,\n ) => IProgressPromise;\n}\n\nexport function injectProgressPromise(\n container: IContainer = injectOrBuildContainer(),\n): IProgressPromiseGenerator {\n return container.get(TYPES.IProgressPromiseGenerator);\n}\n\nexport function bindProgressPromise(\n val: IProgressPromiseGenerator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IProgressPromiseGenerator, val);\n}\n\nexport function unbindProgressPromise(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IProgressPromiseGenerator);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport interface IQueryURL {\n parse: (queryString: string) => Record;\n assemble: (\n queryArgs: Record,\n questionMarkPrefix?: boolean,\n ) => string;\n}\n\nexport function injectQueryURL(container: IContainer = injectOrBuildContainer()): IQueryURL {\n return container.get(TYPES.IQueryURL);\n}\n\nexport function bindQueryURL(\n val: IQueryURL,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IQueryURL, val);\n}\n\nexport function unbindQueryURL(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IQueryURL);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport type LANGUAGE_CODE =\n | 'ar'\n | 'bp'\n | 'cs'\n | 'de'\n | 'en'\n | 'es'\n | 'fr'\n | 'ga'\n | 'gd'\n | 'it'\n | 'ja'\n | 'ko'\n | 'nl'\n | 'pl'\n | 'pt'\n | 'ru'\n | 'zh';\n\nexport interface ITranslationStorage {\n translation: (\n language: LANGUAGE_CODE,\n key: string,\n parameters?: string[],\n fallback?: string,\n ) => string;\n}\n\nexport function injectTranslationStorage(\n container: IContainer = injectOrBuildContainer(),\n): ITranslationStorage {\n return container.get(TYPES.ITranslationStorage);\n}\n\nexport function bindTranslationStorage(\n val: ITranslationStorage,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ITranslationStorage, val);\n}\n\nexport function unbindTranslationStorage(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ITranslationStorage);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from '../util/types';\n\nexport type ZipBinaryStorageType = ArrayBuffer | Blob;\n\nexport interface IZipEntryInfo {\n name: string;\n size: number;\n comment: string;\n lastModifiedDate: Date;\n isDirectory: boolean;\n encrypted: boolean;\n externalFileAttributes: number;\n versionMadeBy: number;\n}\n\nexport interface IZip {\n unzipFile: (blobData: T, fileName: string) => Promise;\n unzipAll: (blobData: T) => Promise>;\n listings: (blobData: ZipBinaryStorageType) => Promise;\n fileInfo: (\n blobData: T,\n fileName: string,\n ) => Promise;\n}\n\nexport function injectZip(container: IContainer = injectOrBuildContainer()): IZip {\n return container.get(TYPES.IZip);\n}\n\nexport function bindZip(val: IZip, container: IContainer = injectOrBuildContainer()): void {\n container.bind(TYPES.IZip, val);\n}\n\nexport function unbindZip(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IZip);\n}\n","import type { LANGUAGE_CODE } from '../interface';\nimport type { IBrowser } from '../interface/browser';\nimport { IBrowserPlatform } from '../interface/browser';\n\nconst USER_AGENTS_IOS = new Set([\n 'iPad Simulator',\n 'iPhone Simulator',\n 'iPod Simulator',\n 'iPad',\n 'iPhone',\n 'iPod',\n]);\n\nconst DEFAULT_LANGUAGE: LANGUAGE_CODE = 'en';\nconst ISO_639_1_STRING_LENGTH = 2;\n\nfunction _navigator(): (Navigator & { userLanguage?: string | undefined }) | undefined {\n return globalThis.navigator;\n}\n\nfunction _document(): Document | undefined {\n return globalThis.document;\n}\n\nfunction _window(): Window | undefined {\n return globalThis.window;\n}\n\nfunction _platform(): IBrowserPlatform {\n const nav = _navigator();\n\n if (!nav) {\n return IBrowserPlatform.Unknown;\n }\n\n const userAgent = nav.userAgent || '';\n\n const isAndroid = /Android/giu.exec(userAgent);\n\n if (isAndroid) {\n return IBrowserPlatform.MobileAndroid;\n }\n\n const document = _document();\n\n const isMac = userAgent.includes('Mac') && document && 'ontouchend' in document;\n\n if (isMac ?? false) {\n return IBrowserPlatform.MobileiOS;\n }\n\n const platform = nav.platform || '';\n const isIOS = USER_AGENTS_IOS.has(platform);\n\n if (isIOS) {\n return IBrowserPlatform.MobileiOS;\n }\n\n return IBrowserPlatform.Unknown;\n}\n\nfunction _isMobile(): boolean {\n const nav = _navigator();\n\n if (!nav) {\n return false;\n }\n\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/giu.test(nav.userAgent);\n}\n\nfunction _isInstalled(): boolean {\n const nav = _navigator() as Record | undefined;\n\n const isStandalone = Boolean(nav?.['standalone']).valueOf();\n\n if (!isStandalone) {\n return true;\n }\n\n const document = _document();\n\n if (document?.referrer.includes('android-app://') ?? false) {\n return true;\n }\n\n const win = _window();\n\n if (win?.matchMedia && win.matchMedia('(display-mode: standalone)').matches) {\n return true;\n }\n\n return false;\n}\n\n/* Primitive implementation, return the original value if '-' not found, otherwise take the 1st arg post split e.g. en-US -> en */\nfunction _BCP47ToISO6391(bcp47: string): string {\n if (bcp47.length <= ISO_639_1_STRING_LENGTH) {\n return bcp47;\n }\n\n if (!bcp47.includes('-')) {\n return bcp47;\n }\n\n return bcp47.split('-').at(0) ?? bcp47;\n}\n\nfunction _language(): LANGUAGE_CODE {\n const nav = _navigator();\n\n if (!nav) {\n return DEFAULT_LANGUAGE;\n }\n\n const languageBCP47 = String(nav.languages[0] ?? nav.userLanguage ?? navigator.language);\n\n const languageISO6391 = _BCP47ToISO6391(languageBCP47);\n\n return languageISO6391 as LANGUAGE_CODE;\n}\n\nfunction browser(): IBrowser {\n const returnValue: IBrowser = {\n platform: _platform(),\n isMobile: _isMobile(),\n isInstalled: _isInstalled(),\n language: _language(),\n };\n return returnValue;\n}\n\nexport default browser;\n","import { buildBindable } from '@monofe/di';\nimport type { IBrowser } from '../interface';\nimport { bindBrowser, injectBrowser, unbindBrowser } from '../interface';\nimport TYPES from '../util/types';\nimport browser from './browser';\n\nexport default buildBindable({\n id: TYPES.IBrowser,\n bind: bindBrowser,\n remove: unbindBrowser,\n inject: injectBrowser,\n build: () => Promise.resolve(browser()),\n});\n","import type { ICache } from '../interface/cache';\n\nfunction Cache(): ICache {\n const store: Record = {};\n\n return {\n add: (key: string | number | symbol, value: unknown): void => {\n store[key] = value;\n },\n get: (key: string | number | symbol) => store[key],\n };\n}\n\nexport default Cache;\n","import { buildBindable } from '@monofe/di';\nimport type { ICache } from '../interface/cache';\nimport { bindCache, injectCache, unbindCache } from '../interface/cache';\nimport TYPES from '../util/types';\nimport cache from './cache';\n\nexport default buildBindable({\n id: TYPES.ICache,\n bind: bindCache,\n remove: unbindCache,\n inject: injectCache,\n build: () => Promise.resolve(cache()),\n});\n","import type { ICache, ICacheController } from '../interface/cache';\nimport Cache from './cache';\n\nconst kCacheKey = '__cache';\n\nfunction _isCache(object: unknown): object is ICache {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return !isNullOrUndefined(record.add) && !isNullOrUndefined(record.get);\n}\n\nfunction _get(associatedObject: unknown): ICache | null {\n if (\n !associatedObject ||\n typeof associatedObject !== 'object' ||\n !Object.isExtensible(associatedObject)\n ) {\n return null;\n }\n\n const searchObject = associatedObject as Record;\n\n const keySearch: symbol = Symbol.for(kCacheKey);\n const cacheExisting = searchObject[keySearch];\n const value = cacheExisting || Cache();\n\n if (!_isCache(value)) {\n return null;\n }\n\n searchObject[keySearch] = value;\n\n return value;\n}\n\nfunction CacheController(): ICacheController {\n const globalCacheObj = Cache();\n\n const controller: ICacheController = {\n getAssociatedCache: _get,\n getGlobalCache: () => globalCacheObj,\n };\n\n return controller;\n}\n\nexport default CacheController;\n","import { buildBindable } from '@monofe/di';\nimport type { ICacheController } from '../interface/cache';\nimport {\n bindCacheController,\n injectCacheController,\n unbindCacheController,\n} from '../interface/cache';\nimport TYPES from '../util/types';\nimport cacheController from './cachecontroller';\n\nexport default buildBindable({\n id: TYPES.ICacheController,\n bind: bindCacheController,\n remove: unbindCacheController,\n inject: injectCacheController,\n build: () => Promise.resolve(cacheController()),\n});\n","import type { IEnv as IEnvironment } from '../interface/env';\n\ntype IEnvironmentStorage = Record | undefined;\n\nconst BOOLEAN_PHRASES_ENABLED = Object.freeze(new Set(['true', 'yes', 'on', 'enable', 'enabled']));\nconst BOOLEAN_PHRASES_DISABLED = Object.freeze(\n new Set(['false', 'no', 'off', 'disable', 'disabled', 'null', 'undefined']),\n);\n\nconst VALUE_PARSERS = {\n string: (value: unknown) => String(value),\n number: (value: unknown) => Number(value),\n bigint: (value: unknown) => (typeof value === 'bigint' ? value : BigInt(Number(value))),\n boolean: (value: unknown) => {\n let returnValue = false;\n\n if (typeof value === 'boolean') {\n returnValue = value;\n } else if (typeof value === 'string') {\n /* Support string typed boolean values: on,off,etc.. */\n const stringValue = value.toLowerCase();\n if (BOOLEAN_PHRASES_ENABLED.has(stringValue)) {\n returnValue = true;\n } else if (BOOLEAN_PHRASES_DISABLED.has(stringValue)) {\n returnValue = false;\n } else if (!Number.isNaN(Number.parseInt(value, 10))) {\n returnValue = Boolean(Number.parseInt(value, 10));\n } else {\n returnValue = Boolean(value);\n }\n } else {\n returnValue = Boolean(value);\n }\n\n return returnValue;\n },\n symbol: (value: unknown) => Symbol.for(String(value)),\n /* eslint-disable-next-line unicorn/no-useless-undefined */\n undefined: (value: unknown) => undefined,\n object: (value: unknown) => (typeof value === 'object' ? value : {}),\n /* eslint-disable-next-line unicorn/no-useless-undefined */\n function: (value: unknown) => undefined,\n} as const;\n\nfunction _queryStorage(\n environmentStorage: IEnvironmentStorage,\n environmentName: string,\n): T | null {\n const records = environmentStorage ?? {};\n const value = records[environmentName] ?? null;\n return value as T | null;\n}\n\nfunction _getValue(\n environmentStorage: IEnvironmentStorage[],\n environmentName: string,\n): T | null {\n for (const storage of environmentStorage) {\n const value = _queryStorage(storage, environmentName);\n\n if (value !== null) {\n return value;\n }\n }\n\n return null;\n}\n\nfunction _getValueWithDefault(\n environmentStorage: IEnvironmentStorage[],\n environmentName: string,\n defaultValue: T,\n): T {\n const value = _getValue(environmentStorage, environmentName) ?? defaultValue;\n const parserType = typeof defaultValue;\n const parser = VALUE_PARSERS[parserType];\n /* We use typeof defaultValue, which is T & that matches the return value */\n return parser(value) as unknown as T;\n}\n\nfunction _getNumber(\n environmentStorage: IEnvironmentStorage[],\n name: string,\n defaultValue = -1,\n): number {\n const value = _getValue(environmentStorage, name) ?? defaultValue;\n return VALUE_PARSERS.number(value);\n}\n\nfunction _getBoolean(\n environmentStorage: IEnvironmentStorage[],\n name: string,\n defaultValue = false,\n): boolean {\n const readValue = _getValue(environmentStorage, name) ?? defaultValue;\n return VALUE_PARSERS.boolean(readValue);\n}\n\nfunction _getString(\n environmentStorage: IEnvironmentStorage[],\n name: string,\n defaultValue = '',\n): string {\n const value = _getValue(environmentStorage, name) ?? defaultValue;\n return VALUE_PARSERS.string(value);\n}\n\nfunction _isRecord(object: unknown): object is Record {\n if (object === undefined || object === null || typeof object !== 'object') {\n return false;\n }\n\n return true;\n}\n\nfunction environment(): IEnvironment {\n const isRunningOnNodeJS = typeof window === 'undefined';\n\n /* eslint-disable-next-line no-restricted-globals */\n const globalObject: Record = isRunningOnNodeJS ? globalThis : window;\n\n const candidates = [\n globalObject['env'],\n globalObject['ENV'],\n /* Expose the process variables on the window */\n process.env,\n ];\n\n const environmentStorage: IEnvironmentStorage[] = candidates.map(item =>\n _isRecord(item) ? item : {},\n );\n const mergedValues = environmentStorage.reduce(\n (previous, current) => ({ ...previous, ...current }),\n {},\n );\n\n const module: IEnvironment = {\n getValue: (environmentName: string) => _getValue(environmentStorage, environmentName),\n getValueWithDefault: (environmentName: string, defaultValue: T) =>\n _getValueWithDefault(environmentStorage, environmentName, defaultValue),\n getNumber: (name: string, defaultValue?: number) =>\n _getNumber(environmentStorage, name, defaultValue ?? -1),\n getBoolean: (name: string, defaultValue?: boolean) =>\n _getBoolean(environmentStorage, name, defaultValue ?? false),\n getString: (name: string, defaultValue?: string) =>\n _getString(environmentStorage, name, defaultValue ?? ''),\n allValues: () => mergedValues ?? {},\n };\n\n return module;\n}\n\nexport default environment;\n","import { buildBindable } from '@monofe/di';\nimport type { IEnv } from '../interface/env';\nimport { bindENV, injectENV, unbindENV } from '../interface/env';\nimport TYPES from '../util/types';\nimport env from './env';\n\nexport default buildBindable({\n id: TYPES.IEnv,\n bind: bindENV,\n remove: unbindENV,\n inject: injectENV,\n build: () => Promise.resolve(env()),\n});\n","import { IFeatureStatus, IFeatureType } from '../interface/featureQuery';\nimport type { MimeType } from '../interface/mimeType';\n\nconst PROMISE_SUPPORTED = Promise.resolve(IFeatureStatus.FeatureStatusSupported);\nconst PROMISE_UNSUPPORTED = Promise.resolve(IFeatureStatus.FeatureStatusUnsupported);\n\nconst MAP_FEATURE: Record Promise> = {\n [IFeatureType.FeatureTypeUndef]: () => PROMISE_UNSUPPORTED,\n [IFeatureType.FeatureTypeSymbol]: () => {\n const globalObject = globalThis as Record;\n return globalObject['Symbol'] !== undefined ? PROMISE_SUPPORTED : PROMISE_UNSUPPORTED;\n },\n [IFeatureType.FeatureTypeIndexedDB]: () => {\n const globalObject = globalThis as Record;\n return ['indexedDB', 'mozIndexedDB', 'webkitIndexedDB', 'msIndexedDB'].some(\n featureString => featureString in globalObject,\n )\n ? PROMISE_SUPPORTED\n : PROMISE_UNSUPPORTED;\n },\n [IFeatureType.FeatureTypeModule]: () => {\n try {\n /* eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval, no-new */\n new Function('import(\"\")');\n return PROMISE_SUPPORTED;\n } catch {\n return PROMISE_UNSUPPORTED;\n }\n },\n [IFeatureType.FeatureTypeLastValue]: () => PROMISE_UNSUPPORTED,\n};\n\nconst _canPlayMediaType = (mediaType: 'audio' | 'video', mimeType: MimeType): IFeatureStatus => {\n const object = document.createElement(mediaType);\n const status =\n object.canPlayType(mimeType) === 'probably' || object.canPlayType(mimeType) === 'maybe'\n ? IFeatureStatus.FeatureStatusSupported\n : IFeatureStatus.FeatureStatusUnsupported;\n return status;\n};\n\nconst MAP_DUMMY_BASE64_DATA: Partial> = {\n 'image/webp': 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=',\n 'image/avif':\n 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUEAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABkAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgSAAAAAAABNjb2xybmNseAABAA0ABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACFtZGF0EgAKBzgABpAQ0GkyDBYAAABIAAAAeUusgg==',\n};\n\nconst _canDisplayImageType = (imageMimeType: MimeType): Promise =>\n new Promise((resolve, reject) => {\n const encodedData = MAP_DUMMY_BASE64_DATA[imageMimeType];\n\n if (encodedData === undefined) {\n resolve(IFeatureStatus.FeatureStatusUnsupported);\n return;\n }\n\n const image = new Image();\n image.src = encodedData;\n image.addEventListener('error', error => {\n reject(error);\n });\n image.addEventListener('load', () => {\n resolve(IFeatureStatus.FeatureStatusSupported);\n });\n });\n\nconst MAP_MIMETYPE_DEFAULTS: Partial Promise>> = {\n /* HLS m3u8 files */\n 'application/x-mpegURL': () => Promise.resolve(IFeatureStatus.FeatureStatusSupported),\n 'vnd.apple.mpegURL': () => Promise.resolve(IFeatureStatus.FeatureStatusSupported),\n};\n\n/* Reduce the status with the lowest value, where the lowest value is lowest support level & bounds check between Undef<->LastValue */\nconst _reduceFeatureStatuses = (statuses: IFeatureStatus[]) =>\n Math.max(\n Math.min(...statuses, IFeatureStatus.FeatureStatusLastValue - 1),\n IFeatureStatus.FeatureStatusUndef + 1,\n );\n\nconst _defaultQuery = () => Promise.resolve(IFeatureStatus.FeatureStatusUnknown);\n\nconst CACHED_RESULTS_MIMETYPE: Record = {};\nconst CACHED_RESULTS_FEATURE: Partial> = {};\n\nasync function canSupportMediaMimeTypes(mimeTypes: MimeType[]): Promise {\n const textResolver = (mimeType: MimeType): Promise | undefined => {\n if (!mimeType.startsWith('text/')) {\n return undefined;\n }\n\n return Promise.resolve(IFeatureStatus.FeatureStatusSupported);\n };\n\n const imageResolver = (mimeType: MimeType): Promise | undefined => {\n if (!mimeType.startsWith('image/')) {\n return undefined;\n }\n\n switch (mimeType.toLowerCase()) {\n case 'image/bmp':\n case 'image/gif':\n case 'image/jpg':\n case 'image/jpeg':\n case 'image/tiff':\n case 'image/png':\n case 'image/svg':\n case 'image/svg+xml':\n case 'image/x-icon':\n return Promise.resolve(IFeatureStatus.FeatureStatusSupported);\n\n default:\n return _canDisplayImageType(mimeType);\n }\n };\n\n const avResolver = (mimeType: MimeType): Promise | undefined => {\n if (mimeType.toLowerCase().startsWith('audio')) {\n return Promise.resolve(_canPlayMediaType('audio', mimeType));\n } else if (mimeType.toLowerCase().startsWith('video')) {\n return Promise.resolve(_canPlayMediaType('video', mimeType));\n } else {\n return undefined;\n }\n };\n\n const statuses = await Promise.all(\n mimeTypes.map(\n mimeType =>\n CACHED_RESULTS_MIMETYPE[mimeType] ??\n textResolver(mimeType) ??\n imageResolver(mimeType) ??\n avResolver(mimeType) ??\n MAP_MIMETYPE_DEFAULTS[mimeType]?.() ??\n _defaultQuery(),\n ),\n );\n\n const result = _reduceFeatureStatuses(statuses);\n\n for (const [index, mimeType] of mimeTypes.entries()) {\n const status = statuses[index];\n if (status === undefined) {\n throw new Error(\n `Error while caching supported mime types. Couldn't find status for mime type '${mimeType}'`,\n );\n } else {\n CACHED_RESULTS_MIMETYPE[mimeType] = status;\n }\n }\n\n return result;\n}\n\nasync function canSupportFeatures(features: IFeatureType[]): Promise {\n const statuses = await Promise.all(\n features.map(\n feature => CACHED_RESULTS_FEATURE[feature] ?? MAP_FEATURE[feature]() ?? _defaultQuery,\n ),\n );\n\n const result = _reduceFeatureStatuses(statuses);\n\n for (const [index, feature] of features.entries()) {\n CACHED_RESULTS_FEATURE[feature] = statuses[index];\n }\n\n return result;\n}\n\nexport default Object.freeze({\n mediaSupported: canSupportMediaMimeTypes,\n featuresSupported: canSupportFeatures,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IFeatureQuery } from '../interface/featureQuery';\nimport {\n bindFeatureQuery,\n injectFeatureQuery,\n unbindFeatureQuery,\n} from '../interface/featureQuery';\nimport TYPES from '../util/types';\nimport featureQuery from './featureQuery';\n\nexport default buildBindable({\n id: TYPES.IFeatureQuery,\n bind: bindFeatureQuery,\n remove: unbindFeatureQuery,\n inject: injectFeatureQuery,\n build: () => Promise.resolve(featureQuery),\n});\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport type { FETCH_TYPES, IFetcher, IFetchRequest, IFetchResponse } from '../interface/fetch';\nimport { bindFetch, injectFetch, unbindFetch } from '../interface/fetch';\nimport type { IProgressPromise } from '../interface/promise';\nimport { injectProgressPromise } from '../interface/promise';\nimport TYPES from '../util/types';\nconst loader = import('./fetch.decorator.retry');\n\nconst DEFAULT_TIMEOUT_MS = 30000; /* 30s */\n\nasync function _build(container: IContainer): Promise {\n const promiser = injectProgressPromise(container);\n\n const module = await loader;\n\n const resolver = (\n requestPayload: IFetchRequest,\n timeout = DEFAULT_TIMEOUT_MS,\n retryCount = 0,\n ): IProgressPromise> =>\n module.default(promiser, requestPayload, timeout, retryCount);\n\n return Object.freeze(resolver);\n}\n\nexport default buildBindable({\n id: TYPES.IFetch,\n dependencies: [TYPES.IProgressPromiseGenerator],\n bind: bindFetch,\n remove: unbindFetch,\n inject: injectFetch,\n build: container => _build(container),\n});\n","/**\n * This file defines an asynchronous version of the localStorage API, backed by\n * an IndexedDB database. It creates a global asyncStorage object that has\n * methods like the localStorage object.\n *\n * To store a value use setItem:\n *\n * asyncStorage.setItem('key', 'value');\n *\n * If you want confirmation that the value has been stored, pass a callback\n * function as the third argument:\n *\n * asyncStorage.setItem('key', 'newValue', function() {\n * console.log('new value stored');\n * });\n *\n * To read a value, call getItem(), but note that you must supply a callback\n * function that the value will be passed to asynchronously:\n *\n * asyncStorage.getItem('key', function(value) {\n * console.log('The value of key is:', value);\n * });\n *\n * Note that unlike localStorage, asyncStorage does not allow you to store and\n * retrieve values by setting and querying properties directly. You cannot just\n * write asyncStorage.key; you have to explicitly call setItem() or getItem().\n *\n * removeItem(), clear(), length(), and key() are like the same-named methods of\n * localStorage, but, like getItem() and setItem() they take a callback\n * argument.\n *\n * The asynchronous nature of getItem() makes it tricky to retrieve multiple\n * values. But unlike localStorage, asyncStorage does not require the values you\n * store to be strings. So if you need to save multiple values and want to\n * retrieve them together, in a single asynchronous operation, just group the\n * values into a single object. The properties of this object may not include\n * DOM elements, but they may include things like Blobs and typed arrays.\n *\n * Unit tests are in apps/gallery/test/unit/asyncStorage_test.js\n */\n\nimport type { IKVKeyType, IKVStorage } from '../interface/kvStorage';\nimport type { ILog } from '../interface/log';\n\n/* eslint-disable-next-line max-lines-per-function */\nfunction storage(\n databaseName = 'site-util-storage',\n storeName = 'keyvaluepairs',\n databaseVersion = 1,\n logger: ILog | null = null,\n): IKVStorage {\n let database: IDBDatabase | null = null;\n\n function withDatabase(callback: () => void) {\n if (database) {\n callback();\n } else {\n const openRequest: IDBOpenDBRequest = indexedDB.open(databaseName, databaseVersion);\n openRequest.addEventListener('error', () => {\n logger?.error(\n `asyncStorage: can't open database: ${openRequest.error?.name ?? ''}`,\n );\n });\n openRequest.onupgradeneeded = () => {\n /* First time setup: create an empty object store */\n openRequest.result.createObjectStore(storeName);\n };\n openRequest.onsuccess = () => {\n database = openRequest.result;\n callback();\n };\n }\n }\n\n function withStore(\n type: IDBTransactionMode,\n callback: (store: IDBObjectStore) => void,\n oncomplete: () => void,\n ) {\n withDatabase(() => {\n if (!database) {\n return;\n }\n const transaction = database.transaction(storeName, type);\n if (oncomplete) {\n transaction.oncomplete = oncomplete;\n }\n callback(transaction.objectStore(storeName));\n });\n }\n\n function getItem(key: IKVKeyType): Promise {\n return new Promise((resolve, reject) => {\n let request: IDBRequest;\n withStore(\n 'readonly',\n function getItemBody(store) {\n request = store.get(key);\n request.addEventListener('error', () => {\n reject(\n `Error in asyncStorage.getItem(): ${request.error?.name ?? 'unknown'}`,\n );\n });\n },\n function onComplete() {\n const value = request.result || null;\n resolve(value);\n },\n );\n });\n }\n\n function getBoolean(key: IKVKeyType): Promise {\n return new Promise((resolve, reject) => {\n getItem(key)\n .then(value => {\n resolve(Boolean(value));\n })\n .catch(error => {\n reject(error);\n });\n });\n }\n\n function getString(key: IKVKeyType): Promise {\n return new Promise((resolve, reject) => {\n getItem(key)\n .then(value => {\n resolve(String(value));\n })\n .catch(error => {\n reject(error);\n });\n });\n }\n\n function setItem(key: IKVKeyType, value: unknown): Promise {\n return new Promise((resolve, reject) => {\n withStore(\n 'readwrite',\n function setItemBody(store) {\n const request = store.put(value, key);\n request.addEventListener('error', () => {\n reject(`Error in asyncStorage.setItem(): ${request.error?.name ?? ''}`);\n });\n },\n resolve,\n );\n });\n }\n\n function removeItem(key: IKVKeyType): Promise {\n return new Promise((resolve, reject) => {\n withStore(\n 'readwrite',\n function removeItemBody(store) {\n const request = store.delete(key);\n request.addEventListener('error', () => {\n reject(`Error in asyncStorage.removeItem(): ${request.error?.name ?? ''}`);\n });\n },\n resolve,\n );\n });\n }\n\n function clear(): Promise {\n return new Promise((resolve, reject) => {\n withStore(\n 'readwrite',\n function clearBody(store) {\n const request = store.clear();\n request.addEventListener('error', () => {\n reject(`Error in asyncStorage.clear(): ${request.error?.name ?? ''}`);\n });\n },\n resolve,\n );\n });\n }\n\n function length(): Promise {\n return new Promise((resolve, reject) => {\n let request: IDBRequest;\n withStore(\n 'readonly',\n function lengthBody(store) {\n request = store.count();\n request.addEventListener('error', () => {\n reject(`Error in asyncStorage.length(): ${request.error?.name ?? ''}`);\n });\n },\n function onComplete() {\n resolve(Number.parseInt(String(request.result), 10));\n },\n );\n });\n }\n\n return {\n getItem,\n getBoolean,\n getString,\n setItem,\n removeItem,\n clear,\n length,\n };\n}\n\nexport default storage;\n","import { buildBindable } from '@monofe/di';\nimport type { IKVStorage } from '../interface/kvStorage';\nimport { bindKVStorage, injectKVStorage, unbindKVStorage } from '../interface/kvStorage';\nimport TYPES from '../util/types';\nimport kvStorage from './kvstorage';\n\nexport default buildBindable({\n id: TYPES.IKVStorage,\n bind: bindKVStorage,\n remove: unbindKVStorage,\n inject: injectKVStorage,\n build: () => Promise.resolve(kvStorage()),\n});\n","import type {\n IConfigLog,\n IConfigLogDestination_ValidValuesOnly,\n IConfigLogLevel,\n} from '../interface/config';\nimport { IConfigLogDestination } from '../interface/config';\nimport type { ILog } from '../interface/log';\nimport type { ILogger } from './log.if';\nimport { LOG_LEVEL } from './log.if';\nconst instantiatorConsole = () => import('./log.console');\nconst instantiatorLocalStorage = () => import('./log.ls');\nconst instantiatorSentry = () => import('./log.sentry');\n\n/* IConfigLogLevel & LOG_LEVEL have same enum values, just cast */\nconst logLevelToConfigLogLevel = (level: LOG_LEVEL): IConfigLogLevel => level as number;\nconst configLogLevelsToLogLevels = (level: IConfigLogLevel[]): LOG_LEVEL[] => level as number[];\n\nfunction _isLogLevelEnabled(config: IConfigLog | IConfigLogLevel[], logLevel: LOG_LEVEL): boolean {\n if (Array.isArray(config)) {\n const configArr = config;\n return configArr.includes(logLevelToConfigLogLevel(logLevel));\n } else {\n const configObj = config;\n return configObj.loggingLevelsEnabled.includes(logLevelToConfigLogLevel(logLevel));\n }\n}\n\nconst LOGGER_RESOLVERS: Record<\n IConfigLogDestination_ValidValuesOnly,\n (config: IConfigLog) => Promise\n> = {\n [IConfigLogDestination.Console]: async (config: IConfigLog) => {\n const logLevels = configLogLevelsToLogLevels(config.loggingLevelsEnabled);\n const localConfig = config.outputConfiguration[IConfigLogDestination.Console] ?? {};\n const isEnabled = config.outputDestinations.includes(IConfigLogDestination.Console);\n return isEnabled\n ? (await instantiatorConsole()).default(logLevels, localConfig)\n : undefined;\n },\n [IConfigLogDestination.LocalStorage]: async (config: IConfigLog) => {\n const logLevels = configLogLevelsToLogLevels(config.loggingLevelsEnabled);\n const localConfig = config.outputConfiguration[IConfigLogDestination.LocalStorage] ?? {};\n const isEnabled = config.outputDestinations.includes(IConfigLogDestination.LocalStorage);\n return isEnabled\n ? (await instantiatorLocalStorage()).default(logLevels, localConfig)\n : undefined;\n },\n [IConfigLogDestination.Remote_Sentry]: async (config: IConfigLog) => {\n const logLevels = configLogLevelsToLogLevels(config.loggingLevelsEnabled);\n const localConfig = config.outputConfiguration[IConfigLogDestination.Remote_Sentry] ?? {};\n const isEnabled = config.outputDestinations.includes(IConfigLogDestination.Remote_Sentry);\n return isEnabled ? (await instantiatorSentry()).default(logLevels, localConfig) : undefined;\n },\n};\n\nfunction logger(config: IConfigLog): ILog {\n let loggers: ILogger[] = [];\n const middlewares: ((message: string) => string)[] = [];\n\n /* Asynchronously resolve/build these loggers. Dynamically fetch logger only when needed */\n Promise.all(Object.values(LOGGER_RESOLVERS).map(fn => fn(config)))\n .then(newLoggers => {\n loggers = newLoggers.filter(x => x !== undefined) as ILogger[];\n })\n .catch((error: Error) => {\n /* eslint-disable-next-line no-console */\n console.error(`Failed to instantiate loggers: ${error.message}`);\n });\n\n const logAll = (logLevel: LOG_LEVEL, message: string) => {\n const logMessage =\n middlewares.length > 0\n ? middlewares.reduce(\n (currentMessage, middleware) => middleware(currentMessage),\n message,\n )\n : message;\n\n if (logMessage.length <= 0) {\n /* Nothing to do */\n return;\n }\n\n for (const loggerEntry of loggers) {\n loggerEntry.log(logLevel, logMessage);\n }\n };\n\n const assertAll = (condition: boolean | number | string, message: string) => {\n for (const loggerEntry of loggers) {\n loggerEntry.assert(condition, message);\n }\n };\n\n const milestone = (msg: string) => {\n logAll(LOG_LEVEL.MILESTONE, msg);\n };\n const verbose = (msg: string) => {\n logAll(LOG_LEVEL.VERBOSE, msg);\n };\n const trace = (msg: string) => {\n logAll(LOG_LEVEL.TRACE, msg);\n };\n const info = (msg: string) => {\n logAll(LOG_LEVEL.INFO, msg);\n };\n const warn = (msg: string) => {\n logAll(LOG_LEVEL.WARN, msg);\n };\n const warning = (msg: string) => {\n logAll(LOG_LEVEL.WARN, msg);\n };\n const error = (msg: string) => {\n logAll(LOG_LEVEL.ERROR, msg);\n };\n const fatal = (msg: string) => {\n logAll(LOG_LEVEL.FATAL, msg);\n };\n const assert = (condition: boolean | number | string, msg: string | undefined) => {\n assertAll(condition, msg ?? 'Assertion check failed');\n };\n const noop = (message: string) => {\n /* No-Op */\n };\n const noopAssert = (condition: boolean | number | string, message: string | undefined) => {\n /* No-Op */\n };\n\n const module: ILog = {\n milestone: _isLogLevelEnabled(config, LOG_LEVEL.MILESTONE) ? milestone : noop,\n verbose: _isLogLevelEnabled(config, LOG_LEVEL.VERBOSE) ? verbose : noop,\n trace: _isLogLevelEnabled(config, LOG_LEVEL.TRACE) ? trace : noop,\n info: _isLogLevelEnabled(config, LOG_LEVEL.INFO) ? info : noop,\n warn: _isLogLevelEnabled(config, LOG_LEVEL.WARN) ? warn : noop,\n warning: _isLogLevelEnabled(config, LOG_LEVEL.WARN) ? warning : noop,\n error: _isLogLevelEnabled(config, LOG_LEVEL.ERROR) ? error : noop,\n fatal: _isLogLevelEnabled(config, LOG_LEVEL.FATAL) ? fatal : noop,\n assert: _isLogLevelEnabled(config, LOG_LEVEL.ASSERT) ? assert : noopAssert,\n\n addMiddleware: middleware => middlewares.push(middleware),\n removeMiddleware: middleware => delete middlewares[middlewares.indexOf(middleware)],\n };\n\n return module;\n}\n\nexport default logger;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectConfigLog } from '../interface/config';\nimport type { ILog } from '../interface/log';\nimport { bindLog, injectLog, unbindLog } from '../interface/log';\nimport TYPES from '../util/types';\nimport logger from './log';\n\nfunction _build(container: IContainer): Readonly {\n const config = injectConfigLog(container);\n\n const log = logger(config);\n\n return Object.freeze(log);\n}\n\nexport default buildBindable({\n id: TYPES.ILog,\n dependencies: [TYPES.IConfigLog],\n bind: bindLog,\n remove: unbindLog,\n inject: injectLog,\n build: container => Promise.resolve(_build(container)),\n});\n","import type { MimeType } from '../interface/mimeType';\n\nconst MIME_MAP: Record = {\n 'Application/xml': 'vcproj',\n 'application/PowerShell': 'psc1',\n 'application/atom+xml': 'atom',\n 'application/directx': 'x',\n 'application/envoy': 'evy',\n 'application/etl': 'etl',\n 'application/fractals': 'fif',\n 'application/fsharp-script': 'fsx',\n 'application/futuresplash': 'spl',\n 'application/hta': 'hta',\n 'application/internet-property-stream': 'acx',\n 'application/java-archive': 'jar',\n 'application/json': 'json',\n 'application/liquidmotion': 'jcz',\n 'application/mac-binhex40': 'hqx',\n 'application/ms-vsi': 'vsi',\n 'application/msaccess': 'mde',\n 'application/msaccess.addin': 'accda',\n 'application/msaccess.cab': 'accdc',\n 'application/msaccess.ftemplate': 'accft',\n 'application/msaccess.runtime': 'accdr',\n 'application/msaccess.webapplication': 'accdw',\n 'application/msword': 'wiz',\n 'application/octet-stream': 'xtp',\n 'application/oda': 'oda',\n 'application/oleobject': 'ods',\n 'application/olescript': 'axs',\n 'application/onenote': 'onepkg',\n 'application/opensearchdescription+xml': 'osdx',\n 'application/pdf': 'pdf',\n 'application/pics-rules': 'prf',\n 'application/pkcs10': 'p10',\n 'application/pkcs7-mime': 'p7c',\n 'application/pkcs7-signature': 'p7s',\n 'application/pkix-crl': 'crl',\n 'application/postscript': 'ps',\n 'application/rat-file': 'rat',\n 'application/rtf': 'rtf',\n 'application/sdp': 'sdp',\n 'application/set-payment-initiation': 'setpay',\n 'application/set-registration-initiation': 'setreg',\n 'application/streamingmedia': 'ssm',\n 'application/vnd.adobe.air-application-installer-package+zip': 'air',\n 'application/vnd.fdf': 'fdf',\n 'application/vnd.ms-excel': 'xlm',\n 'application/vnd.ms-excel.addin.macroEnabled.12': 'xlam',\n 'application/vnd.ms-excel.sheet.binary.macroEnabled.12': 'xlsb',\n 'application/vnd.ms-excel.sheet.macroEnabled.12': 'xlsm',\n 'application/vnd.ms-excel.template.macroEnabled.12': 'xltm',\n 'application/vnd.ms-mediapackage': 'mpf',\n 'application/vnd.ms-office.calx': 'calx',\n 'application/vnd.ms-officetheme': 'thmx',\n 'application/vnd.ms-pki.certstore': 'sst',\n 'application/vnd.ms-pki.pko': 'pko',\n 'application/vnd.ms-pki.seccat': 'cat',\n 'application/vnd.ms-pki.stl': 'stl',\n 'application/vnd.ms-powerpoint': 'pot',\n 'application/vnd.ms-powerpoint.addin.macroEnabled.12': 'ppam',\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12': 'pptm',\n 'application/vnd.ms-powerpoint.slide.macroEnabled.12': 'sldm',\n 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12': 'ppsm',\n 'application/vnd.ms-powerpoint.template.macroEnabled.12': 'potm',\n 'application/vnd.ms-project': 'mpp',\n 'application/vnd.ms-visio.viewer': 'vdx',\n 'application/vnd.ms-word.document.macroEnabled.12': 'docm',\n 'application/vnd.ms-word.template.macroEnabled.12': 'dotm',\n 'application/vnd.ms-works': 'wdb',\n 'application/vnd.ms-wpl': 'wpl',\n 'application/vnd.ms-xpsdocument': 'xps',\n 'application/vnd.oasis.opendocument.presentation': 'odp',\n 'application/vnd.oasis.opendocument.text': 'odt',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'pptx',\n 'application/vnd.openxmlformats-officedocument.presentationml.slide': 'sldx',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow': 'ppsx',\n 'application/vnd.openxmlformats-officedocument.presentationml.template': 'potx',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template': 'xltx',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': 'dotx',\n 'application/vnd.rn-realmedia': 'rm',\n 'application/vnd.rn-rn_music_package': 'rmp',\n 'application/vnd.visio': 'vtx',\n 'application/vnd.wap.wmlc': 'wmlc',\n 'application/vnd.wap.wmlscriptc': 'wmlsc',\n 'application/vsix': 'vsix',\n 'application/windows-library+xml': 'librar-ms',\n 'application/windows-search-connector+xml': 'searchConnecto-ms',\n 'application/winhlp': 'hlp',\n 'application/wlmoviemaker': 'WLMP',\n 'application/x-7z-compressed': '7z',\n 'application/x-bcpio': 'bcpio',\n 'application/x-bridge-url': 'adobebridge',\n 'application/x-cdf': 'cdf',\n 'application/x-compress': 'z',\n 'application/x-compressed': 'tgz',\n 'application/x-cpio': 'cpio',\n 'application/x-csh': 'csh',\n 'application/x-director': 'dir',\n 'application/x-dvi': 'dvi',\n 'application/x-gtar': 'gtar',\n 'application/x-hdf': 'hdf',\n 'application/x-internet-signup': 'isp',\n 'application/x-iphone': 'iii',\n 'application/x-itunes-ipa': 'ipa',\n 'application/x-itunes-ipg': 'ipg',\n 'application/x-itunes-ipsw': 'ipsw',\n 'application/x-itunes-ite': 'ite',\n 'application/x-itunes-itlp': 'itlp',\n 'application/x-itunes-itms': 'itms',\n 'application/x-itunes-itpc': 'itpc',\n 'application/x-java-applet': 'class',\n 'application/x-java-jnlp-file': 'jnlp',\n 'application/x-javascript': 'js',\n 'application/x-latex': 'latex',\n 'application/x-miva-compiled': 'mvc',\n 'application/x-mmxp': 'mxp',\n 'application/x-mpeg': 'amc',\n 'application/x-mpegURL': 'm3u8',\n 'application/x-ms-application': 'application',\n 'application/x-ms-license': 'slupk-ms',\n 'application/x-ms-manifest': 'manifest',\n 'application/x-ms-reader': 'lit',\n 'application/x-ms-vsto': 'vsto',\n 'application/x-ms-wmd': 'wmd',\n 'application/x-ms-xbap': 'xbap',\n 'application/x-msaccess': 'mdb',\n 'application/x-mscardfile': 'crd',\n 'application/x-msclip': 'clp',\n 'application/x-msdownload': 'dll',\n 'application/x-msmediaview': 'mvb',\n 'application/x-msmetafile': 'wmf',\n 'application/x-mspublisher': 'pub',\n 'application/x-msterminal': 'trm',\n 'application/x-mswrite': 'wri',\n 'application/x-netcdf': 'nc',\n 'application/x-oleobject': 'hhc',\n 'application/x-perfmon': 'pmw',\n 'application/x-pkcs12': 'pfx',\n 'application/x-pkcs7-certificates': 'spc',\n 'application/x-pkcs7-certreqresp': 'p7r',\n 'application/x-podcast': 'pcast',\n 'application/x-quicktimeplayer': 'qtl',\n 'application/x-safari-safariextz': 'safariextz',\n 'application/x-safari-webarchive': 'webarchive',\n 'application/x-sgimb': 'sgimb',\n 'application/x-sh': 'sh',\n 'application/x-shar': 'shar',\n 'application/x-shockwave-flash': 'swf',\n 'application/x-silverlight-app': 'xap',\n 'application/x-smaf': 'mmf',\n 'application/x-stuffit': 'sit',\n 'application/x-sv4cpio': 'sv4cpio',\n 'application/x-sv4crc': 'sv4crc',\n 'application/x-tar': 'tar',\n 'application/x-tcl': 'tcl',\n 'application/x-tex': 'tex',\n 'application/x-texinfo': 'texi',\n 'application/x-troff': 'roff',\n 'application/x-troff-man': 'man',\n 'application/x-troff-me': 'me',\n 'application/x-troff-ms': 'ms',\n 'application/x-ustar': 'ustar',\n 'application/x-wais-source': 'src',\n 'application/x-wlpg-detect': 'wlpginstall',\n 'application/x-wlpg3-detect': 'wlpginstall3',\n 'application/x-x509-ca-cert': 'der',\n 'application/x-zip-compressed': 'zip',\n 'application/xaml+xml': 'xaml',\n 'application/xhtml+xml': 'xht',\n 'application/xml': 'xml',\n 'application/zip': 'zip',\n 'audio/aac': 'aac',\n 'audio/ac3': 'ac3',\n 'audio/aiff': 'cdda',\n 'audio/audible': 'aa',\n 'audio/basic': 'snd',\n 'audio/m4a': 'm4a',\n 'audio/m4b': 'm4b',\n 'audio/m4p': 'm4p',\n 'audio/mid': 'midi',\n 'audio/scpls': 'pls',\n 'audio/ogg': 'opus',\n 'audio/opus': 'opus',\n 'audio/vnd.audible.aax': 'aax',\n 'audio/vnd.dlna.adts': 'ADT',\n 'audio/wav': 'wav',\n 'audio/x-aiff': 'aif',\n 'audio/x-caf': 'caf',\n 'audio/x-gsm': 'gsm',\n 'audio/x-m4r': 'm4r',\n 'audio/x-mpegurl': 'm3u',\n 'audio/x-ms-wax': 'wax',\n 'audio/x-pn-realaudio': 'ra',\n 'audio/x-pn-realaudio-plugin': 'rpm',\n 'audio/x-sd2': 'sd2',\n 'audio/x-smd': 'smz',\n 'drawing/x-dwf': 'dwf',\n 'application/x-gzip': 'gz',\n 'image/avif': 'avif',\n 'image/bmp': 'bmp',\n 'image/cis-cod': 'cod',\n 'image/gif': 'gif',\n 'image/ief': 'ief',\n 'image/jpeg': 'jpeg',\n 'image/jpg': 'jpeg',\n 'image/pict': 'pct',\n 'image/pjpeg': 'jfif',\n 'image/png': 'png',\n 'image/tiff': 'tiff',\n 'image/vnd.ms-photo': 'wdp',\n 'image/vnd.rn-realflash': 'rf',\n 'image/vnd.wap.wbmp': 'wbmp',\n 'image/webp': 'webp',\n 'image/x-cmu-raster': 'ras',\n 'image/x-cmx': 'cmx',\n 'image/x-icon': 'ico',\n 'image/x-jg': 'art',\n 'image/x-macpaint': 'pntg',\n 'image/x-portable-anymap': 'pnm',\n 'image/x-portable-bitmap': 'pbm',\n 'image/x-portable-graymap': 'pgm',\n 'image/x-portable-pixmap': 'ppm',\n 'image/x-quicktime': 'qti',\n 'image/x-rgb': 'rgb',\n 'image/x-xbitmap': 'xbm',\n 'image/x-xpixmap': 'xpm',\n 'image/x-xwindowdump': 'xwd',\n 'message/rfc822': 'nws',\n 'application/x-msmoney': 'mny',\n 'audio/mpeg': 'mp3',\n 'application/x-msschedule': 'scd',\n 'text/scriptlet': 'sct',\n 'text/css': 'css',\n 'text/csv': 'csv',\n 'text/dlm': 'dlm',\n 'text/h323': '323',\n 'text/html': 'html',\n 'text/iuls': 'uls',\n 'text/jscript': 'jsx',\n 'text/plain': 'odl',\n 'text/richtext': 'rtx',\n 'text/sgml': 'sgml',\n 'text/tab-separated-values': 'tsv',\n 'text/vbscript': 'vbs',\n 'text/vnd.wap.wmlscript': 'wmls',\n 'text/webviewhtml': 'htt',\n 'text/x-component': 'htc',\n 'text/x-hdml': 'hdml',\n 'text/x-html-insertion': 'qht',\n 'text/x-ms-contact': 'contact',\n 'text/x-ms-group': 'group',\n 'text/x-ms-iqy': 'iqy',\n 'text/x-ms-odc': 'odc',\n 'text/x-ms-rqy': 'rqy',\n 'text/x-setext': 'etx',\n 'text/x-vcard': 'vcf',\n 'text/xml': 'vssettings',\n 'video/AV1': 'av1',\n 'video/vnd.dlna.mpeg-tts': 'tts',\n 'video/3gpp': '3gp',\n 'video/3gpp2': '3g2',\n 'video/quicktime': 'qt',\n 'video/mp4': 'mp4',\n 'video/mpeg': 'mpeg',\n 'video/x-dv': 'dif',\n 'video/x-flv': 'flv',\n 'video/x-ivf': 'IVF',\n 'video/x-la-asf': 'lsf',\n 'video/x-m4v': 'm4v',\n 'video/x-matroska': 'mkv',\n 'video/x-ms-asf': 'asr',\n 'video/x-ms-wm': 'wm',\n 'video/x-ms-wmv': 'wmv',\n 'video/x-ms-wvx': 'wvx',\n 'video/x-msvideo': 'avi',\n 'video/x-sgi-movie': 'movie',\n 'video/webm': 'webm',\n 'audio/x-ms-wma': 'wma',\n 'text/vnd.wap.wml': 'wml',\n 'video/x-ms-wmp': 'wmp',\n 'video/x-ms-wmx': 'wmx',\n 'vnd.apple.mpegURL': 'm3u8',\n 'application/x-ms-wmz': 'wmz',\n 'x-world/x-vrml': 'flr',\n} as const;\n\nfunction mimeTypeToFileExtension(mime: MimeType): string | null {\n return MIME_MAP[mime];\n}\n\nfunction fileExtensionToMimeType(filePathInput: string): MimeType | null {\n let fileExtensionSearch = filePathInput.toLowerCase();\n\n /* If we were given move than the extension, remove anything before the last '.' */\n if (fileExtensionSearch.includes('.')) {\n fileExtensionSearch = fileExtensionSearch.split('.').at(-1) ?? fileExtensionSearch;\n }\n\n const searchList = Object.entries(MIME_MAP) as [MimeType, string][];\n\n const match = searchList.find(\n ([_, fileExtensionCmp]) => fileExtensionCmp === fileExtensionSearch,\n );\n\n return match?.[0] ?? null;\n}\n\nfunction isMimeType(object: unknown): object is MimeType {\n if (object === null || object === undefined || typeof object !== 'string') {\n return false;\n }\n\n const typeLookup = object as MimeType;\n\n return Boolean(MIME_MAP[typeLookup]);\n}\n\nfunction mimeType() {\n return {\n fileExtensionToMimeType,\n mimeTypeToFileExtension,\n isMimeType,\n };\n}\n\nexport default mimeType;\n","import { buildBindable } from '@monofe/di';\nimport type { IMimeType } from '../interface/mimeType';\nimport { bindMimeType, injectMimeType, unbindMimeType } from '../interface/mimeType';\nimport TYPES from '../util/types';\nimport mimeType from './mimeType';\n\nexport default buildBindable({\n id: TYPES.IMimeType,\n bind: bindMimeType,\n remove: unbindMimeType,\n inject: injectMimeType,\n build: () => Promise.resolve(mimeType()),\n});\n","export default function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}","import classApplyDescriptorSet from \"./classApplyDescriptorSet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}","export default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n descriptor.value = value;\n }\n}","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","import os from 'os';\nimport escapeStringRegexp from 'escape-string-regexp';\n\nconst extractPathRegex = /\\s+at.*[(\\s](.*)\\)?/;\nconst pathRegex = /^(?:(?:(?:node|node:[\\w/]+|(?:(?:node:)?internal\\/[\\w/]*|.*node_modules\\/(?:babel-polyfill|pirates)\\/.*)?\\w+)(?:\\.js)?:\\d+:\\d+)|native)/;\nconst homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir().replace(/\\\\/g, '/');\n\nexport default function cleanStack(stack, {pretty = false, basePath} = {}) {\n\tconst basePathRegex = basePath && new RegExp(`(at | \\\\()${escapeStringRegexp(basePath.replace(/\\\\/g, '/'))}`, 'g');\n\n\tif (typeof stack !== 'string') {\n\t\treturn undefined;\n\t}\n\n\treturn stack.replace(/\\\\/g, '/')\n\t\t.split('\\n')\n\t\t.filter(line => {\n\t\t\tconst pathMatches = line.match(extractPathRegex);\n\t\t\tif (pathMatches === null || !pathMatches[1]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst match = pathMatches[1];\n\n\t\t\t// Electron\n\t\t\tif (\n\t\t\t\tmatch.includes('.app/Contents/Resources/electron.asar') ||\n\t\t\t\tmatch.includes('.app/Contents/Resources/default_app.asar')\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn !pathRegex.test(match);\n\t\t})\n\t\t.filter(line => line.trim() !== '')\n\t\t.map(line => {\n\t\t\tif (basePathRegex) {\n\t\t\t\tline = line.replace(basePathRegex, '$1');\n\t\t\t}\n\n\t\t\tif (pretty) {\n\t\t\t\tline = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~')));\n\t\t\t}\n\n\t\t\treturn line;\n\t\t})\n\t\t.join('\\n');\n}\n","import indentString from 'indent-string';\nimport cleanStack from 'clean-stack';\n\nconst cleanInternalStack = stack => stack.replace(/\\s+at .*aggregate-error\\/index.js:\\d+:\\d+\\)?/g, '');\n\nexport default class AggregateError extends Error {\n\t#errors;\n\n\tname = 'AggregateError';\n\n\tconstructor(errors) {\n\t\tif (!Array.isArray(errors)) {\n\t\t\tthrow new TypeError(`Expected input to be an Array, got ${typeof errors}`);\n\t\t}\n\n\t\terrors = errors.map(error => {\n\t\t\tif (error instanceof Error) {\n\t\t\t\treturn error;\n\t\t\t}\n\n\t\t\tif (error !== null && typeof error === 'object') {\n\t\t\t\t// Handle plain error objects with message property and/or possibly other metadata\n\t\t\t\treturn Object.assign(new Error(error.message), error);\n\t\t\t}\n\n\t\t\treturn new Error(error);\n\t\t});\n\n\t\tlet message = errors\n\t\t\t.map(error => {\n\t\t\t\t// The `stack` property is not standardized, so we can't assume it exists\n\t\t\t\treturn typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error);\n\t\t\t})\n\t\t\t.join('\\n');\n\t\tmessage = '\\n' + indentString(message, 4);\n\t\tsuper(message);\n\n\t\tthis.#errors = errors;\n\t}\n\n\tget errors() {\n\t\treturn this.#errors.slice();\n\t}\n}\n","export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n","import classApplyDescriptorGet from \"./classApplyDescriptorGet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}","export default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n}","import AggregateError from 'aggregate-error';\n\nexport default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true\n\t} = {}\n) {\n\treturn new Promise((resolve, reject_) => { // eslint-disable-line promise/param-names\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency >= 1)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t};\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (!skippedIndexesMap.size) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport const pMapSkip = Symbol('skip');\n","import pMap from 'p-map';\n\nexport default function pTimes(count, mapper, options) {\n\treturn pMap(Array.from({length: count}).fill(), (_, index) => mapper(index), options);\n}\n","import pTimes from 'p-times';\n\nconst sum = iterable => {\n\tlet total = 0;\n\n\tfor (const value of iterable.values()) {\n\t\ttotal += value;\n\t}\n\n\treturn total;\n};\n\nexport class PProgress extends Promise {\n\tstatic all(promises, options) {\n\t\treturn pProgress(async progress => {\n\t\t\tif (\n\t\t\t\toptions && typeof options.concurrency === 'number'\n\t\t\t\t&& !(promises.every(promise => typeof promise === 'function'))\n\t\t\t) {\n\t\t\t\tthrow new TypeError('When `options.concurrency` is set, the first argument must be an Array of Promise-returning functions');\n\t\t\t}\n\n\t\t\tconst progressMap = new Map();\n\n\t\t\tconst reportProgress = () => {\n\t\t\t\tprogress(sum(progressMap) / promises.length);\n\t\t\t};\n\n\t\t\tconst mapper = async index => {\n\t\t\t\tconst nextValue = promises[index];\n\t\t\t\tconst promise = typeof nextValue === 'function' ? nextValue() : nextValue;\n\t\t\t\tprogressMap.set(promise, 0);\n\n\t\t\t\tif (promise instanceof PProgress) {\n\t\t\t\t\tpromise.onProgress(percentage => {\n\t\t\t\t\t\tprogressMap.set(promise, percentage);\n\t\t\t\t\t\treportProgress();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst value = await promise;\n\t\t\t\tprogressMap.set(promise, 1);\n\t\t\t\treportProgress();\n\t\t\t\treturn value;\n\t\t\t};\n\n\t\t\treturn pTimes(promises.length, mapper, options);\n\t\t});\n\t}\n\n\tstatic allSettled(promises, {concurrency} = {}) {\n\t\treturn pProgress(async progress => {\n\t\t\tif (\n\t\t\t\ttypeof concurrency === 'number'\n\t\t\t\t&& !(promises.every(promise => typeof promise === 'function'))\n\t\t\t) {\n\t\t\t\tthrow new TypeError('When `options.concurrency` is set, the first argument must be an Array of Promise-returning functions');\n\t\t\t}\n\n\t\t\tconst progressMap = new Map();\n\n\t\t\tconst reportProgress = () => {\n\t\t\t\tprogress(sum(progressMap) / promises.length);\n\t\t\t};\n\n\t\t\tconst mapper = async index => {\n\t\t\t\tconst nextValue = promises[index];\n\t\t\t\tconst promise = typeof nextValue === 'function' ? nextValue() : nextValue;\n\t\t\t\tprogressMap.set(promise, 0);\n\n\t\t\t\tif (promise instanceof PProgress) {\n\t\t\t\t\tpromise.onProgress(percentage => {\n\t\t\t\t\t\tprogressMap.set(promise, percentage);\n\t\t\t\t\t\treportProgress();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: 'fulfilled',\n\t\t\t\t\t\tvalue: await promise,\n\t\t\t\t\t};\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: 'rejected',\n\t\t\t\t\t\treason: error,\n\t\t\t\t\t};\n\t\t\t\t} finally {\n\t\t\t\t\tprogressMap.set(promise, 1);\n\t\t\t\t\treportProgress();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn pTimes(promises.length, mapper, {\n\t\t\t\tconcurrency,\n\t\t\t});\n\t\t});\n\t}\n\n\tconstructor(executor) {\n\t\tconst setProgress = progress => {\n\t\t\tif (progress > 1 || progress < 0) {\n\t\t\t\tthrow new TypeError('The progress percentage should be a number between 0 and 1');\n\t\t\t}\n\n\t\t\t(async () => {\n\t\t\t\t// We wait for the next microtask tick so `super` is called before we use `this`\n\t\t\t\tawait Promise.resolve();\n\n\t\t\t\t// Note: we don't really have guarantees over\n\t\t\t\t// the order in which async operations are evaluated,\n\t\t\t\t// so if we get an out-of-order progress, we'll just discard it.\n\t\t\t\tif (progress <= this._progress) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._progress = progress;\n\n\t\t\t\tfor (const listener of this._listeners) {\n\t\t\t\t\tlistener(progress);\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\tsuper((resolve, reject) => {\n\t\t\texecutor(\n\t\t\t\tvalue => {\n\t\t\t\t\tsetProgress(1);\n\t\t\t\t\tresolve(value);\n\t\t\t\t},\n\t\t\t\treject,\n\t\t\t\tprogress => {\n\t\t\t\t\tif (progress !== 1) {\n\t\t\t\t\t\tsetProgress(progress);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\n\t\tthis._listeners = new Set();\n\t\tthis._setProgress = setProgress;\n\t\tthis._progress = 0;\n\t}\n\n\tget progress() {\n\t\treturn this._progress;\n\t}\n\n\tonProgress(callback) {\n\t\tif (typeof callback !== 'function') {\n\t\t\tthrow new TypeError(`Expected a \\`Function\\`, got \\`${typeof callback}\\``);\n\t\t}\n\n\t\tthis._listeners.add(callback);\n\t\treturn this;\n\t}\n\n\tthen(onFulfilled, onRejected) {\n\t\tconst child = super.then(onFulfilled, onRejected);\n\t\tthis._listeners.add(progress => {\n\t\t\tchild._setProgress(progress);\n\t\t});\n\t\treturn child;\n\t}\n}\n\nexport default function pProgress(input) {\n\treturn new PProgress(async (resolve, reject, progress) => {\n\t\ttry {\n\t\t\tresolve(await input(progress));\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n}\n","import { PProgress } from 'p-progress';\nimport type {\n IProgressPromise,\n ProgressNotifier,\n PromiseAsyncExecutor,\n PromiseExecutor,\n} from '../interface/promise';\nimport promiseUtil from '../util/promise';\n\nfunction _async(executor: PromiseAsyncExecutor): IProgressPromise {\n const wrapper = async (\n resolve: (value?: ValueType | PromiseLike) => void,\n reject: (reason?: unknown) => void,\n progress: ProgressNotifier,\n ) => {\n try {\n const result = await executor(progress);\n resolve(result);\n } catch (error: unknown) {\n reject(error);\n }\n };\n\n /* Incorrect in source version. See https://github.com/sindresorhus/p-progress/blob/d1e701f7f9179bc047ebc1a566e79c16fadccb3b/index.js#L167 */\n /* eslint-disable-next-line @typescript-eslint/no-misused-promises */\n const promiser = new PProgress(wrapper);\n\n return promiser;\n}\n\nfunction _promise(executor: PromiseExecutor): IProgressPromise {\n /* Incorrect in source version. See https://github.com/sindresorhus/p-progress/blob/d1e701f7f9179bc047ebc1a566e79c16fadccb3b/index.js#L167 */\n /* eslint-disable-next-line @typescript-eslint/no-misused-promises */\n const promiser = new PProgress(executor);\n return promiser;\n}\n\nfunction _retry(\n factory: () => IProgressPromise,\n delayBetweenRetries = 1000,\n retryCount = 0,\n): IProgressPromise {\n const promise = _async(async progressCallback => {\n if (retryCount < 0) {\n throw new Error('Retry count exceeded, cannot continue (<0)');\n }\n\n const promise = factory();\n promise.onProgress(progressCallback);\n\n let response = await promise.catch((error: Error) => error);\n\n if (response instanceof Error) {\n if (delayBetweenRetries > 0) {\n await promiseUtil.delay(delayBetweenRetries).catch(() => undefined);\n }\n\n const canRetry = retryCount > 1;\n\n if (canRetry) {\n response = await _retry(factory, delayBetweenRetries, retryCount - 1);\n } else {\n throw response;\n }\n }\n\n return response;\n });\n\n return promise;\n}\n\nexport default Object.freeze({\n async: _async,\n promise: _promise,\n retry: _retry,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IProgressPromiseGenerator } from '../interface/promise';\nimport {\n bindProgressPromise,\n injectProgressPromise,\n unbindProgressPromise,\n} from '../interface/promise';\nimport TYPES from '../util/types';\nimport promise from './promise';\n\nexport default buildBindable({\n id: TYPES.IProgressPromiseGenerator,\n bind: bindProgressPromise,\n remove: unbindProgressPromise,\n inject: injectProgressPromise,\n build: () => Promise.resolve(promise),\n});\n","function parse(queryString: string): Record {\n const query: Record = {};\n\n const pairs = (queryString.startsWith('?') ? queryString.substr(1) : queryString).split('&');\n\n for (const pairsValue of pairs) {\n const [keyIn, valueIn] = pairsValue.split('=') as (string | undefined)[];\n if (keyIn !== undefined && valueIn !== undefined) {\n const key = decodeURIComponent(keyIn);\n const value = decodeURIComponent(valueIn) || '';\n query[key] = value;\n }\n }\n return query;\n}\n\nfunction assemble(\n queryArgs: Record,\n questionMarkPrefix = true,\n): string {\n const strPairs: string[] = [];\n\n for (const [key, value] of Object.entries(queryArgs)) {\n const encodedStr = `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;\n strPairs.push(encodedStr);\n }\n\n return (questionMarkPrefix ? '?' : '') + strPairs.join('&');\n}\n\nexport default Object.freeze({\n parse,\n assemble,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IQueryURL } from '../interface/query';\nimport { bindQueryURL, injectQueryURL, unbindQueryURL } from '../interface/query';\nimport TYPES from '../util/types';\nimport queryURL from './querystring';\n\nexport default buildBindable({\n id: TYPES.IQueryURL,\n bind: bindQueryURL,\n remove: unbindQueryURL,\n inject: injectQueryURL,\n build: () => Promise.resolve(queryURL),\n});\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectENV } from '../interface/env';\nimport type { ITranslationStorage } from '../interface/translationStorage';\nimport {\n bindTranslationStorage,\n injectTranslationStorage,\n unbindTranslationStorage,\n} from '../interface/translationStorage';\nimport TYPES from '../util/types';\nconst loader = import('./translationstorage');\n\nasync function _build(container: IContainer): Promise> {\n const env = injectENV(container);\n\n const module = await loader;\n\n return Object.freeze(module.default(env));\n}\n\nexport default buildBindable({\n id: TYPES.ITranslationStorage,\n dependencies: [TYPES.IEnv],\n bind: bindTranslationStorage,\n remove: unbindTranslationStorage,\n inject: injectTranslationStorage,\n build: container => _build(container),\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IZip } from '../interface/zip';\nimport { bindZip, injectZip, unbindZip } from '../interface/zip';\nimport TYPES from '../util/types';\nconst loader = import('./zip');\n\nasync function _build(): Promise {\n return (await loader).default;\n}\n\nexport default buildBindable({\n id: TYPES.IZip,\n bind: bindZip,\n remove: unbindZip,\n inject: injectZip,\n build: () => _build(),\n});\n","import type { IBinder } from '@monofe/di';\nimport { buildBinderListings } from '@monofe/di';\n\nimport browserBind from '../impl/browser.bind';\nimport cacheBind from '../impl/cache.bind';\nimport cachecontrollerBind from '../impl/cachecontroller.bind';\nimport envBind from '../impl/env.bind';\nimport featureQueryBind from '../impl/featureQuery.bind';\nimport fetchBind from '../impl/fetch.bind';\nimport kvStorageBind from '../impl/kvStorage.bind';\nimport logBind from '../impl/log.bind';\nimport mimeTypeBind from '../impl/mimeType.bind';\nimport promiseBind from '../impl/promise.bind';\nimport querystringBind from '../impl/querystring.bind';\nimport translationstorageBind from '../impl/translationstorage.bind';\nimport zipBind from '../impl/zip.bind';\n\nconst BINDER_LOADERS: (Readonly> & { private?: boolean })[] = [\n browserBind,\n cacheBind,\n cachecontrollerBind,\n envBind,\n featureQueryBind,\n fetchBind,\n kvStorageBind,\n logBind,\n mimeTypeBind,\n promiseBind,\n querystringBind,\n translationstorageBind,\n zipBind,\n];\n\nexport default buildBinderListings(BINDER_LOADERS);\n","function isArrayBuffer(object: unknown): object is ArrayBuffer {\n try {\n return object instanceof ArrayBuffer || object instanceof Buffer;\n } catch {\n /* Buffer|ArrayBuffer definitions missing (running in Browser?) */\n return false;\n }\n}\n\nfunction arrayBufferToString(buffer: ArrayBuffer): string {\n const result = new TextDecoder().decode(buffer);\n return result;\n}\n\nfunction stringToArrayBuffer(string_: string): ArrayBuffer {\n const byteArray = new TextEncoder().encode(string_);\n const buffer = byteArray.buffer;\n return buffer;\n}\n\nfunction bufferToArrayBuffer(buffer: Buffer): ArrayBuffer {\n const arrayBuffer = new ArrayBuffer(buffer.length);\n /* This looks like bufferView is completely redundant but this is the correct way to modify an ArrayBuffer\n https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\n */\n const bufferView = new Uint8Array(arrayBuffer);\n for (const [index, element] of buffer.entries()) {\n bufferView[index] = element;\n }\n return arrayBuffer;\n}\n\nconst arrayBufferToBuffer = (arrayBuffer: ArrayBuffer): Buffer => Buffer.from(arrayBuffer);\n\nexport default Object.freeze({\n arrayBufferToString,\n stringToArrayBuffer,\n bufferToArrayBuffer,\n arrayBufferToBuffer,\n isArrayBuffer,\n});\n","interface BufferLike {\n isBuffer: (obj: unknown) => boolean;\n}\n\nfunction _isObject(obj: unknown): obj is Record {\n if (obj === undefined || obj === null || typeof obj !== 'object') {\n return false;\n }\n\n return true;\n}\n\nfunction _isBufferLike(obj: unknown): obj is BufferLike {\n if (obj === undefined || obj === null || typeof obj !== 'function') {\n return false;\n }\n\n const allowedProperties = Object.keys(obj);\n\n if (!allowedProperties.includes('isBuffer')) {\n return false;\n }\n\n const property = Object.getOwnPropertyDescriptor(obj, 'isBuffer');\n\n if (!property) {\n return false;\n }\n\n if (typeof property.value !== 'function') {\n return false;\n }\n\n return true;\n}\n\nfunction _bufferLike(obj: unknown): BufferLike | undefined {\n if (!_isObject(obj)) {\n return undefined;\n }\n\n if (!obj.constructor) {\n return undefined;\n }\n\n const bufferLike = obj.constructor;\n\n if (!_isBufferLike(bufferLike)) {\n return undefined;\n }\n\n return bufferLike;\n}\n\n/* Instead of including a Buffer polyfill on Browser, we only need the isBuffer, using the lines below */\nfunction isBuffer(obj: unknown): obj is Buffer {\n const bufferLike = _bufferLike(obj);\n\n /* If we have a definition of Buffer.isBuffer from #obj.constructor.isBuffer, so ask it instead */\n const result = Boolean(bufferLike?.isBuffer(obj));\n\n return result;\n}\n\nexport default Object.freeze({\n isBuffer,\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport { useEffect, useState } from 'react';\nimport type { IBrowser } from '../interface/browser';\nimport { injectBrowser } from '../interface/browser';\nimport type { IFetcher } from '../interface/fetch';\nimport { injectFetch } from '../interface/fetch';\nimport type { IKVStorage } from '../interface/kvStorage';\nimport { injectKVStorage } from '../interface/kvStorage';\nimport type { ITranslationStorage } from '../interface/translationStorage';\nimport { injectTranslationStorage } from '../interface/translationStorage';\nimport type { IZip } from '../interface/zip';\nimport { injectZip } from '../interface/zip';\n\nexport function useInjector(resolver: Promise): T | null {\n const [item, setItem] = useState(null);\n\n useEffect(() => {\n resolver\n .then(val => {\n setItem(val);\n })\n .catch(err => {\n throw err;\n });\n }, [setItem, resolver]);\n\n return item;\n}\n\nexport function useFetch(container: IContainer = injectOrBuildContainer()): IFetcher | null {\n return useInjector(Promise.resolve(injectFetch(container)));\n}\n\nexport function useZip(container: IContainer = injectOrBuildContainer()): IZip | null {\n return useInjector(Promise.resolve(injectZip(container)));\n}\n\nexport function useKVStorage(container: IContainer = injectOrBuildContainer()): IKVStorage | null {\n return useInjector(Promise.resolve(injectKVStorage(container)));\n}\n\nexport function useBrowser(container: IContainer = injectOrBuildContainer()): IBrowser | null {\n return useInjector(Promise.resolve(injectBrowser(container)));\n}\n\nexport function useTranslationStorage(\n container: IContainer = injectOrBuildContainer(),\n): ITranslationStorage | null {\n return useInjector(Promise.resolve(injectTranslationStorage(container)));\n}\n\nexport function useKVState(\n key: string,\n kvFetch: Promise,\n initial: T,\n): [T, (newValue: T) => void] {\n const [state, setState] = useState(initial);\n\n const setValue = (newValue: T) => {\n kvFetch\n .then(kv => kv.setItem(key, newValue))\n .catch(error => {\n throw error;\n });\n setState(newValue);\n };\n\n kvFetch\n .then(kv => kv.getItem(key))\n .then(val => {\n setState(val as T);\n })\n .catch(error => {\n throw error;\n });\n\n return [state, setValue];\n}\n","import type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useState } from 'react';\n\n/* Same as useState, except 3 return-value allow for partial state updates */\nfunction ReactUseStateWithUpdate(\n initialState: S | (() => S),\n): [S, Dispatch>, Dispatch>] {\n const [getVal, setVal] = useState(initialState);\n const updateVal = useCallback((partial: Partial) => {\n setVal(sPrev => ({ ...sPrev, ...partial }));\n }, []);\n return [getVal, setVal, updateVal];\n}\n\nexport default ReactUseStateWithUpdate;\n","/* Unable to type variadic arguments, so we have to type out each variant & combine. Below we support upto 5 arguments */\n\n/* Valid argument type for memoize function */\ntype ArgType = string | number | boolean | symbol | object;\n\n/* Function variants with each arg typed */\ntype Func0 = () => Return;\ntype Func1 = (arg1: Arg1) => Return;\ntype Func2 = (arg1: Arg1, arg2: Arg2) => Return;\ntype Func3 = (\n arg1: Arg1,\n arg2: Arg2,\n arg3: Arg3,\n) => Return;\ntype Func4<\n Return,\n Arg1 extends ArgType,\n Arg2 extends ArgType,\n Arg3 extends ArgType,\n Arg4 extends ArgType,\n> = (arg1: Arg1, arg2: Arg2, arg3: Arg3, arg4: Arg4) => Return;\ntype Func5 = (\n arg1: Arg1,\n arg2: Arg2,\n arg3: Arg3,\n arg4: Arg4,\n arg5: Arg5,\n) => Return;\n\n/* Dynamically choose between Func1, Func2, Func3, Func4, Func5 based on the arguments used */\ntype FuncType<\n Return,\n Arg1 = undefined,\n Arg2 = undefined,\n Arg3 = undefined,\n Arg4 = undefined,\n Arg5 = undefined,\n> = Arg1 extends ArgType\n ? Arg2 extends ArgType\n ? Arg3 extends ArgType\n ? Arg4 extends ArgType\n ? Arg5 extends ArgType\n ? Func5\n : Func4\n : Func3\n : Func2\n : Func1\n : Func0;\n\n/* Default argument serializer */\nconst _createKeyFromArray = (...argList: A) => {\n const stringList = argList.map(item => {\n if (typeof item === 'object') {\n return JSON.stringify(item);\n } else if (Array.isArray(item)) {\n return (item as unknown[]).map((arrayItem: unknown) => String(arrayItem));\n } else {\n return `_${String(item)}_`;\n }\n });\n\n return `_${stringList.join('_')}_`;\n};\n\n/**\n * Memoize\n *\n * @desc Creates a function that memoizes the result of fn.\n * The arguments of the fn are used to create a cache key.\n *\n * @param {Function} fn The function to have its output memoized.\n * @param {Function=} argsSerializer Function that will convert #fn args to a string lookup key\n * @param {Array=} Array of arg,return values to pre-insert into cached values\n * @returns {Function} Memoized fn version\n */\nexport function memoize<\n Return,\n Arg1 = undefined,\n Arg2 = undefined,\n Arg3 = undefined,\n Arg4 = undefined,\n Arg5 = undefined,\n>(\n fn: FuncType,\n argsSerializer: FuncType<\n string,\n Arg1,\n Arg2,\n Arg3,\n Arg4,\n Arg5\n > = _createKeyFromArray as FuncType,\n presetValues: [unknown[], Return][] = [],\n): FuncType {\n const cache = new Map();\n\n /* Loop through & set all preset values into cache first */\n for (const [argsValue, returnValue] of presetValues) {\n const [keyArg1, keyArg2, keyArg3, keyArg4, keyArg5] = argsValue;\n const serializedKey = argsSerializer(\n keyArg1 as Arg1,\n keyArg2 as Arg2,\n keyArg3 as Arg3,\n keyArg4 as Arg4,\n keyArg5 as Arg5,\n );\n cache.set(serializedKey, returnValue);\n }\n\n const memoFn = (arg1: Arg1, arg2: Arg2, arg3: Arg3, arg4: Arg4, arg5: Arg5): Return => {\n const cacheKey = argsSerializer(arg1, arg2, arg3, arg4, arg5);\n\n const cachedResult = cache.get(cacheKey);\n\n if (cachedResult !== undefined) {\n return cachedResult;\n }\n\n const result = fn(arg1, arg2, arg3, arg4, arg5);\n cache.set(cacheKey, result);\n return result;\n };\n\n return memoFn as FuncType;\n}\n\n/**\n * Memoize\n *\n * @desc Creates a async function that memoizes the result of fn.\n * The arguments of the fn are used to create a cache key.\n *\n * @param {Function} fn The function to have its output memoized.\n * @param {Function=} argsSerializer Function that will convert #fn args to a string lookup key\n * @param {Array=} Array of arg,return values to pre-insert into cached values\n * @returns {Function} Memoized fn version\n */\nexport function memoizeAsync<\n Return,\n Arg1 = undefined,\n Arg2 = undefined,\n Arg3 = undefined,\n Arg4 = undefined,\n Arg5 = undefined,\n>(\n fn: FuncType, Arg1, Arg2, Arg3, Arg4, Arg5>,\n argsSerializer: FuncType<\n string,\n Arg1,\n Arg2,\n Arg3,\n Arg4,\n Arg5\n > = _createKeyFromArray as FuncType,\n presetValues: [unknown[], Return][] = [],\n): FuncType, Arg1, Arg2, Arg3, Arg4, Arg5> {\n const cache = new Map();\n\n /* Loop through & set all preset values into cache first */\n for (const [argsValue, returnValue] of presetValues) {\n const [keyArg1, keyArg2, keyArg3, keyArg4, keyArg5] = argsValue;\n const serializedKey = argsSerializer(\n keyArg1 as Arg1,\n keyArg2 as Arg2,\n keyArg3 as Arg3,\n keyArg4 as Arg4,\n keyArg5 as Arg5,\n );\n cache.set(serializedKey, returnValue);\n }\n\n const memoAsyncFn = async (\n arg1: Arg1,\n arg2: Arg2,\n arg3: Arg3,\n arg4: Arg4,\n arg5: Arg5,\n ): Promise => {\n const cacheKey = argsSerializer(arg1, arg2, arg3, arg4, arg5);\n\n const cachedResult = cache.get(cacheKey);\n\n if (cachedResult !== undefined) {\n return cachedResult;\n }\n\n const result = await fn(arg1, arg2, arg3, arg4, arg5);\n cache.set(cacheKey, result);\n return result;\n };\n\n return memoAsyncFn as FuncType, Arg1, Arg2, Arg3, Arg4, Arg5>;\n}\n","function editNestedKeyValue(objectSearch: T, keySearch: string, valueReplace: unknown): T {\n let returnValue = objectSearch;\n\n if (returnValue === undefined || returnValue === null) {\n /* Return original value */\n } else if (Array.isArray(objectSearch)) {\n returnValue = objectSearch.map(item =>\n editNestedKeyValue(item as T, keySearch, valueReplace),\n ) as unknown as T;\n } else if (typeof returnValue === 'object') {\n const objectCast = returnValue as Record;\n Object.keys(objectCast).forEach(keyObj => {\n /* Must cast to Record before using index signatures */\n const valueObj = objectCast[keyObj];\n const newValue =\n keyObj === keySearch\n ? valueReplace\n : editNestedKeyValue(valueObj, keySearch, valueReplace);\n objectCast[keyObj] = newValue;\n });\n } else {\n /* Return original value */\n }\n\n return returnValue;\n}\n\nexport default Object.freeze({\n editNestedKeyValue,\n});\n","function replaceLeading(\n input: string,\n removal: string,\n replacement = '',\n sequenceRepeats = true,\n): string {\n /* Must escape any backslashes */\n const regexPattern = `^(${removal.replace('\\\\', '\\\\\\\\')})${sequenceRepeats ? '+' : ''}`;\n const reg = new RegExp(regexPattern, 'gu');\n return input.replace(reg, replacement);\n}\n\nfunction replaceTrailing(\n input: string,\n removal: string,\n replacement = '',\n sequenceRepeats = true,\n): string {\n /* Must escape any backslashes */\n const regexPattern = `(${removal.replace('\\\\', '\\\\\\\\')})${sequenceRepeats ? '+' : ''}$`;\n const reg = new RegExp(regexPattern, 'gu');\n return input.replace(reg, replacement);\n}\n\nfunction trim(input: string, removal = ' '): string {\n return replaceLeading(replaceTrailing(input, removal), removal);\n}\n\nconst trimLeading = (input: string, removal = ' ') => replaceLeading(input, removal, '');\nconst trimTrailing = (input: string, removal = ' ') => replaceTrailing(input, removal, '');\n\nconst addLeading = (input: string, character: string) => {\n if (input.startsWith(character)) {\n return input;\n }\n return `${character}${input}`;\n};\nconst addTrailing = (input: string, character: string) => {\n if (input.endsWith(character)) {\n return input;\n }\n return `${input}${character}`;\n};\n\nexport default Object.freeze({\n trim,\n trimLeading,\n trimTrailing,\n replaceLeading,\n replaceTrailing,\n removeLeading: (input: string, removal: string) => replaceLeading(input, removal),\n removeTrailing: (input: string, removal: string) => replaceTrailing(input, removal),\n addLeading,\n addTrailing,\n});\n","/* Will actually replace any double triple etc slashes with one '/' */\nconst removeDoubleSlashes = (path: Readonly) => path.replaceAll(/\\/{2,}/gu, '/');\n\nconst ensureStartingSlash = (path: Readonly) => (path.startsWith('/') ? path : `/${path}`);\n\nconst removeTrailingSlash = (path: Readonly) =>\n path.endsWith('/') ? path.slice(0, -1) : path;\n\nconst _NoOp = (path: Readonly) => path;\n\nexport type UrlSanitizer = (path: Readonly) => string;\n\nexport interface IUrlOptions {\n requireLeadingSlash?: boolean;\n removeTrailingSlash?: boolean;\n removeDoubleSlashes?: boolean;\n operators?: UrlSanitizer[];\n}\n\nexport const UrlDefaults: Required = {\n requireLeadingSlash: true,\n removeTrailingSlash: false,\n removeDoubleSlashes: true,\n operators: [],\n};\n\nfunction sanitizePath(path: string, optionsIn?: IUrlOptions): string {\n const options: Required = {\n ...UrlDefaults,\n ...optionsIn,\n };\n\n const operators: UrlSanitizer[] = [\n ...options.operators,\n options.requireLeadingSlash ? ensureStartingSlash : _NoOp,\n options.removeTrailingSlash ? removeTrailingSlash : _NoOp,\n options.removeDoubleSlashes ? removeDoubleSlashes : _NoOp,\n ];\n\n const result = operators.reduce((currentValue, op) => op(currentValue), path);\n return result;\n}\n\nexport default Object.freeze({\n operators: {\n removeDoubleSlashes,\n ensureStartingSlash,\n removeTrailingSlash,\n },\n allOperators: [removeDoubleSlashes, ensureStartingSlash, removeTrailingSlash],\n sanitizePath,\n});\n","const clamp = (value: number, min: number, max: number): number =>\n Math.max(Math.min(value, max), min);\n\nexport default Object.freeze({\n clamp,\n});\n","import type { IProgressPromise } from '../interface/promise';\n\nasync function anyInOrder(all: (Promise | IProgressPromise)[]): Promise {\n let errorResult: Error | null = null;\n\n for (const promise of all) {\n /* eslint-disable-next-line no-await-in-loop */\n const result = await promise.catch((promiseError: Error) => promiseError);\n\n if (result instanceof Error) {\n errorResult = result;\n } else {\n return result;\n }\n }\n\n throw errorResult ?? new Error(`Failed to run promises ${String(all)}`);\n}\n\n/** Sleep promise, will await #ms milliseconds before returning */\nconst delay = (ms: number) =>\n new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n\nasync function retry(\n factory: () => Promise | IProgressPromise,\n delayBetweenRetries = 1000,\n retryCount = 0,\n): Promise {\n if (retryCount < 0) {\n throw new Error('Retry count exceeded, cannot continue (<0)');\n }\n\n const promise = factory();\n\n let response = await promise.catch((error: Error) => error);\n\n if (response instanceof Error) {\n if (delayBetweenRetries > 0) {\n await delay(delayBetweenRetries).catch(() => undefined);\n }\n\n const canRetry = retryCount > 1;\n\n if (canRetry) {\n response = await retry(factory, delayBetweenRetries, retryCount - 1);\n } else {\n throw response;\n }\n }\n\n return response;\n}\n\nexport default Object.freeze({\n anyInOrder,\n delay,\n retry,\n});\n","export enum SymbolNames {\n IBrowser = 'IBrowser',\n\n ICache = 'ICache',\n ICacheController = 'ICacheController',\n\n IConfigLog = 'IConfigLog',\n IConfigAPI = 'IConfigAPI',\n IConfigManifest = 'IConfigManifest',\n IConfigCache = 'IConfigCache',\n\n IEnv = 'IEnv',\n\n IFeatureQuery = 'IFeatureQuery',\n\n IFetch = 'IFetch',\n\n IKVStorage = 'IKVStorage',\n\n ILog = 'ILog',\n\n IMimeType = 'IMimeType',\n\n IProgressPromiseGenerator = 'IProgressPromiseGenerator',\n\n IQueryURL = 'IQueryURL',\n\n IRouter = 'IRouter',\n ITranslationStorage = 'ITranslationStorage',\n IZip = 'IZip',\n}\n\nconst TYPES = {\n IBrowser: Symbol.for(SymbolNames.IBrowser),\n\n ICache: Symbol.for(SymbolNames.ICache),\n ICacheController: Symbol.for(SymbolNames.ICacheController),\n\n IConfigLog: Symbol.for(SymbolNames.IConfigLog),\n IConfigAPI: Symbol.for(SymbolNames.IConfigAPI),\n IConfigManifest: Symbol.for(SymbolNames.IConfigManifest),\n IConfigCache: Symbol.for(SymbolNames.IConfigCache),\n\n IEnv: Symbol.for(SymbolNames.IEnv),\n\n IFeatureQuery: Symbol.for(SymbolNames.IFeatureQuery),\n\n IFetch: Symbol.for(SymbolNames.IFetch),\n\n IKVStorage: Symbol.for(SymbolNames.IKVStorage),\n\n ILog: Symbol.for(SymbolNames.ILog),\n\n IMimeType: Symbol.for(SymbolNames.IMimeType),\n\n IProgressPromiseGenerator: Symbol.for(SymbolNames.IProgressPromiseGenerator),\n\n IQueryURL: Symbol.for(SymbolNames.IQueryURL),\n\n IRouter: Symbol.for(SymbolNames.IRouter),\n ITranslationStorage: Symbol.for(SymbolNames.ITranslationStorage),\n IZip: Symbol.for(SymbolNames.IZip),\n} as const;\n\nexport default TYPES;\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type cacheFirstResponder from '../impl/cacheFirst';\nimport type oAuthTokenResponder from '../impl/cacheOAuth';\nimport type fetchToCacheResponder from '../impl/fetchToCache';\nimport type headerAppendResponder from '../impl/headerAppend';\nimport type keepAliveResponder from '../impl/keepAlive';\nimport type logDiagnosticsResponder from '../impl/logDiagnostics';\nimport type preCacheResponder from '../impl/preCache';\nimport type zipRelativePathResponder from '../impl/zipPathRelative';\n\nexport interface MESSAGE_INTERFACES {\n AddCacheFirst: typeof cacheFirstResponder;\n AddHeader: typeof headerAppendResponder;\n AddOAuthTokenCache: typeof oAuthTokenResponder;\n AddPreCache: typeof preCacheResponder;\n AddZipPathRelativeResponder: typeof zipRelativePathResponder;\n AddKeepAliveMessageResponder: typeof keepAliveResponder;\n LogDiagnostics: typeof logDiagnosticsResponder;\n FetchToCache: typeof fetchToCacheResponder;\n}\n\nexport interface IMessageInstantiator {\n allInterfaces: () => K[];\n message: (name: K) => V;\n}\n\nexport const TYPES = {\n IMessageInstantiator: Symbol.for('IMessageInstantiator'),\n};\n\nexport function injectMessageInstantiator(\n container: IContainer = injectOrBuildContainer(),\n): IMessageInstantiator {\n return container.get(TYPES.IMessageInstantiator);\n}\n\nexport function bindMessageInstantiator(\n val: IMessageInstantiator,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IMessageInstantiator, val);\n}\n\nexport function unbindMessageInstantiator(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IMessageInstantiator);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport type { IServiceWorkerClient } from './worker';\n\nexport interface IServiceWorkerController {\n start: (url: string, scope: string) => IServiceWorkerClient;\n active: () => IServiceWorkerClient | undefined;\n terminate: () => void;\n}\n\nexport const TYPES = {\n IServiceWorkerController: Symbol.for('IServiceWorkerController'),\n};\n\nexport function injectServiceWorkerController(\n container: IContainer = injectOrBuildContainer(),\n): IServiceWorkerController {\n return container.get(TYPES.IServiceWorkerController);\n}\n\nexport function bindServiceWorkerController(\n val: IServiceWorkerController,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IServiceWorkerController, val);\n}\n\nexport function unbindServiceWorkerController(\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.remove(TYPES.IServiceWorkerController);\n}\n","import type { IFetchRequest, IProgressPromise } from '@monofe/util';\n\nexport enum IServiceWorkerStatus {\n Off = 0 /* Unset */,\n Idle = 1 /* Initializing */,\n Starting = 2 /* Registering for interception */,\n Ready = 3 /* Initialized, but not intercepting requests */,\n Running = 4 /* Running & intercepting requests */,\n Stopped = 5,\n}\n\nexport type IServiceWorkerCallback = (worker: IServiceWorkerClient) => void;\n\nexport interface IServiceWorkerClient {\n status: IServiceWorkerStatus;\n start: () => void;\n stop: () => void;\n\n subscribeStatusChange: (callback: IServiceWorkerCallback) => void;\n unsubscribeStatusChange: (callback: IServiceWorkerCallback) => void;\n\n isInterceptingNetworkRequests: () => boolean;\n\n addCacheFirst: (matcher: RegExp, maxAge: number, maxEntries: number, cacheName: string) => void;\n addOAuthTokenCache: (pathSuffix: string) => void;\n addZipPathFetchResponder: (zipPath: string, relativeRespondPath: string) => void;\n addHeader: (matcher: RegExp, headerKey: string, headerVal: string, expiration: Date) => void;\n\n isRequestCached: (request: IFetchRequest, cacheName?: string) => Promise;\n addRequestsToCache: (\n requests: IFetchRequest[],\n options?: {\n cacheName?: string /* When missing attempt to find a match based on installed MessageResponders */;\n },\n ) => IProgressPromise;\n}\n","import type { IFetchRequest, ILog } from '@monofe/util';\nimport type { IMessageInstantiator } from '../../message/interface/instantiator';\nimport type { IChannelID, IRegexSerializer } from '../../util';\n\nfunction addCacheFirst(\n dependencies: {\n log: ILog;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n worker: ServiceWorker;\n },\n matcher: RegExp,\n maxAge: number,\n maxEntries: number,\n cacheName: string,\n cacheQueryOptions?: Partial,\n fetchOptions?: Partial,\n): void {\n dependencies.log.info(`Requesting cache-first handler: ${cacheName}`);\n\n const message = dependencies.message.message('AddCacheFirst').construct(\n {\n matcher,\n maxAge,\n maxEntries,\n cacheName,\n cacheQueryOptions,\n fetchOptions,\n },\n {\n regexParser: dependencies.regexParser,\n },\n );\n\n dependencies.worker.postMessage(message);\n}\n\nfunction addOAuthTokenCache(\n dependencies: {\n log: ILog;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n worker: ServiceWorker;\n },\n pathSuffix: string,\n): void {\n dependencies.log.info(`Requesting oauthTokenCache: ${pathSuffix}`);\n\n const message = dependencies.message.message('AddOAuthTokenCache').construct(\n {\n pathSuffix,\n },\n {},\n );\n\n dependencies.worker.postMessage(message);\n}\n\nfunction addZipPathFetchResponder(\n dependencies: {\n log: ILog;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n worker: ServiceWorker;\n },\n zipPath: string,\n relativeRespondPath: string,\n): void {\n dependencies.log.info(`Requesting zipPathResponder: ${zipPath}`);\n\n const message = dependencies.message.message('AddZipPathRelativeResponder').construct(\n {\n zipPath,\n relativeRespondPath,\n },\n {},\n );\n\n dependencies.worker.postMessage(message);\n}\n\nfunction addHeader(\n dependencies: {\n log: ILog;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n worker: ServiceWorker;\n },\n matcher: RegExp,\n headerKey: string,\n headerVal: string,\n expiration: Date,\n): void {\n dependencies.log.info(`Requesting addHeader: ${headerKey}:${headerVal}`);\n\n const message = dependencies.message.message('AddHeader').construct(\n {\n matcher,\n headerKey,\n headerVal,\n expiration,\n },\n {\n regexParser: dependencies.regexParser,\n },\n );\n\n dependencies.worker.postMessage(message);\n}\n\nfunction fetchToCache(\n dependencies: {\n log: ILog;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n worker: ServiceWorker;\n },\n requests: IFetchRequest[],\n cacheName?: string,\n port?: IChannelID,\n): void {\n dependencies.log.verbose(\n `Request fetch to cache download: ${JSON.stringify(requests.map(req => req.url))}`,\n );\n\n const message = dependencies.message.message('FetchToCache').construct(\n {\n requests,\n cacheName,\n callbackChannel: port,\n },\n {},\n );\n\n dependencies.worker.postMessage(message);\n}\n\nfunction keepAlive(dependencies: {\n log: ILog;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n worker: ServiceWorker;\n}): void {\n const message = dependencies.message.message('AddKeepAliveMessageResponder').construct({}, {});\n\n dependencies.worker.postMessage(message);\n}\nexport default Object.freeze({\n addCacheFirst,\n addOAuthTokenCache,\n addZipPathFetchResponder,\n addHeader,\n fetchToCache,\n keepAlive,\n});\n","function isLocalHost(): boolean {\n const isWindowDefined = typeof window !== 'undefined';\n\n const hostName = isWindowDefined ? window.location.hostname : '';\n\n if (hostName === 'localhost') {\n return true;\n }\n\n if (hostName === '[::1]') {\n return true;\n }\n\n if (/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/.exec(hostName)) {\n return true;\n }\n\n return false;\n}\n\nexport default Object.freeze({\n isLocalHost,\n});\n","import type { ILog } from '@monofe/util';\nimport host from './host';\n\nexport interface IRegistrationConfig {\n scope?: string;\n onRegister?: (registration: ServiceWorkerRegistration) => void;\n onReady?: (worker: ServiceWorker) => void;\n onInstall?: (worker: ServiceWorker) => void;\n}\n\nconst _hasServiceWorker = (): boolean => 'serviceWorker' in navigator;\n\nconst _fetchServiceWorker = (swUrl: string): Promise =>\n fetch(swUrl, {\n headers: {\n 'Service-Worker': 'script',\n },\n });\n\ninterface IServiceWorkerRegisterable {\n isValid: boolean;\n description: string;\n}\n\nasync function _checkValidServiceWorker(swUrl: string): Promise {\n const result: IServiceWorkerRegisterable = {\n isValid: false,\n description: '',\n };\n\n const response = await _fetchServiceWorker(swUrl).catch(() => undefined);\n\n const didFindFile = (response?.status ?? 0) >= 200 && (response?.status ?? 0) <= 299;\n const isJavascriptFile =\n (response?.headers.get('content-type')?.indexOf('javascript') ?? -1) !== -1;\n\n if (!response) {\n result.description = 'No internet connection found. App is running in offline mode.';\n } else if (!didFindFile) {\n result.description = 'Unable to find service worker file';\n } else if (!isJavascriptFile) {\n result.description =\n `Service worker has wrong mime type: ${response.headers.get('content-type') ?? ''}` ||\n 'unknown';\n } else {\n result.isValid = true;\n }\n\n return result;\n}\n\nasync function _canRegister(swUrl: string): Promise {\n let canRegister = false;\n\n if (host.isLocalHost()) {\n /* This is running on localhost. Let's check if a service worker still exists or not. */\n const { isValid } = await _checkValidServiceWorker(swUrl);\n canRegister = isValid;\n } else {\n /* Is not localhost. Just register service worker */\n canRegister = true;\n }\n\n return canRegister;\n}\n\nfunction _registerWorker(\n log: ILog,\n swUrl: string,\n config?: IRegistrationConfig,\n): Promise {\n const scope = config?.scope ?? '.';\n\n log.info(`Registering worker url:'${swUrl}' to scope:'${scope}'`);\n\n return navigator.serviceWorker.register(swUrl, { scope });\n}\n\nfunction _addRegistrationCallbacks(\n log: ILog,\n registration: ServiceWorkerRegistration,\n config?: IRegistrationConfig,\n): void {\n log.info('Registration completed, awaiting SW installed/activated status');\n\n function _processState(this: ServiceWorker): void {\n switch (this.state) {\n case 'installing':\n case 'installed':\n log.info(`Worker is install(ed), ${this.state}`);\n config?.onInstall?.(this);\n break;\n\n case 'activating':\n case 'activated':\n log.info(`Worker is up and running, ${this.state}`);\n config?.onReady?.(this);\n break;\n\n default:\n log.info(`Worker state updated to: ${this.state}`);\n break;\n }\n }\n\n const onRegistrationUpdate = (): void => {\n const newWorker = registration.installing;\n\n if (newWorker) {\n newWorker.onstatechange = _processState;\n }\n };\n\n registration.onupdatefound = onRegistrationUpdate;\n\n if (registration.waiting) {\n registration.waiting.onstatechange = _processState;\n }\n\n if (registration.installing) {\n registration.installing.onstatechange = _processState;\n }\n\n if (registration.active) {\n registration.active.onstatechange = _processState;\n registration\n .update()\n .then(() => {\n log.verbose('Registration updated');\n })\n .catch((error: Error) => {\n log.error(`Update failed: ${error.message}`);\n });\n\n _processState.call(registration.active);\n }\n\n /* Run through now, incase we are already in final state */\n}\n\nfunction start(log: ILog, swUrl: string, config?: IRegistrationConfig): Promise {\n if (!_hasServiceWorker()) {\n log.error('Unable to register, no service worker');\n return Promise.resolve();\n }\n\n const startRegistration = async function (): Promise {\n if (await _canRegister(swUrl)) {\n log.info(`Starting SW ${swUrl} registration`);\n _registerWorker(log, swUrl, config)\n .then(reg => {\n config?.onRegister?.(reg);\n _addRegistrationCallbacks(log, reg, config);\n })\n .catch(error => {\n log.error(`Registering new worker failed: ${JSON.stringify(error)}`);\n });\n } else {\n log.warn(\n 'No service worker found, Probably a different app. Will reload the page on SW unregister',\n );\n navigator.serviceWorker.ready\n .then(registration => registration.unregister())\n .then(() => {\n window.location.reload();\n })\n .catch((error: Error) => {\n log.error(`Failed to unregister SW: ${error.message}`);\n });\n }\n };\n\n return new Promise((resolve, reject) => {\n const start = (): void => {\n startRegistration()\n .then(() => {\n resolve();\n })\n .catch(error => {\n reject(error);\n });\n };\n\n const hasDOMLoaded = document.readyState === 'complete';\n\n /* Delay registration. Don't degrade the first visit experience. */\n if (hasDOMLoaded) {\n start();\n } else {\n window.addEventListener('load', start);\n }\n });\n}\n\nfunction stop(log: ILog, registration: ServiceWorkerRegistration): void {\n registration.unregister().catch(error => {\n log.error(`Failed to register onload: ${JSON.stringify(error)}`);\n });\n}\n\nexport default Object.freeze({\n start,\n stop,\n});\n","import type { IConfigCache, IConfigCacheAssets, IConfigCacheOAuthToken, ILog } from '@monofe/util';\nimport type { IMessageInstantiator } from '../../message/interface/instantiator';\nimport type { IRegexSerializer } from '../../util';\nimport bridge from './dispatch';\n\nfunction _isConfigToken(object: unknown): object is IConfigCacheOAuthToken {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return !isNullOrUndefined(record.tokenPath);\n}\n\nfunction _isConfigAsset(object: unknown): object is IConfigCacheAssets {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.cacheName) &&\n !isNullOrUndefined(record.expiration) &&\n !isNullOrUndefined(record.maxEntries) &&\n !isNullOrUndefined(record.matcher)\n );\n}\n\nfunction _tokenConfigs(config: IConfigCache): IConfigCacheOAuthToken[] {\n const arr: IConfigCacheOAuthToken[] = [];\n\n for (const settings of Object.values(config)) {\n if (!_isConfigToken(settings)) {\n continue;\n }\n arr.push(settings);\n }\n\n return arr;\n}\n\nfunction _assetConfigs(config: IConfigCache): IConfigCacheAssets[] {\n const arr: IConfigCacheAssets[] = [];\n\n for (const settings of Object.values(config)) {\n if (!_isConfigAsset(settings)) {\n continue;\n }\n arr.push(settings);\n }\n\n return arr;\n}\n\nfunction setupSWRules(\n log: ILog,\n regexParser: IRegexSerializer,\n message: IMessageInstantiator,\n worker: ServiceWorker,\n config: IConfigCache,\n): void {\n log.info('SW-Rules, Adding Cache First');\n\n const deps = {\n log,\n regexParser,\n message,\n worker,\n config,\n };\n\n for (const settings of _assetConfigs(config)) {\n log.info(\n `SW-Rules, Registering cache-first: ${settings.cacheName}, ${JSON.stringify(settings)}`,\n );\n bridge.addCacheFirst(\n deps,\n /* Matcher: */ settings.matcher,\n /* MaxAge: */ settings.expiration,\n /* MaxEntries: */ settings.maxEntries,\n /* CacheName */ settings.cacheName,\n /* Ignore-search */ settings.cacheQueryOptions ?? {},\n /* Fetch overrides */ settings.fetchOptions ?? {},\n );\n }\n\n for (const settings of _tokenConfigs(config)) {\n log.info(`SW-Rules, Adding OAuth Token Cache: %{settings.tokenPath}`);\n bridge.addOAuthTokenCache(deps, settings.tokenPath);\n }\n}\n\nexport default Object.freeze(setupSWRules);\n","import type {\n IConfigCache,\n IFetcher,\n IFetchRequest,\n ILog,\n IProgressPromise,\n IProgressPromiseGenerator,\n} from '@monofe/util';\nimport type { ICallbackMessage } from '../../message/interface/fetchToCache';\nimport type { IMessageInstantiator } from '../../message/interface/instantiator';\nimport type { IRegexSerializer } from '../../util/interface';\nimport type { IChannelController } from '../../util/interface/channel';\nimport { IChannelStatus } from '../../util/interface/channel';\nimport type { IServiceWorkerCallback, IServiceWorkerClient } from '../interface/worker';\nimport { IServiceWorkerStatus } from '../interface/worker';\nimport dispatch from './dispatch';\nimport registration from './registration';\nimport rules from './rules';\n\nconst WORKER_KEEP_ALIVE_DELAY_MS = 5000; /* 5s */\n\ninterface IServiceWorkerPrivate extends IServiceWorkerClient {\n registration: ServiceWorkerRegistration | null;\n worker: ServiceWorker | null;\n statusChangeCallbacks: IServiceWorkerCallback[];\n}\n\ninterface IServiceWorkerDependencies {\n log: ILog;\n fetcher: IFetcher;\n promiser: IProgressPromiseGenerator;\n config: IConfigCache;\n regexParser: IRegexSerializer;\n message: IMessageInstantiator;\n channelController: IChannelController;\n}\n\nasync function _requestInNamedCache(request: Request, cacheName: string): Promise {\n const cache = await caches.open(cacheName);\n const response = await cache.match(request, {\n ignoreMethod: true,\n ignoreSearch: true,\n });\n\n const hasCachedValue = response !== undefined;\n return hasCachedValue;\n}\n\nconst _notifyCallbacksOfStatusChange = (worker: IServiceWorkerPrivate): void => {\n for (const callback of worker.statusChangeCallbacks) {\n callback(worker as IServiceWorkerClient);\n }\n};\n\nconst _obtainScreenLock = (): Promise<{ release: () => void }> =>\n 'wakeLock' in navigator\n ? navigator.wakeLock.request('screen')\n : Promise.resolve({\n release: (): void => {\n /* No-Op */\n },\n });\n\nfunction _promiseWithScreenLock(\n promiser: IProgressPromiseGenerator,\n wrappedPromise: IProgressPromise,\n): IProgressPromise {\n return promiser.async(async progressCallback => {\n const lock = await _obtainScreenLock();\n\n wrappedPromise.onProgress(newProgress => {\n progressCallback(newProgress);\n });\n\n const result: T | Error = await wrappedPromise.catch((error: Error) => error);\n\n lock.release();\n\n if (result instanceof Error) {\n throw result;\n } else {\n return result;\n }\n });\n}\n\nfunction _downloadRequests(\n dependencies: IServiceWorkerDependencies & { worker: ServiceWorker },\n channelID: string,\n requests: IFetchRequest[],\n options?: {\n cacheName?: string;\n },\n): IProgressPromise {\n return dependencies.promiser.promise((resolve, reject, progress) => {\n const channel = dependencies.channelController.channel(channelID);\n\n const subKey = 'client-callback';\n\n const fetchDeps = { ...dependencies };\n\n /* Service Workers are hunted down & killed shortly after being dispatched to. \n To keep this from happening, we *must* periodically send a message to the service worker, \n this will prevent Chrome (Safari is OK) from pausing execution. \n It becomes apparent on larger downloads on Android-Chrome I.e. Orkney-Mainland\n Attaching Chrome DevTools will *prevent* this issue from occurring too.\n https://stackoverflow.com/questions/42733835/service-worker-termination-by-a-timeout-timer-was-canceled-because-devtools-is-a \n */\n const keepAliveTimer = setInterval(() => {\n dispatch.keepAlive(fetchDeps);\n }, WORKER_KEEP_ALIVE_DELAY_MS);\n\n const cleanup = () => {\n channel.removeListener(subKey, 'NewMessage');\n channel.removeListener(subKey, 'Error');\n channel.removeListener(subKey, 'StatusChanged');\n\n clearInterval(keepAliveTimer);\n };\n\n const processMessage = (message: ICallbackMessage) => {\n if (message.error !== undefined) {\n cleanup();\n reject(message.error);\n } else if (message.done || message.progress >= 1) {\n cleanup();\n resolve();\n } else if (message.progress < 1) {\n progress(message.progress);\n }\n };\n\n channel.addEventListener('client-callback', 'NewMessage', message => {\n const payload = message as ICallbackMessage;\n processMessage(payload);\n });\n\n channel.addEventListener(subKey, 'Error', error => {\n processMessage({\n error: `FetchToCache message failed: ${JSON.stringify(error)}`,\n progress: -1,\n done: false,\n });\n });\n\n channel.addEventListener(subKey, 'StatusChanged', status => {\n if (status === IChannelStatus.Expired) {\n processMessage({\n error: `Message channel: ${channelID} expired`,\n progress: -1,\n done: false,\n });\n }\n });\n\n dispatch.fetchToCache(fetchDeps, requests, options?.cacheName, channelID);\n });\n}\n\nfunction _installWorker(\n dependencies: IServiceWorkerDependencies & { controller: IServiceWorkerPrivate },\n url: string,\n scope: string,\n) {\n let hasInstalledRules = false;\n\n const _installRules = (worker: ServiceWorker): void => {\n if (hasInstalledRules) {\n return;\n }\n hasInstalledRules = true;\n\n rules(\n dependencies.log,\n dependencies.regexParser,\n dependencies.message,\n worker,\n dependencies.config,\n );\n };\n\n const _onReady = (worker: ServiceWorker): void => {\n dependencies.controller.worker = worker;\n\n dependencies.controller.status = IServiceWorkerStatus.Ready;\n _notifyCallbacksOfStatusChange(dependencies.controller);\n\n _installRules(worker);\n\n const checkControllerStatus = (): void => {\n dependencies.controller.status = dependencies.controller.isInterceptingNetworkRequests()\n ? IServiceWorkerStatus.Running\n : IServiceWorkerStatus.Ready;\n _notifyCallbacksOfStatusChange(dependencies.controller);\n };\n\n navigator.serviceWorker.addEventListener('controllerchange', checkControllerStatus);\n\n checkControllerStatus();\n\n /* Cleanup: unsubscribe & remove event listener when we are no longer in ready state */\n const statusChangeCallback = (swCallback: IServiceWorkerClient): void => {\n const shouldUnsubscribe =\n swCallback.status !== IServiceWorkerStatus.Ready &&\n swCallback.status !== IServiceWorkerStatus.Running;\n\n if (shouldUnsubscribe) {\n navigator.serviceWorker.removeEventListener(\n 'controllerchange',\n checkControllerStatus,\n );\n dependencies.controller.unsubscribeStatusChange(statusChangeCallback);\n }\n };\n\n dependencies.controller.subscribeStatusChange(statusChangeCallback);\n };\n\n const _onInstall = (worker: ServiceWorker): void => {\n _installRules(worker);\n dependencies.controller.worker = worker;\n };\n\n registration\n .start(dependencies.log, url, {\n scope,\n onInstall: _onInstall,\n onReady: _onReady,\n onRegister: reg => {\n dependencies.controller.registration = reg;\n },\n })\n .catch(error => {\n dependencies.log.error(`Failed to start registration: ${JSON.stringify(error)}`);\n dependencies.controller.status = IServiceWorkerStatus.Off;\n });\n\n dependencies.log.info('Starting service-worker');\n dependencies.controller.status = IServiceWorkerStatus.Starting;\n _notifyCallbacksOfStatusChange(dependencies.controller);\n}\n\nfunction ServiceWorker(\n dependencies: IServiceWorkerDependencies,\n url: string,\n scope: string,\n): IServiceWorkerClient {\n const controller: IServiceWorkerPrivate = {\n status: IServiceWorkerStatus.Idle,\n registration: null,\n worker: null,\n statusChangeCallbacks: [],\n isInterceptingNetworkRequests: () => navigator.serviceWorker.controller !== null,\n start: () => {\n _installWorker({ ...dependencies, controller }, url, scope);\n },\n subscribeStatusChange: (callback: IServiceWorkerCallback) => {\n controller.statusChangeCallbacks.push(callback);\n },\n unsubscribeStatusChange: (callback: IServiceWorkerCallback) => {\n controller.statusChangeCallbacks = controller.statusChangeCallbacks.filter(\n callback_ => callback_ !== callback,\n );\n },\n stop: () => {\n if (!controller.registration) {\n dependencies.log.error('Worker not registered, skipping stop');\n return;\n }\n controller.status = IServiceWorkerStatus.Stopped;\n _notifyCallbacksOfStatusChange(controller);\n registration.stop(dependencies.log, controller.registration);\n },\n addCacheFirst: (matcher: RegExp, maxAge: number, maxEntries: number, cacheName: string) => {\n if (!controller.worker) {\n dependencies.log.error('Worker not registered!, Skipping addCacheFirst');\n return;\n }\n dependencies.log.info(`Registering cache-first: ${cacheName}`);\n dispatch.addCacheFirst(\n { ...dependencies, worker: controller.worker },\n matcher,\n maxAge,\n maxEntries,\n cacheName,\n );\n },\n addOAuthTokenCache: (pathSuffix: string) => {\n if (!controller.worker) {\n dependencies.log.error('Worker not registered!, Skipping addOAuthCache');\n return;\n }\n dependencies.log.info(`Registering oauthTokenCache: ${pathSuffix}`);\n dispatch.addOAuthTokenCache({ ...dependencies, worker: controller.worker }, pathSuffix);\n },\n addZipPathFetchResponder: (zipPath: string, relativeRespondPath: string) => {\n if (!controller.worker) {\n dependencies.log.error('Worker not registered!, Skipping addZipPathFetchResponder');\n return;\n }\n dependencies.log.info(`Registering zipPathResponder: ${zipPath}`);\n dispatch.addZipPathFetchResponder(\n { ...dependencies, worker: controller.worker },\n zipPath,\n relativeRespondPath,\n );\n },\n addHeader: (matcher: RegExp, headerKey: string, headerValue: string, expiration: Date) => {\n if (!controller.worker) {\n dependencies.log.error('Worker not registered!, Skipping addHeader');\n return;\n }\n dependencies.log.info(`Registering addHeader: ${headerKey}:${headerValue}`);\n dispatch.addHeader(\n { ...dependencies, worker: controller.worker },\n matcher,\n headerKey,\n headerValue,\n expiration,\n );\n },\n isRequestCached: async (request: IFetchRequest, cacheName?: string): Promise => {\n if (window.caches === undefined) {\n throw new Error('No caches found');\n }\n const cacheNames = [cacheName];\n const requestCheck = new Request(request.url, {\n method: request.method,\n body: request.body,\n });\n const results = await Promise.all(\n cacheNames.map(name => _requestInNamedCache(requestCheck, cacheName ?? '')),\n );\n const anyCacheHits = results.reduce((previous, current) => previous || current);\n return anyCacheHits;\n },\n addRequestsToCache: (\n requests: IFetchRequest[],\n options?: {\n cacheName?: string;\n },\n ): IProgressPromise => {\n const worker = controller.worker;\n if (!worker) {\n throw new Error(`No service-worker running, aborting request to cache`);\n }\n const channelID = requests[requests.length - 1]?.url;\n if (channelID === undefined)\n throw new Error('No channelID found when attempting to add requests to cache');\n return _promiseWithScreenLock(\n dependencies.promiser,\n _downloadRequests({ ...dependencies, worker }, channelID, requests, options),\n );\n },\n };\n\n return controller;\n}\n\nexport default Object.freeze(ServiceWorker);\n","import type { IServiceWorkerClient } from '../interface';\nimport type { IServiceWorkerController } from '../interface/controller';\nimport serviceWorker from './worker';\n\nfunction controller(deps: Parameters[0]): Promise {\n let activeWorker: IServiceWorkerClient | null = null;\n\n return Promise.resolve({\n start: (url: string, scope: string): IServiceWorkerClient => {\n deps.log.verbose('Starting Service-Worker');\n activeWorker?.stop();\n activeWorker = serviceWorker(deps, url, scope);\n activeWorker.start();\n return activeWorker;\n },\n active: (): IServiceWorkerClient | undefined => activeWorker ?? undefined,\n terminate: (): void => {\n deps.log.verbose('Terminating Service-Worker');\n activeWorker?.stop();\n activeWorker = null;\n },\n });\n}\n\nexport default Object.freeze(controller);\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport {\n injectConfigCache,\n injectFetch,\n injectLog,\n injectProgressPromise,\n TYPES as UTIL_TYPES,\n} from '@monofe/util';\nimport {\n injectMessageInstantiator,\n TYPES as MESSAGE_TYPES,\n} from '../../message/interface/instantiator';\nimport { injectChannelController, TYPES as WORKER_TYPES } from '../../util/interface';\nimport { injectRegexSerializer } from '../../util/interface/regex';\nimport type { IServiceWorkerController } from '../interface/controller';\nimport {\n bindServiceWorkerController,\n injectServiceWorkerController,\n TYPES,\n unbindServiceWorkerController,\n} from '../interface/controller';\nimport controller from './controller';\n\nfunction _build(container: IContainer): Promise> {\n const deps = {\n log: injectLog(container),\n fetcher: injectFetch(container),\n promiser: injectProgressPromise(container),\n config: injectConfigCache(container),\n regexParser: injectRegexSerializer(container),\n message: injectMessageInstantiator(container),\n channelController: injectChannelController(container),\n };\n\n return Object.freeze(controller(deps));\n}\n\nexport default buildBindable({\n id: TYPES.IServiceWorkerController,\n dependencies: [\n UTIL_TYPES.ILog,\n UTIL_TYPES.IFetch,\n UTIL_TYPES.IProgressPromiseGenerator,\n UTIL_TYPES.IConfigCache,\n WORKER_TYPES.IRegexSerializer,\n MESSAGE_TYPES.IMessageInstantiator,\n WORKER_TYPES.IChannelController,\n ],\n bind: bindServiceWorkerController,\n remove: unbindServiceWorkerController,\n inject: injectServiceWorkerController,\n build: container => _build(container),\n});\n","import { buildBinderListings } from '@monofe/di';\nimport serviceWorker from './impl/controller.bind';\n\nexport default buildBinderListings([serviceWorker]);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'ADDROUTE_CACHEFIRST';\n\nexport interface IMessageCacheFirstPayload extends IMessageBase {\n type: 'ADDROUTE_CACHEFIRST';\n payload: {\n matcher: string;\n maxAge: number;\n maxEntries: number;\n cacheName: string;\n cacheQueryOptions?: Partial;\n fetchOptions?: Partial;\n };\n}\n","import type { IRegexSerializer } from '../../util';\nimport type { IMessage } from '../interface/base';\nimport type { IMessageCacheFirstPayload } from '../interface/cacheFirst';\nimport { MESSAGE_TYPE } from '../interface/cacheFirst';\n\nfunction construct(\n args: {\n matcher: RegExp;\n maxAge: number;\n maxEntries: number;\n cacheName: string;\n cacheQueryOptions?: Partial;\n fetchOptions?: Partial;\n },\n deps: { regexParser: IRegexSerializer },\n): IMessageCacheFirstPayload {\n return {\n type: MESSAGE_TYPE,\n payload: {\n matcher: deps.regexParser.stringify(\n args.matcher,\n ) /* Regex not serializable by JSON.stringify */,\n maxAge: args.maxAge,\n maxEntries: args.maxEntries,\n cacheName: args.cacheName,\n cacheQueryOptions: args.cacheQueryOptions,\n fetchOptions: args.fetchOptions,\n },\n };\n}\n\nfunction isMatch(object: unknown): object is IMessageCacheFirstPayload {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n !isNullOrUndefined(record.payload?.matcher) &&\n !isNullOrUndefined(record.payload?.maxAge) &&\n !isNullOrUndefined(record.payload?.maxEntries) &&\n !isNullOrUndefined(record.payload?.cacheName) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nconst controller: IMessage<\n IMessageCacheFirstPayload,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'ADDROUTE_CACHEOAUTHTOKEN';\n\nexport interface IMessageOAuthTokenPayload extends IMessageBase {\n type: 'ADDROUTE_CACHEOAUTHTOKEN';\n payload: {\n pathSuffix: string;\n };\n}\n","import type { IMessage } from '../interface/base';\nimport type { IMessageOAuthTokenPayload } from '../interface/cacheOAuth';\nimport { MESSAGE_TYPE } from '../interface/cacheOAuth';\n\nfunction construct(\n args: { pathSuffix: string },\n deps: Record,\n): IMessageOAuthTokenPayload {\n return {\n type: MESSAGE_TYPE,\n payload: {\n pathSuffix: args.pathSuffix,\n },\n };\n}\n\nfunction isMatch(object: unknown): object is IMessageOAuthTokenPayload {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n !isNullOrUndefined(record.payload?.pathSuffix) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nconst controller: IMessage<\n IMessageOAuthTokenPayload,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IFetchRequest } from '@monofe/util';\nimport type { IChannelID } from '../../util/interface/channel';\nimport type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'CACHE_FETCH';\n\nexport interface ICallbackMessage {\n error?: string;\n progress: number;\n done: boolean;\n}\n\nexport interface IMessageFetchToCachePayload extends IMessageBase {\n type: 'CACHE_FETCH';\n payload: {\n requests: IFetchRequest[];\n cacheName?: string;\n callbackChannel?: IChannelID | undefined;\n };\n}\n","import type { IFetchRequest } from '@monofe/util';\nimport type { IChannelID } from '../../util/interface/channel';\nimport type { IMessage } from '../interface/base';\nimport type { IMessageFetchToCachePayload } from '../interface/fetchToCache';\nimport { MESSAGE_TYPE } from '../interface/fetchToCache';\n\nfunction isMatch(object: unknown): object is IMessageFetchToCachePayload {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial =\n object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n !isNullOrUndefined(record.payload?.requests) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nfunction construct(\n args: {\n requests: IFetchRequest[];\n cacheName?: string;\n callbackChannel?: IChannelID;\n },\n deps: Record,\n): IMessageFetchToCachePayload {\n return {\n type: MESSAGE_TYPE,\n payload: args,\n };\n}\n\nconst controller: IMessage<\n IMessageFetchToCachePayload,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'ADDROUTE_HEADERAPPEND';\n\nexport interface IMessageHeaderAppendResponderPayload extends IMessageBase {\n type: 'ADDROUTE_HEADERAPPEND';\n payload: {\n matcher: string;\n key: string;\n val: string;\n expiration: number;\n };\n}\n","import type { IRegexSerializer } from '../../util';\nimport type { IMessage } from '../interface/base';\nimport type { IMessageHeaderAppendResponderPayload } from '../interface/headerAppend';\nimport { MESSAGE_TYPE } from '../interface/headerAppend';\n\nfunction construct(\n args: {\n matcher: RegExp;\n headerKey: string;\n headerVal: string;\n expiration: Date;\n },\n deps: { regexParser: IRegexSerializer },\n): IMessageHeaderAppendResponderPayload {\n return {\n type: MESSAGE_TYPE,\n payload: {\n matcher: deps.regexParser.stringify(args.matcher),\n key: args.headerKey,\n val: args.headerVal,\n expiration: args.expiration.getTime(),\n },\n };\n}\n\nfunction isMatch(object: unknown): object is IMessageHeaderAppendResponderPayload {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial =\n object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n !isNullOrUndefined(record.payload?.matcher) &&\n !isNullOrUndefined(record.payload?.key) &&\n !isNullOrUndefined(record.payload?.val) &&\n !isNullOrUndefined(record.payload?.expiration) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nconst controller: IMessage<\n IMessageHeaderAppendResponderPayload,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'KEEP_ALIVE';\n\nexport interface IMessageKeepAlive extends IMessageBase {\n type: 'KEEP_ALIVE';\n payload: Record;\n}\n","import type { IMessage } from '../interface/base';\nimport type { IMessageKeepAlive } from '../interface/keepAlive';\nimport { MESSAGE_TYPE } from '../interface/keepAlive';\n\nfunction isMatch(object: unknown): object is IMessageKeepAlive {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nfunction construct(deps: Record, args: Record): IMessageKeepAlive {\n return {\n type: MESSAGE_TYPE,\n payload: {},\n };\n}\n\nconst controller: IMessage<\n IMessageKeepAlive,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'LOG_DIAGNOSTICS';\n\nexport interface IMessageLogDiagnostics extends IMessageBase {\n type: 'LOG_DIAGNOSTICS';\n payload: Record;\n}\n","import type { IMessage } from '../interface/base';\nimport type { IMessageLogDiagnostics } from '../interface/logDiagnostics';\nimport { MESSAGE_TYPE } from '../interface/logDiagnostics';\n\nfunction construct(\n args: Record,\n deps: Record,\n): IMessageLogDiagnostics {\n return {\n type: MESSAGE_TYPE,\n payload: {},\n };\n}\n\nfunction isMatch(object: unknown): object is IMessageLogDiagnostics {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return !isNullOrUndefined(record.type) && record.type === MESSAGE_TYPE;\n}\n\nconst controller: IMessage<\n IMessageLogDiagnostics,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'ADDROUTE_PRECACHE';\n\nexport interface IMessagePreCachePayload extends IMessageBase {\n type: 'ADDROUTE_PRECACHE';\n payload: {\n paths: string[];\n };\n}\n","import type { IMessage } from '../interface/base';\nimport type { IMessagePreCachePayload } from '../interface/preCache';\nimport { MESSAGE_TYPE } from '../interface/preCache';\n\nfunction construct(\n args: { paths: string[] },\n deps: Record,\n): IMessagePreCachePayload {\n return {\n type: MESSAGE_TYPE,\n payload: {\n paths: args.paths,\n },\n };\n}\n\nfunction isMatch(object: unknown): object is IMessagePreCachePayload {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial = object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n !isNullOrUndefined(record.payload?.paths) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nconst controller: IMessage<\n IMessagePreCachePayload,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import type { IMessageBase } from './base';\n\nexport const MESSAGE_TYPE = 'ADDROUTE_ZIPRELATIVEPATH';\n\nexport interface IMessageZipRelativePathResponderPayload extends IMessageBase {\n type: 'ADDROUTE_ZIPRELATIVEPATH';\n payload: {\n zipPath: string;\n relativeRespondPath: string;\n };\n}\n","import type { IMessage } from '../interface/base';\nimport type { IMessageZipRelativePathResponderPayload } from '../interface/zipPathRelative';\nimport { MESSAGE_TYPE } from '../interface/zipPathRelative';\n\nfunction isMatch(object: unknown): object is IMessageZipRelativePathResponderPayload {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record: Partial =\n object as Partial;\n\n return (\n !isNullOrUndefined(record.type) &&\n !isNullOrUndefined(record.payload) &&\n !isNullOrUndefined(record.payload?.zipPath) &&\n !isNullOrUndefined(record.payload?.relativeRespondPath) &&\n record.type === MESSAGE_TYPE\n );\n}\n\nfunction construct(\n args: {\n zipPath: string;\n relativeRespondPath: string;\n },\n deps: Record,\n): IMessageZipRelativePathResponderPayload {\n return {\n type: MESSAGE_TYPE,\n payload: {\n zipPath: args.zipPath,\n relativeRespondPath: args.relativeRespondPath,\n },\n };\n}\n\nconst controller: IMessage<\n IMessageZipRelativePathResponderPayload,\n Parameters[0],\n Parameters[1]\n> = {\n construct,\n isMatch,\n};\n\nexport default Object.freeze(controller);\n","import cacheFirstResponder from '../impl/cacheFirst';\nimport oAuthTokenResponder from '../impl/cacheOAuth';\nimport fetchToCacheResponder from '../impl/fetchToCache';\nimport headerAppendResponder from '../impl/headerAppend';\nimport keepAliveResponder from '../impl/keepAlive';\nimport logDiagnosticsResponder from '../impl/logDiagnostics';\nimport preCacheResponder from '../impl/preCache';\nimport zipRelativePathResponder from '../impl/zipPathRelative';\nimport type { MESSAGE_INTERFACES } from '../interface/instantiator';\n\nconst InstantiateMap: MESSAGE_INTERFACES = {\n AddCacheFirst: cacheFirstResponder,\n AddHeader: headerAppendResponder,\n AddOAuthTokenCache: oAuthTokenResponder,\n AddPreCache: preCacheResponder,\n AddZipPathRelativeResponder: zipRelativePathResponder,\n AddKeepAliveMessageResponder: keepAliveResponder,\n LogDiagnostics: logDiagnosticsResponder,\n FetchToCache: fetchToCacheResponder,\n};\n\nexport default Object.freeze({\n allInterfaces: () => Object.keys(InstantiateMap) as K[],\n message: (name: K) =>\n InstantiateMap[name] as V,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IMessageInstantiator } from '../../message/interface/instantiator';\nimport {\n bindMessageInstantiator,\n injectMessageInstantiator,\n TYPES,\n unbindMessageInstantiator,\n} from '../../message/interface/instantiator';\nimport instantiator from './instantiator';\n\nexport default buildBindable({\n id: TYPES.IMessageInstantiator,\n bind: bindMessageInstantiator,\n remove: unbindMessageInstantiator,\n inject: injectMessageInstantiator,\n build: () => Promise.resolve(instantiator),\n});\n","import { buildBinderListings } from '@monofe/di';\nimport instantiator from './util/instantiator.bind';\n\nexport default buildBinderListings([instantiator]);\n","const CACHE_SEARCH_PARAMS = Object.freeze({\n ignoreMethod: true,\n ignoreSearch: true,\n});\n\nconst _openCache = (name: string): Promise =>\n /* Caches not always available on every browser. *MUST* check */\n /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */\n caches === undefined ? Promise.reject(new Error('No caches available')) : caches.open(name);\n\nconst _insertToCache = (cache: Cache, request: Request, response: Response): Promise =>\n cache.put(request, response);\n\nconst _isInCache = async (cache: Cache, request: Request): Promise => {\n const result = await caches.match(request, CACHE_SEARCH_PARAMS).catch(() => undefined);\n return Boolean(result);\n};\n\nexport default Object.freeze({\n open: _openCache,\n insert: _insertToCache,\n exists: _isInCache,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { ICacheStorage } from '../interface/cache';\nimport { bindCacheStorage, injectCacheStorage, unbindCacheStorage } from '../interface/cache';\nimport TYPES from '../interface/types';\nimport cacheStorage from './cache';\n\nexport default buildBindable({\n id: TYPES.ICacheStorage,\n dependencies: [],\n bind: bindCacheStorage,\n remove: unbindCacheStorage,\n inject: injectCacheStorage,\n build: container => Promise.resolve(cacheStorage),\n});\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport interface ICallbackController {\n subscribe: (\n callback: Callback,\n event: Event,\n key?: string,\n ) => void;\n unsubscribe: (\n callback: Callback,\n event: Event,\n ) => void;\n search: (\n subscriberKey: string,\n event: Event,\n ) => Callback[] | undefined;\n eventListeners: (\n event: Event,\n ) => Callback[];\n}\n\nexport interface ICallbackBuilder {\n build: () => ICallbackController;\n}\n\nexport function injectCallbackBuilder(\n container: IContainer = injectOrBuildContainer(),\n): ICallbackBuilder {\n return container.get(TYPES.ICallbackBuilder);\n}\n\nexport function bindCallbackBuilder(\n val: ICallbackBuilder,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ICallbackBuilder, val);\n}\n\nexport function unbindCallbackBuilder(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ICallbackBuilder);\n}\n","import type { ICallbackController } from '../interface/callback';\n\ninterface ICallbackRecord {\n name: string;\n callback: Callback;\n}\n\nfunction callbackRegistry(): ICallbackController {\n const state: Partial<{\n [Event in keyof CallbackMap]: ICallbackRecord[];\n }> = {};\n\n const controller: ICallbackController = {\n subscribe: (\n callback: Callback,\n event: Event,\n key?: string,\n ) => {\n const existingRecords = state[event] ?? [];\n state[event] = [\n ...existingRecords,\n { name: key ?? `callback-${existingRecords.length}`, callback },\n ];\n },\n unsubscribe: (\n callback: Callback,\n event: Event,\n ) => {\n const existingRecords = (state[event] ?? []).filter(cb => cb.callback !== callback);\n state[event] = existingRecords;\n },\n search: (\n subscriberKey: string,\n event: Event,\n ) =>\n (state[event] ?? [])\n .filter(record => record.name === subscriberKey)\n .map(record => record.callback) as Callback[],\n eventListeners: (\n event: Event,\n ) => (state[event] ?? []).map(record => record.callback) as Callback[],\n };\n\n return controller;\n}\n\nexport default Object.freeze({\n build: () => callbackRegistry(),\n});\n","import { buildBindable } from '@monofe/di';\nimport type { ICallbackBuilder } from '../interface/callback';\nimport {\n bindCallbackBuilder,\n injectCallbackBuilder,\n unbindCallbackBuilder,\n} from '../interface/callback';\nimport TYPES from '../interface/types';\nimport callbackBuilder from './callback';\n\nexport default buildBindable({\n id: TYPES.ICallbackBuilder,\n dependencies: [],\n bind: bindCallbackBuilder,\n remove: unbindCallbackBuilder,\n inject: injectCallbackBuilder,\n build: () => Promise.resolve(callbackBuilder),\n});\n","/**\n * returns true if the given object is a promise\n */\nexport function isPromise(obj) {\n if (obj && typeof obj.then === 'function') {\n return true;\n } else {\n return false;\n }\n}\nexport var PROMISE_RESOLVED_FALSE = Promise.resolve(false);\nexport var PROMISE_RESOLVED_TRUE = Promise.resolve(true);\nexport var PROMISE_RESOLVED_VOID = Promise.resolve();\nexport function sleep(time, resolveWith) {\n if (!time) time = 0;\n return new Promise(function (res) {\n return setTimeout(function () {\n return res(resolveWith);\n }, time);\n });\n}\nexport function randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n/**\n * https://stackoverflow.com/a/8084248\n */\n\nexport function randomToken() {\n return Math.random().toString(36).substring(2);\n}\nvar lastMs = 0;\nvar additional = 0;\n/**\n * returns the current time in micro-seconds,\n * WARNING: This is a pseudo-function\n * Performance.now is not reliable in webworkers, so we just make sure to never return the same time.\n * This is enough in browsers, and this function will not be used in nodejs.\n * The main reason for this hack is to ensure that BroadcastChannel behaves equal to production when it is used in fast-running unit tests.\n */\n\nexport function microSeconds() {\n var ms = new Date().getTime();\n\n if (ms === lastMs) {\n additional++;\n return ms * 1000 + additional;\n } else {\n lastMs = ms;\n additional = 0;\n return ms * 1000;\n }\n}\n/**\n * copied from the 'detect-node' npm module\n * We cannot use the module directly because it causes problems with rollup\n * @link https://github.com/iliakan/detect-node/blob/master/index.js\n */\n\nexport var isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';","import { microSeconds as micro, isNode, PROMISE_RESOLVED_VOID } from '../util.js';\nexport var microSeconds = micro;\nexport var type = 'native';\nexport function create(channelName) {\n var state = {\n messagesCallback: null,\n bc: new BroadcastChannel(channelName),\n subFns: [] // subscriberFunctions\n\n };\n\n state.bc.onmessage = function (msg) {\n if (state.messagesCallback) {\n state.messagesCallback(msg.data);\n }\n };\n\n return state;\n}\nexport function close(channelState) {\n channelState.bc.close();\n channelState.subFns = [];\n}\nexport function postMessage(channelState, messageJson) {\n try {\n channelState.bc.postMessage(messageJson, false);\n return PROMISE_RESOLVED_VOID;\n } catch (err) {\n return Promise.reject(err);\n }\n}\nexport function onMessage(channelState, fn) {\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n /**\n * in the electron-renderer, isNode will be true even if we are in browser-context\n * so we also check if window is undefined\n */\n if (isNode && typeof window === 'undefined') return false;\n\n if (typeof BroadcastChannel === 'function') {\n if (BroadcastChannel._pubkey) {\n throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');\n }\n\n return true;\n } else return false;\n}\nexport function averageResponseTime() {\n return 150;\n}\nexport default {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};",null,"export function fillOptionsWithDefaults() {\n var originalOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = JSON.parse(JSON.stringify(originalOptions)); // main\n\n if (typeof options.webWorkerSupport === 'undefined') options.webWorkerSupport = true; // indexed-db\n\n if (!options.idb) options.idb = {}; // after this time the messages get deleted\n\n if (!options.idb.ttl) options.idb.ttl = 1000 * 45;\n if (!options.idb.fallbackInterval) options.idb.fallbackInterval = 150; // handles abrupt db onclose events.\n\n if (originalOptions.idb && typeof originalOptions.idb.onclose === 'function') options.idb.onclose = originalOptions.idb.onclose; // localstorage\n\n if (!options.localstorage) options.localstorage = {};\n if (!options.localstorage.removeTimeout) options.localstorage.removeTimeout = 1000 * 60; // custom methods\n\n if (originalOptions.methods) options.methods = originalOptions.methods; // node\n\n if (!options.node) options.node = {};\n if (!options.node.ttl) options.node.ttl = 1000 * 60 * 2; // 2 minutes;\n\n /**\n * On linux use 'ulimit -Hn' to get the limit of open files.\n * On ubuntu this was 4096 for me, so we use half of that as maxParallelWrites default.\n */\n\n if (!options.node.maxParallelWrites) options.node.maxParallelWrites = 2048;\n if (typeof options.node.useFastPath === 'undefined') options.node.useFastPath = true;\n return options;\n}","/**\n * this method uses indexeddb to store the messages\n * There is currently no observerAPI for idb\n * @link https://github.com/w3c/IndexedDB/issues/51\n * \n * When working on this, ensure to use these performance optimizations:\n * @link https://rxdb.info/slow-indexeddb.html\n */\nimport { sleep, randomInt, randomToken, microSeconds as micro, isNode, PROMISE_RESOLVED_VOID } from '../util.js';\nexport var microSeconds = micro;\nimport { ObliviousSet } from 'oblivious-set';\nimport { fillOptionsWithDefaults } from '../options.js';\nvar DB_PREFIX = 'pubkey.broadcast-channel-0-';\nvar OBJECT_STORE_ID = 'messages';\n/**\n * Use relaxed durability for faster performance on all transactions.\n * @link https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/\n */\n\nexport var TRANSACTION_SETTINGS = {\n durability: 'relaxed'\n};\nexport var type = 'idb';\nexport function getIdb() {\n if (typeof indexedDB !== 'undefined') return indexedDB;\n\n if (typeof window !== 'undefined') {\n if (typeof window.mozIndexedDB !== 'undefined') return window.mozIndexedDB;\n if (typeof window.webkitIndexedDB !== 'undefined') return window.webkitIndexedDB;\n if (typeof window.msIndexedDB !== 'undefined') return window.msIndexedDB;\n }\n\n return false;\n}\n/**\n * If possible, we should explicitly commit IndexedDB transactions\n * for better performance.\n * @link https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/\n */\n\nexport function commitIndexedDBTransaction(tx) {\n if (tx.commit) {\n tx.commit();\n }\n}\nexport function createDatabase(channelName) {\n var IndexedDB = getIdb(); // create table\n\n var dbName = DB_PREFIX + channelName;\n /**\n * All IndexedDB databases are opened without version\n * because it is a bit faster, especially on firefox\n * @link http://nparashuram.com/IndexedDB/perf/#Open%20Database%20with%20version\n */\n\n var openRequest = IndexedDB.open(dbName);\n\n openRequest.onupgradeneeded = function (ev) {\n var db = ev.target.result;\n db.createObjectStore(OBJECT_STORE_ID, {\n keyPath: 'id',\n autoIncrement: true\n });\n };\n\n var dbPromise = new Promise(function (res, rej) {\n openRequest.onerror = function (ev) {\n return rej(ev);\n };\n\n openRequest.onsuccess = function () {\n res(openRequest.result);\n };\n });\n return dbPromise;\n}\n/**\n * writes the new message to the database\n * so other readers can find it\n */\n\nexport function writeMessage(db, readerUuid, messageJson) {\n var time = new Date().getTime();\n var writeObject = {\n uuid: readerUuid,\n time: time,\n data: messageJson\n };\n var tx = db.transaction([OBJECT_STORE_ID], 'readwrite', TRANSACTION_SETTINGS);\n return new Promise(function (res, rej) {\n tx.oncomplete = function () {\n return res();\n };\n\n tx.onerror = function (ev) {\n return rej(ev);\n };\n\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n objectStore.add(writeObject);\n commitIndexedDBTransaction(tx);\n });\n}\nexport function getAllMessages(db) {\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n return new Promise(function (res) {\n objectStore.openCursor().onsuccess = function (ev) {\n var cursor = ev.target.result;\n\n if (cursor) {\n ret.push(cursor.value); //alert(\"Name for SSN \" + cursor.key + \" is \" + cursor.value.name);\n\n cursor[\"continue\"]();\n } else {\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n };\n });\n}\nexport function getMessagesHigherThan(db, lastCursorId) {\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n var keyRangeValue = IDBKeyRange.bound(lastCursorId + 1, Infinity);\n /**\n * Optimization shortcut,\n * if getAll() can be used, do not use a cursor.\n * @link https://rxdb.info/slow-indexeddb.html\n */\n\n if (objectStore.getAll) {\n var getAllRequest = objectStore.getAll(keyRangeValue);\n return new Promise(function (res, rej) {\n getAllRequest.onerror = function (err) {\n return rej(err);\n };\n\n getAllRequest.onsuccess = function (e) {\n res(e.target.result);\n };\n });\n }\n\n function openCursor() {\n // Occasionally Safari will fail on IDBKeyRange.bound, this\n // catches that error, having it open the cursor to the first\n // item. When it gets data it will advance to the desired key.\n try {\n keyRangeValue = IDBKeyRange.bound(lastCursorId + 1, Infinity);\n return objectStore.openCursor(keyRangeValue);\n } catch (e) {\n return objectStore.openCursor();\n }\n }\n\n return new Promise(function (res, rej) {\n var openCursorRequest = openCursor();\n\n openCursorRequest.onerror = function (err) {\n return rej(err);\n };\n\n openCursorRequest.onsuccess = function (ev) {\n var cursor = ev.target.result;\n\n if (cursor) {\n if (cursor.value.id < lastCursorId + 1) {\n cursor[\"continue\"](lastCursorId + 1);\n } else {\n ret.push(cursor.value);\n cursor[\"continue\"]();\n }\n } else {\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n };\n });\n}\nexport function removeMessagesById(db, ids) {\n var tx = db.transaction([OBJECT_STORE_ID], 'readwrite', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n return Promise.all(ids.map(function (id) {\n var deleteRequest = objectStore[\"delete\"](id);\n return new Promise(function (res) {\n deleteRequest.onsuccess = function () {\n return res();\n };\n });\n }));\n}\nexport function getOldMessages(db, ttl) {\n var olderThen = new Date().getTime() - ttl;\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n return new Promise(function (res) {\n objectStore.openCursor().onsuccess = function (ev) {\n var cursor = ev.target.result;\n\n if (cursor) {\n var msgObk = cursor.value;\n\n if (msgObk.time < olderThen) {\n ret.push(msgObk); //alert(\"Name for SSN \" + cursor.key + \" is \" + cursor.value.name);\n\n cursor[\"continue\"]();\n } else {\n // no more old messages,\n commitIndexedDBTransaction(tx);\n res(ret);\n return;\n }\n } else {\n res(ret);\n }\n };\n });\n}\nexport function cleanOldMessages(db, ttl) {\n return getOldMessages(db, ttl).then(function (tooOld) {\n return removeMessagesById(db, tooOld.map(function (msg) {\n return msg.id;\n }));\n });\n}\nexport function create(channelName, options) {\n options = fillOptionsWithDefaults(options);\n return createDatabase(channelName).then(function (db) {\n var state = {\n closed: false,\n lastCursorId: 0,\n channelName: channelName,\n options: options,\n uuid: randomToken(),\n\n /**\n * emittedMessagesIds\n * contains all messages that have been emitted before\n * @type {ObliviousSet}\n */\n eMIs: new ObliviousSet(options.idb.ttl * 2),\n // ensures we do not read messages in parrallel\n writeBlockPromise: PROMISE_RESOLVED_VOID,\n messagesCallback: null,\n readQueuePromises: [],\n db: db\n };\n /**\n * Handle abrupt closes that do not originate from db.close().\n * This could happen, for example, if the underlying storage is\n * removed or if the user clears the database in the browser's\n * history preferences.\n */\n\n db.onclose = function () {\n state.closed = true;\n if (options.idb.onclose) options.idb.onclose();\n };\n /**\n * if service-workers are used,\n * we have no 'storage'-event if they post a message,\n * therefore we also have to set an interval\n */\n\n\n _readLoop(state);\n\n return state;\n });\n}\n\nfunction _readLoop(state) {\n if (state.closed) return;\n readNewMessages(state).then(function () {\n return sleep(state.options.idb.fallbackInterval);\n }).then(function () {\n return _readLoop(state);\n });\n}\n\nfunction _filterMessage(msgObj, state) {\n if (msgObj.uuid === state.uuid) return false; // send by own\n\n if (state.eMIs.has(msgObj.id)) return false; // already emitted\n\n if (msgObj.data.time < state.messagesCallbackTime) return false; // older then onMessageCallback\n\n return true;\n}\n/**\n * reads all new messages from the database and emits them\n */\n\n\nfunction readNewMessages(state) {\n // channel already closed\n if (state.closed) return PROMISE_RESOLVED_VOID; // if no one is listening, we do not need to scan for new messages\n\n if (!state.messagesCallback) return PROMISE_RESOLVED_VOID;\n return getMessagesHigherThan(state.db, state.lastCursorId).then(function (newerMessages) {\n var useMessages = newerMessages\n /**\n * there is a bug in iOS where the msgObj can be undefined some times\n * so we filter them out\n * @link https://github.com/pubkey/broadcast-channel/issues/19\n */\n .filter(function (msgObj) {\n return !!msgObj;\n }).map(function (msgObj) {\n if (msgObj.id > state.lastCursorId) {\n state.lastCursorId = msgObj.id;\n }\n\n return msgObj;\n }).filter(function (msgObj) {\n return _filterMessage(msgObj, state);\n }).sort(function (msgObjA, msgObjB) {\n return msgObjA.time - msgObjB.time;\n }); // sort by time\n\n useMessages.forEach(function (msgObj) {\n if (state.messagesCallback) {\n state.eMIs.add(msgObj.id);\n state.messagesCallback(msgObj.data);\n }\n });\n return PROMISE_RESOLVED_VOID;\n });\n}\n\nexport function close(channelState) {\n channelState.closed = true;\n channelState.db.close();\n}\nexport function postMessage(channelState, messageJson) {\n channelState.writeBlockPromise = channelState.writeBlockPromise.then(function () {\n return writeMessage(channelState.db, channelState.uuid, messageJson);\n }).then(function () {\n if (randomInt(0, 10) === 0) {\n /* await (do not await) */\n cleanOldMessages(channelState.db, channelState.options.idb.ttl);\n }\n });\n return channelState.writeBlockPromise;\n}\nexport function onMessage(channelState, fn, time) {\n channelState.messagesCallbackTime = time;\n channelState.messagesCallback = fn;\n readNewMessages(channelState);\n}\nexport function canBeUsed() {\n if (isNode) return false;\n var idb = getIdb();\n if (!idb) return false;\n return true;\n}\nexport function averageResponseTime(options) {\n return options.idb.fallbackInterval * 2;\n}\nexport default {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","/**\n * A localStorage-only method which uses localstorage and its 'storage'-event\n * This does not work inside of webworkers because they have no access to locastorage\n * This is basically implemented to support IE9 or your grandmothers toaster.\n * @link https://caniuse.com/#feat=namevalue-storage\n * @link https://caniuse.com/#feat=indexeddb\n */\nimport { ObliviousSet } from 'oblivious-set';\nimport { fillOptionsWithDefaults } from '../options.js';\nimport { sleep, randomToken, microSeconds as micro, isNode } from '../util.js';\nexport var microSeconds = micro;\nvar KEY_PREFIX = 'pubkey.broadcastChannel-';\nexport var type = 'localstorage';\n/**\n * copied from crosstab\n * @link https://github.com/tejacques/crosstab/blob/master/src/crosstab.js#L32\n */\n\nexport function getLocalStorage() {\n var localStorage;\n if (typeof window === 'undefined') return null;\n\n try {\n localStorage = window.localStorage;\n localStorage = window['ie8-eventlistener/storage'] || window.localStorage;\n } catch (e) {// New versions of Firefox throw a Security exception\n // if cookies are disabled. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1028153\n }\n\n return localStorage;\n}\nexport function storageKey(channelName) {\n return KEY_PREFIX + channelName;\n}\n/**\n* writes the new message to the storage\n* and fires the storage-event so other readers can find it\n*/\n\nexport function postMessage(channelState, messageJson) {\n return new Promise(function (res) {\n sleep().then(function () {\n var key = storageKey(channelState.channelName);\n var writeObj = {\n token: randomToken(),\n time: new Date().getTime(),\n data: messageJson,\n uuid: channelState.uuid\n };\n var value = JSON.stringify(writeObj);\n getLocalStorage().setItem(key, value);\n /**\n * StorageEvent does not fire the 'storage' event\n * in the window that changes the state of the local storage.\n * So we fire it manually\n */\n\n var ev = document.createEvent('Event');\n ev.initEvent('storage', true, true);\n ev.key = key;\n ev.newValue = value;\n window.dispatchEvent(ev);\n res();\n });\n });\n}\nexport function addStorageEventListener(channelName, fn) {\n var key = storageKey(channelName);\n\n var listener = function listener(ev) {\n if (ev.key === key) {\n fn(JSON.parse(ev.newValue));\n }\n };\n\n window.addEventListener('storage', listener);\n return listener;\n}\nexport function removeStorageEventListener(listener) {\n window.removeEventListener('storage', listener);\n}\nexport function create(channelName, options) {\n options = fillOptionsWithDefaults(options);\n\n if (!canBeUsed()) {\n throw new Error('BroadcastChannel: localstorage cannot be used');\n }\n\n var uuid = randomToken();\n /**\n * eMIs\n * contains all messages that have been emitted before\n * @type {ObliviousSet}\n */\n\n var eMIs = new ObliviousSet(options.localstorage.removeTimeout);\n var state = {\n channelName: channelName,\n uuid: uuid,\n eMIs: eMIs // emittedMessagesIds\n\n };\n state.listener = addStorageEventListener(channelName, function (msgObj) {\n if (!state.messagesCallback) return; // no listener\n\n if (msgObj.uuid === uuid) return; // own message\n\n if (!msgObj.token || eMIs.has(msgObj.token)) return; // already emitted\n\n if (msgObj.data.time && msgObj.data.time < state.messagesCallbackTime) return; // too old\n\n eMIs.add(msgObj.token);\n state.messagesCallback(msgObj.data);\n });\n return state;\n}\nexport function close(channelState) {\n removeStorageEventListener(channelState.listener);\n}\nexport function onMessage(channelState, fn, time) {\n channelState.messagesCallbackTime = time;\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n if (isNode) return false;\n var ls = getLocalStorage();\n if (!ls) return false;\n\n try {\n var key = '__broadcastchannel_check';\n ls.setItem(key, 'works');\n ls.removeItem(key);\n } catch (e) {\n // Safari 10 in private mode will not allow write access to local\n // storage and fail with a QuotaExceededError. See\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API#Private_Browsing_Incognito_modes\n return false;\n }\n\n return true;\n}\nexport function averageResponseTime() {\n var defaultTime = 120;\n var userAgent = navigator.userAgent.toLowerCase();\n\n if (userAgent.includes('safari') && !userAgent.includes('chrome')) {\n // safari is much slower so this time is higher\n return defaultTime * 2;\n }\n\n return defaultTime;\n}\nexport default {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","import { microSeconds as micro } from '../util.js';\nexport var microSeconds = micro;\nexport var type = 'simulate';\nvar SIMULATE_CHANNELS = new Set();\nexport function create(channelName) {\n var state = {\n name: channelName,\n messagesCallback: null\n };\n SIMULATE_CHANNELS.add(state);\n return state;\n}\nexport function close(channelState) {\n SIMULATE_CHANNELS[\"delete\"](channelState);\n}\nexport function postMessage(channelState, messageJson) {\n return new Promise(function (res) {\n return setTimeout(function () {\n var channelArray = Array.from(SIMULATE_CHANNELS);\n channelArray.filter(function (channel) {\n return channel.name === channelState.name;\n }).filter(function (channel) {\n return channel !== channelState;\n }).filter(function (channel) {\n return !!channel.messagesCallback;\n }).forEach(function (channel) {\n return channel.messagesCallback(messageJson);\n });\n res();\n }, 5);\n });\n}\nexport function onMessage(channelState, fn) {\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n return true;\n}\nexport function averageResponseTime() {\n return 5;\n}\nexport default {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","import NativeMethod from './methods/native.js';\nimport IndexeDbMethod from './methods/indexed-db.js';\nimport LocalstorageMethod from './methods/localstorage.js';\nimport SimulateMethod from './methods/simulate.js'; // the line below will be removed from es5/browser builds\n\n\nimport { isNode } from './util.js'; // order is important\n\nvar METHODS = [NativeMethod, // fastest\nIndexeDbMethod, LocalstorageMethod];\nexport function chooseMethod(options) {\n var chooseMethods = [].concat(options.methods, METHODS).filter(Boolean); // the line below will be removed from es5/browser builds\n\n\n\n if (options.type) {\n if (options.type === 'simulate') {\n // only use simulate-method if directly chosen\n return SimulateMethod;\n }\n\n var ret = chooseMethods.find(function (m) {\n return m.type === options.type;\n });\n if (!ret) throw new Error('method-type ' + options.type + ' not found');else return ret;\n }\n /**\n * if no webworker support is needed,\n * remove idb from the list so that localstorage is been chosen\n */\n\n\n if (!options.webWorkerSupport && !isNode) {\n chooseMethods = chooseMethods.filter(function (m) {\n return m.type !== 'idb';\n });\n }\n\n var useMethod = chooseMethods.find(function (method) {\n return method.canBeUsed();\n });\n if (!useMethod) throw new Error(\"No useable method found in \" + JSON.stringify(METHODS.map(function (m) {\n return m.type;\n })));else return useMethod;\n}","import { isPromise, PROMISE_RESOLVED_FALSE, PROMISE_RESOLVED_VOID } from './util.js';\nimport { chooseMethod } from './method-chooser.js';\nimport { fillOptionsWithDefaults } from './options.js';\n/**\n * Contains all open channels,\n * used in tests to ensure everything is closed.\n */\n\nexport var OPEN_BROADCAST_CHANNELS = new Set();\nvar lastId = 0;\nexport var BroadcastChannel = function BroadcastChannel(name, options) {\n // identifier of the channel to debug stuff\n this.id = lastId++;\n OPEN_BROADCAST_CHANNELS.add(this);\n this.name = name;\n\n if (ENFORCED_OPTIONS) {\n options = ENFORCED_OPTIONS;\n }\n\n this.options = fillOptionsWithDefaults(options);\n this.method = chooseMethod(this.options); // isListening\n\n this._iL = false;\n /**\n * _onMessageListener\n * setting onmessage twice,\n * will overwrite the first listener\n */\n\n this._onML = null;\n /**\n * _addEventListeners\n */\n\n this._addEL = {\n message: [],\n internal: []\n };\n /**\n * Unsend message promises\n * where the sending is still in progress\n * @type {Set}\n */\n\n this._uMP = new Set();\n /**\n * _beforeClose\n * array of promises that will be awaited\n * before the channel is closed\n */\n\n this._befC = [];\n /**\n * _preparePromise\n */\n\n this._prepP = null;\n\n _prepareChannel(this);\n}; // STATICS\n\n/**\n * used to identify if someone overwrites\n * window.BroadcastChannel with this\n * See methods/native.js\n */\n\nBroadcastChannel._pubkey = true;\n/**\n * clears the tmp-folder if is node\n * @return {Promise} true if has run, false if not node\n */\n\nexport function clearNodeFolder(options) {\n options = fillOptionsWithDefaults(options);\n var method = chooseMethod(options);\n\n if (method.type === 'node') {\n return method.clearNodeFolder().then(function () {\n return true;\n });\n } else {\n return PROMISE_RESOLVED_FALSE;\n }\n}\n/**\n * if set, this method is enforced,\n * no mather what the options are\n */\n\nvar ENFORCED_OPTIONS;\nexport function enforceOptions(options) {\n ENFORCED_OPTIONS = options;\n} // PROTOTYPE\n\nBroadcastChannel.prototype = {\n postMessage: function postMessage(msg) {\n if (this.closed) {\n throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +\n /**\n * In the past when this error appeared, it was realy hard to debug.\n * So now we log the msg together with the error so it at least\n * gives some clue about where in your application this happens.\n */\n JSON.stringify(msg));\n }\n\n return _post(this, 'message', msg);\n },\n postInternal: function postInternal(msg) {\n return _post(this, 'internal', msg);\n },\n\n set onmessage(fn) {\n var time = this.method.microSeconds();\n var listenObj = {\n time: time,\n fn: fn\n };\n\n _removeListenerObject(this, 'message', this._onML);\n\n if (fn && typeof fn === 'function') {\n this._onML = listenObj;\n\n _addListenerObject(this, 'message', listenObj);\n } else {\n this._onML = null;\n }\n },\n\n addEventListener: function addEventListener(type, fn) {\n var time = this.method.microSeconds();\n var listenObj = {\n time: time,\n fn: fn\n };\n\n _addListenerObject(this, type, listenObj);\n },\n removeEventListener: function removeEventListener(type, fn) {\n var obj = this._addEL[type].find(function (obj) {\n return obj.fn === fn;\n });\n\n _removeListenerObject(this, type, obj);\n },\n close: function close() {\n var _this = this;\n\n if (this.closed) {\n return;\n }\n\n OPEN_BROADCAST_CHANNELS[\"delete\"](this);\n this.closed = true;\n var awaitPrepare = this._prepP ? this._prepP : PROMISE_RESOLVED_VOID;\n this._onML = null;\n this._addEL.message = [];\n return awaitPrepare // wait until all current sending are processed\n .then(function () {\n return Promise.all(Array.from(_this._uMP));\n }) // run before-close hooks\n .then(function () {\n return Promise.all(_this._befC.map(function (fn) {\n return fn();\n }));\n }) // close the channel\n .then(function () {\n return _this.method.close(_this._state);\n });\n },\n\n get type() {\n return this.method.type;\n },\n\n get isClosed() {\n return this.closed;\n }\n\n};\n/**\n * Post a message over the channel\n * @returns {Promise} that resolved when the message sending is done\n */\n\nfunction _post(broadcastChannel, type, msg) {\n var time = broadcastChannel.method.microSeconds();\n var msgObj = {\n time: time,\n type: type,\n data: msg\n };\n var awaitPrepare = broadcastChannel._prepP ? broadcastChannel._prepP : PROMISE_RESOLVED_VOID;\n return awaitPrepare.then(function () {\n var sendPromise = broadcastChannel.method.postMessage(broadcastChannel._state, msgObj); // add/remove to unsend messages list\n\n broadcastChannel._uMP.add(sendPromise);\n\n sendPromise[\"catch\"]().then(function () {\n return broadcastChannel._uMP[\"delete\"](sendPromise);\n });\n return sendPromise;\n });\n}\n\nfunction _prepareChannel(channel) {\n var maybePromise = channel.method.create(channel.name, channel.options);\n\n if (isPromise(maybePromise)) {\n channel._prepP = maybePromise;\n maybePromise.then(function (s) {\n // used in tests to simulate slow runtime\n\n /*if (channel.options.prepareDelay) {\n await new Promise(res => setTimeout(res, this.options.prepareDelay));\n }*/\n channel._state = s;\n });\n } else {\n channel._state = maybePromise;\n }\n}\n\nfunction _hasMessageListeners(channel) {\n if (channel._addEL.message.length > 0) return true;\n if (channel._addEL.internal.length > 0) return true;\n return false;\n}\n\nfunction _addListenerObject(channel, type, obj) {\n channel._addEL[type].push(obj);\n\n _startListening(channel);\n}\n\nfunction _removeListenerObject(channel, type, obj) {\n channel._addEL[type] = channel._addEL[type].filter(function (o) {\n return o !== obj;\n });\n\n _stopListening(channel);\n}\n\nfunction _startListening(channel) {\n if (!channel._iL && _hasMessageListeners(channel)) {\n // someone is listening, start subscribing\n var listenerFn = function listenerFn(msgObj) {\n channel._addEL[msgObj.type].forEach(function (listenerObject) {\n /**\n * Getting the current time in JavaScript has no good precision.\n * So instead of only listening to events that happend 'after' the listener\n * was added, we also listen to events that happended 100ms before it.\n * This ensures that when another process, like a WebWorker, sends events\n * we do not miss them out because their timestamp is a bit off compared to the main process.\n * Not doing this would make messages missing when we send data directly after subscribing and awaiting a response.\n * @link https://johnresig.com/blog/accuracy-of-javascript-time/\n */\n var hundredMsInMicro = 100 * 1000;\n var minMessageTime = listenerObject.time - hundredMsInMicro;\n\n if (msgObj.time >= minMessageTime) {\n listenerObject.fn(msgObj.data);\n }\n });\n };\n\n var time = channel.method.microSeconds();\n\n if (channel._prepP) {\n channel._prepP.then(function () {\n channel._iL = true;\n channel.method.onMessage(channel._state, listenerFn, time);\n });\n } else {\n channel._iL = true;\n channel.method.onMessage(channel._state, listenerFn, time);\n }\n }\n}\n\nfunction _stopListening(channel) {\n if (channel._iL && !_hasMessageListeners(channel)) {\n // noone is listening, stop subscribing\n channel._iL = false;\n var time = channel.method.microSeconds();\n channel.method.onMessage(channel._state, null, time);\n }\n}","/* global WorkerGlobalScope */\nfunction add(fn) {\n if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker\n } else {\n /**\n * if we are on react-native, there is no window.addEventListener\n * @link https://github.com/pubkey/unload/issues/6\n */\n if (typeof window.addEventListener !== 'function') return;\n /**\n * for normal browser-windows, we use the beforeunload-event\n */\n\n window.addEventListener('beforeunload', function () {\n fn();\n }, true);\n /**\n * for iframes, we have to use the unload-event\n * @link https://stackoverflow.com/q/47533670/3443137\n */\n\n window.addEventListener('unload', function () {\n fn();\n }, true);\n }\n /**\n * TODO add fallback for safari-mobile\n * @link https://stackoverflow.com/a/26193516/3443137\n */\n\n}\n\nexport default {\n add: add\n};","import isNode from 'detect-node';\nimport BrowserMethod from './browser.js';\nimport NodeMethod from './node.js';\nvar USE_METHOD = isNode ? NodeMethod : BrowserMethod;\nvar LISTENERS = new Set();\nvar startedListening = false;\n\nfunction startListening() {\n if (startedListening) return;\n startedListening = true;\n USE_METHOD.add(runAll);\n}\n\nexport function add(fn) {\n startListening();\n if (typeof fn !== 'function') throw new Error('Listener is no function');\n LISTENERS.add(fn);\n var addReturn = {\n remove: function remove() {\n return LISTENERS[\"delete\"](fn);\n },\n run: function run() {\n LISTENERS[\"delete\"](fn);\n return fn();\n }\n };\n return addReturn;\n}\nexport function runAll() {\n var promises = [];\n LISTENERS.forEach(function (fn) {\n promises.push(fn());\n LISTENERS[\"delete\"](fn);\n });\n return Promise.all(promises);\n}\nexport function removeAll() {\n LISTENERS.clear();\n}\nexport function getSize() {\n return LISTENERS.size;\n}","import { sleep, randomToken, PROMISE_RESOLVED_VOID, PROMISE_RESOLVED_TRUE } from './util.js';\nimport { add as unloadAdd } from 'unload';\n\nvar LeaderElection = function LeaderElection(broadcastChannel, options) {\n var _this = this;\n\n this.broadcastChannel = broadcastChannel;\n this._options = options;\n this.isLeader = false;\n this.hasLeader = false;\n this.isDead = false;\n this.token = randomToken();\n /**\n * Apply Queue,\n * used to ensure we do not run applyOnce()\n * in parallel.\n */\n\n this._aplQ = PROMISE_RESOLVED_VOID; // amount of unfinished applyOnce() calls\n\n this._aplQC = 0; // things to clean up\n\n this._unl = []; // _unloads\n\n this._lstns = []; // _listeners\n\n this._dpL = function () {}; // onduplicate listener\n\n\n this._dpLC = false; // true when onduplicate called\n\n /**\n * Even when the own instance is not applying,\n * we still listen to messages to ensure the hasLeader flag\n * is set correctly.\n */\n\n var hasLeaderListener = function hasLeaderListener(msg) {\n if (msg.context === 'leader') {\n if (msg.action === 'death') {\n _this.hasLeader = false;\n }\n\n if (msg.action === 'tell') {\n _this.hasLeader = true;\n }\n }\n };\n\n this.broadcastChannel.addEventListener('internal', hasLeaderListener);\n\n this._lstns.push(hasLeaderListener);\n};\n\nLeaderElection.prototype = {\n /**\n * Returns true if the instance is leader,\n * false if not.\n * @async\n */\n applyOnce: function applyOnce( // true if the applyOnce() call came from the fallbackInterval cycle\n isFromFallbackInterval) {\n var _this2 = this;\n\n if (this.isLeader) {\n return sleep(0, true);\n }\n\n if (this.isDead) {\n return sleep(0, false);\n }\n /**\n * Already applying more then once,\n * -> wait for the apply queue to be finished.\n */\n\n\n if (this._aplQC > 1) {\n return this._aplQ;\n }\n /**\n * Add a new apply-run\n */\n\n\n var applyRun = function applyRun() {\n /**\n * Optimization shortcuts.\n * Directly return if a previous run\n * has already elected a leader.\n */\n if (_this2.isLeader) {\n return PROMISE_RESOLVED_TRUE;\n }\n\n var stopCriteria = false;\n var stopCriteriaPromiseResolve;\n /**\n * Resolves when a stop criteria is reached.\n * Uses as a performance shortcut so we do not\n * have to await the responseTime when it is already clear\n * that the election failed.\n */\n\n var stopCriteriaPromise = new Promise(function (res) {\n stopCriteriaPromiseResolve = function stopCriteriaPromiseResolve() {\n stopCriteria = true;\n res();\n };\n });\n var recieved = [];\n\n var handleMessage = function handleMessage(msg) {\n if (msg.context === 'leader' && msg.token != _this2.token) {\n recieved.push(msg);\n\n if (msg.action === 'apply') {\n // other is applying\n if (msg.token > _this2.token) {\n /**\n * other has higher token\n * -> stop applying and let other become leader.\n */\n stopCriteriaPromiseResolve();\n }\n }\n\n if (msg.action === 'tell') {\n // other is already leader\n stopCriteriaPromiseResolve();\n _this2.hasLeader = true;\n }\n }\n };\n\n _this2.broadcastChannel.addEventListener('internal', handleMessage);\n /**\n * If the applyOnce() call came from the fallbackInterval,\n * we can assume that the election runs in the background and\n * not critical process is waiting for it.\n * When this is true, we give the other intances\n * more time to answer to messages in the election cycle.\n * This makes it less likely to elect duplicate leaders.\n * But also it takes longer which is not a problem because we anyway\n * run in the background.\n */\n\n\n var waitForAnswerTime = isFromFallbackInterval ? _this2._options.responseTime * 4 : _this2._options.responseTime;\n\n var applyPromise = _sendMessage(_this2, 'apply') // send out that this one is applying\n .then(function () {\n return Promise.race([sleep(waitForAnswerTime), stopCriteriaPromise.then(function () {\n return Promise.reject(new Error());\n })]);\n }) // send again in case another instance was just created\n .then(function () {\n return _sendMessage(_this2, 'apply');\n }) // let others time to respond\n .then(function () {\n return Promise.race([sleep(waitForAnswerTime), stopCriteriaPromise.then(function () {\n return Promise.reject(new Error());\n })]);\n })[\"catch\"](function () {}).then(function () {\n _this2.broadcastChannel.removeEventListener('internal', handleMessage);\n\n if (!stopCriteria) {\n // no stop criteria -> own is leader\n return beLeader(_this2).then(function () {\n return true;\n });\n } else {\n // other is leader\n return false;\n }\n });\n\n return applyPromise;\n };\n\n this._aplQC = this._aplQC + 1;\n this._aplQ = this._aplQ.then(function () {\n return applyRun();\n }).then(function () {\n _this2._aplQC = _this2._aplQC - 1;\n });\n return this._aplQ.then(function () {\n return _this2.isLeader;\n });\n },\n awaitLeadership: function awaitLeadership() {\n if (\n /* _awaitLeadershipPromise */\n !this._aLP) {\n this._aLP = _awaitLeadershipOnce(this);\n }\n\n return this._aLP;\n },\n\n set onduplicate(fn) {\n this._dpL = fn;\n },\n\n die: function die() {\n var _this3 = this;\n\n this._lstns.forEach(function (listener) {\n return _this3.broadcastChannel.removeEventListener('internal', listener);\n });\n\n this._lstns = [];\n\n this._unl.forEach(function (uFn) {\n return uFn.remove();\n });\n\n this._unl = [];\n\n if (this.isLeader) {\n this.hasLeader = false;\n this.isLeader = false;\n }\n\n this.isDead = true;\n return _sendMessage(this, 'death');\n }\n};\n/**\n * @param leaderElector {LeaderElector}\n */\n\nfunction _awaitLeadershipOnce(leaderElector) {\n if (leaderElector.isLeader) {\n return PROMISE_RESOLVED_VOID;\n }\n\n return new Promise(function (res) {\n var resolved = false;\n\n function finish() {\n if (resolved) {\n return;\n }\n\n resolved = true;\n leaderElector.broadcastChannel.removeEventListener('internal', whenDeathListener);\n res(true);\n } // try once now\n\n\n leaderElector.applyOnce().then(function () {\n if (leaderElector.isLeader) {\n finish();\n }\n });\n /**\n * Try on fallbackInterval\n * @recursive\n */\n\n var tryOnFallBack = function tryOnFallBack() {\n return sleep(leaderElector._options.fallbackInterval).then(function () {\n if (leaderElector.isDead || resolved) {\n return;\n }\n\n if (leaderElector.isLeader) {\n finish();\n } else {\n return leaderElector.applyOnce(true).then(function () {\n if (leaderElector.isLeader) {\n finish();\n } else {\n tryOnFallBack();\n }\n });\n }\n });\n };\n\n tryOnFallBack(); // try when other leader dies\n\n var whenDeathListener = function whenDeathListener(msg) {\n if (msg.context === 'leader' && msg.action === 'death') {\n leaderElector.hasLeader = false;\n leaderElector.applyOnce().then(function () {\n if (leaderElector.isLeader) {\n finish();\n }\n });\n }\n };\n\n leaderElector.broadcastChannel.addEventListener('internal', whenDeathListener);\n\n leaderElector._lstns.push(whenDeathListener);\n });\n}\n/**\n * sends and internal message over the broadcast-channel\n */\n\n\nfunction _sendMessage(leaderElector, action) {\n var msgJson = {\n context: 'leader',\n action: action,\n token: leaderElector.token\n };\n return leaderElector.broadcastChannel.postInternal(msgJson);\n}\n\nexport function beLeader(leaderElector) {\n leaderElector.isLeader = true;\n leaderElector.hasLeader = true;\n var unloadFn = unloadAdd(function () {\n return leaderElector.die();\n });\n\n leaderElector._unl.push(unloadFn);\n\n var isLeaderListener = function isLeaderListener(msg) {\n if (msg.context === 'leader' && msg.action === 'apply') {\n _sendMessage(leaderElector, 'tell');\n }\n\n if (msg.context === 'leader' && msg.action === 'tell' && !leaderElector._dpLC) {\n /**\n * another instance is also leader!\n * This can happen on rare events\n * like when the CPU is at 100% for long time\n * or the tabs are open very long and the browser throttles them.\n * @link https://github.com/pubkey/broadcast-channel/issues/414\n * @link https://github.com/pubkey/broadcast-channel/issues/385\n */\n leaderElector._dpLC = true;\n\n leaderElector._dpL(); // message the lib user so the app can handle the problem\n\n\n _sendMessage(leaderElector, 'tell'); // ensure other leader also knows the problem\n\n }\n };\n\n leaderElector.broadcastChannel.addEventListener('internal', isLeaderListener);\n\n leaderElector._lstns.push(isLeaderListener);\n\n return _sendMessage(leaderElector, 'tell');\n}\n\nfunction fillOptionsWithDefaults(options, channel) {\n if (!options) options = {};\n options = JSON.parse(JSON.stringify(options));\n\n if (!options.fallbackInterval) {\n options.fallbackInterval = 3000;\n }\n\n if (!options.responseTime) {\n options.responseTime = channel.method.averageResponseTime(channel.options);\n }\n\n return options;\n}\n\nexport function createLeaderElection(channel, options) {\n if (channel._leaderElector) {\n throw new Error('BroadcastChannel already has a leader-elector');\n }\n\n options = fillOptionsWithDefaults(options, channel);\n var elector = new LeaderElection(channel, options);\n\n channel._befC.push(function () {\n return elector.die();\n });\n\n channel._leaderElector = elector;\n return elector;\n}","import type { ILog } from '@monofe/util';\nimport { BroadcastChannel } from 'broadcast-channel';\nimport type { ICallbackBuilder } from '../interface/callback';\nimport type {\n IChannel,\n IChannelController,\n IChannelEventMap,\n IChannelID,\n} from '../interface/channel';\nimport { IChannelStatus } from '../interface/channel';\n\nfunction createChannel(callbackBuilder: ICallbackBuilder, id: IChannelID, logger: ILog): IChannel {\n const callbackRegistry = callbackBuilder.build();\n\n const handler = new BroadcastChannel(id, {\n type: 'idb',\n });\n\n handler.onmessage = (message: unknown): void => {\n const callbacks = callbackRegistry.eventListeners('NewMessage');\n for (const callback of callbacks) {\n callback(message);\n }\n };\n\n const channel = {\n id: (): string => id,\n status: (): IChannelStatus =>\n handler.isClosed ? IChannelStatus.Expired : IChannelStatus.Active,\n postMessage: (message: unknown): void => {\n handler.postMessage(message).catch(error => {\n logger.error(`Failed to post message, error: ${JSON.stringify(error)}`);\n });\n },\n addEventListener: <\n Event extends keyof IChannelEventMap,\n Callback extends IChannelEventMap[Event],\n >(\n key: string,\n event: Event,\n callback: Callback,\n ): void => {\n callbackRegistry.subscribe(callback, event, key);\n },\n removeListener: (key: string, event: Event): void => {\n const callbacks = callbackRegistry.search(key, event)!;\n for (const callback of callbacks) {\n callbackRegistry.unsubscribe(callback, event);\n }\n },\n terminate: (): void => {\n handler\n .close()\n .then(() => {\n const callbacks = callbackRegistry.eventListeners('StatusChanged');\n for (const callback of callbacks) {\n callback(IChannelStatus.Expired);\n }\n })\n .catch(error => {\n logger.error(`Failed to terminate connection: ${JSON.stringify(error)}`);\n });\n },\n };\n\n return channel;\n}\n\nfunction channel(logger: ILog, callbackBuilder: ICallbackBuilder): IChannelController {\n const records: Map = new Map();\n\n const controller = {\n channel: (key: IChannelID): IChannel => {\n const channel = records.get(key) ?? createChannel(callbackBuilder, key, logger);\n records.set(key, channel);\n return channel;\n },\n all: (): IChannel[] => Array.from(records.values()),\n };\n\n return controller;\n}\n\nexport default channel;\n","import type { IContainer } from '@monofe/di';\nimport { buildBindable } from '@monofe/di';\nimport { injectLog, TYPES as UTIL_TYPES } from '@monofe/util';\nimport { injectCallbackBuilder } from '../interface/callback';\nimport type { IChannelController } from '../interface/channel';\nimport {\n bindChannelController,\n injectChannelController,\n unbindChannelController,\n} from '../interface/channel';\nimport TYPES from '../interface/types';\nimport channelController from './channel';\n\nfunction _build(container: IContainer): Readonly {\n const logger = injectLog(container);\n const callbackBuilder = injectCallbackBuilder(container);\n return Object.freeze(channelController(logger, callbackBuilder));\n}\n\nexport default buildBindable({\n id: TYPES.IChannelController,\n dependencies: [UTIL_TYPES.ILog, TYPES.ICallbackBuilder],\n bind: bindChannelController,\n remove: unbindChannelController,\n inject: injectChannelController,\n build: container => Promise.resolve(_build(container)),\n});\n","export enum LOG_LEVEL {\n MILESTONE = 1,\n TRACE = 2,\n VERBOSE = 3,\n INFO = 4,\n WARN = 5,\n ERROR = 6,\n FATAL = 7,\n ASSERT = 8,\n}\n\nexport interface ILogger {\n assert: (condition: boolean | number | string, message: string) => void;\n log: (logLevel: LOG_LEVEL, message: string) => void;\n}\n","const DEFAULT_FILE_SIZE = 52428800; /* 50MiB */\nconst PROGRESS_THRESHOLD = 0.1; /* 1% of 0->1 */\nconst DEFAULT_TIMEOUT_MS = 300000; /* 300s in MS */\n\nconst _clamp = (value: number, min: number, max: number): number =>\n Math.max(Math.min(value, max), min);\n\nconst _responseWithProgressCallbacks = (\n response: Response & { body: ReadableStream },\n callback?: (progress: number) => void,\n): Response => {\n const contentLength = parseInt(\n response.headers.get('Content-Length') ?? `${DEFAULT_FILE_SIZE}`,\n 10,\n );\n\n const stream = new ReadableStream({\n start: async (controller): Promise => {\n const reader = response.body.getReader();\n let readerIndex = 0;\n let lastProgress = 0;\n\n while (readerIndex < contentLength) {\n const { done, value } = await reader.read().catch(error => {\n controller.error(error);\n return { done: true, value: null };\n });\n\n readerIndex += value?.length ?? 0;\n\n if (done) {\n readerIndex = contentLength;\n }\n\n const newProgress = _clamp(readerIndex / contentLength, 0, 1);\n const progressDelta = newProgress - lastProgress;\n\n /* Message 1% delta min */\n if (callback && progressDelta > PROGRESS_THRESHOLD) {\n callback(newProgress);\n lastProgress = newProgress;\n }\n\n controller.enqueue(value);\n }\n\n controller.close();\n },\n });\n\n return new Response(stream, response);\n};\n\nconst fetchWithProgress = async (\n request: Request,\n timeout?: number,\n callback?: (progress: number) => void,\n): Promise => {\n const controller = new AbortController();\n\n const timeoutId = setTimeout(() => {\n controller.abort();\n }, timeout ?? DEFAULT_TIMEOUT_MS);\n\n /* https://github.com/GoogleChrome/workbox/issues/1796 */\n const response = await fetch(\n request,\n request.mode === 'navigate' ? undefined : { signal: controller.signal },\n );\n\n const hasProgressSupport = response.body !== null;\n /* Cannot set `Response.type` in `new Response` hence CORS is not supported */\n const isCorsRequest = request.mode === 'cors';\n\n const responseReturn =\n hasProgressSupport && !isCorsRequest\n ? _responseWithProgressCallbacks(\n response as Response & { body: ReadableStream },\n callback,\n )\n : response;\n\n clearTimeout(timeoutId);\n\n return responseReturn;\n};\n\nexport default Object.freeze({\n fetchWithProgress,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IFetchHelper } from '../interface/fetch';\nimport { bindFetchHelper, injectFetchHelper, unbindFetchHelper } from '../interface/fetch';\nimport TYPES from '../interface/types';\nimport fetcher from './fetch';\n\nexport default buildBindable({\n id: TYPES.IFetchHelper,\n bind: bindFetchHelper,\n remove: unbindFetchHelper,\n inject: injectFetchHelper,\n build: () => Promise.resolve(fetcher),\n});\n","import type { ILogger } from './log.if';\nimport { LOG_LEVEL } from './log.if';\n\nconst logMap: Record void> = {\n /* eslint-disable no-console */\n [LOG_LEVEL.MILESTONE]: message => {\n console.info(message);\n },\n [LOG_LEVEL.TRACE]: message => {\n console.debug(message);\n },\n [LOG_LEVEL.VERBOSE]: message => {\n console.debug(message);\n },\n [LOG_LEVEL.INFO]: message => {\n console.info(message);\n },\n [LOG_LEVEL.WARN]: message => {\n console.warn(message);\n },\n [LOG_LEVEL.ERROR]: message => {\n console.error(message);\n },\n [LOG_LEVEL.FATAL]: message => {\n console.error(message);\n },\n [LOG_LEVEL.ASSERT]: message => {\n console.assert(true, message);\n },\n /* eslint-enable no-console */\n};\n\nfunction _consoleLog(logLevel: LOG_LEVEL, message: string): void {\n logMap[logLevel](message);\n}\n\nfunction logger(levels: LOG_LEVEL[]): ILogger {\n const object: ILogger = {\n assert: (condition, message) => {\n const fireBoolean = typeof condition === 'boolean' && condition;\n const fireNumber = typeof condition === 'number' && condition !== 0;\n const fireString = typeof condition === 'string' && condition.length > 0;\n\n if (fireBoolean || fireNumber || fireString) {\n _consoleLog(LOG_LEVEL.ASSERT, message);\n }\n },\n log: (level, msg) => {\n _consoleLog(level, msg);\n },\n };\n\n return object;\n}\n\nexport default logger;\n","import type { ILog } from '@monofe/util';\nimport consoleLoggerInstantiator from './log.console';\nimport type { ILogger } from './log.if';\nimport { LOG_LEVEL } from './log.if';\n\n/* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/dot-notation */\nconst BUILD_ENVIRONMENT = String(process.env['NODE_ENV']) || 'unknown';\n\nconst ENV_IS_DEVELOPMENT = BUILD_ENVIRONMENT !== 'production';\n\nconst LOG_LEVEL_DEV = [\n LOG_LEVEL.MILESTONE,\n LOG_LEVEL.TRACE,\n LOG_LEVEL.VERBOSE,\n LOG_LEVEL.INFO,\n LOG_LEVEL.WARN,\n LOG_LEVEL.ERROR,\n LOG_LEVEL.FATAL,\n LOG_LEVEL.ASSERT,\n];\nconst LOG_LEVEL_PROD = [LOG_LEVEL.WARN, LOG_LEVEL.ERROR, LOG_LEVEL.FATAL, LOG_LEVEL.ASSERT];\n\nconst _logLevels = (): LOG_LEVEL[] => (ENV_IS_DEVELOPMENT ? LOG_LEVEL_DEV : LOG_LEVEL_PROD);\n\nconst _buildLoggers = (logLevels: LOG_LEVEL[]): ILogger[] => [consoleLoggerInstantiator(logLevels)];\n\nfunction logger(): ILog {\n const logLevels = _logLevels();\n const loggers: ILogger[] = _buildLoggers(logLevels);\n const middlewares: ((message: string) => string)[] = [];\n\n const isLogLevelEnabled = (logLevel: LOG_LEVEL): boolean => logLevels.includes(logLevel);\n\n const logAll = (logLevel: LOG_LEVEL, message: string): void => {\n const logMessage =\n middlewares.length > 0\n ? middlewares.reduce(\n (currentMessage, middleware) => middleware(currentMessage),\n message,\n )\n : message;\n\n if (logMessage.length <= 0) {\n /* Nothing to do */\n return;\n }\n\n for (const logger of loggers) {\n logger.log(logLevel, message);\n }\n };\n\n const assertAll = (condition: boolean | number | string, message: string): void => {\n for (const logger of loggers) {\n logger.assert(condition, message);\n }\n };\n\n const logNoop = (_: string): void => {\n /* No-Op */\n };\n\n const logAssertNoop = (_: boolean | number | string, __: string | undefined): void => {\n /* No-Op */\n };\n\n const module: ILog = {\n milestone: isLogLevelEnabled(LOG_LEVEL.MILESTONE)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.MILESTONE, msg);\n }\n : logNoop,\n verbose: isLogLevelEnabled(LOG_LEVEL.VERBOSE)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.VERBOSE, msg);\n }\n : logNoop,\n trace: isLogLevelEnabled(LOG_LEVEL.TRACE)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.TRACE, msg);\n }\n : logNoop,\n info: isLogLevelEnabled(LOG_LEVEL.INFO)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.INFO, msg);\n }\n : logNoop,\n warn: isLogLevelEnabled(LOG_LEVEL.WARN)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.WARN, msg);\n }\n : logNoop,\n warning: isLogLevelEnabled(LOG_LEVEL.WARN)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.WARN, msg);\n }\n : logNoop,\n error: isLogLevelEnabled(LOG_LEVEL.ERROR)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.ERROR, msg);\n }\n : logNoop,\n fatal: isLogLevelEnabled(LOG_LEVEL.FATAL)\n ? (msg: string): void => {\n logAll(LOG_LEVEL.FATAL, msg);\n }\n : logNoop,\n assert: isLogLevelEnabled(LOG_LEVEL.ASSERT)\n ? (condition: boolean | number | string, message: string | undefined): void => {\n assertAll(condition, message ?? 'Assertion check failed');\n }\n : logAssertNoop,\n\n addMiddleware: middleware => middlewares.push(middleware),\n removeMiddleware: middleware => delete middlewares[middlewares.indexOf(middleware)],\n };\n\n return module;\n}\n\nexport default logger;\n","import { buildBindable } from '@monofe/di';\nimport type { ILog } from '@monofe/util';\nimport { bindLog, injectLog, TYPES as UTIL_TYPES, unbindLog } from '@monofe/util';\nimport log from './log';\n\nexport default buildBindable({\n id: UTIL_TYPES.ILog,\n bind: bindLog,\n remove: unbindLog,\n inject: injectLog,\n build: () => Promise.resolve(log()),\n});\n","interface IRegexSerialized {\n pattern: string;\n flags: string;\n lastIndex?: number;\n}\n\nfunction _isRegexSerialized(object: unknown): object is IRegexSerialized {\n const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record = object as Partial;\n\n return !isNullOrUndefined(record.pattern) && !isNullOrUndefined(record.flags);\n}\n\nfunction _serialize(regex: RegExp): IRegexSerialized {\n const state: IRegexSerialized = {\n pattern: regex.source,\n /* Always unicode */\n flags: `u${regex.global ? 'g' : ''}${regex.ignoreCase ? 'i' : ''}${\n regex.multiline ? 'm' : ''\n }`,\n };\n\n if (regex.lastIndex !== 0) {\n state.lastIndex = regex.lastIndex;\n }\n\n return state;\n}\n\nfunction _expand(state: IRegexSerialized): RegExp {\n const regExp = new RegExp(state.pattern, state.flags);\n regExp.lastIndex = state.lastIndex ?? 0;\n return regExp;\n}\n\n/* Stages (encode)\n 1. Construct IRegexSerialized object representing RegExp \n 2. Use JSON.stringify to convert from IRegexSerialized to string\n 3. use encodeURI to ensure any unicode sequences will be preserved \n*/\nfunction stringify(regex: RegExp): string {\n return encodeURI(JSON.stringify(_serialize(regex)));\n}\n\nfunction parse(regex: string): RegExp {\n const result = JSON.parse(decodeURI(regex)) as unknown;\n\n if (!_isRegexSerialized(result)) {\n throw new Error(`Unexpected parsing of non-regex string: ${regex}`);\n }\n\n return _expand(result);\n}\n\nexport default Object.freeze({\n stringify,\n parse,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IRegexSerializer } from '../interface/regex';\nimport {\n bindRegexSerializer,\n injectRegexSerializer,\n unbindRegexSerializer,\n} from '../interface/regex';\nimport TYPES from '../interface/types';\nimport regex from './regex';\n\nexport default buildBindable({\n id: TYPES.IRegexSerializer,\n bind: bindRegexSerializer,\n remove: unbindRegexSerializer,\n inject: injectRegexSerializer,\n build: () => Promise.resolve(regex),\n});\n","import type { IRequestSerialized, IRequestSerializer } from '../interface/requestSerializer';\n\nfunction _serializeHeaders(headers: Headers): Record {\n const serialized: Record = {};\n\n headers.forEach((value, key) => {\n serialized[key] = String(value);\n });\n\n return serialized;\n}\n\nfunction serializeRequest(request: Request): Promise {\n const serialized: IRequestSerialized = {\n url: request.url,\n headers: _serializeHeaders(request.headers),\n method: request.method,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n referrerPolicy: request.referrerPolicy,\n isHistoryNavigation:\n (request as unknown as IRequestSerialized).isHistoryNavigation || false,\n isReloadNavigation: (request as unknown as IRequestSerialized).isReloadNavigation || false,\n integrity: request.integrity,\n destination: request.destination,\n body: '',\n };\n\n /* Only if method is not `GET` or `HEAD` is the request allowed to have body. */\n if (request.method === 'GET') {\n return Promise.resolve(serialized);\n }\n if (request.method === 'HEAD') {\n return Promise.resolve(serialized);\n } else {\n return request\n .clone()\n .text()\n .then(body => {\n serialized.body = body;\n return Promise.resolve(serialized);\n });\n }\n}\n\nfunction deserializeRequest(requestIn: IRequestSerialized): Request {\n const request = new Request('', {\n ...requestIn,\n headers: new Headers(requestIn.headers),\n });\n return request;\n}\n\nfunction serializer(): Readonly {\n const val: IRequestSerializer = {\n serialize: serializeRequest,\n parse: deserializeRequest,\n };\n\n return Object.freeze(val);\n}\n\nexport default serializer;\n","import { buildBindable } from '@monofe/di';\nimport { bindRequestSerializer } from '../interface';\nimport type { IRequestSerializer } from '../interface/requestSerializer';\nimport { injectRequestSerializer, unbindRequestSerializer } from '../interface/requestSerializer';\nimport TYPES from '../interface/types';\nimport requestJSON from './requestJSON';\n\nexport default buildBindable({\n id: TYPES.IRequestSerializer,\n bind: bindRequestSerializer,\n remove: unbindRequestSerializer,\n inject: injectRequestSerializer,\n build: () => Promise.resolve(requestJSON()),\n});\n","import type { IResponseSerialized, IResponseSerializer } from '../interface/responseSerializer';\n\nfunction _serializeHeaders(headers: Headers): Record {\n const serialized: Record = {};\n\n headers.forEach((value, key) => {\n serialized[key] = value;\n });\n\n return serialized;\n}\n\nfunction serializeResponse(response: Response): Promise {\n const serialized: IResponseSerialized = {\n headers: _serializeHeaders(response.headers),\n status: response.status,\n statusText: response.statusText,\n body: '',\n };\n\n return response\n .clone()\n .text()\n .then(body => {\n serialized.body = body;\n return Promise.resolve(serialized);\n });\n}\n\nfunction deserializeResponse(data: IResponseSerialized): Response {\n const response = new Response(data.body, data);\n return response;\n}\n\nfunction serializer(): IResponseSerializer {\n const val: IResponseSerializer = {\n serialize: serializeResponse,\n parse: deserializeResponse,\n };\n\n return val;\n}\n\nexport default serializer;\n","import { buildBindable } from '@monofe/di';\nimport type { IResponseSerializer } from '../interface/responseSerializer';\nimport {\n bindResponseSerializer,\n injectResponseSerializer,\n unbindResponseSerializer,\n} from '../interface/responseSerializer';\nimport TYPES from '../interface/types';\nimport responseJSON from './responseJSON';\n\nexport default buildBindable({\n id: TYPES.IResponseSerializer,\n bind: bindResponseSerializer,\n remove: unbindResponseSerializer,\n inject: injectResponseSerializer,\n build: () => Promise.resolve(responseJSON()),\n});\n","import { buildBindable } from '@monofe/di';\nimport type { ISettingsStorage } from '../interface';\nimport {\n bindSettingsStorage,\n injectSettingsStorage,\n unbindSettingsStorage,\n} from '../interface/settingsStorage';\nimport TYPES from '../interface/types';\nconst loader = import('./settingsStorage');\n\nasync function _build(): Promise> {\n const module = await loader;\n return module.default();\n}\n\nexport default buildBindable({\n id: TYPES.ISettingsStorage,\n bind: bindSettingsStorage,\n remove: unbindSettingsStorage,\n inject: injectSettingsStorage,\n build: _build,\n});\n","import type { IZipEntryInfo, ZipBinaryStorageType } from '@monofe/util';\nimport type { ZipEntry, ZipInfo } from 'unzipit';\nimport { unzip } from 'unzipit';\n\nfunction _zipFile(sourceData: ArrayBuffer | Blob): Promise {\n return unzip(sourceData);\n}\n\nfunction _isBlob(object: unknown): object is Blob {\n const blobObject = globalThis.Blob as unknown as Blob | undefined;\n\n if (blobObject === undefined) {\n return false;\n }\n\n return (\n object instanceof globalThis.Blob ||\n ['[object Blob]', '[object File]'].includes(Object.prototype.toString.call(object))\n );\n}\n\nfunction _isArrayBuffer(object: unknown): object is ArrayBuffer | Buffer {\n const arrayBufferObject = globalThis.ArrayBuffer as unknown as ArrayBuffer | undefined;\n\n if (arrayBufferObject === undefined) {\n return false;\n }\n\n return object instanceof globalThis.ArrayBuffer || object instanceof Buffer;\n}\n\nasync function _unzipEntry(\n sourceData: T,\n entry: ZipEntry,\n): Promise {\n if (_isBlob(sourceData)) {\n const result = await entry.blob();\n return result as T;\n } else if (_isArrayBuffer(sourceData)) {\n const result = await entry.arrayBuffer();\n return result as T;\n } else {\n throw new Error(`unknown zip src-data type ${typeof sourceData}, entry:${entry.name}`);\n }\n}\n\nasync function _unzipFile(\n sourceData: T,\n fileName: string,\n): Promise {\n const zipFile = await _zipFile(sourceData);\n\n const matchedEntries = Object.entries(zipFile.entries)\n .filter(entry => entry[1].name === fileName)\n .map(value => value[1]);\n\n const primaryMatch = matchedEntries.at(0);\n\n if (!primaryMatch) {\n throw new Error('No matching files found');\n }\n\n const result = await _unzipEntry(sourceData, primaryMatch);\n\n return result;\n}\n\nasync function _unzipAll(\n sourceData: T,\n): Promise> {\n const zipFile = await _zipFile(sourceData);\n\n const _extractEntry = async (entry: Readonly): Promise<{ name: string; data: T }> => {\n const data = await _unzipEntry(sourceData, entry);\n return { name: entry.name, data };\n };\n\n const extractedFiles: { name: string; data: T }[] = await Promise.all(\n Object.entries(zipFile.entries).map(entry => _extractEntry(entry[1])),\n );\n\n const items: Record = extractedFiles.reduce(\n (currentValue, newValue) => Object.assign(currentValue, newValue),\n {},\n );\n\n return items;\n}\n\nasync function _listings(blobData: ZipBinaryStorageType): Promise {\n const zipFile = await _zipFile(blobData);\n const entries = Object.entries(zipFile.entries).map(entry => entry[1].name);\n return entries;\n}\n\nasync function _fileInfo(\n blobData: T,\n fileName: string,\n): Promise {\n const zipFile = await _zipFile(blobData);\n const entry = Object.entries(zipFile.entries)\n .filter(zipEntry => zipEntry[1].name === fileName)\n .map(zipEntry => zipEntry[1])\n .at(-1);\n if (!entry) {\n throw new Error(`No entry found for file: ${fileName}`);\n }\n\n return {\n ...entry,\n lastModifiedDate: entry.lastModDate,\n };\n}\n\nexport default Object.freeze({\n unzipFile: _unzipFile,\n unzipAll: _unzipAll,\n listings: _listings,\n fileInfo: _fileInfo,\n});\n","import { buildBindable } from '@monofe/di';\nimport type { IZip } from '@monofe/util';\nimport { bindZip, injectZip, TYPES, unbindZip } from '@monofe/util';\nimport zip from './zip';\n\nexport default buildBindable({\n id: TYPES.IZip,\n bind: bindZip,\n remove: unbindZip,\n inject: injectZip,\n build: () => Promise.resolve(zip),\n});\n","import { buildBinderListings } from '@monofe/di';\nimport cacheBind from './impl/cache.bind';\nimport callbackBind from './impl/callback.bind';\nimport channelBind from './impl/channel.bind';\nimport fetchHelperBind from './impl/fetch.bind';\nimport loggerBind from './impl/log.bind';\nimport regexJSONBind from './impl/regex.bind';\nimport requestJSONBind from './impl/requestJSON.bind';\nimport responseJSONBind from './impl/responseJSON.bind';\nimport kvStorageBind from './impl/settingsStorage.bind';\nimport zipBind from './impl/zip.bind';\n\nexport default buildBinderListings([\n cacheBind,\n callbackBind,\n channelBind,\n fetchHelperBind,\n loggerBind,\n regexJSONBind,\n requestJSONBind,\n responseJSONBind,\n kvStorageBind,\n zipBind,\n]);\n","import { buildBinderListings } from '@monofe/di';\nimport bindClient from './client/bind';\nimport bindMessage from './message/bind';\nimport bindUtil from './util/bind';\n\nexport default buildBinderListings([bindClient, bindUtil, bindMessage]);\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport interface ICacheStorage {\n open: (name: string) => Promise;\n insert: (cache: Cache, request: Request, response: Response) => Promise;\n exists: (cache: Cache, request: Request) => Promise;\n}\n\nexport function injectCacheStorage(\n container: IContainer = injectOrBuildContainer(),\n): ICacheStorage {\n return container.get(TYPES.ICacheStorage);\n}\n\nexport function bindCacheStorage(\n val: ICacheStorage,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ICacheStorage, val);\n}\n\nexport function unbindCacheStorage(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ICacheStorage);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport enum IChannelStatus {\n Undef = 0,\n Active = 1,\n Expired = 2,\n LastValue = 3,\n}\n\nexport interface IChannelEventMap {\n Error: (error: Error) => void;\n NewMessage: (message: unknown) => void;\n StatusChanged: (newStatus: IChannelStatus) => void;\n}\n\nexport interface IChannelPort {\n postMessage: (key: string, message: unknown) => void;\n postMessageRequest: (callback: (key: string, message: unknown) => void) => void;\n onMessageResponse: (callback: (key: string, message: unknown) => void) => void;\n}\n\nexport type IChannelID = string;\n\nexport interface IChannel {\n id: () => IChannelID;\n status: () => IChannelStatus;\n postMessage: (message: unknown) => void;\n addEventListener: <\n Event extends keyof IChannelEventMap,\n Callback extends IChannelEventMap[Event],\n >(\n key: string,\n event: Event,\n callback: Callback,\n ) => void;\n removeListener: (key: string, event: Event) => void;\n terminate: () => void;\n}\n\nexport interface IChannelController {\n channel: (key: IChannelID) => IChannel;\n all: () => IChannel[];\n}\n\nexport function injectChannelController(\n container: IContainer = injectOrBuildContainer(),\n): IChannelController {\n return container.get(TYPES.IChannelController);\n}\n\nexport function bindChannelController(\n val: IChannelController,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IChannelController, val);\n}\n\nexport function unbindChannelController(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IChannelController);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport interface IFetchHelper {\n fetchWithProgress: (\n request: Request,\n timeout?: number,\n callback?: (progress: number) => void,\n ) => Promise;\n}\n\nexport function injectFetchHelper(container: IContainer = injectOrBuildContainer()): IFetchHelper {\n return container.get(TYPES.IFetchHelper);\n}\n\nexport function bindFetchHelper(\n val: IFetchHelper,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IFetchHelper, val);\n}\n\nexport function unbindFetchHelper(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IFetchHelper);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport interface IRegexSerializer {\n stringify: (regex: RegExp) => string;\n parse: (regex: string) => RegExp;\n}\n\nexport function injectRegexSerializer(\n container: IContainer = injectOrBuildContainer(),\n): IRegexSerializer {\n return container.get(TYPES.IRegexSerializer);\n}\n\nexport function bindRegexSerializer(\n val: IRegexSerializer,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IRegexSerializer, val);\n}\n\nexport function unbindRegexSerializer(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IRegexSerializer);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport interface IRequestSerialized {\n headers: Record;\n url: string;\n method: string;\n mode: RequestMode | undefined;\n credentials: RequestCredentials | undefined;\n cache: RequestCache;\n redirect: RequestRedirect | undefined;\n referrer: string;\n referrerPolicy: ReferrerPolicy;\n isHistoryNavigation: boolean;\n isReloadNavigation: boolean;\n integrity: string;\n destination: string;\n body: string;\n}\n\nexport interface IRequestSerializer {\n serialize: (request: Request) => Promise;\n parse: (request: IRequestSerialized) => Request;\n}\n\nexport function injectRequestSerializer(\n container: IContainer = injectOrBuildContainer(),\n): IRequestSerializer {\n return container.get(TYPES.IRequestSerializer);\n}\n\nexport function bindRequestSerializer(\n val: IRequestSerializer,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IRequestSerializer, val);\n}\n\nexport function unbindRequestSerializer(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IRequestSerializer);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport interface IResponseSerialized {\n headers: Record;\n status: number;\n statusText: string;\n body: string;\n}\n\nexport interface IResponseSerializer {\n serialize: (request: Response) => Promise;\n parse: (request: IResponseSerialized) => Response;\n}\n\nexport function injectResponseSerializer(\n container: IContainer = injectOrBuildContainer(),\n): IResponseSerializer {\n return container.get(TYPES.IResponseSerializer);\n}\n\nexport function bindResponseSerializer(\n val: IResponseSerializer,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IResponseSerializer, val);\n}\n\nexport function unbindResponseSerializer(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IResponseSerializer);\n}\n","import type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport TYPES from './types';\n\nexport type ISettingsKey = Date | number | string;\n\nexport interface ISettingsStorage {\n get: (key: ISettingsKey) => Promise;\n set: (key: ISettingsKey, val: unknown) => Promise;\n delete: (key: ISettingsKey) => Promise;\n clear: () => Promise;\n keys: () => Promise;\n}\n\nexport function injectSettingsStorage(\n container: IContainer = injectOrBuildContainer(),\n): ISettingsStorage {\n return container.get(TYPES.ISettingsStorage);\n}\n\nexport function bindSettingsStorage(\n val: ISettingsStorage,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.ISettingsStorage, val);\n}\n\nexport function unbindSettingsStorage(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.ISettingsStorage);\n}\n","const TYPES = {\n ICacheStorage: Symbol.for('ICacheStorage'),\n\n IChannelController: Symbol.for('IChannelController'),\n\n ICallbackBuilder: Symbol.for('ICallbackBuilder'),\n\n IFetchHelper: Symbol.for('IFetchHelper'),\n\n ISettingsStorage: Symbol.for('ISettingsStorage'),\n\n IRegexSerializer: Symbol.for('IRegexSerializer'),\n\n IRequestSerializer: Symbol.for('IRequestSerializer'),\n\n IResponseSerializer: Symbol.for('IResponseSerializer'),\n};\n\nexport default TYPES;\n","module.exports = require('./dist/shared/lib/head')\n","module.exports = require('./dist/client/link')\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */\n\nvar hasElementType = typeof Element !== 'undefined';\nvar hasMap = typeof Map === 'function';\nvar hasSet = typeof Set === 'function';\nvar hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;\n\n// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js\n\nfunction equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function isEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if (((error.message || '').match(/stack|recursion/i))) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('react-fast-compare cannot handle circular refs');\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = format;\nvar smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\\.?|via)$/i;\nfunction toTitleCase(string) {\n return string.toString().trim().replace(/[A-Za-z0-9\\u00C0-\\u00FF]+[^\\s-]*/g, function (match, index, title) {\n if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== \":\" && (title.charAt(index + match.length) !== \"-\" || title.charAt(index - 1) === \"-\") && title.charAt(index - 1).search(/[^\\s-]/) < 0) {\n return match.toLowerCase();\n }\n if (match.substr(1).search(/[A-Z]|\\../) > -1) {\n return match;\n }\n return match.charAt(0).toUpperCase() + match.substr(1);\n });\n}\n\n// See if s could be an email address. We don't want to send personal data like email.\n// https://support.google.com/analytics/answer/2795983?hl=en\nfunction mightBeEmail(s) {\n // There's no point trying to validate rfc822 fully, just look for ...@...\n return typeof s === \"string\" && s.indexOf(\"@\") !== -1;\n}\nvar redacted = \"REDACTED (Potential Email Address)\";\nfunction redactEmail(string) {\n if (mightBeEmail(string)) {\n console.warn(\"This arg looks like an email address, redacting.\");\n return redacted;\n }\n return string;\n}\nfunction format() {\n var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var _str = s || \"\";\n if (titleCase) {\n _str = toTitleCase(s);\n }\n if (redactingEmail) {\n _str = redactEmail(_str);\n }\n return _str;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.GA4 = void 0;\nvar _gtag = _interopRequireDefault(require(\"./gtag\"));\nvar _format = _interopRequireDefault(require(\"./format\"));\nvar _excluded = [\"eventCategory\", \"eventAction\", \"eventLabel\", \"eventValue\", \"hitType\"],\n _excluded2 = [\"title\", \"location\"],\n _excluded3 = [\"page\", \"hitType\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/*\nLinks\nhttps://developers.google.com/gtagjs/reference/api\nhttps://developers.google.com/tag-platform/gtagjs/reference\n*/\n/**\n * @typedef GaOptions\n * @type {Object}\n * @property {boolean} [cookieUpdate=true]\n * @property {number} [cookieExpires=63072000] Default two years\n * @property {string} [cookieDomain=\"auto\"]\n * @property {string} [cookieFlags]\n * @property {string} [userId]\n * @property {string} [clientId]\n * @property {boolean} [anonymizeIp]\n * @property {string} [contentGroup1]\n * @property {string} [contentGroup2]\n * @property {string} [contentGroup3]\n * @property {string} [contentGroup4]\n * @property {string} [contentGroup5]\n * @property {boolean} [allowAdFeatures=true]\n * @property {boolean} [allowAdPersonalizationSignals]\n * @property {boolean} [nonInteraction]\n * @property {string} [page]\n */\n/**\n * @typedef UaEventOptions\n * @type {Object}\n * @property {string} action\n * @property {string} category\n * @property {string} [label]\n * @property {number} [value]\n * @property {boolean} [nonInteraction]\n * @property {('beacon'|'xhr'|'image')} [transport]\n */\n/**\n * @typedef InitOptions\n * @type {Object}\n * @property {string} trackingId\n * @property {GaOptions|any} [gaOptions]\n * @property {Object} [gtagOptions] New parameter\n */\nvar GA4 = /*#__PURE__*/function () {\n function GA4() {\n var _this = this;\n _classCallCheck(this, GA4);\n _defineProperty(this, \"reset\", function () {\n _this.isInitialized = false;\n _this._testMode = false;\n _this._currentMeasurementId;\n _this._hasLoadedGA = false;\n _this._isQueuing = false;\n _this._queueGtag = [];\n });\n _defineProperty(this, \"_gtag\", function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (!_this._testMode) {\n if (_this._isQueuing) {\n _this._queueGtag.push(args);\n } else {\n _gtag[\"default\"].apply(void 0, args);\n }\n } else {\n _this._queueGtag.push(args);\n }\n });\n _defineProperty(this, \"_loadGA\", function (GA_MEASUREMENT_ID, nonce) {\n var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"https://www.googletagmanager.com/gtag/js\";\n if (typeof window === \"undefined\" || typeof document === \"undefined\") {\n return;\n }\n if (!_this._hasLoadedGA) {\n // Global Site Tag (gtag.js) - Google Analytics\n var script = document.createElement(\"script\");\n script.async = true;\n script.src = \"\".concat(gtagUrl, \"?id=\").concat(GA_MEASUREMENT_ID);\n if (nonce) {\n script.setAttribute(\"nonce\", nonce);\n }\n document.body.appendChild(script);\n window.dataLayer = window.dataLayer || [];\n window.gtag = function gtag() {\n window.dataLayer.push(arguments);\n };\n _this._hasLoadedGA = true;\n }\n });\n _defineProperty(this, \"_toGtagOptions\", function (gaOptions) {\n if (!gaOptions) {\n return;\n }\n var mapFields = {\n // Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate\n // New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update\n cookieUpdate: \"cookie_update\",\n cookieExpires: \"cookie_expires\",\n cookieDomain: \"cookie_domain\",\n cookieFlags: \"cookie_flags\",\n // must be in set method?\n userId: \"user_id\",\n clientId: \"client_id\",\n anonymizeIp: \"anonymize_ip\",\n // https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article\n contentGroup1: \"content_group1\",\n contentGroup2: \"content_group2\",\n contentGroup3: \"content_group3\",\n contentGroup4: \"content_group4\",\n contentGroup5: \"content_group5\",\n // https://support.google.com/analytics/answer/9050852?hl=en\n allowAdFeatures: \"allow_google_signals\",\n allowAdPersonalizationSignals: \"allow_ad_personalization_signals\",\n nonInteraction: \"non_interaction\",\n page: \"page_path\",\n hitCallback: \"event_callback\"\n };\n var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n if (mapFields[key]) {\n prev[mapFields[key]] = value;\n } else {\n prev[key] = value;\n }\n return prev;\n }, {});\n return gtagOptions;\n });\n _defineProperty(this, \"initialize\", function (GA_MEASUREMENT_ID) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!GA_MEASUREMENT_ID) {\n throw new Error(\"Require GA_MEASUREMENT_ID\");\n }\n var initConfigs = typeof GA_MEASUREMENT_ID === \"string\" ? [{\n trackingId: GA_MEASUREMENT_ID\n }] : GA_MEASUREMENT_ID;\n _this._currentMeasurementId = initConfigs[0].trackingId;\n var gaOptions = options.gaOptions,\n gtagOptions = options.gtagOptions,\n nonce = options.nonce,\n _options$testMode = options.testMode,\n testMode = _options$testMode === void 0 ? false : _options$testMode,\n gtagUrl = options.gtagUrl;\n _this._testMode = testMode;\n if (!testMode) {\n _this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);\n }\n if (!_this.isInitialized) {\n _this._gtag(\"js\", new Date());\n initConfigs.forEach(function (config) {\n var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);\n if (Object.keys(mergedGtagOptions).length) {\n _this._gtag(\"config\", config.trackingId, mergedGtagOptions);\n } else {\n _this._gtag(\"config\", config.trackingId);\n }\n });\n }\n _this.isInitialized = true;\n if (!testMode) {\n var queues = _toConsumableArray(_this._queueGtag);\n _this._queueGtag = [];\n _this._isQueuing = false;\n while (queues.length) {\n var queue = queues.shift();\n _this._gtag.apply(_this, _toConsumableArray(queue));\n if (queue[0] === \"get\") {\n _this._isQueuing = true;\n }\n }\n }\n });\n _defineProperty(this, \"set\", function (fieldsObject) {\n if (!fieldsObject) {\n console.warn(\"`fieldsObject` is required in .set()\");\n return;\n }\n if (_typeof(fieldsObject) !== \"object\") {\n console.warn(\"Expected `fieldsObject` arg to be an Object\");\n return;\n }\n if (Object.keys(fieldsObject).length === 0) {\n console.warn(\"empty `fieldsObject` given to .set()\");\n }\n _this._gaCommand(\"set\", fieldsObject);\n });\n _defineProperty(this, \"_gaCommandSendEvent\", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {\n _this._gtag(\"event\", eventAction, _objectSpread(_objectSpread({\n event_category: eventCategory,\n event_label: eventLabel,\n value: eventValue\n }, fieldsObject && {\n non_interaction: fieldsObject.nonInteraction\n }), _this._toGtagOptions(fieldsObject)));\n });\n _defineProperty(this, \"_gaCommandSendEventParameters\", function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (typeof args[0] === \"string\") {\n _this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));\n } else {\n var _args$ = args[0],\n eventCategory = _args$.eventCategory,\n eventAction = _args$.eventAction,\n eventLabel = _args$.eventLabel,\n eventValue = _args$.eventValue,\n hitType = _args$.hitType,\n rest = _objectWithoutProperties(_args$, _excluded);\n _this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);\n }\n });\n _defineProperty(this, \"_gaCommandSendTiming\", function (timingCategory, timingVar, timingValue, timingLabel) {\n _this._gtag(\"event\", \"timing_complete\", {\n name: timingVar,\n value: timingValue,\n event_category: timingCategory,\n event_label: timingLabel\n });\n });\n _defineProperty(this, \"_gaCommandSendPageview\", function (page, fieldsObject) {\n if (fieldsObject && Object.keys(fieldsObject).length) {\n var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),\n title = _this$_toGtagOptions.title,\n location = _this$_toGtagOptions.location,\n rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);\n _this._gtag(\"event\", \"page_view\", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {\n page_path: page\n }), title && {\n page_title: title\n }), location && {\n page_location: location\n }), rest));\n } else if (page) {\n _this._gtag(\"event\", \"page_view\", {\n page_path: page\n });\n } else {\n _this._gtag(\"event\", \"page_view\");\n }\n });\n _defineProperty(this, \"_gaCommandSendPageviewParameters\", function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n if (typeof args[0] === \"string\") {\n _this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));\n } else {\n var _args$2 = args[0],\n page = _args$2.page,\n hitType = _args$2.hitType,\n rest = _objectWithoutProperties(_args$2, _excluded3);\n _this._gaCommandSendPageview(page, rest);\n }\n });\n _defineProperty(this, \"_gaCommandSend\", function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n var hitType = typeof args[0] === \"string\" ? args[0] : args[0].hitType;\n switch (hitType) {\n case \"event\":\n _this._gaCommandSendEventParameters.apply(_this, args);\n break;\n case \"pageview\":\n _this._gaCommandSendPageviewParameters.apply(_this, args);\n break;\n case \"timing\":\n _this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));\n break;\n case \"screenview\":\n case \"transaction\":\n case \"item\":\n case \"social\":\n case \"exception\":\n console.warn(\"Unsupported send command: \".concat(hitType));\n break;\n default:\n console.warn(\"Send command doesn't exist: \".concat(hitType));\n }\n });\n _defineProperty(this, \"_gaCommandSet\", function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n if (typeof args[0] === \"string\") {\n args[0] = _defineProperty({}, args[0], args[1]);\n }\n _this._gtag(\"set\", _this._toGtagOptions(args[0]));\n });\n _defineProperty(this, \"_gaCommand\", function (command) {\n for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {\n args[_key6 - 1] = arguments[_key6];\n }\n switch (command) {\n case \"send\":\n _this._gaCommandSend.apply(_this, args);\n break;\n case \"set\":\n _this._gaCommandSet.apply(_this, args);\n break;\n default:\n console.warn(\"Command doesn't exist: \".concat(command));\n }\n });\n _defineProperty(this, \"ga\", function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n if (typeof args[0] === \"string\") {\n _this._gaCommand.apply(_this, args);\n } else {\n var readyCallback = args[0];\n _this._gtag(\"get\", _this._currentMeasurementId, \"client_id\", function (clientId) {\n _this._isQueuing = false;\n var queues = _this._queueGtag;\n readyCallback({\n get: function get(property) {\n return property === \"clientId\" ? clientId : property === \"trackingId\" ? _this._currentMeasurementId : property === \"apiVersion\" ? \"1\" : undefined;\n }\n });\n while (queues.length) {\n var queue = queues.shift();\n _this._gtag.apply(_this, _toConsumableArray(queue));\n }\n });\n _this._isQueuing = true;\n }\n return _this.ga;\n });\n _defineProperty(this, \"event\", function (optionsOrName, params) {\n if (typeof optionsOrName === \"string\") {\n _this._gtag(\"event\", optionsOrName, _this._toGtagOptions(params));\n } else {\n var action = optionsOrName.action,\n category = optionsOrName.category,\n label = optionsOrName.label,\n value = optionsOrName.value,\n nonInteraction = optionsOrName.nonInteraction,\n transport = optionsOrName.transport;\n if (!category || !action) {\n console.warn(\"args.category AND args.action are required in event()\");\n return;\n }\n\n // Required Fields\n var fieldObject = {\n hitType: \"event\",\n eventCategory: (0, _format[\"default\"])(category),\n eventAction: (0, _format[\"default\"])(action)\n };\n\n // Optional Fields\n if (label) {\n fieldObject.eventLabel = (0, _format[\"default\"])(label);\n }\n if (typeof value !== \"undefined\") {\n if (typeof value !== \"number\") {\n console.warn(\"Expected `args.value` arg to be a Number.\");\n } else {\n fieldObject.eventValue = value;\n }\n }\n if (typeof nonInteraction !== \"undefined\") {\n if (typeof nonInteraction !== \"boolean\") {\n console.warn(\"`args.nonInteraction` must be a boolean.\");\n } else {\n fieldObject.nonInteraction = nonInteraction;\n }\n }\n if (typeof transport !== \"undefined\") {\n if (typeof transport !== \"string\") {\n console.warn(\"`args.transport` must be a string.\");\n } else {\n if ([\"beacon\", \"xhr\", \"image\"].indexOf(transport) === -1) {\n console.warn(\"`args.transport` must be either one of these values: `beacon`, `xhr` or `image`\");\n }\n fieldObject.transport = transport;\n }\n }\n _this._gaCommand(\"send\", fieldObject);\n }\n });\n _defineProperty(this, \"send\", function (fieldObject) {\n _this._gaCommand(\"send\", fieldObject);\n });\n this.reset();\n }\n _createClass(GA4, [{\n key: \"gtag\",\n value: function gtag() {\n this._gtag.apply(this, arguments);\n }\n }]);\n return GA4;\n}();\nexports.GA4 = GA4;\nvar _default = new GA4();\nexports[\"default\"] = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar gtag = function gtag() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof window !== \"undefined\") {\n var _window;\n if (typeof window.gtag === \"undefined\") {\n window.dataLayer = window.dataLayer || [];\n window.gtag = function gtag() {\n window.dataLayer.push(arguments);\n };\n }\n (_window = window).gtag.apply(_window, args);\n }\n};\nvar _default = gtag;\nexports[\"default\"] = _default;","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.ReactGAImplementation = void 0;\nvar _ga = _interopRequireWildcard(require(\"./ga4\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nvar ReactGAImplementation = _ga.GA4;\nexports.ReactGAImplementation = ReactGAImplementation;\nvar _default = _ga[\"default\"];\nexports[\"default\"] = _default;","/** @license React v17.0.2\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;\nif(\"function\"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x(\"react.element\");c=x(\"react.portal\");d=x(\"react.fragment\");e=x(\"react.strict_mode\");f=x(\"react.profiler\");g=x(\"react.provider\");h=x(\"react.context\");k=x(\"react.forward_ref\");l=x(\"react.suspense\");m=x(\"react.suspense_list\");n=x(\"react.memo\");p=x(\"react.lazy\");q=x(\"react.block\");r=x(\"react.server.block\");u=x(\"react.fundamental\");v=x(\"react.debug_trace_mode\");w=x(\"react.legacy_hidden\")}\nfunction y(a){if(\"object\"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;\nexports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};\nexports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||\"object\"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};\nexports.typeOf=y;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import React from 'react';\nexport var ReactReduxContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ReactReduxContext.displayName = 'ReactRedux';\n}\n\nexport default ReactReduxContext;","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nvar batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport var setBatch = function setBatch(newBatch) {\n return batch = newBatch;\n}; // Supply a getter just to skip dealing with ESM bindings\n\nexport var getBatch = function getBatch() {\n return batch;\n};","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nfunction createListenerCollection() {\n var batch = getBatch();\n var first = null;\n var last = null;\n return {\n clear: function clear() {\n first = null;\n last = null;\n },\n notify: function notify() {\n batch(function () {\n var listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get: function get() {\n var listeners = [];\n var listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n subscribe: function subscribe(callback) {\n var isSubscribed = true;\n var listener = last = {\n callback: callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\n\nvar nullListeners = {\n notify: function notify() {},\n get: function get() {\n return [];\n }\n};\nexport function createSubscription(store, parentSub) {\n var unsubscribe;\n var listeners = nullListeners;\n\n function addNestedSub(listener) {\n trySubscribe();\n return listeners.subscribe(listener);\n }\n\n function notifyNestedSubs() {\n listeners.notify();\n }\n\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n\n function isSubscribed() {\n return Boolean(unsubscribe);\n }\n\n function trySubscribe() {\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n\n function tryUnsubscribe() {\n if (unsubscribe) {\n unsubscribe();\n unsubscribe = undefined;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n\n var subscription = {\n addNestedSub: addNestedSub,\n notifyNestedSubs: notifyNestedSubs,\n handleChangeWrapper: handleChangeWrapper,\n isSubscribed: isSubscribed,\n trySubscribe: trySubscribe,\n tryUnsubscribe: tryUnsubscribe,\n getListeners: function getListeners() {\n return listeners;\n }\n };\n return subscription;\n}","import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;","import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { ReactReduxContext } from './Context';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\n\nfunction Provider(_ref) {\n var store = _ref.store,\n context = _ref.context,\n children = _ref.children;\n var contextValue = useMemo(function () {\n var subscription = createSubscription(store);\n subscription.onStateChange = subscription.notifyNestedSubs;\n return {\n store: store,\n subscription: subscription\n };\n }, [store]);\n var previousState = useMemo(function () {\n return store.getState();\n }, [store]);\n useIsomorphicLayoutEffect(function () {\n var subscription = contextValue.subscription;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return function () {\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n };\n }, [contextValue, previousState]);\n var Context = context || ReactReduxContext;\n return /*#__PURE__*/React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nif (process.env.NODE_ENV !== 'production') {\n Provider.propTypes = {\n store: PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n }),\n context: PropTypes.object,\n children: PropTypes.any\n };\n}\n\nexport default Provider;","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n/**\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\n * hook that you should usually not need to call directly.\n *\n * @returns {any} the value of the `ReactReduxContext`\n *\n * @example\n *\n * import React from 'react'\n * import { useReduxContext } from 'react-redux'\n *\n * export const CounterComponent = ({ value }) => {\n * const { store } = useReduxContext()\n * return
{store.getState()}
\n * }\n */\n\nexport function useReduxContext() {\n var contextValue = useContext(ReactReduxContext);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a ');\n }\n\n return contextValue;\n}","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\n *\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\n * @returns {Function} A `useDispatch` hook bound to the specified context.\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\n * A hook to access the redux `dispatch` function.\n *\n * @returns {any|function} redux store's `dispatch` function\n *\n * @example\n *\n * import React, { useCallback } from 'react'\n * import { useDispatch } from 'react-redux'\n *\n * export const CounterComponent = ({ value }) => {\n * const dispatch = useDispatch()\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\n * return (\n *
\n * {value}\n * \n *
\n * )\n * }\n */\n\nexport var useDispatch = /*#__PURE__*/createDispatchHook();","import { useReducer, useRef, useMemo, useContext, useDebugValue } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from '../components/Context';\n\nvar refEquality = function refEquality(a, b) {\n return a === b;\n};\n\nfunction useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {\n var _useReducer = useReducer(function (s) {\n return s + 1;\n }, 0),\n forceRender = _useReducer[1];\n\n var subscription = useMemo(function () {\n return createSubscription(store, contextSub);\n }, [store, contextSub]);\n var latestSubscriptionCallbackError = useRef();\n var latestSelector = useRef();\n var latestStoreState = useRef();\n var latestSelectedState = useRef();\n var storeState = store.getState();\n var selectedState;\n\n try {\n if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {\n var newSelectedState = selector(storeState); // ensure latest selected state is reused so that a custom equality function can result in identical references\n\n if (latestSelectedState.current === undefined || !equalityFn(newSelectedState, latestSelectedState.current)) {\n selectedState = newSelectedState;\n } else {\n selectedState = latestSelectedState.current;\n }\n } else {\n selectedState = latestSelectedState.current;\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n err.message += \"\\nThe error may be correlated with this previous error:\\n\" + latestSubscriptionCallbackError.current.stack + \"\\n\\n\";\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(function () {\n latestSelector.current = selector;\n latestStoreState.current = storeState;\n latestSelectedState.current = selectedState;\n latestSubscriptionCallbackError.current = undefined;\n });\n useIsomorphicLayoutEffect(function () {\n function checkForUpdates() {\n try {\n var newStoreState = store.getState(); // Avoid calling selector multiple times if the store's state has not changed\n\n if (newStoreState === latestStoreState.current) {\n return;\n }\n\n var _newSelectedState = latestSelector.current(newStoreState);\n\n if (equalityFn(_newSelectedState, latestSelectedState.current)) {\n return;\n }\n\n latestSelectedState.current = _newSelectedState;\n latestStoreState.current = newStoreState;\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n latestSubscriptionCallbackError.current = err;\n }\n\n forceRender();\n }\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n return function () {\n return subscription.tryUnsubscribe();\n };\n }, [store, subscription]);\n return selectedState;\n}\n/**\n * Hook factory, which creates a `useSelector` hook bound to a given context.\n *\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\n * @returns {Function} A `useSelector` hook bound to the specified context.\n */\n\n\nexport function createSelectorHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useSelector(selector, equalityFn) {\n if (equalityFn === void 0) {\n equalityFn = refEquality;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(\"You must pass a selector to useSelector\");\n }\n\n if (typeof selector !== 'function') {\n throw new Error(\"You must pass a function as a selector to useSelector\");\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(\"You must pass a function as an equality function to useSelector\");\n }\n }\n\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store,\n contextSub = _useReduxContext.subscription;\n\n var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\n * A hook to access the redux store's state. This hook takes a selector function\n * as an argument. The selector is called with the store state.\n *\n * This hook takes an optional equality comparison function as the second parameter\n * that allows you to customize the way the selected state is compared to determine\n * whether the component needs to be re-rendered.\n *\n * @param {Function} selector the selector function\n * @param {Function=} equalityFn the function that will be used to determine equality\n *\n * @returns {any} the selected state\n *\n * @example\n *\n * import React from 'react'\n * import { useSelector } from 'react-redux'\n *\n * export const CounterComponent = () => {\n * const counter = useSelector(state => state.counter)\n * return
{counter}
\n * }\n */\n\nexport var useSelector = /*#__PURE__*/createSelectorHook();","export * from './exports';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch'; // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/* unzipit@1.4.0, license MIT */\n/* global SharedArrayBuffer, process */\n\nfunction readBlobAsArrayBuffer(blob) {\n if (blob.arrayBuffer) {\n return blob.arrayBuffer();\n }\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', () => {\n resolve(reader.result);\n });\n reader.addEventListener('error', reject);\n reader.readAsArrayBuffer(blob);\n });\n}\n\nasync function readBlobAsUint8Array(blob) {\n const arrayBuffer = await readBlobAsArrayBuffer(blob);\n return new Uint8Array(arrayBuffer);\n}\n\nfunction isBlob(v) {\n return typeof Blob !== 'undefined' && v instanceof Blob;\n}\n\nfunction isSharedArrayBuffer(b) {\n return typeof SharedArrayBuffer !== 'undefined' && b instanceof SharedArrayBuffer;\n}\n\nconst isNode =\n (typeof process !== 'undefined') &&\n process.versions &&\n (typeof process.versions.node !== 'undefined') &&\n (typeof process.versions.electron === 'undefined');\n\nfunction isTypedArraySameAsArrayBuffer(typedArray) {\n return typedArray.byteOffset === 0 && typedArray.byteLength === typedArray.buffer.byteLength;\n}\n\nclass ArrayBufferReader {\n constructor(arrayBufferOrView) {\n this.typedArray = (arrayBufferOrView instanceof ArrayBuffer || isSharedArrayBuffer(arrayBufferOrView))\n ? new Uint8Array(arrayBufferOrView)\n : new Uint8Array(arrayBufferOrView.buffer, arrayBufferOrView.byteOffset, arrayBufferOrView.byteLength);\n }\n async getLength() {\n return this.typedArray.byteLength;\n }\n async read(offset, length) {\n return new Uint8Array(this.typedArray.buffer, this.typedArray.byteOffset + offset, length);\n }\n}\n\nclass BlobReader {\n constructor(blob) {\n this.blob = blob;\n }\n async getLength() {\n return this.blob.size;\n }\n async read(offset, length) {\n const blob = this.blob.slice(offset, offset + length);\n const arrayBuffer = await readBlobAsArrayBuffer(blob);\n return new Uint8Array(arrayBuffer);\n }\n async sliceAsBlob(offset, length, type = '') {\n return this.blob.slice(offset, offset + length, type);\n }\n}\n\nclass HTTPRangeReader {\n constructor(url) {\n this.url = url;\n }\n async getLength() {\n if (this.length === undefined) {\n const req = await fetch(this.url, { method: 'HEAD' });\n if (!req.ok) {\n throw new Error(`failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);\n }\n this.length = parseInt(req.headers.get('content-length'));\n if (Number.isNaN(this.length)) {\n throw Error('could not get length');\n }\n }\n return this.length;\n }\n async read(offset, size) {\n if (size === 0) {\n return new Uint8Array(0);\n }\n const req = await fetch(this.url, {\n headers: {\n Range: `bytes=${offset}-${offset + size - 1}`,\n },\n });\n if (!req.ok) {\n throw new Error(`failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size}: ${req.statusText}`);\n }\n const buffer = await req.arrayBuffer();\n return new Uint8Array(buffer);\n }\n}\n\nfunction inflate(data, buf) {\n\tvar u8=Uint8Array;\n\tif(data[0]==3 && data[1]==0) return (buf ? buf : new u8(0));\n\tvar bitsF = _bitsF, bitsE = _bitsE, decodeTiny = _decodeTiny, get17 = _get17;\n\t\n\tvar noBuf = (buf==null);\n\tif(noBuf) buf = new u8((data.length>>>2)<<3);\n\t\n\tvar BFINAL=0, BTYPE=0, HLIT=0, HDIST=0, HCLEN=0, ML=0, MD=0; \t\n\tvar off = 0, pos = 0;\n\tvar lmap, dmap;\n\t\n\twhile(BFINAL==0) {\t\t\n\t\tBFINAL = bitsF(data, pos , 1);\n\t\tBTYPE = bitsF(data, pos+1, 2); pos+=3;\n\t\t//console.log(BFINAL, BTYPE);\n\t\t\n\t\tif(BTYPE==0) {\n\t\t\tif((pos&7)!=0) pos+=8-(pos&7);\n\t\t\tvar p8 = (pos>>>3)+4, len = data[p8-4]|(data[p8-3]<<8); //console.log(len);//bitsF(data, pos, 16), \n\t\t\tif(noBuf) buf=_check(buf, off+len);\n\t\t\tbuf.set(new u8(data.buffer, data.byteOffset+p8, len), off);\n\t\t\t//for(var i=0; itl)tl=l; } pos+=3*HCLEN; //console.log(itree);\n\t\t\tmakeCodes(U.itree, tl);\n\t\t\tcodes2map(U.itree, tl, U.imap);\n\t\t\t\n\t\t\tlmap = U.lmap; dmap = U.dmap;\n\t\t\t\n\t\t\tpos = decodeTiny(U.imap, (1<>>24))-1; pos+=(ml&0xffffff);\n\t\t\tmakeCodes(U.ltree, mx0);\n\t\t\tcodes2map(U.ltree, mx0, lmap);\n\t\t\t\n\t\t\t//var md = decodeTiny(U.imap, (1<>>24))-1; pos+=(md&0xffffff);\n\t\t\tmakeCodes(U.dtree, mx1);\n\t\t\tcodes2map(U.dtree, mx1, dmap);\n\t\t}\n\t\t//var ooff=off, opos=pos;\n\t\twhile(true) {\n\t\t\tvar code = lmap[get17(data, pos) & ML]; pos += code&15;\n\t\t\tvar lit = code>>>4; //U.lhst[lit]++; \n\t\t\tif((lit>>>8)==0) { buf[off++] = lit; }\n\t\t\telse if(lit==256) { break; }\n\t\t\telse {\n\t\t\t\tvar end = off+lit-254;\n\t\t\t\tif(lit>264) { var ebs = U.ldef[lit-257]; end = off + (ebs>>>3) + bitsE(data, pos, ebs&7); pos += ebs&7; }\n\t\t\t\t//dst[end-off]++;\n\t\t\t\t\n\t\t\t\tvar dcode = dmap[get17(data, pos) & MD]; pos += dcode&15;\n\t\t\t\tvar dlit = dcode>>>4;\n\t\t\t\tvar dbs = U.ddef[dlit], dst = (dbs>>>4) + bitsF(data, pos, dbs&15); pos += dbs&15;\n\t\t\t\t\n\t\t\t\t//var o0 = off-dst, stp = Math.min(end-off, dst);\n\t\t\t\t//if(stp>20) while(off>>3);\n\t}\n\t//console.log(dst);\n\t//console.log(tlen, dlen, off-tlen+tcnt);\n\treturn buf.length==off ? buf : buf.slice(0,off);\n}\nfunction _check(buf, len) {\n\tvar bl=buf.length; if(len<=bl) return buf;\n\tvar nbuf = new Uint8Array(Math.max(bl<<1,len)); nbuf.set(buf,0);\n\t//for(var i=0; i>>4; \n\t\tif(lit<=15) { tree[i]=lit; i++; }\n\t\telse {\n\t\t\tvar ll = 0, n = 0;\n\t\t\tif(lit==16) {\n\t\t\t\tn = (3 + bitsE(data, pos, 2)); pos += 2; ll = tree[i-1];\n\t\t\t}\n\t\t\telse if(lit==17) {\n\t\t\t\tn = (3 + bitsE(data, pos, 3)); pos += 3;\n\t\t\t}\n\t\t\telse if(lit==18) {\n\t\t\t\tn = (11 + bitsE(data, pos, 7)); pos += 7;\n\t\t\t}\n\t\t\tvar ni = i+n;\n\t\t\twhile(i>>1;\n\twhile(imx)mx=v; i++; }\n\twhile(i>1;\n\t\tvar cl = tree[i+1], val = (lit<<4)|cl; // : (0x8000 | (U.of0[lit-257]<<7) | (U.exb[lit-257]<<4) | cl);\n\t\tvar rest = (MAX_BITS-cl), i0 = tree[i]<>>(15-MAX_BITS);\n\t\twhile(i0!=i1) {\n\t\t\tvar p0 = r15[i0]>>>(15-MAX_BITS);\n\t\t\tmap[p0]=val; i0++;\n\t\t}\n\t}\n}\nfunction revCodes(tree, MAX_BITS) {\n\tvar r15 = U.rev15, imb = 15-MAX_BITS;\n\tfor(var i=0; i>>imb; }\n}\n\nfunction _bitsE(dt, pos, length) { return ((dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) )>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16))>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8))>>>(pos&7))&511;\n} */\nfunction _get17(dt, pos) {\t// return at least 17 meaningful bytes\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) )>>>(pos&7);\n}\nconst U = function(){\n\tvar u16=Uint16Array, u32=Uint32Array;\n\treturn {\n\t\tnext_code : new u16(16),\n\t\tbl_count : new u16(16),\n\t\tordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n\t\tof0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n\t\texb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n\t\tldef : new u16(32),\n\t\tdf0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n\t\tdxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n\t\tddef : new u32(32),\n\t\tflmap: new u16( 512), fltree: [],\n\t\tfdmap: new u16( 32), fdtree: [],\n\t\tlmap : new u16(32768), ltree : [], ttree:[],\n\t\tdmap : new u16(32768), dtree : [],\n\t\timap : new u16( 512), itree : [],\n\t\t//rev9 : new u16( 512)\n\t\trev15: new u16(1<<15),\n\t\tlhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n\t\tlits : new u32(15000),\n\t\tstrt : new u16(1<<16),\n\t\tprev : new u16(1<<15)\n\t}; \n} ();\n\n(function(){\t\n\tvar len = 1<<15;\n\tfor(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n\t\tx = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n\t\tx = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n\t\tx = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n\t\tU.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n\t}\n\t\n\tfunction pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n\t\n\tfor(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n\t\n\tpushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n\t/*\n\tvar i = 0;\n\tfor(; i<=143; i++) U.fltree.push(0,8);\n\tfor(; i<=255; i++) U.fltree.push(0,9);\n\tfor(; i<=279; i++) U.fltree.push(0,7);\n\tfor(; i<=287; i++) U.fltree.push(0,8);\n\t*/\n\tmakeCodes(U.fltree, 9);\n\tcodes2map(U.fltree, 9, U.flmap);\n\trevCodes (U.fltree, 9);\n\t\n\tpushV(U.fdtree,32,5);\n\t//for(i=0;i<32; i++) U.fdtree.push(0,5);\n\tmakeCodes(U.fdtree, 5);\n\tcodes2map(U.fdtree, 5, U.fdmap);\n\trevCodes (U.fdtree, 5);\n\t\n\tpushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n\t/*\n\tfor(var i=0; i< 19; i++) U.itree.push(0,0);\n\tfor(var i=0; i<286; i++) U.ltree.push(0,0);\n\tfor(var i=0; i< 30; i++) U.dtree.push(0,0);\n\tfor(var i=0; i<320; i++) U.ttree.push(0,0);\n\t*/\n})();\n\nconst crc = {\r\n\ttable : ( function() {\r\n\t var tab = new Uint32Array(256);\r\n\t for (var n=0; n<256; n++) {\r\n\t\t\tvar c = n;\r\n\t\t\tfor (var k=0; k<8; k++) {\r\n\t\t\t\tif (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n\t\t\t\telse c = c >>> 1;\r\n\t\t\t}\r\n\t\t\ttab[n] = c; } \r\n\t\treturn tab; })(),\r\n\tupdate : function(c, buf, off, len) {\r\n\t\tfor (var i=0; i>> 8);\r\n\t\treturn c;\r\n\t},\r\n\tcrc : function(b,o,l) { return crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n};\r\n\r\nfunction inflateRaw(file, buf) { return inflate(file, buf); }\n\n/* global module */\n\nconst config = {\n numWorkers: 1,\n workerURL: '',\n useWorkers: false,\n};\n\nlet nextId = 0;\n\n// Requests are put on a queue.\n// We don't send the request to the worker until the worker\n// is finished. This probably adds a small amount of latency\n// but the issue is imagine you have 2 workers. You give worker\n// A x seconds of work to do and worker B y seconds of work to\n// do. You don't know which will finish first. If you give\n// the worker with more work to do the request then you'll\n// waste time.\n\n// note: we can't check `workers.length` for deciding if\n// we've reached `config.numWorkers` because creation the worker\n// is async which means other requests to make workers might\n// come in before a worker gets added to `workers`\nlet numWorkers = 0;\nlet canUseWorkers = true; // gets set to false if we can't start a worker\nconst workers = [];\nconst availableWorkers = [];\nconst waitingForWorkerQueue = [];\nconst currentlyProcessingIdToRequestMap = new Map();\n\nfunction handleResult(e) {\n makeWorkerAvailable(e.target);\n const {id, error, data} = e.data;\n const request = currentlyProcessingIdToRequestMap.get(id);\n currentlyProcessingIdToRequestMap.delete(id);\n if (error) {\n request.reject(error);\n } else {\n request.resolve(data);\n }\n}\n\n// Because Firefox uses non-standard onerror to signal an error.\nfunction startWorker(url) {\n return new Promise((resolve, reject) => {\n const worker = new Worker(url);\n worker.onmessage = (e) => {\n if (e.data === 'start') {\n worker.onerror = undefined;\n worker.onmessage = undefined;\n resolve(worker);\n } else {\n reject(new Error(`unexpected message: ${e.data}`));\n }\n };\n worker.onerror = reject;\n });\n}\n\nfunction dynamicRequire(mod, request) {\n return mod.require(request);\n}\n\nconst workerHelper = (function() {\n if (isNode) {\n // We need to use `dynamicRequire` because `require` on it's own will be optimized by webpack.\n const {Worker} = dynamicRequire(module, 'worker_threads');\n return {\n async createWorker(url) {\n return new Worker(url);\n },\n addEventListener(worker, fn) {\n worker.on('message', (data) => {\n fn({target: worker, data});\n });\n },\n async terminate(worker) {\n await worker.terminate();\n },\n };\n } else {\n return {\n async createWorker(url) {\n // I don't understand this security issue\n // Apparently there is some iframe setting or http header\n // that prevents cross domain workers. But, I can manually\n // download the text and do it. I reported this to Chrome\n // and they said it was fine so ¯\\_(ツ)_/¯\n try {\n const worker = await startWorker(url);\n return worker;\n } catch (e) {\n console.warn('could not load worker:', url);\n }\n\n let text;\n try {\n const req = await fetch(url, {mode: 'cors'});\n if (!req.ok) {\n throw new Error(`could not load: ${url}`);\n }\n text = await req.text();\n url = URL.createObjectURL(new Blob([text], {type: 'application/javascript'}));\n const worker = await startWorker(url);\n config.workerURL = url; // this is a hack. What's a better way to structure this code?\n return worker;\n } catch (e) {\n console.warn('could not load worker via fetch:', url);\n }\n\n if (text !== undefined) {\n try {\n url = `data:application/javascript;base64,${btoa(text)}`;\n const worker = await startWorker(url);\n config.workerURL = url;\n return worker;\n } catch (e) {\n console.warn('could not load worker via dataURI');\n }\n }\n\n console.warn('workers will not be used');\n throw new Error('can not start workers');\n },\n addEventListener(worker, fn) {\n worker.addEventListener('message', fn);\n },\n async terminate(worker) {\n worker.terminate();\n },\n };\n }\n}());\n\nfunction makeWorkerAvailable(worker) {\n availableWorkers.push(worker);\n processWaitingForWorkerQueue();\n}\n\nasync function getAvailableWorker() {\n if (availableWorkers.length === 0 && numWorkers < config.numWorkers) {\n ++numWorkers; // see comment at numWorkers declaration\n try {\n const worker = await workerHelper.createWorker(config.workerURL);\n workers.push(worker);\n availableWorkers.push(worker);\n workerHelper.addEventListener(worker, handleResult);\n } catch (e) {\n // set this global out-of-band (needs refactor)\n canUseWorkers = false;\n }\n }\n return availableWorkers.pop();\n}\n\n// @param {Uint8Array} src\n// @param {number} uncompressedSize\n// @param {string} [type] mime-type\n// @returns {ArrayBuffer|Blob} ArrayBuffer if type is falsy or Blob otherwise.\nfunction inflateRawLocal(src, uncompressedSize, type, resolve) {\n const dst = new Uint8Array(uncompressedSize);\n inflateRaw(src, dst);\n resolve(type\n ? new Blob([dst], {type})\n : dst.buffer);\n}\n\nasync function processWaitingForWorkerQueue() {\n if (waitingForWorkerQueue.length === 0) {\n return;\n }\n\n if (config.useWorkers && canUseWorkers) {\n const worker = await getAvailableWorker();\n // canUseWorkers might have been set out-of-band (need refactor)\n if (canUseWorkers) {\n if (worker) {\n if (waitingForWorkerQueue.length === 0) {\n // the queue might be empty while we awaited for a worker.\n makeWorkerAvailable(worker);\n return;\n }\n const {id, src, uncompressedSize, type, resolve, reject} = waitingForWorkerQueue.shift();\n currentlyProcessingIdToRequestMap.set(id, {id, resolve, reject});\n const transferables = [];\n // NOTE: Originally I thought you could transfer an ArrayBuffer.\n // The code on this side is often using views into the entire file\n // which means if we transferred we'd lose the entire file. That sucks\n // because it means there's an expensive copy to send the uncompressed\n // data to the worker.\n //\n // Also originally I thought we could send a Blob but we'd need to refactor\n // the code in unzipit/readEntryData as currently it reads the uncompressed\n // bytes.\n //\n //if (!isBlob(src) && !isSharedArrayBuffer(src)) {\n // transferables.push(src);\n //}\n worker.postMessage({\n type: 'inflate',\n data: {\n id,\n type,\n src,\n uncompressedSize,\n },\n }, transferables);\n }\n return;\n }\n }\n\n // inflate locally\n // We loop here because what happens if many requests happen at once\n // the first N requests will try to async make a worker. Other requests\n // will then be on the queue. But if we fail to make workers then there\n // are pending requests.\n while (waitingForWorkerQueue.length) {\n const {src, uncompressedSize, type, resolve} = waitingForWorkerQueue.shift();\n let data = src;\n if (isBlob(src)) {\n data = await readBlobAsUint8Array(src);\n }\n inflateRawLocal(data, uncompressedSize, type, resolve);\n }\n}\n\nfunction setOptions(options) {\n config.workerURL = options.workerURL || config.workerURL;\n // there's no reason to set the workerURL if you're not going to use workers\n if (options.workerURL) {\n config.useWorkers = true;\n }\n config.useWorkers = options.useWorkers !== undefined ? options.useWorkers : config.useWorkers;\n config.numWorkers = options.numWorkers || config.numWorkers;\n}\n\n// It has to take non-zero time to put a large typed array in a Blob since the very\n// next instruction you could change the contents of the array. So, if you're reading\n// the zip file for images/video/audio then all you want is a Blob on which to get a URL.\n// so that operation of putting the data in a Blob should happen in the worker.\n//\n// Conversely if you want the data itself then you want an ArrayBuffer immediately\n// since the worker can transfer its ArrayBuffer zero copy.\n//\n// @param {Uint8Array|Blob} src\n// @param {number} uncompressedSize\n// @param {string} [type] falsy or mimeType string (eg: 'image/png')\n// @returns {ArrayBuffer|Blob} ArrayBuffer if type is falsy or Blob otherwise.\nfunction inflateRawAsync(src, uncompressedSize, type) {\n return new Promise((resolve, reject) => {\n // note: there is potential an expensive copy here. In order for the data\n // to make it into the worker we need to copy the data to the worker unless\n // it's a Blob or a SharedArrayBuffer.\n //\n // Solutions:\n //\n // 1. A minor enhancement, if `uncompressedSize` is small don't call the worker.\n //\n // might be a win period as their is overhead calling the worker\n //\n // 2. Move the entire library to the worker\n //\n // Good, Maybe faster if you pass a URL, Blob, or SharedArrayBuffer? Not sure about that\n // as those are also easy to transfer. Still slow if you pass an ArrayBuffer\n // as the ArrayBuffer has to be copied to the worker.\n //\n // I guess benchmarking is really the only thing to try.\n waitingForWorkerQueue.push({src, uncompressedSize, type, resolve, reject, id: nextId++});\n processWaitingForWorkerQueue();\n });\n}\n\nfunction clearArray(arr) {\n arr.splice(0, arr.length);\n}\n\nasync function cleanup() {\n for (const worker of workers) {\n await workerHelper.terminate(worker);\n }\n clearArray(workers);\n clearArray(availableWorkers);\n clearArray(waitingForWorkerQueue);\n currentlyProcessingIdToRequestMap.clear();\n numWorkers = 0;\n canUseWorkers = true;\n}\n\n/*\nclass Zip {\n constructor(reader) {\n comment, // the comment for this entry\n commentBytes, // the raw comment for this entry\n }\n}\n*/\n\nfunction dosDateTimeToDate(date, time) {\n const day = date & 0x1f; // 1-31\n const month = (date >> 5 & 0xf) - 1; // 1-12, 0-11\n const year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108\n\n const millisecond = 0;\n const second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)\n const minute = time >> 5 & 0x3f; // 0-59\n const hour = time >> 11 & 0x1f; // 0-23\n\n return new Date(year, month, day, hour, minute, second, millisecond);\n}\n\nclass ZipEntry {\n constructor(reader, rawEntry) {\n this._reader = reader;\n this._rawEntry = rawEntry;\n this.name = rawEntry.name;\n this.nameBytes = rawEntry.nameBytes;\n this.size = rawEntry.uncompressedSize;\n this.compressedSize = rawEntry.compressedSize;\n this.comment = rawEntry.comment;\n this.commentBytes = rawEntry.commentBytes;\n this.compressionMethod = rawEntry.compressionMethod;\n this.lastModDate = dosDateTimeToDate(rawEntry.lastModFileDate, rawEntry.lastModFileTime);\n this.isDirectory = rawEntry.uncompressedSize === 0 && rawEntry.name.endsWith('/');\n this.encrypted = !!(rawEntry.generalPurposeBitFlag & 0x1);\n this.externalFileAttributes = rawEntry.externalFileAttributes;\n this.versionMadeBy = rawEntry.versionMadeBy;\n }\n // returns a promise that returns a Blob for this entry\n async blob(type = 'application/octet-stream') {\n return await readEntryDataAsBlob(this._reader, this._rawEntry, type);\n }\n // returns a promise that returns an ArrayBuffer for this entry\n async arrayBuffer() {\n return await readEntryDataAsArrayBuffer(this._reader, this._rawEntry);\n }\n // returns text, assumes the text is valid utf8. If you want more options decode arrayBuffer yourself\n async text() {\n const buffer = await this.arrayBuffer();\n return decodeBuffer(new Uint8Array(buffer));\n }\n // returns text with JSON.parse called on it. If you want more options decode arrayBuffer yourself\n async json() {\n const text = await this.text();\n return JSON.parse(text);\n }\n}\n\nconst EOCDR_WITHOUT_COMMENT_SIZE = 22;\nconst MAX_COMMENT_SIZE = 0xffff; // 2-byte size\nconst EOCDR_SIGNATURE = 0x06054b50;\nconst ZIP64_EOCDR_SIGNATURE = 0x06064b50;\n\nasync function readAs(reader, offset, length) {\n return await reader.read(offset, length);\n}\n\n// The point of this function is we want to be able to pass the data\n// to a worker as fast as possible so when decompressing if the data\n// is already a blob and we can get a blob then get a blob.\n//\n// I'm not sure what a better way to refactor this is. We've got examples\n// of multiple readers. Ideally, for every type of reader we could ask\n// it, \"give me a type that is zero copy both locally and when sent to a worker\".\n//\n// The problem is the worker would also have to know the how to handle this\n// opaque type. I suppose the correct solution is to register different\n// reader handlers in the worker so BlobReader would register some\n// `handleZeroCopyType`. At the moment I don't feel like\n// refactoring. As it is you just pass in an instance of the reader\n// but instead you'd have to register the reader and some how get the\n// source for the `handleZeroCopyType` handler function into the worker.\n// That sounds like a huge PITA, requiring you to put the implementation\n// in a separate file so the worker can load it or some other workaround\n// hack.\n//\n// For now this hack works even if it's not generic.\nasync function readAsBlobOrTypedArray(reader, offset, length, type) {\n if (reader.sliceAsBlob) {\n return await reader.sliceAsBlob(offset, length, type);\n }\n return await reader.read(offset, length);\n}\n\nconst crc$1 = {\n unsigned() {\n return 0;\n },\n};\n\nfunction getUint16LE(uint8View, offset) {\n return uint8View[offset ] +\n uint8View[offset + 1] * 0x100;\n}\n\nfunction getUint32LE(uint8View, offset) {\n return uint8View[offset ] +\n uint8View[offset + 1] * 0x100 +\n uint8View[offset + 2] * 0x10000 +\n uint8View[offset + 3] * 0x1000000;\n}\n\nfunction getUint64LE(uint8View, offset) {\n return getUint32LE(uint8View, offset) +\n getUint32LE(uint8View, offset + 4) * 0x100000000;\n}\n\n/* eslint-disable no-irregular-whitespace */\n// const decodeCP437 = (function() {\n// const cp437 = '\\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';\n//\n// return function(uint8view) {\n// return Array.from(uint8view).map(v => cp437[v]).join('');\n// };\n// }());\n/* eslint-enable no-irregular-whitespace */\n\nconst utf8Decoder = new TextDecoder();\nfunction decodeBuffer(uint8View, isUTF8) { /* eslint-disable-line no-unused-vars */ /* lgtm [js/superfluous-trailing-arguments] */\n if (isSharedArrayBuffer(uint8View.buffer)) {\n uint8View = new Uint8Array(uint8View);\n }\n return utf8Decoder.decode(uint8View);\n /*\n AFAICT the UTF8 flat is not set so it's 100% up to the user\n to self decode if their file is not utf8 filenames\n return isUTF8\n ? utf8Decoder.decode(uint8View)\n : decodeCP437(uint8View);\n */\n}\n\nasync function findEndOfCentralDirector(reader, totalLength) {\n const size = Math.min(EOCDR_WITHOUT_COMMENT_SIZE + MAX_COMMENT_SIZE, totalLength);\n const readStart = totalLength - size;\n const data = await readAs(reader, readStart, size);\n for (let i = size - EOCDR_WITHOUT_COMMENT_SIZE; i >= 0; --i) {\n if (getUint32LE(data, i) !== EOCDR_SIGNATURE) {\n continue;\n }\n\n // 0 - End of central directory signature\n const eocdr = new Uint8Array(data.buffer, data.byteOffset + i, data.byteLength - i);\n // 4 - Number of this disk\n const diskNumber = getUint16LE(eocdr, 4);\n if (diskNumber !== 0) {\n throw new Error(`multi-volume zip files are not supported. This is volume: ${diskNumber}`);\n }\n\n // 6 - Disk where central directory starts\n // 8 - Number of central directory records on this disk\n // 10 - Total number of central directory records\n const entryCount = getUint16LE(eocdr, 10);\n // 12 - Size of central directory (bytes)\n const centralDirectorySize = getUint32LE(eocdr, 12);\n // 16 - Offset of start of central directory, relative to start of archive\n const centralDirectoryOffset = getUint32LE(eocdr, 16);\n // 20 - Comment length\n const commentLength = getUint16LE(eocdr, 20);\n const expectedCommentLength = eocdr.length - EOCDR_WITHOUT_COMMENT_SIZE;\n if (commentLength !== expectedCommentLength) {\n throw new Error(`invalid comment length. expected: ${expectedCommentLength}, actual: ${commentLength}`);\n }\n\n // 22 - Comment\n // the encoding is always cp437.\n const commentBytes = new Uint8Array(eocdr.buffer, eocdr.byteOffset + 22, commentLength);\n const comment = decodeBuffer(commentBytes);\n\n if (entryCount === 0xffff || centralDirectoryOffset === 0xffffffff) {\n return await readZip64CentralDirectory(reader, readStart + i, comment, commentBytes);\n } else {\n return await readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);\n }\n }\n\n throw new Error('could not find end of central directory. maybe not zip file');\n}\n\nconst END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE = 0x07064b50;\n\nasync function readZip64CentralDirectory(reader, offset, comment, commentBytes) {\n // ZIP64 Zip64 end of central directory locator\n const zip64EocdlOffset = offset - 20;\n const eocdl = await readAs(reader, zip64EocdlOffset, 20);\n\n // 0 - zip64 end of central dir locator signature\n if (getUint32LE(eocdl, 0) !== END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE) {\n throw new Error('invalid zip64 end of central directory locator signature');\n }\n\n // 4 - number of the disk with the start of the zip64 end of central directory\n // 8 - relative offset of the zip64 end of central directory record\n const zip64EocdrOffset = getUint64LE(eocdl, 8);\n // 16 - total number of disks\n\n // ZIP64 end of central directory record\n const zip64Eocdr = await readAs(reader, zip64EocdrOffset, 56);\n\n // 0 - zip64 end of central dir signature 4 bytes (0x06064b50)\n if (getUint32LE(zip64Eocdr, 0) !== ZIP64_EOCDR_SIGNATURE) {\n throw new Error('invalid zip64 end of central directory record signature');\n }\n // 4 - size of zip64 end of central directory record 8 bytes\n // 12 - version made by 2 bytes\n // 14 - version needed to extract 2 bytes\n // 16 - number of this disk 4 bytes\n // 20 - number of the disk with the start of the central directory 4 bytes\n // 24 - total number of entries in the central directory on this disk 8 bytes\n // 32 - total number of entries in the central directory 8 bytes\n const entryCount = getUint64LE(zip64Eocdr, 32);\n // 40 - size of the central directory 8 bytes\n const centralDirectorySize = getUint64LE(zip64Eocdr, 40);\n // 48 - offset of start of central directory with respect to the starting disk number 8 bytes\n const centralDirectoryOffset = getUint64LE(zip64Eocdr, 48);\n // 56 - zip64 extensible data sector (variable size)\n return readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);\n}\n\nconst CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE = 0x02014b50;\n\nasync function readEntries(reader, centralDirectoryOffset, centralDirectorySize, rawEntryCount, comment, commentBytes) {\n let readEntryCursor = 0;\n const allEntriesBuffer = await readAs(reader, centralDirectoryOffset, centralDirectorySize);\n const rawEntries = [];\n\n for (let e = 0; e < rawEntryCount; ++e) {\n const buffer = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + 46);\n // 0 - Central directory file header signature\n const signature = getUint32LE(buffer, 0);\n if (signature !== CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE) {\n throw new Error(`invalid central directory file header signature: 0x${signature.toString(16)}`);\n }\n const rawEntry = {\n // 4 - Version made by\n versionMadeBy: getUint16LE(buffer, 4),\n // 6 - Version needed to extract (minimum)\n versionNeededToExtract: getUint16LE(buffer, 6),\n // 8 - General purpose bit flag\n generalPurposeBitFlag: getUint16LE(buffer, 8),\n // 10 - Compression method\n compressionMethod: getUint16LE(buffer, 10),\n // 12 - File last modification time\n lastModFileTime: getUint16LE(buffer, 12),\n // 14 - File last modification date\n lastModFileDate: getUint16LE(buffer, 14),\n // 16 - CRC-32\n crc32: getUint32LE(buffer, 16),\n // 20 - Compressed size\n compressedSize: getUint32LE(buffer, 20),\n // 24 - Uncompressed size\n uncompressedSize: getUint32LE(buffer, 24),\n // 28 - File name length (n)\n fileNameLength: getUint16LE(buffer, 28),\n // 30 - Extra field length (m)\n extraFieldLength: getUint16LE(buffer, 30),\n // 32 - File comment length (k)\n fileCommentLength: getUint16LE(buffer, 32),\n // 34 - Disk number where file starts\n // 36 - Internal file attributes\n internalFileAttributes: getUint16LE(buffer, 36),\n // 38 - External file attributes\n externalFileAttributes: getUint32LE(buffer, 38),\n // 42 - Relative offset of local file header\n relativeOffsetOfLocalHeader: getUint32LE(buffer, 42),\n };\n\n if (rawEntry.generalPurposeBitFlag & 0x40) {\n throw new Error('strong encryption is not supported');\n }\n\n readEntryCursor += 46;\n\n const data = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + rawEntry.fileNameLength + rawEntry.extraFieldLength + rawEntry.fileCommentLength);\n rawEntry.nameBytes = data.slice(0, rawEntry.fileNameLength);\n rawEntry.name = decodeBuffer(rawEntry.nameBytes);\n\n // 46+n - Extra field\n const fileCommentStart = rawEntry.fileNameLength + rawEntry.extraFieldLength;\n const extraFieldBuffer = data.slice(rawEntry.fileNameLength, fileCommentStart);\n rawEntry.extraFields = [];\n let i = 0;\n while (i < extraFieldBuffer.length - 3) {\n const headerId = getUint16LE(extraFieldBuffer, i + 0);\n const dataSize = getUint16LE(extraFieldBuffer, i + 2);\n const dataStart = i + 4;\n const dataEnd = dataStart + dataSize;\n if (dataEnd > extraFieldBuffer.length) {\n throw new Error('extra field length exceeds extra field buffer size');\n }\n rawEntry.extraFields.push({\n id: headerId,\n data: extraFieldBuffer.slice(dataStart, dataEnd),\n });\n i = dataEnd;\n }\n\n // 46+n+m - File comment\n rawEntry.commentBytes = data.slice(fileCommentStart, fileCommentStart + rawEntry.fileCommentLength);\n rawEntry.comment = decodeBuffer(rawEntry.commentBytes);\n\n readEntryCursor += data.length;\n\n if (rawEntry.uncompressedSize === 0xffffffff ||\n rawEntry.compressedSize === 0xffffffff ||\n rawEntry.relativeOffsetOfLocalHeader === 0xffffffff) {\n // ZIP64 format\n // find the Zip64 Extended Information Extra Field\n const zip64ExtraField = rawEntry.extraFields.find(e => e.id === 0x0001);\n if (!zip64ExtraField) {\n throw new Error('expected zip64 extended information extra field');\n }\n const zip64EiefBuffer = zip64ExtraField.data;\n let index = 0;\n // 0 - Original Size 8 bytes\n if (rawEntry.uncompressedSize === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n throw new Error('zip64 extended information extra field does not include uncompressed size');\n }\n rawEntry.uncompressedSize = getUint64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 8 - Compressed Size 8 bytes\n if (rawEntry.compressedSize === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n throw new Error('zip64 extended information extra field does not include compressed size');\n }\n rawEntry.compressedSize = getUint64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 16 - Relative Header Offset 8 bytes\n if (rawEntry.relativeOffsetOfLocalHeader === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n throw new Error('zip64 extended information extra field does not include relative header offset');\n }\n rawEntry.relativeOffsetOfLocalHeader = getUint64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 24 - Disk Start Number 4 bytes\n }\n\n // check for Info-ZIP Unicode Path Extra Field (0x7075)\n // see https://github.com/thejoshwolfe/yauzl/issues/33\n const nameField = rawEntry.extraFields.find(e =>\n e.id === 0x7075 &&\n e.data.length >= 6 && // too short to be meaningful\n e.data[0] === 1 && // Version 1 byte version of this extra field, currently 1\n getUint32LE(e.data, 1), crc$1.unsigned(rawEntry.nameBytes)); // NameCRC32 4 bytes File Name Field CRC32 Checksum\n // > If the CRC check fails, this UTF-8 Path Extra Field should be\n // > ignored and the File Name field in the header should be used instead.\n if (nameField) {\n // UnicodeName Variable UTF-8 version of the entry File Name\n rawEntry.fileName = decodeBuffer(nameField.data.slice(5));\n }\n\n // validate file size\n if (rawEntry.compressionMethod === 0) {\n let expectedCompressedSize = rawEntry.uncompressedSize;\n if ((rawEntry.generalPurposeBitFlag & 0x1) !== 0) {\n // traditional encryption prefixes the file data with a header\n expectedCompressedSize += 12;\n }\n if (rawEntry.compressedSize !== expectedCompressedSize) {\n throw new Error(`compressed size mismatch for stored file: ${rawEntry.compressedSize} != ${expectedCompressedSize}`);\n }\n }\n rawEntries.push(rawEntry);\n }\n const zip = {\n comment,\n commentBytes,\n };\n return {\n zip,\n entries: rawEntries.map(e => new ZipEntry(reader, e)),\n };\n}\n\nasync function readEntryDataHeader(reader, rawEntry) {\n if (rawEntry.generalPurposeBitFlag & 0x1) {\n throw new Error('encrypted entries not supported');\n }\n const buffer = await readAs(reader, rawEntry.relativeOffsetOfLocalHeader, 30);\n // note: maybe this should be passed in or cached on entry\n // as it's async so there will be at least one tick (not sure about that)\n const totalLength = await reader.getLength();\n\n // 0 - Local file header signature = 0x04034b50\n const signature = getUint32LE(buffer, 0);\n if (signature !== 0x04034b50) {\n throw new Error(`invalid local file header signature: 0x${signature.toString(16)}`);\n }\n\n // all this should be redundant\n // 4 - Version needed to extract (minimum)\n // 6 - General purpose bit flag\n // 8 - Compression method\n // 10 - File last modification time\n // 12 - File last modification date\n // 14 - CRC-32\n // 18 - Compressed size\n // 22 - Uncompressed size\n // 26 - File name length (n)\n const fileNameLength = getUint16LE(buffer, 26);\n // 28 - Extra field length (m)\n const extraFieldLength = getUint16LE(buffer, 28);\n // 30 - File name\n // 30+n - Extra field\n const localFileHeaderEnd = rawEntry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;\n let decompress;\n if (rawEntry.compressionMethod === 0) {\n // 0 - The file is stored (no compression)\n decompress = false;\n } else if (rawEntry.compressionMethod === 8) {\n // 8 - The file is Deflated\n decompress = true;\n } else {\n throw new Error(`unsupported compression method: ${rawEntry.compressionMethod}`);\n }\n const fileDataStart = localFileHeaderEnd;\n const fileDataEnd = fileDataStart + rawEntry.compressedSize;\n if (rawEntry.compressedSize !== 0) {\n // bounds check now, because the read streams will probably not complain loud enough.\n // since we're dealing with an unsigned offset plus an unsigned size,\n // we only have 1 thing to check for.\n if (fileDataEnd > totalLength) {\n throw new Error(`file data overflows file bounds: ${fileDataStart} + ${rawEntry.compressedSize} > ${totalLength}`);\n }\n }\n return {\n decompress,\n fileDataStart,\n };\n}\n\nasync function readEntryDataAsArrayBuffer(reader, rawEntry) {\n const {decompress, fileDataStart} = await readEntryDataHeader(reader, rawEntry);\n if (!decompress) {\n const dataView = await readAs(reader, fileDataStart, rawEntry.compressedSize);\n // make copy?\n //\n // 1. The source is a Blob/file. In this case we'll get back TypedArray we can just hand to the user\n // 2. The source is a TypedArray. In this case we'll get back TypedArray that is a view into a larger buffer\n // but because ultimately this is used to return an ArrayBuffer to `someEntry.arrayBuffer()`\n // we need to return copy since we need the `ArrayBuffer`, not the TypedArray to exactly match the data.\n // Note: We could add another API function `bytes()` or something that returned a `Uint8Array`\n // instead of an `ArrayBuffer`. This would let us skip a copy here. But this case only happens for uncompressed\n // data. That seems like a rare enough case that adding a new API is not worth it? Or is it? A zip of jpegs or mp3s\n // might not be compressed. For now that's a TBD.\n return isTypedArraySameAsArrayBuffer(dataView) ? dataView.buffer : dataView.slice().buffer;\n }\n // see comment in readEntryDateAsBlob\n const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);\n const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize);\n return result;\n}\n\nasync function readEntryDataAsBlob(reader, rawEntry, type) {\n const {decompress, fileDataStart} = await readEntryDataHeader(reader, rawEntry);\n if (!decompress) {\n const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize, type);\n if (isBlob(typedArrayOrBlob)) {\n return typedArrayOrBlob;\n }\n return new Blob([isSharedArrayBuffer(typedArrayOrBlob.buffer) ? new Uint8Array(typedArrayOrBlob) : typedArrayOrBlob], {type});\n }\n // Here's the issue with this mess (should refactor?)\n // if the source is a blob then we really want to pass a blob to inflateRawAsync to avoid a large\n // copy if we're going to a worker.\n const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);\n const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize, type);\n return result;\n}\n\nfunction setOptions$1(options) {\n setOptions(options);\n}\n\nasync function unzipRaw(source) {\n let reader;\n if (typeof Blob !== 'undefined' && source instanceof Blob) {\n reader = new BlobReader(source);\n } else if (source instanceof ArrayBuffer || (source && source.buffer && source.buffer instanceof ArrayBuffer)) {\n reader = new ArrayBufferReader(source);\n } else if (isSharedArrayBuffer(source) || isSharedArrayBuffer(source.buffer)) {\n reader = new ArrayBufferReader(source);\n } else if (typeof source === 'string') {\n const req = await fetch(source);\n if (!req.ok) {\n throw new Error(`failed http request ${source}, status: ${req.status}: ${req.statusText}`);\n }\n const blob = await req.blob();\n reader = new BlobReader(blob);\n } else if (typeof source.getLength === 'function' && typeof source.read === 'function') {\n reader = source;\n } else {\n throw new Error('unsupported source type');\n }\n\n const totalLength = await reader.getLength();\n\n if (totalLength > Number.MAX_SAFE_INTEGER) {\n throw new Error(`file too large. size: ${totalLength}. Only file sizes up 4503599627370496 bytes are supported`);\n }\n\n return await findEndOfCentralDirector(reader, totalLength);\n}\n\n// If the names are not utf8 you should use unzipitRaw\nasync function unzip(source) {\n const {zip, entries} = await unzipRaw(source);\n return {\n zip,\n entries: Object.fromEntries(entries.map(v => [v.name, v])),\n };\n}\n\nfunction cleanup$1() {\n cleanup();\n}\n\nexport { HTTPRangeReader, cleanup$1 as cleanup, setOptions$1 as setOptions, unzip, unzipRaw };\n","import { buildBinderListings } from '@monofe/di';\nimport buildDeleteTour from './delete-tour/bind';\nimport buildDialog from './dialog/bind';\nimport buildDownloadLanguage from './download-language/bind';\nimport buildDownloadTour from './download-tour/bind';\nimport buildOfflineToast from './offline-alert/bind';\nimport buildToast from './toast/bind';\n\nexport default buildBinderListings([\n buildToast,\n buildDialog,\n buildDownloadTour,\n buildDeleteTour,\n buildDownloadLanguage,\n buildOfflineToast,\n]);\n","import type { CSSProperties } from 'react';\nimport styles from './MainView.module.css';\nimport type { ILaunchViewProps as ILaunchViewProperties } from './interface';\n\nexport enum StyleElement {\n Container = 'Container',\n BackgroundImage = 'BackgroundImage',\n ProgressBar = 'ProgressBar',\n LoadingIcon = 'LoadingIcon',\n ImageIcon = 'ImageIcon',\n TextStatus = 'TextStatus',\n TextDetail = 'TextDetail',\n}\n\nconst DEFAULTS: Record = {\n [StyleElement.Container]: {},\n [StyleElement.BackgroundImage]: {},\n [StyleElement.ProgressBar]: {},\n [StyleElement.LoadingIcon]: {},\n [StyleElement.ImageIcon]: {},\n [StyleElement.TextStatus]: {},\n [StyleElement.TextDetail]: {},\n};\n\nconst PROPS_APPLICATOR: Record CSSProperties> =\n {\n [StyleElement.Container]: (properties: ILaunchViewProperties) => ({\n backgroundColor: properties.model.backgroundColor,\n }),\n [StyleElement.BackgroundImage]: (properties: ILaunchViewProperties) => ({}),\n [StyleElement.ProgressBar]: (properties: ILaunchViewProperties) => ({\n backgroundColor: properties.model.progressBar.backgroundColor,\n opacity: properties.model.progressBar.visible ? 1 : 0,\n pointerEvents: properties.model.progressBar.visible ? 'auto' : 'none',\n }),\n [StyleElement.LoadingIcon]: (properties: ILaunchViewProperties) => ({\n color: properties.model.status.color,\n }),\n [StyleElement.ImageIcon]: (properties: ILaunchViewProperties) => ({}),\n [StyleElement.TextStatus]: (properties: ILaunchViewProperties) => ({\n color: properties.model.status.color,\n fontWeight: properties.model.status.fontWeight,\n fontFamily: properties.model.status.fontFamily,\n fontSize: properties.model.status.fontSize,\n lineHeight: properties.model.status.fontSize,\n opacity: properties.model.status.visible ? 1 : 0,\n }),\n [StyleElement.TextDetail]: (properties: ILaunchViewProperties) => ({\n color: properties.model.detail.color,\n fontWeight: properties.model.detail.fontWeight,\n fontFamily: properties.model.detail.fontFamily,\n fontSize: properties.model.detail.fontSize,\n lineHeight: properties.model.detail.fontSize,\n opacity: properties.model.detail.visible ? 1 : 0,\n }),\n };\n\nexport function classNameForElement(element: StyleElement, model: ILaunchViewProperties): string {\n const name = element.toString();\n return styles[name] ?? '';\n}\n\nexport function styleForElement(\n element: StyleElement,\n properties: ILaunchViewProperties,\n): CSSProperties {\n const style = { ...DEFAULTS[element], ...PROPS_APPLICATOR[element](properties) };\n\n return style;\n}\n","import React from 'react';\nimport type { ILaunchViewProps } from './interface';\nimport MainView from './MainView';\n\nfunction Launch(props: ILaunchViewProps) {\n return ;\n}\n\nexport default Launch;\n","import { useEffect, useState } from 'react';\n\ntype FunctionElement = () => JSX.Element | null;\ntype CompletionCallback = () => void;\n\nfunction LazyRender({\n resolvers,\n onResolved,\n}: {\n resolvers: (() => Promise)[];\n onResolved?: CompletionCallback | undefined;\n}): JSX.Element {\n const [views, setViews] = useState([]);\n\n useEffect(() => {\n const startNextJob = (index: number) => {\n if (index >= resolvers.length) {\n onResolved?.();\n return; /* DONE */\n }\n\n const callback = () => {\n /* We checked the index against the array length above so `resolver` here is guaranteed to exist */\n const resolver = resolvers[index] as () => Promise;\n resolver()\n .then(element => {\n setViews(currentViews => [...currentViews, element]);\n startNextJob(index + 1);\n })\n .catch(error => {\n throw error;\n });\n };\n\n /* RequestIdleCallback isn't supported on Safari so just immediately call the callback in that case */\n const hasIdleCallback =\n typeof window !== 'undefined' && typeof window.requestIdleCallback !== 'undefined';\n\n if (hasIdleCallback) {\n requestIdleCallback(callback);\n } else {\n callback();\n }\n };\n\n startNextJob(0);\n }, [resolvers, onResolved]);\n\n return (\n <>\n {views.map((View, index) => (\n \n ))}\n \n );\n}\n\nexport default LazyRender;\n","import { __rest, __assign } from 'tslib';\nimport * as React from 'react';\nimport { useContext, useMemo } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nfunction MotionConfig(_a) {\n var children = _a.children, config = __rest(_a, [\"children\"]);\n /**\n * Inherit props from any parent MotionConfig components\n */\n config = __assign(__assign({}, useContext(MotionConfigContext)), config);\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(function () { return config.isStatic; });\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n var transitionDependency = typeof config.transition === \"object\"\n ? config.transition.toString()\n : \"\";\n var context = useMemo(function () { return config; }, [\n transitionDependency,\n config.transformPagePoint,\n ]);\n return (React.createElement(MotionConfigContext.Provider, { value: context }, children));\n}\n\nexport { MotionConfig };\n","import React from \"react\";\nvar __jsx = React.createElement;\nimport { Analytics } from '@monofe/app-common';\nimport { injectConfigManifest, injectENV, injectLog, useBrowser, useKVStorage, useTranslationStorage } from '@monofe/util';\n\nfunction AnalyticsWrapper(props) {\n const browser = useBrowser();\n const translater = useTranslationStorage();\n const storage = useKVStorage();\n const manifest = injectConfigManifest();\n const env = injectENV();\n const logger = injectLog();\n return __jsx(Analytics, {\n pathname: props.router.asPath,\n manifest: manifest,\n language: browser === null || browser === void 0 ? void 0 : browser.language,\n env: env,\n translater: translater,\n storage: storage,\n logger: logger\n });\n}\n\nexport default AnalyticsWrapper;","import { buildBindable } from '@monofe/di';\nimport { bindConfigAPI, injectConfigAPI, injectENV, TYPES, unbindConfigAPI } from '@monofe/util';\nconst DEFAULTS = {\n url: 'https://api.ats-workspace.com',\n auth: {\n clientId: 'MobileApplication.Test',\n clientSecret: 'secr3t!MobileApplication.Test',\n grantType: 'password',\n username: 'awdemo',\n password: '@Demo1'\n },\n extension: {\n auth: '/apptoken',\n siteData: '/sites/app.GetMyZipPatchSite',\n mediaDiff: '/media/app.CalculateMyMediaDifference',\n media: '/media(%MEDIAID%)/app.GetFile',\n mediaWithAccessToken: '/media(%MEDIAID%)/app.GetFile?access_token=%ACCESS_TOKEN%'\n }\n};\n\nfunction _build(container) {\n const env = injectENV(container);\n const config = {\n url: env.getString('REACT_APP_API_URL', DEFAULTS.url),\n auth: {\n clientId: env.getString('REACT_APP_API_AUTH_CLIENTID', DEFAULTS.auth.clientId),\n clientSecret: env.getString('REACT_APP_API_AUTH_CLIENTSECRET', DEFAULTS.auth.clientSecret),\n grantType: env.getString('REACT_APP_API_AUTH_GRANTTYPE', DEFAULTS.auth.grantType),\n username: env.getString('REACT_APP_API_AUTH_USERNAME', DEFAULTS.auth.username),\n password: env.getString('REACT_APP_API_AUTH_PASSWORD', DEFAULTS.auth.password)\n },\n extension: {\n auth: env.getString('REACT_APP_API_EXTENSION_AUTH', DEFAULTS.extension.auth),\n siteData: env.getString('REACT_APP_API_EXTENSION_SITEDATA', DEFAULTS.extension.siteData),\n mediaDiff: env.getString('REACT_APP_API_EXTENSION_MEDIADIFF', DEFAULTS.extension.mediaDiff),\n media: env.getString('REACT_APP_API_EXTENSION_MEDIA', DEFAULTS.extension.media),\n mediaWithAccessToken: env.getString('REACT_APP_API_EXTENSION_MEDIA_WITH_ACCESS_TOKEN', DEFAULTS.extension.mediaWithAccessToken)\n }\n };\n return Object.freeze(config);\n}\n\nexport default buildBindable({\n id: TYPES.IConfigAPI,\n dependencies: [TYPES.IEnv],\n bind: bindConfigAPI,\n remove: unbindConfigAPI,\n inject: injectConfigAPI,\n build: container => Promise.resolve(_build(container))\n});","/* eslint-disable @typescript-eslint/no-magic-numbers */\n\nimport type { IContainer } from '@monofe/di';\nimport { injectOrBuildContainer } from '@monofe/di';\n\nexport interface IAsset {\n path: string;\n}\n\nexport interface IImageAsset extends IAsset {\n width: number;\n height: number;\n}\n\nexport interface IImageAssetMap {\n Flag: {\n AD: IImageAsset;\n AR: IImageAsset;\n BE: IImageAsset;\n BG: IImageAsset;\n BP: IImageAsset;\n BSL: IImageAsset;\n CS: IImageAsset;\n DE: IImageAsset;\n EN: IImageAsset;\n ES: IImageAsset;\n FI: IImageAsset;\n FR: IImageAsset;\n GD: IImageAsset;\n GL: IImageAsset;\n GR: IImageAsset;\n HU: IImageAsset;\n IS: IImageAsset;\n IT: IImageAsset;\n JA: IImageAsset;\n KO: IImageAsset;\n LT: IImageAsset;\n NL: IImageAsset;\n NO: IImageAsset;\n PL: IImageAsset;\n PT: IImageAsset;\n RO: IImageAsset;\n RU: IImageAsset;\n SE: IImageAsset;\n SH: IImageAsset;\n ZH: IImageAsset;\n };\n AppIcon: {\n 167: IImageAsset;\n 180: IImageAsset;\n 192: IImageAsset;\n 512: IImageAsset;\n 64: IImageAsset;\n favico: IImageAsset;\n };\n Splash: {\n '1024x1024': IImageAsset;\n '1125x2436': IImageAsset;\n '1136x640': IImageAsset;\n '1200x627': IImageAsset;\n '1242x2148': IImageAsset;\n '1294x750': IImageAsset;\n '1536x2048': IImageAsset;\n '1668x2224': IImageAsset;\n '2048x1536': IImageAsset;\n '2048x2732': IImageAsset;\n '2148x1242': IImageAsset;\n '2224x1668': IImageAsset;\n '2436x1125': IImageAsset;\n '2732x2048': IImageAsset;\n '640x1136': IImageAsset;\n '750x1294': IImageAsset;\n };\n Misc: {\n Alpha: IImageAsset;\n Alpha_Debug: IImageAsset;\n };\n}\n\nexport interface IAssetMap {\n Image: IImageAssetMap;\n}\n\nexport interface IAssetFetcher {\n imageAsset: (\n group: K,\n name: V,\n ) => IImageAssetMap[K][V];\n imageAssetGroup: (group: K) => IImageAsset[];\n imageAssetGroupClosestMatch: (\n group: K,\n targetWidth: number,\n targetHeight: number,\n ) => IImageAsset;\n}\n\nexport const TYPES = {\n IAssetFetcher: Symbol.for('IAssetFetcher'),\n};\n\nexport function injectAssetFetcher(\n container: IContainer = injectOrBuildContainer(),\n): IAssetFetcher {\n return container.get(TYPES.IAssetFetcher);\n}\n\nexport function bindAssetFetcher(\n val: IAssetFetcher,\n container: IContainer = injectOrBuildContainer(),\n): void {\n container.bind(TYPES.IAssetFetcher, val);\n}\n\nexport function unbindAssetFetcher(container: IContainer = injectOrBuildContainer()): void {\n container.remove(TYPES.IAssetFetcher);\n}\n","import _defineProperty from \"/home/vsts/work/r1/a/artifacts/source-code/node_modules/next/dist/compiled/@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n/* eslint-disable @typescript-eslint/no-magic-numbers */\nconst FLAG_SIZE = {\n width: 177,\n height: 179\n};\nconst FLAG_PATH_PREFIX = 'img/asset/flags/';\nconst FLAG_CODES = ['AD', 'AR', 'BE', 'BG', 'BP', 'CS', 'DE', 'EN', 'ES', 'FI', 'FR', 'GD', 'GL', 'GR', 'HU', 'IS', 'IT', 'JA', 'KO', 'LT', 'NL', 'NO', 'PL', 'PT', 'RO', 'RU', 'SE', 'SH', 'ZH', 'BSL'];\nconst SIZES_SPLASH_SCREEN = [[750, 1294], [640, 1136], [2732, 2048], [2436, 1125], [2224, 1668], [2148, 1242], [2048, 2732], [2048, 1536], [1668, 2224], [1536, 2048], [1294, 750], [1242, 2148], [1200, 627], [1136, 640], [1125, 2436], [1024, 1024]];\nconst SIZES_APP_ICON = [64, 167, 192, 512];\nconst ASSETS_APP_ICON = [{\n favico: {\n width: 512,\n height: 512,\n path: 'img/favicon.ico'\n }\n}];\nconst AssetFlagData = FLAG_CODES.map(flagCode => {\n const data = _objectSpread(_objectSpread({}, FLAG_SIZE), {}, {\n path: \"\".concat(FLAG_PATH_PREFIX).concat(flagCode.toLowerCase(), \".png\")\n });\n\n return {\n [flagCode]: data\n };\n}).reduce((current, next) => _objectSpread(_objectSpread({}, current), next), {});\nconst AssetAppIcons = [...SIZES_APP_ICON.map(iconSize => {\n const data = {\n width: iconSize,\n height: iconSize,\n path: \"img/AppIcon\".concat(iconSize, \".png\")\n };\n return {\n [iconSize]: data\n };\n}), ...ASSETS_APP_ICON].reduce((current, next) => _objectSpread(_objectSpread({}, current), next), {});\nconst AssetSplashIcons = SIZES_SPLASH_SCREEN.map(splashSize => {\n const [width, height] = splashSize;\n\n if (width === undefined || height === undefined) {\n throw new Error(\"Invalid splash screen sizing. Found width:\".concat(width !== null && width !== void 0 ? width : 'undefined', \", height:\").concat(height !== null && height !== void 0 ? height : 'undefined'));\n }\n\n const data = {\n width,\n height,\n path: \"img/Splash\".concat(width, \"x\").concat(height, \".png\")\n };\n return {\n [\"\".concat(width, \"x\").concat(height)]: data\n };\n}).reduce((current, next) => _objectSpread(_objectSpread({}, current), next), {});\nexport default Object.freeze({\n Flag: AssetFlagData,\n AppIcon: AssetAppIcons,\n Splash: AssetSplashIcons,\n Misc: {\n Alpha: {\n width: 1,\n height: 1,\n path: 'img/Misc/alpha.png'\n },\n Alpha_Debug: {\n width: 200,\n height: 200,\n path: 'img/Misc/alpha_debug.png'\n }\n }\n});","import _defineProperty from \"/home/vsts/work/r1/a/artifacts/source-code/node_modules/next/dist/compiled/@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nimport { buildBindable } from '@monofe/di';\nimport { TYPES, bindAssetFetcher, injectAssetFetcher, unbindAssetFetcher } from '@monofe/ui-workspace/common/asset';\nimport DATA_IMAGE from './asset.image';\nconst WEIGHTING_ASPECT_RATIO = 0.5;\n/* 50% */\n\nconst WEIGHTING_SIZE = 0.25;\n/* 25% (width or height) */\n\n/** The maths checks out - Alex */\n\nfunction _weightings(valuesIn, targetValue, weightGenerator) {\n const weightingsAll = valuesIn.map(value => weightGenerator(value));\n const weightingsMin = Math.min(...weightingsAll);\n const weightingsMax = Math.max(...weightingsAll);\n const weightingsDelta = weightingsMax - weightingsMin;\n /* Take all of the weight values and place it within the range of possible values, \n such that weightingsNormalized contains values between 0->1 only, where 0=targetValue & 1=further value away received */\n\n const weightingsNormalized = weightingsAll.map(weight => Math.abs(weight - targetValue) / weightingsDelta);\n return {\n minValue: weightingsMin,\n maxValue: weightingsMax,\n weightings: weightingsAll,\n weightingsNormalized: weightingsNormalized\n };\n}\n\nfunction _closestImage(target, allImages) {\n var _weightedImages$shift;\n\n /* For each image generate a weighting value, where 0=same as target & 1=furthest value away */\n const weightingsAR = _weightings(allImages, target.width / target.height, image => image.width / image.height);\n\n const weightingsWidth = _weightings(allImages, target.width, image => image.width);\n\n const weightingsHeight = _weightings(allImages, target.height, image => image.height);\n\n const weightedImages = allImages.map((image, index) => {\n const aspectRatio = weightingsAR.weightingsNormalized[index];\n const width = weightingsWidth.weightingsNormalized[index];\n const height = weightingsHeight.weightingsNormalized[index];\n\n if (aspectRatio === undefined || width === undefined || height === undefined) {\n throw new Error(\"Weightings arrays are not the same length. This shouldn't happen\");\n }\n\n return _objectSpread(_objectSpread({}, image), {}, {\n weight:\n /* Take the weightings generated above & generate an overall weight value, \n where the aspect-ratio takes priority over image size */\n aspectRatio * WEIGHTING_ASPECT_RATIO + width * WEIGHTING_SIZE + height * WEIGHTING_SIZE\n });\n });\n /* Sort by smallest weight first */\n\n weightedImages.sort((previous, next) => previous.weight - next.weight);\n /* & pick it out, this image is the closest to #target above */\n\n const asset = (_weightedImages$shift = weightedImages.shift()) !== null && _weightedImages$shift !== void 0 ? _weightedImages$shift : allImages.at(0);\n\n if (!asset) {\n throw new Error('Cannot find closest image, none provided!');\n }\n\n return asset;\n}\n\nfunction _imageAsset(group, name) {\n return DATA_IMAGE[group][name];\n}\n\nfunction _imageAssetGroup(group) {\n return Object.values(DATA_IMAGE[group]);\n}\n\nfunction _imageAssetGroupClosestMatch(group, targetWidth, targetHeight) {\n const allValues = Object.values(DATA_IMAGE[group]);\n\n const image = _closestImage({\n width: targetWidth,\n height: targetHeight\n }, allValues);\n\n return image;\n}\n\nfunction _build() {\n return {\n imageAsset: _imageAsset,\n imageAssetGroup: _imageAssetGroup,\n imageAssetGroupClosestMatch: _imageAssetGroupClosestMatch\n };\n}\n\nexport default buildBindable({\n id: TYPES.IAssetFetcher,\n dependencies: [],\n bind: bindAssetFetcher,\n remove: unbindAssetFetcher,\n inject: injectAssetFetcher,\n build: () => Promise.resolve(_build())\n});","import { buildBindable } from '@monofe/di';\nimport { bindConfigCache, injectConfigCache, TYPES, unbindConfigCache } from '@monofe/util';\nconst SECONDS_IN_A_DAY = 86400;\nconst EXPIRATION_DAYS = 21;\nconst EXPIRATION_THRESHOLD = EXPIRATION_DAYS * SECONDS_IN_A_DAY;\n\nfunction _build() {\n return [\n /* PublicAssets */\n {\n cacheName: 'app-public-cache',\n expiration: EXPIRATION_THRESHOLD,\n maxEntries: 200,\n matcher: /(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*\\/(?:img|image|image[s\\u017F]|font|font[s\\u017F])\\/(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*/gi\n },\n /* External(Adobe) fonts */\n {\n cacheName: 'app-external-fonts-cache',\n expiration: EXPIRATION_THRESHOLD,\n maxEntries: 200,\n matcher: /(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*u[s\\u017F]e\\.type[k\\u212A]it\\.net\\/(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*/gi\n },\n /* BuildMediaAssets */\n {\n cacheName: 'app-assets-local-cache',\n expiration: EXPIRATION_THRESHOLD,\n maxEntries: 1000,\n matcher: /(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*\\/a[s\\u017F][s\\u017F]et[s\\u017F]?\\/(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*/gi,\n cacheQueryOptions: {\n ignoreSearch: true,\n\n /* Header 'Vary: Accept-Encoding' being received for all media files */\n ignoreVary: true\n }\n },\n /* WorkspaceMedia */\n {\n cacheName: 'app-assets-remote-cache',\n expiration: EXPIRATION_THRESHOLD,\n maxEntries: 1000,\n\n /* Match all minus media.json */\n matcher: /app(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])GetFile/gi,\n fetchOptions: {\n /* When the browser loads the associated asset,\n we need to intercept in the service-worker & resolve. \n By default all requests from the browser have no cors.\n Changes below allow non-opaque responses to be saved to cache */\n mode: 'cors'\n },\n cacheQueryOptions: {\n ignoreSearch: true,\n ignoreVary: true\n }\n },\n /* WorkspaceStream */\n {\n cacheName: 'app-stream-cache',\n expiration: EXPIRATION_THRESHOLD,\n maxEntries: 1000,\n\n /* Match all minus media.json */\n matcher: /at[s\\u017F]web(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])app\\/media\\/[0-9]*\\/(?!media(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])j[s\\u017F]on(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)/gi,\n fetchOptions: {\n /* When the browser loads the associated asset,\n we need to intercept in the service-worker & resolve. \n By default all requests from the browser have no cors.\n Changes below allow non-opaque responses to be saved to cache */\n mode: 'cors',\n headers: {\n 'X-Force-Cors': 'true'\n },\n credentials: 'omit'\n },\n cacheQueryOptions: {\n /* All files which can be compressed (.html, .css from extracted html zips) may be served by the CDN as gzip\n The issue, is that it will then add header 'Vary: Accept-Encoding', by default the Vary header will void CacheStorage hits\n More info: https://stackoverflow.com/questions/58270383/workbox-pre-cached-audio-with-range-requests-router-fails-to-play-in-chrome-when */\n ignoreVary: true,\n ignoreSearch: true\n }\n }];\n}\n\nexport default buildBindable({\n id: TYPES.IConfigCache,\n dependencies: [],\n bind: bindConfigCache,\n remove: unbindConfigCache,\n inject: injectConfigCache,\n build: () => Promise.resolve(_build())\n});","import { buildBindable } from '@monofe/di';\nimport { bindConfigLog, IConfigLogDestination, IConfigLogLevel, injectConfigLog, injectENV, TYPES, unbindConfigLog } from '@monofe/util';\nconst DEFAULTS = {\n LOGGINGLEVELSENABLED: [IConfigLogLevel.Milestone, IConfigLogLevel.Trace, IConfigLogLevel.Info, IConfigLogLevel.Warn, IConfigLogLevel.Error, IConfigLogLevel.Fatal],\n OUTPUTDESTINATIONS: [IConfigLogDestination.Console],\n OUTPUTCONFIGURATION: {\n [IConfigLogDestination.Console]: {},\n [IConfigLogDestination.Remote_Sentry]: {}\n }\n};\n\nfunction _build(container) {\n const env = injectENV(container);\n const config = {\n loggingLevelsEnabled: env.getValueWithDefault('REACT_APP_LOG_LEVELS', DEFAULTS.LOGGINGLEVELSENABLED),\n outputDestinations: env.getValueWithDefault('REACT_APP_LOG_DESTINATIONS', DEFAULTS.OUTPUTDESTINATIONS),\n outputConfiguration: env.getValueWithDefault('REACT_APP_LOG_SETTINGS', DEFAULTS.OUTPUTCONFIGURATION)\n };\n return Object.freeze(config);\n}\n\nexport default buildBindable({\n id: TYPES.IConfigLog,\n dependencies: [TYPES.IEnv],\n bind: bindConfigLog,\n remove: unbindConfigLog,\n inject: injectConfigLog,\n build: container => Promise.resolve(_build(container))\n});","import { buildBindable } from '@monofe/di';\nimport { bindConfigManifest, injectConfigManifest, TYPES, unbindConfigManifest } from '@monofe/util';\nimport MANIFEST_JSON from '../../../public/manifest.json';\n\nfunction _build(container) {\n return Promise.resolve(Object.freeze(MANIFEST_JSON));\n}\n\nexport default buildBindable({\n id: TYPES.IConfigManifest,\n dependencies: [],\n bind: bindConfigManifest,\n remove: unbindConfigManifest,\n inject: injectConfigManifest,\n build: container => Promise.resolve(_build(container))\n});","import { buildBinderListings } from '@monofe/di';\nimport api from './api';\nimport asset from './asset';\nimport cache from './cache';\nimport log from './log';\nimport manifest from './manifest';\nexport default buildBinderListings([api, asset, cache, log, manifest]);","import { buildBindable } from '@monofe/di';\nimport { TYPES as UTIL_TYPES, injectFeatureQuery, injectMimeType } from '@monofe/util';\nimport tourDataResolver from './tourDataResolver';\nimport { TYPES, bindTourDataResolver, injectTourDataResolver, unbindTourDataResolver } from './tourDataResolver.if';\n\nfunction _build(container) {\n const query = injectFeatureQuery(container);\n const mimeType = injectMimeType(container);\n const result = tourDataResolver(query, mimeType);\n return Object.freeze(result);\n}\n\nexport default buildBindable({\n id: TYPES.ITourDataResolver,\n dependencies: [UTIL_TYPES.IFeatureQuery, UTIL_TYPES.IMimeType],\n bind: bindTourDataResolver,\n remove: unbindTourDataResolver,\n inject: injectTourDataResolver,\n build: container => Promise.resolve(_build(container))\n});","import { bind as bindApiService } from '@monofe/apiservice';\nimport { bind as bindAppCommon } from '@monofe/app-common';\nimport { bind as bindAppState } from '@monofe/appstate';\nimport { buildBinderListings } from '@monofe/di';\nimport { bind as bindUIWorkspace } from '@monofe/ui-workspace';\nimport { bind as bindUtil } from '@monofe/util';\nimport { bind as bindWorker } from '@monofe/worker';\nimport { TYPES } from '@monofe/worker/util';\nimport bindConfig from './config';\nimport { default as bindTourDataResolver } from './tourDataResolver.bind';\n\nfunction all() {\n /* SettingsStorage uses IDB, which isn't available in NodeJS */\n const banishList = [TYPES.ISettingsStorage];\n const bindables = [buildBinderListings([bindTourDataResolver], Symbol.for('pwa')), bindUtil, bindApiService, bindAppState, bindUIWorkspace, bindConfig, bindWorker, bindAppCommon].flatMap(listing => listing.allBinders()).filter(binder => !banishList.includes(binder.id));\n return Promise.resolve(bindables);\n}\n\nexport default Object.freeze({\n all\n});","import bindableDeleteTour from '@monofe/ui-workspace/delete-tour/bind';\nimport bindableDownloadLanguage from '@monofe/ui-workspace/download-language/bind';\nimport bindableDownloadTour from '@monofe/ui-workspace/download-tour/bind';\nimport bindables from './bindables';\nimport { injectTourDataResolver } from './tourDataResolver.if';\n\nfunction _overrides() {\n const dep = Object.freeze({\n get resolver() {\n return injectTourDataResolver();\n }\n\n });\n bindableDownloadLanguage.setBuildDependencies(dep);\n bindableDownloadTour.setBuildDependencies(dep);\n bindableDeleteTour.setBuildDependencies(dep);\n}\n\nasync function _nodeBind(container) {\n const binders = await bindables.all();\n binders.forEach(binder => {\n container.addBindable(binder);\n });\n await container.resolveAll();\n}\n\nasync function _windowBind(container) {\n const binders = await bindables.all();\n binders.forEach(binder => {\n container.addBindable(binder);\n });\n await container.resolveAll();\n}\n\nfunction bind(binder, env) {\n _overrides();\n\n const isWindowDefined = typeof window !== 'undefined';\n const isClientSide = env ? env === 'Client' : isWindowDefined;\n return isClientSide ? _windowBind(binder) : _nodeBind(binder);\n}\n\nexport default bind;","import React from \"react\";\nvar __jsx = React.createElement;\nimport { createContext, useEffect, useState } from 'react';\nimport bind from '../utils/bind';\nimport { globalBinder } from '../utils/container';\nconst context = /*#__PURE__*/createContext(globalBinder.container());\n\nfunction ContainerProvider(props) {\n const {\n 0: isReady,\n 1: setReady\n } = useState(false);\n useEffect(() => {\n bind(globalBinder).then(() => {\n setReady(true);\n }).catch(error => {\n throw error;\n });\n }, []);\n return __jsx(React.Fragment, null, isReady && globalBinder && context && __jsx(context.Provider, {\n value: globalBinder.container()\n }, props.children));\n}\n\nexport default ContainerProvider;","/* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/dot-notation */\nconst BUILD_ENVIRONMENT = String(process.env['NODE_ENV']) || 'unknown';\n\nconst _isProduction = () => {\n try {\n /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */\n return BUILD_ENVIRONMENT === 'production';\n } catch (error) {\n return true;\n }\n};\n\nexport default Object.freeze({\n isProduction: _isProduction()\n});","import env from './env';\nconst settings = {\n loggingEnabled: env.isProduction\n};\nexport default Object.freeze({\n logging: {\n enable: () => {\n settings.loggingEnabled = true;\n },\n disable: () => {\n settings.loggingEnabled = false;\n },\n isEnabled: () => settings.loggingEnabled\n }\n});","import settings from './settings';\n\nconst _logWarn = message => {\n /* eslint-disable-next-line no-console */\n console.warn(message);\n};\n\nconst _logError = message => {\n /* eslint-disable-next-line no-console */\n console.error(message);\n};\n\nconst _noop = message => {\n /* Nothing to do */\n};\n\nexport default Object.freeze({\n warn: settings.logging.isEnabled() ? _logWarn : _noop,\n error: settings.logging.isEnabled() ? _logError : _noop\n});","import React from \"react\";\nvar __jsx = React.createElement;\nimport { injectA2HS } from '@monofe/app-common/a2hs';\nimport { injectStoresRenderer } from '@monofe/appstate';\nimport { injectOrBuildContainer } from '@monofe/di';\nimport { AwaitOnlineRender, DelayedRender } from '@monofe/ui-common';\nimport { injectDeleteTour, injectDownloadTour } from '@monofe/ui-workspace';\nimport LazyResolver from '@monofe/ui-workspace/common/LazyResolver';\nimport { injectDialog } from '@monofe/ui-workspace/dialog';\nimport { injectOfflineAlert } from '@monofe/ui-workspace/offline-alert';\nimport { injectToast } from '@monofe/ui-workspace/toast';\nimport { injectENV } from '@monofe/util';\nimport { injectServiceWorkerController } from '@monofe/worker';\nimport { AnimatePresence, LazyMotion, MotionConfig, domAnimation } from 'framer-motion';\nimport Head from 'next/head';\nimport { useCallback, useEffect } from 'react';\nimport '../../public/common.css';\nimport AnalyticsWrapper from '../components/AnalyticsWrapper';\nimport ContainerProvider from '../components/ContainerProvider';\nimport { log } from '../private';\nimport { injectSiteConfig } from '../utils/siteConfig';\n\nconst bindToast = () => import('@monofe/ui-workspace/toast');\n\nconst bindOfflineNotification = () => import('@monofe/ui-workspace/offline-alert');\n\nconst bindDialog = () => import('@monofe/ui-workspace/dialog');\n\nconst bindDownloadTour = () => import('@monofe/ui-workspace/download-tour');\n\nconst bindDeleteTour = () => import('@monofe/ui-workspace/delete-tour');\n\nconst bindA2HS = () => import('@monofe/app-common/a2hs');\n\nconst PATH_SERVICE_WORKER = 'service-worker.js';\nconst SCOPE_SERVICE_WORKER_DEFAULT = '.';\nconst ENV_IS_SW_ENABLED = 'REACT_APP_SW_ENABLED';\nconst ENV_SW_OVERRIDE = 'REACT_APP_SWFORCE';\nconst ENV_BUILDTYPE = 'NODE_ENV';\n\nfunction startServiceWorker(container) {\n const env = injectENV(container);\n const isProduction = env.getString(ENV_BUILDTYPE) === 'production';\n /* For testing, run `yarn startsw` to force the Service Worker to run in development */\n\n const swEnableOverride = env.getBoolean(ENV_SW_OVERRIDE);\n const hasServiceWorker = ('serviceWorker' in navigator);\n const swEnabled = env.getBoolean(ENV_IS_SW_ENABLED, true);\n /* If missing assume YES, otherwise allow for ENV to disable service-workers (Agnelli) */\n\n if (swEnabled && hasServiceWorker && isProduction || swEnableOverride) {\n const controller = injectServiceWorkerController(container);\n /* Limit SW visibility to base subpath of PWA, scope *must* end with slash '/qc/mauto' -> '/qc/mauto/' */\n\n let scope = env.getString('REACT_APP_ROUTE_BASENAME') || new URL(document.baseURI).pathname\n /* Use href */\n || SCOPE_SERVICE_WORKER_DEFAULT;\n\n if (!scope.endsWith('/')) {\n scope += '/';\n }\n\n controller.start(PATH_SERVICE_WORKER, scope);\n }\n\n return Promise.resolve();\n}\n\nconst StoreProvider = _ref => {\n var _injectStoresRenderer;\n\n let {\n container,\n children\n } = _ref;\n const Render = (_injectStoresRenderer = injectStoresRenderer(container).render) !== null && _injectStoresRenderer !== void 0 ? _injectStoresRenderer : () => __jsx(React.Fragment, null);\n useEffect(() => {\n startServiceWorker(container).catch(err => {\n log.error('failed to start sw');\n });\n }, [container]);\n return __jsx(Render, null, children);\n};\n\nfunction useLazyBinder(container, binder, injectable, onCompletion) {\n return useCallback(() => new Promise((resolve, reject) => {\n binder().then(binder => binder.bind.bind(container)).then(() => {\n onCompletion === null || onCompletion === void 0 ? void 0 : onCompletion();\n resolve(injectable().renderer);\n }).catch(error => {\n reject(error);\n });\n }), [container, binder, injectable, onCompletion]);\n}\n\nfunction App(_ref2) {\n let {\n Component,\n pageProps,\n router\n } = _ref2;\n const container = injectOrBuildContainer();\n const siteConfig = injectSiteConfig();\n\n const updateA2HSSiteName = () => {\n injectA2HS(container).setSiteName(siteConfig.appLongName);\n };\n\n const LazyToast = useLazyBinder(container, bindToast, injectToast);\n const LazyOffline = useLazyBinder(container, bindOfflineNotification, injectOfflineAlert);\n const LazyDialog = useLazyBinder(container, bindDialog, injectDialog);\n const LazyDownloadTour = useLazyBinder(container, bindDownloadTour, injectDownloadTour);\n const LazyDeleteTour = useLazyBinder(container, bindDeleteTour, injectDeleteTour);\n const LazyA2HS = useLazyBinder(container, bindA2HS, injectA2HS, updateA2HSSiteName);\n return __jsx(React.Fragment, null, __jsx(Head, null, __jsx(\"meta\", {\n name: \"viewport\",\n content: \"width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover, user-scalable=no, minimal-ui\"\n })), __jsx(ContainerProvider, null, __jsx(StoreProvider, {\n container: container\n }, __jsx(LazyMotion, {\n strict: true,\n features: domAnimation\n }, __jsx(MotionConfig, {\n transition: {\n duration: 0.3\n }\n }), __jsx(DelayedRender, {\n delay: 4000\n }, __jsx(AwaitOnlineRender, null, __jsx(LazyResolver, {\n resolvers: [LazyToast, LazyOffline, LazyDialog, LazyDownloadTour, LazyDeleteTour]\n }), __jsx(AnalyticsWrapper, {\n router: router\n }))), __jsx(DelayedRender, {\n delay: 30000\n }, __jsx(AwaitOnlineRender, null, __jsx(LazyResolver, {\n resolvers: [LazyA2HS]\n }))), __jsx(AnimatePresence, {\n key: \"animated-switch\",\n exitBeforeEnter: false,\n initial: false\n }, __jsx(Component, pageProps))))));\n}\n\nexport default App;","import { bindContainer, buildBinderRegistry } from '@monofe/di';\nexport const globalBinder = buildBinderRegistry();\nconst globalContainer = globalBinder.container();\nbindContainer(globalContainer);\nexport default Object.freeze(globalContainer);","function _isSiteConfig(object) {\n const isNullOrUndefined = value => value === null || value === undefined;\n\n if (isNullOrUndefined(object) || typeof object !== 'object') {\n return false;\n }\n\n const record = object;\n return !isNullOrUndefined(record.name) && !isNullOrUndefined(record.env) && !isNullOrUndefined(record.asset_copy) && !isNullOrUndefined(record.public_url) && !isNullOrUndefined(record.appShortName) && !isNullOrUndefined(record.appLongName) && !isNullOrUndefined(record.appDescription) && !isNullOrUndefined(record.appTintColor) && !isNullOrUndefined(record.appBackgroundColor);\n}\n/* Cannot use injectENV, as we are called in Document, without container setup & async support */\n\n\nexport const injectSiteConfig = () => {\n const configString = process.env['NEXT_PUBLIC_SITE_CONFIG'];\n\n if (configString === undefined || typeof configString !== 'string') {\n throw new Error(\"Unexpected data retrieving site config\");\n }\n\n const siteConfig = JSON.parse(configString);\n\n if (!_isSiteConfig(siteConfig)) {\n throw new Error(\"Data retrieved is not a valid site config\");\n }\n\n return siteConfig;\n};","const SITE_DATA = {};\n\nfunction _insert(interfaceName, entity) {\n var _SITE_DATA$interfaceN;\n\n const insertValues = Array.isArray(entity) ? entity : [entity];\n const primaryKeys = new Set(insertValues.map(value => value.primaryKey()));\n const values = (_SITE_DATA$interfaceN = SITE_DATA[interfaceName]) !== null && _SITE_DATA$interfaceN !== void 0 ? _SITE_DATA$interfaceN : [];\n const newValues = [...values.filter(value => !primaryKeys.has(value.primaryKey())), ...insertValues];\n SITE_DATA[interfaceName] = newValues;\n}\n\nfunction _get(interfaceName, pk) {\n var _SITE_DATA$interfaceN2;\n\n const values = (_SITE_DATA$interfaceN2 = SITE_DATA[interfaceName]) !== null && _SITE_DATA$interfaceN2 !== void 0 ? _SITE_DATA$interfaceN2 : [];\n const matches = values.filter(value => value.primaryKey() === pk);\n return matches.at(0);\n}\n\nfunction _all(interfaceName) {\n var _SITE_DATA$interfaceN3;\n\n const values = (_SITE_DATA$interfaceN3 = SITE_DATA[interfaceName]) !== null && _SITE_DATA$interfaceN3 !== void 0 ? _SITE_DATA$interfaceN3 : [];\n return values;\n}\n\nfunction _remove(interfaceName, pk) {\n var _SITE_DATA$interfaceN4;\n\n const values = (_SITE_DATA$interfaceN4 = SITE_DATA[interfaceName]) !== null && _SITE_DATA$interfaceN4 !== void 0 ? _SITE_DATA$interfaceN4 : [];\n const newValues = values.filter(value => value.primaryKey() !== pk);\n SITE_DATA[interfaceName] = newValues;\n}\n\nexport default Object.freeze({\n insert: _insert,\n get: _get,\n all: _all,\n remove: _remove\n});","import { injectOrBuildContainer } from '@monofe/di';\nexport const TYPES = {\n ITourDataResolver: Symbol.for('ITourDataResolver')\n};\nexport function injectTourDataResolver() {\n let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : injectOrBuildContainer();\n return container.get(TYPES.ITourDataResolver);\n}\nexport function bindTourDataResolver(val) {\n let container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : injectOrBuildContainer();\n container.bind(TYPES.ITourDataResolver, val);\n}\nexport function unbindTourDataResolver() {\n let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : injectOrBuildContainer();\n container.remove(TYPES.ITourDataResolver);\n}","import _defineProperty from \"/home/vsts/work/r1/a/artifacts/source-code/node_modules/next/dist/compiled/@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nimport { IMediaType } from '@monofe/ui-workspace/download-tour';\nimport { IFeatureStatus, injectMimeType, memoize, memoizeAsync, stringTools, urlTools } from '@monofe/util';\nimport { injectSiteConfig } from './siteConfig';\nimport siteData from './siteData';\nexport const resolverData = {\n mediaPrefix: undefined,\n mediaSchema: undefined,\n downloadList: undefined\n};\nconst MIMETYPE_WEIGHTING_MAP_STREAM = {\n 'application/x-mpegURL': 1,\n 'video/mp4': 2\n};\nconst MIMETYPE_WEIGHTING_MAP_DOWNLOAD = {\n 'image/avif': 1,\n 'image/webp': 2,\n 'image/png': 8,\n 'image/jpeg': 9,\n 'image/jpg': 9,\n 'video/webm': 2,\n 'video/mp4': 3,\n 'audio/ogg': 4,\n 'audio/mpeg': 5,\n 'text/html': 9,\n 'text/plain': 10\n};\n\nconst MIMETYPE_WEIGHTING_MAP_ALL = _objectSpread(_objectSpread({}, MIMETYPE_WEIGHTING_MAP_STREAM), MIMETYPE_WEIGHTING_MAP_DOWNLOAD);\n\nfunction _prioritizeAssets(sortAssets, priorities) {\n const mimeTypeResolver = injectMimeType();\n const versions = [...sortAssets].sort((itemA, itemB) => {\n var _ref, _itemA$mimeType, _ref2, _itemB$mimeType, _priorities$mimeTypeA, _priorities$mimeTypeB;\n\n const mimeTypeA = (_ref = (_itemA$mimeType = itemA.mimeType) !== null && _itemA$mimeType !== void 0 ? _itemA$mimeType : mimeTypeResolver.fileExtensionToMimeType(itemA.path)) !== null && _ref !== void 0 ? _ref : 'text/plain';\n const mimeTypeB = (_ref2 = (_itemB$mimeType = itemB.mimeType) !== null && _itemB$mimeType !== void 0 ? _itemB$mimeType : mimeTypeResolver.fileExtensionToMimeType(itemB.path)) !== null && _ref2 !== void 0 ? _ref2 : 'text/plain';\n const weightingA = (_priorities$mimeTypeA = priorities[mimeTypeA]) !== null && _priorities$mimeTypeA !== void 0 ? _priorities$mimeTypeA : Number.MAX_SAFE_INTEGER;\n const weightingB = (_priorities$mimeTypeB = priorities[mimeTypeB]) !== null && _priorities$mimeTypeB !== void 0 ? _priorities$mimeTypeB : Number.MAX_SAFE_INTEGER;\n return weightingA - weightingB;\n });\n return versions;\n}\n\nfunction _assetSupportResolver(query, mimeType) {\n const mimeTypeResolver = asset => {\n var _ref3, _asset$mimeType;\n\n return (_ref3 = (_asset$mimeType = asset.mimeType) !== null && _asset$mimeType !== void 0 ? _asset$mimeType : mimeType.fileExtensionToMimeType(asset.path)) !== null && _ref3 !== void 0 ? _ref3 : 'text/plain';\n };\n\n const supportResolver = async asset => {\n const status = await query.mediaSupported([mimeTypeResolver(asset)]).catch(error => IFeatureStatus.FeatureStatusUnsupported);\n return status === IFeatureStatus.FeatureStatusSupported;\n };\n\n return memoizeAsync(supportResolver);\n}\n\nfunction _urlBuilder(asset) {\n var _asset$dependencies;\n\n /* Get value */\n const publicUrl = injectSiteConfig().public_url;\n const publicPrefix = publicUrl ? new URL(publicUrl).pathname : '/';\n const urls = ((_asset$dependencies = asset.dependencies) !== null && _asset$dependencies !== void 0 ? _asset$dependencies : [asset]).map(version => {\n var _asset$prefix;\n\n return (\n /* Make sure to use asset.prefix as it's the parent IMediumAssetSchema, the child may or may not have the prefix set */\n\n /* E.g. /c/demo /assets /SjFaN3dSRW8rNUo1b0tiR2NrWFFmUT09/contents audio/click.mp3 */\n [publicPrefix, resolverData.mediaPrefix, (_asset$prefix = asset.prefix) !== null && _asset$prefix !== void 0 ? _asset$prefix : '', version.path].join('/')\n );\n }).map(urlPath => urlTools.sanitizePath(urlPath, {\n requireLeadingSlash: false\n })).map(pathUrl => new URL(pathUrl, publicUrl));\n return urls;\n}\n\nfunction _assetFromUrl(url) {\n var _resolverData$mediaSc, _resolverData$mediaSc2;\n\n const path = stringTools.addLeading(url.pathname, '/');\n /* Get value */\n\n const publicUrl = injectSiteConfig().public_url;\n const publicPrefix = publicUrl ? new URL(publicUrl).pathname : '/';\n\n if (resolverData.mediaPrefix === undefined || !path.startsWith(publicPrefix)) {\n return undefined;\n }\n\n const versionPath = urlTools.sanitizePath(stringTools.addLeading(path.replace(publicUrl, '/').replace(publicPrefix, '/').replace(resolverData.mediaPrefix, '/'), '/'));\n const media = (_resolverData$mediaSc = (_resolverData$mediaSc2 = resolverData.mediaSchema) === null || _resolverData$mediaSc2 === void 0 ? void 0 : _resolverData$mediaSc2.media) !== null && _resolverData$mediaSc !== void 0 ? _resolverData$mediaSc : [];\n const matchingMedia = media.flatMap(item => item.versions).flatMap(item => {\n var _item$dependencies;\n\n return [item, ...((_item$dependencies = item.dependencies) !== null && _item$dependencies !== void 0 ? _item$dependencies : [])];\n }).filter(version => version.path === versionPath).at(-1);\n return matchingMedia;\n}\n\nfunction buildTourDataResolver(query, mimeType) {\n const assetFromUrl = memoize(_assetFromUrl);\n\n const assetSupportResolver = _assetSupportResolver(query, mimeType);\n\n const urlBuilder = memoize(_urlBuilder);\n return {\n get: (name, pk) => {\n const result = siteData.get(name, pk);\n\n if (result === undefined) {\n throw new Error(\"Unable to find entity: \".concat(name, \":\").concat(pk));\n }\n\n return Promise.resolve(result);\n },\n all: name => Promise.resolve(siteData.all(name)),\n downloadList: () => {\n var _resolverData$downloa;\n\n return Promise.resolve((_resolverData$downloa = resolverData.downloadList) !== null && _resolverData$downloa !== void 0 ? _resolverData$downloa : []);\n },\n urlsForMedium: async function (medium) {\n var _resolverData$mediaSc3, _resolverData$mediaSc4;\n\n let types = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [IMediaType.Stream, IMediaType.Download];\n const media = (_resolverData$mediaSc3 = (_resolverData$mediaSc4 = resolverData.mediaSchema) === null || _resolverData$mediaSc4 === void 0 ? void 0 : _resolverData$mediaSc4.media) !== null && _resolverData$mediaSc3 !== void 0 ? _resolverData$mediaSc3 : [];\n const matches = media.filter(item => item.sourceGuid === medium.id);\n const primaryMatch = matches.at(0);\n\n if (!primaryMatch) {\n throw new Error(\"No matches found for: \".concat(medium.id));\n }\n\n let mimeTypePriorities = MIMETYPE_WEIGHTING_MAP_ALL;\n\n if (types.length === 1 && types.at(0) === IMediaType.Stream) {\n mimeTypePriorities = MIMETYPE_WEIGHTING_MAP_STREAM;\n } else if (types.length === 1 && types.at(0) === IMediaType.Download) {\n mimeTypePriorities = MIMETYPE_WEIGHTING_MAP_DOWNLOAD;\n }\n\n const versions = _prioritizeAssets(primaryMatch.versions, mimeTypePriorities);\n\n for (const version of versions) {\n const hasSupport = await assetSupportResolver(version);\n\n if (!hasSupport) {\n continue;\n }\n\n const urls = urlBuilder(version);\n return urls;\n }\n\n throw new Error(\"No supporting files found: \".concat(versions.toString()));\n },\n urlContentLength: url => {\n var _asset$size;\n\n const asset = assetFromUrl(url);\n return Promise.resolve((_asset$size = asset === null || asset === void 0 ? void 0 : asset.size) !== null && _asset$size !== void 0 ? _asset$size : -1);\n }\n };\n}\n\nexport default buildTourDataResolver;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _router = require(\"../shared/lib/router/router\");\n\nvar _router1 = require(\"./router\");\n\nvar _useIntersection = require(\"./use-intersection\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nconst prefetched = {};\n\nfunction prefetch(router, href, as, options) {\n if (typeof window === 'undefined' || !router) return;\n if (!(0, _router).isLocalURL(href)) return; // Prefetch the JSON page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n\n router.prefetch(href, as, options).catch(err => {\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n const curLocale = options && typeof options.locale !== 'undefined' ? options.locale : router && router.locale; // Join on an invalid URI character\n\n prefetched[href + '%' + as + (curLocale ? '%' + curLocale : '')] = true;\n}\n\nfunction isModifiedEvent(event) {\n const {\n target\n } = event.currentTarget;\n return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;\n}\n\nfunction linkClicked(e, router, href, as, replace, shallow, scroll, locale) {\n const {\n nodeName\n } = e.currentTarget; // anchors inside an svg have a lowercase nodeName\n\n const isAnchorNodeName = nodeName.toUpperCase() === 'A';\n\n if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {\n // ignore click for browser’s default behavior\n return;\n }\n\n e.preventDefault(); // replace state instead of push if prop is present\n\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n locale,\n scroll\n });\n}\n\nfunction Link(props) {\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args) {\n return new Error(\"Failed prop type: The prop `\".concat(args.key, \"` expects a \").concat(args.expected, \" in ``, but got `\").concat(args.actual, \"` instead.\") + (typeof window !== 'undefined' ? \"\\nOpen your browser's console to view the Component stack trace.\" : ''));\n } // TypeScript trick for type-guarding:\n\n\n const requiredPropsGuard = {\n href: true\n };\n const requiredProps = Object.keys(requiredPropsGuard);\n requiredProps.forEach(key => {\n if (key === 'href') {\n if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key]\n });\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _ = key;\n }\n }); // TypeScript trick for type-guarding:\n\n const optionalPropsGuard = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n locale: true\n };\n const optionalProps = Object.keys(optionalPropsGuard);\n optionalProps.forEach(key => {\n const valType = typeof props[key];\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType\n });\n }\n } else if (key === 'locale') {\n if (props[key] && valType !== 'string') {\n throw createPropError({\n key,\n expected: '`string`',\n actual: valType\n });\n }\n } else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'prefetch') {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType\n });\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _ = key;\n }\n }); // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n\n const hasWarned = _react.default.useRef(false);\n\n if (props.prefetch && !hasWarned.current) {\n hasWarned.current = true;\n console.warn('Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated');\n }\n }\n\n const p = props.prefetch !== false;\n const router = (0, _router1).useRouter();\n\n const {\n href,\n as\n } = _react.default.useMemo(() => {\n const [resolvedHref, resolvedAs] = (0, _router).resolveHref(router, props.href, true);\n return {\n href: resolvedHref,\n as: props.as ? (0, _router).resolveHref(router, props.as) : resolvedAs || resolvedHref\n };\n }, [router, props.href, props.as]);\n\n const previousHref = _react.default.useRef(href);\n\n const previousAs = _react.default.useRef(as);\n\n let {\n children,\n replace,\n shallow,\n scroll,\n locale\n } = props;\n\n if (typeof children === 'string') {\n children = /*#__PURE__*/_react.default.createElement(\"a\", null, children);\n } // This will return the first child, if multiple are provided it will throw an error\n\n\n let child;\n\n if (process.env.NODE_ENV === 'development') {\n try {\n child = _react.default.Children.only(children);\n } catch (err) {\n if (!children) {\n throw new Error(\"No children were passed to with `href` of `\".concat(props.href, \"` but one child is required https://nextjs.org/docs/messages/link-no-children\"));\n }\n\n throw new Error(\"Multiple children were passed to with `href` of `\".concat(props.href, \"` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children\") + (typeof window !== 'undefined' ? \" \\nOpen your browser's console to view the Component stack trace.\" : ''));\n }\n } else {\n child = _react.default.Children.only(children);\n }\n\n const childRef = child && typeof child === 'object' && child.ref;\n const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({\n rootMargin: '200px'\n });\n\n const setRef = _react.default.useCallback(el => {\n // Before the link getting observed, check if visible state need to be reset\n if (previousAs.current !== as || previousHref.current !== href) {\n resetVisible();\n previousAs.current = as;\n previousHref.current = href;\n }\n\n setIntersectionRef(el);\n\n if (childRef) {\n if (typeof childRef === 'function') childRef(el);else if (typeof childRef === 'object') {\n childRef.current = el;\n }\n }\n }, [as, childRef, href, resetVisible, setIntersectionRef]);\n\n _react.default.useEffect(() => {\n const shouldPrefetch = isVisible && p && (0, _router).isLocalURL(href);\n const curLocale = typeof locale !== 'undefined' ? locale : router && router.locale;\n const isPrefetched = prefetched[href + '%' + as + (curLocale ? '%' + curLocale : '')];\n\n if (shouldPrefetch && !isPrefetched) {\n prefetch(router, href, as, {\n locale: curLocale\n });\n }\n }, [as, href, isVisible, locale, p, router]);\n\n const childProps = {\n ref: setRef,\n onClick: e => {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\"Component rendered inside next/link has to pass click event to \\\"onClick\\\" prop.\");\n }\n }\n\n if (child.props && typeof child.props.onClick === 'function') {\n child.props.onClick(e);\n }\n\n if (!e.defaultPrevented) {\n linkClicked(e, router, href, as, replace, shallow, scroll, locale);\n }\n }\n };\n\n childProps.onMouseEnter = e => {\n if (child.props && typeof child.props.onMouseEnter === 'function') {\n child.props.onMouseEnter(e);\n }\n\n if ((0, _router).isLocalURL(href)) {\n prefetch(router, href, as, {\n priority: true\n });\n }\n }; // If child is an
tag and doesn't have a href attribute, or if the 'passHref' property is\n // defined, we specify the current 'href', so that repetition is not needed by the user\n\n\n if (props.passHref || child.type === 'a' && !('href' in child.props)) {\n const curLocale = typeof locale !== 'undefined' ? locale : router && router.locale; // we only render domain locales if we are currently on a domain locale\n // so that locale links are still visitable in development/preview envs\n\n const localeDomain = router && router.isLocaleDomain && (0, _router).getDomainLocale(as, curLocale, router && router.locales, router && router.domainLocales);\n childProps.href = localeDomain || (0, _router).addBasePath((0, _router).addLocale(as, curLocale, router && router.defaultLocale));\n }\n\n return /*#__PURE__*/_react.default.cloneElement(child, childProps);\n}\n\nvar _default = Link;\nexports.default = _default;\n\nif (typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) {\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.useIntersection = useIntersection;\n\nvar _react = require(\"react\");\n\nvar _requestIdleCallback = require(\"./request-idle-callback\");\n\nconst hasIntersectionObserver = typeof IntersectionObserver !== 'undefined';\n\nfunction useIntersection(_ref) {\n let {\n rootRef,\n rootMargin,\n disabled\n } = _ref;\n const isDisabled = disabled || !hasIntersectionObserver;\n const unobserve = (0, _react).useRef();\n const [visible, setVisible] = (0, _react).useState(false);\n const [root, setRoot] = (0, _react).useState(rootRef ? rootRef.current : null);\n const setRef = (0, _react).useCallback(el => {\n if (unobserve.current) {\n unobserve.current();\n unobserve.current = undefined;\n }\n\n if (isDisabled || visible) return;\n\n if (el && el.tagName) {\n unobserve.current = observe(el, isVisible => isVisible && setVisible(isVisible), {\n root,\n rootMargin\n });\n }\n }, [isDisabled, root, rootMargin, visible]);\n const resetVisible = (0, _react).useCallback(() => {\n setVisible(false);\n }, []);\n (0, _react).useEffect(() => {\n if (!hasIntersectionObserver) {\n if (!visible) {\n const idleCallback = (0, _requestIdleCallback).requestIdleCallback(() => setVisible(true));\n return () => (0, _requestIdleCallback).cancelIdleCallback(idleCallback);\n }\n }\n }, [visible]);\n (0, _react).useEffect(() => {\n if (rootRef) setRoot(rootRef.current);\n }, [rootRef]);\n return [setRef, visible, resetVisible];\n}\n\nfunction observe(element, callback, options) {\n const {\n id,\n observer,\n elements\n } = createObserver(options);\n elements.set(element, callback);\n observer.observe(element);\n return function unobserve() {\n elements.delete(element);\n observer.unobserve(element); // Destroy observer when there's nothing left to watch:\n\n if (elements.size === 0) {\n observer.disconnect();\n observers.delete(id);\n let index = idList.findIndex(obj => obj.root === id.root && obj.margin === id.margin);\n\n if (index > -1) {\n idList.splice(index, 1);\n }\n }\n };\n}\n\nconst observers = new Map();\nconst idList = [];\n\nfunction createObserver(options) {\n const id = {\n root: options.root || null,\n margin: options.rootMargin || ''\n };\n let existing = idList.find(obj => obj.root === id.root && obj.margin === id.margin);\n let instance;\n\n if (existing) {\n instance = observers.get(existing);\n } else {\n instance = observers.get(id);\n idList.push(id);\n }\n\n if (instance) {\n return instance;\n }\n\n const elements = new Map();\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n const callback = elements.get(entry.target);\n const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;\n\n if (callback && isVisible) {\n callback(isVisible);\n }\n });\n }, options);\n observers.set(id, instance = {\n id,\n observer,\n elements\n });\n return instance;\n}\n\nif (typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) {\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AmpStateContext = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nconst AmpStateContext = _react.default.createContext({});\n\nexports.AmpStateContext = AmpStateContext;\n\nif (process.env.NODE_ENV !== 'production') {\n AmpStateContext.displayName = 'AmpStateContext';\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isInAmpMode = isInAmpMode;\nexports.useAmp = useAmp;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _ampContext = require(\"./amp-context\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction isInAmpMode() {\n let {\n ampFirst = false,\n hybrid = false,\n hasQuery = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return ampFirst || hybrid && hasQuery;\n}\n\nfunction useAmp() {\n // Don't assign the context value to a variable to save bytes\n return isInAmpMode(_react.default.useContext(_ampContext.AmpStateContext));\n}","\"use strict\";\n\nvar _defineProperty = require(\"/home/vsts/work/r1/a/artifacts/source-code/node_modules/next/dist/compiled/@babel/runtime/helpers/defineProperty\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultHead = defaultHead;\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _sideEffect = _interopRequireDefault(require(\"./side-effect\"));\n\nvar _ampContext = require(\"./amp-context\");\n\nvar _headManagerContext = require(\"./head-manager-context\");\n\nvar _amp = require(\"./amp\");\n\nvar _utils = require(\"./utils\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\n\n if (desc.get || desc.set) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n}\n\nfunction defaultHead() {\n let inAmpMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n const head = [/*#__PURE__*/_react.default.createElement(\"meta\", {\n charSet: \"utf-8\"\n })];\n\n if (!inAmpMode) {\n head.push( /*#__PURE__*/_react.default.createElement(\"meta\", {\n name: \"viewport\",\n content: \"width=device-width\"\n }));\n }\n\n return head;\n}\n\nfunction onlyReactElement(list, child) {\n // React children can be \"string\" or \"number\" in this case we ignore them for backwards compat\n if (typeof child === 'string' || typeof child === 'number') {\n return list;\n } // Adds support for React.Fragment\n\n\n if (child.type === _react.default.Fragment) {\n return list.concat(_react.default.Children.toArray(child.props.children).reduce((fragmentList, fragmentChild) => {\n if (typeof fragmentChild === 'string' || typeof fragmentChild === 'number') {\n return fragmentList;\n }\n\n return fragmentList.concat(fragmentChild);\n }, []));\n }\n\n return list.concat(child);\n}\n\nconst METATYPES = ['name', 'httpEquiv', 'charSet', 'itemProp'];\n/*\n returns a function for filtering head child elements\n which shouldn't be duplicated, like \n Also adds support for deduplicated `key` properties\n*/\n\nfunction unique() {\n const keys = new Set();\n const tags = new Set();\n const metaTypes = new Set();\n const metaCategories = {};\n return h => {\n let isUnique = true;\n let hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n const key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (let i = 0, len = METATYPES.length; i < len; i++) {\n const metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n const category = h.props[metatype];\n const categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}\n/**\n *\n * @param headElements List of multiple <Head> instances\n */\n\n\nfunction reduceComponents(headElements, props) {\n return headElements.reduce((list, headElement) => {\n const headElementChildren = _react.default.Children.toArray(headElement.props.children);\n\n return list.concat(headElementChildren);\n }, []).reduce(onlyReactElement, []).reverse().concat(defaultHead(props.inAmpMode)).filter(unique()).reverse().map((c, i) => {\n const key = c.key || i;\n\n if (process.env.NODE_ENV !== 'development' && process.env.__NEXT_OPTIMIZE_FONTS && !props.inAmpMode) {\n if (c.type === 'link' && c.props['href'] && // TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.\n ['https://fonts.googleapis.com/css', 'https://use.typekit.net/'].some(url => c.props['href'].startsWith(url))) {\n const newProps = _objectSpread({}, c.props || {});\n\n newProps['data-href'] = newProps['href'];\n newProps['href'] = undefined; // Add this attribute to make it easy to identify optimized tags\n\n newProps['data-optimized-fonts'] = true;\n return /*#__PURE__*/_react.default.cloneElement(c, newProps);\n }\n }\n\n if (process.env.NODE_ENV === 'development' && process.env.__NEXT_CONCURRENT_FEATURES) {\n // omit JSON-LD structured data snippets from the warning\n if (c.type === 'script' && c.props['type'] !== 'application/ld+json') {\n const srcMessage = c.props['src'] ? \"<script> tag with src=\\\"\".concat(c.props['src'], \"\\\"\") : \"inline <script>\";\n (0, _utils).warnOnce(\"Do not add <script> tags using next/head (see \".concat(srcMessage, \"). Use next/script instead. \\nSee more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component\"));\n } else if (c.type === 'link' && c.props['rel'] === 'stylesheet') {\n (0, _utils).warnOnce(\"Do not add stylesheets using next/head (see <link rel=\\\"stylesheet\\\"> tag with href=\\\"\".concat(c.props['href'], \"\\\"). Use Document instead. \\nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component\"));\n }\n }\n\n return /*#__PURE__*/_react.default.cloneElement(c, {\n key\n });\n });\n}\n/**\n * This component injects elements to `<head>` of your page.\n * To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.\n */\n\n\nfunction Head(_ref) {\n let {\n children\n } = _ref;\n const ampState = (0, _react).useContext(_ampContext.AmpStateContext);\n const headManager = (0, _react).useContext(_headManagerContext.HeadManagerContext);\n return /*#__PURE__*/_react.default.createElement(_sideEffect.default, {\n reduceComponentsToState: reduceComponents,\n headManager: headManager,\n inAmpMode: (0, _amp).isInAmpMode(ampState)\n }, children);\n}\n\nvar _default = Head;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\n\n if (desc.get || desc.set) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n}\n\nconst isServer = typeof window === 'undefined';\n\nclass _class extends _react.Component {\n constructor(props) {\n super(props);\n\n this.emitChange = () => {\n if (this._hasHeadManager) {\n this.props.headManager.updateHead(this.props.reduceComponentsToState([...this.props.headManager.mountedInstances], this.props));\n }\n };\n\n this._hasHeadManager = this.props.headManager && this.props.headManager.mountedInstances;\n\n if (isServer && this._hasHeadManager) {\n this.props.headManager.mountedInstances.add(this);\n this.emitChange();\n }\n }\n\n componentDidMount() {\n if (this._hasHeadManager) {\n this.props.headManager.mountedInstances.add(this);\n }\n\n this.emitChange();\n }\n\n componentDidUpdate() {\n this.emitChange();\n }\n\n componentWillUnmount() {\n if (this._hasHeadManager) {\n this.props.headManager.mountedInstances.delete(this);\n }\n\n this.emitChange();\n }\n\n render() {\n return null;\n }\n\n}\n\nexports.default = _class;","\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/_app\",\n function () {\n return require(\"private-next-pages/_app.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/_app\"])\n });\n }\n ","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"InstallBannerView_Container__LTujX\",\"Heading\":\"InstallBannerView_Heading__26oK_\",\"SubHeading\":\"InstallBannerView_SubHeading__WjyFf\",\"Footer\":\"InstallBannerView_Footer__FHFeW\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"MainView_Container__SgTVV\",\"InstallBanner\":\"MainView_InstallBanner__pp80v\",\"IconCross\":\"MainView_IconCross__JbwkR\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"CookieView_Container__mG0CY\",\"BackgroundOverlay\":\"CookieView_BackgroundOverlay__H6gS7\",\"TitleContainer\":\"CookieView_TitleContainer__c8uS3\",\"ButtonContainer\":\"CookieView_ButtonContainer__wcx3L\",\"BodyContainer\":\"CookieView_BodyContainer__hGy2Y\",\"ButtonAccept\":\"CookieView_ButtonAccept__kFq_s\",\"ButtonDecline\":\"CookieView_ButtonDecline__KDtNX\",\"ButtonPrivacyPolicy\":\"CookieView_ButtonPrivacyPolicy__WkU9X\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"PopUpView_Container__MgDw8\",\"AlertContainer\":\"PopUpView_AlertContainer__MfrkQ\",\"AlertTitle\":\"PopUpView_AlertTitle__BzAAz\",\"AlertOptionYes\":\"PopUpView_AlertOptionYes__q6aW_\",\"AlertOptionNo\":\"PopUpView_AlertOptionNo__BH0Jm\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"HighlightableButton_Container___ndD6\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"ToggleSwitch_Container__n6O7i\",\"Checkbox\":\"ToggleSwitch_Checkbox___w9Gq\",\"Label\":\"ToggleSwitch_Label___g6g4\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"DimOverlay_Container__S0RIt\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Picture\":\"Image_Picture__P3vQt\",\"Image\":\"Image_Image__K6uPV\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Wrapper\":\"ZoomPanPinch_Wrapper__uTT1d\",\"Content\":\"ZoomPanPinch_Content__SvKTK\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"BackLink_Container__qqFOi\",\"Div\":\"BackLink_Div__bh236\",\"Icon\":\"BackLink_Icon__QGebh\",\"SVG\":\"BackLink_SVG__LvKQn\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"PageControl_Container__eY9H9\",\"ButtonArrowLeft\":\"PageControl_ButtonArrowLeft__e8ecE\",\"ButtonArrowRight\":\"PageControl_ButtonArrowRight__UaEXf\",\"ButtonDot\":\"PageControl_ButtonDot__z0D8Z\",\"IconArrowLeft\":\"PageControl_IconArrowLeft__ABu4G\",\"IconArrowRight\":\"PageControl_IconArrowRight__3hSMb\",\"IconDot\":\"PageControl_IconDot__3jwFN\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Spinner\":\"BufferingWheel_Spinner__z0w1t\",\"Container\":\"BufferingWheel_Container__DRq7N\",\"anim-spin\":\"BufferingWheel_anim-spin__zhxwd\",\"Text\":\"BufferingWheel_Text__9cOA6\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"ProgressBar_Container__Cnm0v\",\"Bar\":\"ProgressBar_Bar__58xwa\",\"Text\":\"ProgressBar_Text___yJBm\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"ItemView_Container__ioPiN\",\"Image\":\"ItemView_Image__BZ6D3\",\"MarkerContainer\":\"ItemView_MarkerContainer__Z4E9I\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"MainView_Container__ST_au\",\"ItemContainer\":\"MainView_ItemContainer__rMi9_\",\"Item\":\"MainView_Item__1NNA9\",\"PageControl\":\"MainView_PageControl__ccot6\",\"ButtonMinus\":\"MainView_ButtonMinus__ZWM8Y\",\"ButtonPlus\":\"MainView_ButtonPlus__6KjFQ\",\"IconMinus\":\"MainView_IconMinus__3elAv\",\"IconPlus\":\"MainView_IconPlus__BBkE8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"AllMessages_Container__kJ37o\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Container\":\"Toast_Container__76xvT\",\"Icon\":\"Toast_Icon__ykISq\",\"Text\":\"Toast_Text__eNpz1\"};","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"next/dist/compiled/@babel/runtime/helpers/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","function isAnimationControls(v) {\n return typeof v === \"object\" && typeof v.start === \"function\";\n}\n\nexport { isAnimationControls };\n","var isKeyframesTarget = function (v) {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n","import { __values } from 'tslib';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\n\nvar presenceId = 0;\nfunction getPresenceId() {\n var id = presenceId;\n presenceId++;\n return id;\n}\nvar PresenceChild = function (_a) {\n var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout;\n var presenceChildren = useConstant(newChildrenMap);\n var id = useConstant(getPresenceId);\n var context = useMemo(function () { return ({\n id: id,\n initial: initial,\n isPresent: isPresent,\n custom: custom,\n onExitComplete: function (childId) {\n var e_1, _a;\n presenceChildren.set(childId, true);\n try {\n for (var _b = __values(presenceChildren.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var isComplete = _c.value;\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete();\n },\n register: function (childId) {\n presenceChildren.set(childId, false);\n return function () { return presenceChildren.delete(childId); };\n },\n }); }, \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout ? undefined : [isPresent]);\n useMemo(function () {\n presenceChildren.forEach(function (_, key) { return presenceChildren.set(key, false); });\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(function () {\n !isPresent && !presenceChildren.size && (onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete());\n }, [isPresent]);\n return (React.createElement(PresenceContext.Provider, { value: context }, children));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { __read, __spreadArray } from 'tslib';\nimport * as React from 'react';\nimport { useContext, useRef, useEffect, cloneElement, Children, isValidElement } from 'react';\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\n\nfunction getChildKey(child) {\n return child.key || \"\";\n}\nfunction updateChildLookup(children, allChildren) {\n var seenChildren = process.env.NODE_ENV !== \"production\" ? new Set() : null;\n children.forEach(function (child) {\n var key = getChildKey(child);\n if (process.env.NODE_ENV !== \"production\" && seenChildren) {\n if (seenChildren.has(key)) {\n console.warn(\"Children of AnimatePresence require unique keys. \\\"\".concat(key, \"\\\" is a duplicate.\"));\n }\n seenChildren.add(key);\n }\n allChildren.set(key, child);\n });\n}\nfunction onlyElements(children) {\n var filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, function (child) {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nvar AnimatePresence = function (_a) {\n var children = _a.children, custom = _a.custom, _b = _a.initial, initial = _b === void 0 ? true : _b, onExitComplete = _a.onExitComplete, exitBeforeEnter = _a.exitBeforeEnter, _c = _a.presenceAffectsLayout, presenceAffectsLayout = _c === void 0 ? true : _c;\n // We want to force a re-render once all exiting animations have finished. We\n // either use a local forceRender function, or one from a parent context if it exists.\n var _d = __read(useForceUpdate(), 1), forceRender = _d[0];\n var forceRenderLayoutGroup = useContext(LayoutGroupContext).forceRender;\n if (forceRenderLayoutGroup)\n forceRender = forceRenderLayoutGroup;\n var isInitialRender = useRef(true);\n var isMounted = useRef(true);\n useEffect(function () { return function () {\n isMounted.current = false;\n }; }, []);\n // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key\n var filteredChildren = onlyElements(children);\n // Keep a living record of the children we're actually rendering so we\n // can diff to figure out which are entering and exiting\n var presentChildren = useRef(filteredChildren);\n // A lookup table to quickly reference components by key\n var allChildren = useRef(new Map()).current;\n // A living record of all currently exiting components.\n var exiting = useRef(new Set()).current;\n updateChildLookup(filteredChildren, allChildren);\n // If this is the initial component render, just deal with logic surrounding whether\n // we play onMount animations or not.\n if (isInitialRender.current) {\n isInitialRender.current = false;\n return (React.createElement(React.Fragment, null, filteredChildren.map(function (child) { return (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout }, child)); })));\n }\n // If this is a subsequent render, deal with entering and exiting children\n var childrenToRender = __spreadArray([], __read(filteredChildren), false);\n // Diff the keys of the currently-present and target children to update our\n // exiting list.\n var presentKeys = presentChildren.current.map(getChildKey);\n var targetKeys = filteredChildren.map(getChildKey);\n // Diff the present children with our target children and mark those that are exiting\n var numPresent = presentKeys.length;\n for (var i = 0; i < numPresent; i++) {\n var key = presentKeys[i];\n if (targetKeys.indexOf(key) === -1) {\n exiting.add(key);\n }\n else {\n // In case this key has re-entered, remove from the exiting list\n exiting.delete(key);\n }\n }\n // If we currently have exiting children, and we're deferring rendering incoming children\n // until after all current children have exiting, empty the childrenToRender array\n if (exitBeforeEnter && exiting.size) {\n childrenToRender = [];\n }\n // Loop through all currently exiting components and clone them to overwrite `animate`\n // with any `exit` prop they might have defined.\n exiting.forEach(function (key) {\n // If this component is actually entering again, early return\n if (targetKeys.indexOf(key) !== -1)\n return;\n var child = allChildren.get(key);\n if (!child)\n return;\n var insertionIndex = presentKeys.indexOf(key);\n var onExit = function () {\n allChildren.delete(key);\n exiting.delete(key);\n // Remove this child from the present children\n var removeIndex = presentChildren.current.findIndex(function (presentChild) { return presentChild.key === key; });\n presentChildren.current.splice(removeIndex, 1);\n // Defer re-rendering until all exiting children have indeed left\n if (!exiting.size) {\n presentChildren.current = filteredChildren;\n if (isMounted.current === false) {\n return;\n }\n forceRender();\n onExitComplete && onExitComplete();\n }\n };\n childrenToRender.splice(insertionIndex, 0, React.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout }, child));\n });\n // Add `MotionContext` even to children that don't need it to ensure we're rendering\n // the same tree between renders\n childrenToRender = childrenToRender.map(function (child) {\n var key = child.key;\n return exiting.has(key) ? (child) : (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout }, child));\n });\n presentChildren.current = childrenToRender;\n if (process.env.NODE_ENV !== \"production\" &&\n exitBeforeEnter &&\n childrenToRender.length > 1) {\n console.warn(\"You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour.\");\n }\n return (React.createElement(React.Fragment, null, exiting.size\n ? childrenToRender\n : childrenToRender.map(function (child) { return cloneElement(child); })));\n};\n\nexport { AnimatePresence };\n","import { __read, __rest } from 'tslib';\nimport * as React from 'react';\nimport { useState, useRef, useEffect } from 'react';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { loadFeatures } from '../../motion/features/definitions.mjs';\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimations } from \"framer-motion\"\n *\n * function App() {\n * return (\n * <LazyMotion features={domAnimations}>\n * <m.div animate={{ scale: 2 }} />\n * </LazyMotion>\n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * <LazyMotion features={() => import('./path/to/domAnimations')}>\n * <m.div animate={{ scale: 2 }} />\n * </LazyMotion>\n * )\n * }\n * ```\n *\n * @public\n */\nfunction LazyMotion(_a) {\n var children = _a.children, features = _a.features, _b = _a.strict, strict = _b === void 0 ? false : _b;\n var _c = __read(useState(!isLazyBundle(features)), 2), setIsLoaded = _c[1];\n var loadedRenderer = useRef(undefined);\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n var renderer = features.renderer, loadedFeatures = __rest(features, [\"renderer\"]);\n loadedRenderer.current = renderer;\n loadFeatures(loadedFeatures);\n }\n useEffect(function () {\n if (isLazyBundle(features)) {\n features().then(function (_a) {\n var renderer = _a.renderer, loadedFeatures = __rest(_a, [\"renderer\"]);\n loadFeatures(loadedFeatures);\n loadedRenderer.current = renderer;\n setIsLoaded(true);\n });\n }\n }, []);\n return (React.createElement(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict: strict } }, children));\n}\nfunction isLazyBundle(features) {\n return typeof features === \"function\";\n}\n\nexport { LazyMotion };\n","import { createContext } from 'react';\n\n/**\n * @internal\n */\nvar LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","import { createContext } from 'react';\n\nvar LazyContext = createContext({ strict: false });\n\nexport { LazyContext };\n","import { createContext } from 'react';\n\n/**\n * @public\n */\nvar MotionConfigContext = createContext({\n transformPagePoint: function (p) { return p; },\n isStatic: false,\n});\n\nexport { MotionConfigContext };\n","import { createContext } from 'react';\n\n/**\n * @public\n */\nvar PresenceContext = createContext(null);\n\nexport { PresenceContext };\n","var createDefinition = function (propNames) { return ({\n isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); },\n}); };\nvar featureDefinitions = {\n measureLayout: createDefinition([\"layout\", \"layoutId\", \"drag\"]),\n animation: createDefinition([\n \"animate\",\n \"exit\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"whileFocus\",\n \"whileDrag\",\n \"whileInView\",\n ]),\n exit: createDefinition([\"exit\"]),\n drag: createDefinition([\"drag\", \"dragControls\"]),\n focus: createDefinition([\"whileFocus\"]),\n hover: createDefinition([\"whileHover\", \"onHoverStart\", \"onHoverEnd\"]),\n tap: createDefinition([\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"]),\n pan: createDefinition([\n \"onPan\",\n \"onPanStart\",\n \"onPanSessionStart\",\n \"onPanEnd\",\n ]),\n inView: createDefinition([\n \"whileInView\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n ]),\n};\nfunction loadFeatures(features) {\n for (var key in features) {\n if (features[key] === null)\n continue;\n if (key === \"projectionNodeConstructor\") {\n featureDefinitions.projectionNodeConstructor = features[key];\n }\n else {\n featureDefinitions[key].Component = features[key];\n }\n }\n}\n\nexport { featureDefinitions, loadFeatures };\n","var scaleCorrectors = {};\nfunction addScaleCorrector(correctors) {\n Object.assign(scaleCorrectors, correctors);\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n","import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nimport { isTransformProp, isTransformOriginProp } from '../../render/html/utils/transform.mjs';\n\nfunction isForcedMotionValue(key, _a) {\n var layout = _a.layout, layoutId = _a.layoutId;\n return (isTransformProp(key) ||\n isTransformOriginProp(key) ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue };\n","import { useContext, useEffect } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence() {\n var context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n // Replace with useOpaqueId when released in React\n var id = useUniqueId();\n useEffect(function () { return register(id); }, []);\n var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); };\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\nvar counter = 0;\nvar incrementId = function () { return counter++; };\nvar useUniqueId = function () { return useConstant(incrementId); };\n\nexport { isPresent, useIsPresent, usePresence };\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n var prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (var i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n","const clamp = (min, max, v) => Math.min(Math.max(v, min), max);\n\nexport { clamp };\n","import { warning } from 'hey-listen';\nimport { clamp } from '../../utils/clamp.mjs';\n\nconst safeMin = 0.001;\nconst minDuration = 0.01;\nconst maxDuration = 10.0;\nconst minDamping = 0.05;\nconst maxDamping = 1;\nfunction findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) {\n let envelope;\n let derivative;\n warning(duration <= maxDuration * 1000, \"Spring duration must be 10 seconds or less\");\n let dampingRatio = 1 - bounce;\n dampingRatio = clamp(minDamping, maxDamping, dampingRatio);\n duration = clamp(minDuration, maxDuration, duration / 1000);\n if (dampingRatio < 1) {\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = duration * 1000;\n if (isNaN(undampedFreq)) {\n return {\n stiffness: 100,\n damping: 10,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring, maxDamping, maxDuration, minDamping, minDuration };\n","import { __rest } from 'tslib';\nimport { findSpring, calcAngularFreq } from '../utils/find-spring.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = Object.assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options);\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n const derived = findSpring(options);\n springOptions = Object.assign(Object.assign(Object.assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 });\n springOptions.isResolvedFromDuration = true;\n }\n return springOptions;\n}\nfunction spring(_a) {\n var { from = 0.0, to = 1.0, restSpeed = 2, restDelta } = _a, options = __rest(_a, [\"from\", \"to\", \"restSpeed\", \"restDelta\"]);\n const state = { done: false, value: from };\n let { stiffness, damping, mass, velocity, duration, isResolvedFromDuration, } = getSpringOptions(options);\n let resolveSpring = zero;\n let resolveVelocity = zero;\n function createSpring() {\n const initialVelocity = velocity ? -(velocity / 1000) : 0.0;\n const initialDelta = to - from;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000;\n if (restDelta === undefined) {\n restDelta = Math.min(Math.abs(to - from) / 100, 0.4);\n }\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (to -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (dampingRatio *\n undampedAngularFreq *\n envelope *\n ((Math.sin(angularFreq * t) *\n (initialVelocity +\n dampingRatio *\n undampedAngularFreq *\n initialDelta)) /\n angularFreq +\n initialDelta * Math.cos(angularFreq * t)) -\n envelope *\n (Math.cos(angularFreq * t) *\n (initialVelocity +\n dampingRatio *\n undampedAngularFreq *\n initialDelta) -\n angularFreq *\n initialDelta *\n Math.sin(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n resolveSpring = (t) => to -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) *\n t);\n }\n else {\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (to -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n }\n createSpring();\n return {\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = resolveVelocity(t) * 1000;\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? to : current;\n return state;\n },\n flipTarget: () => {\n velocity = -velocity;\n [from, to] = [to, from];\n createSpring();\n },\n };\n}\nspring.needsInterpolation = (a, b) => typeof a === \"string\" || typeof b === \"string\";\nconst zero = (_t) => 0;\n\nexport { spring };\n","const progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","const mix = (from, to, progress) => -progress * from + progress * to + from;\n\nexport { mix };\n","import { isString, singleColorRegex, floatRegex } from '../utils.mjs';\n\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||\n (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (!isString(v))\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","import { number, alpha } from '../numbers/index.mjs';\nimport { sanitize, clamp } from '../utils.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = clamp(0, 255);\nconst rgbUnit = Object.assign(Object.assign({}, number), { transform: (v) => Math.round(clampRgbUnit(v)) });\nconst rgba = {\n test: isColorString('rgb', 'red'),\n parse: splitColor('red', 'green', 'blue'),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => 'rgba(' +\n rgbUnit.transform(red) +\n ', ' +\n rgbUnit.transform(green) +\n ', ' +\n rgbUnit.transform(blue) +\n ', ' +\n sanitize(alpha.transform(alpha$1)) +\n ')',\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = '';\n let g = '';\n let b = '';\n let a = '';\n if (v.length > 5) {\n r = v.substr(1, 2);\n g = v.substr(3, 2);\n b = v.substr(5, 2);\n a = v.substr(7, 2);\n }\n else {\n r = v.substr(1, 1);\n g = v.substr(2, 1);\n b = v.substr(3, 1);\n a = v.substr(4, 1);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: isColorString('#'),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: isColorString('hsl', 'hue'),\n parse: splitColor('hue', 'saturation', 'lightness'),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return ('hsla(' +\n Math.round(hue) +\n ', ' +\n percent.transform(sanitize(saturation)) +\n ', ' +\n percent.transform(sanitize(lightness)) +\n ', ' +\n sanitize(alpha.transform(alpha$1)) +\n ')');\n },\n};\n\nexport { hsla };\n","function hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","import { mix } from './mix.mjs';\nimport { hsla, rgba, hex } from 'style-value-types';\nimport { invariant } from 'hey-listen';\nimport { hslaToRgba } from './hsla-to-rgba.mjs';\n\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const toExpo = to * to;\n return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo));\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nconst notAnimatable = (color) => `'${color}' is not an animatable color. Use the equivalent color code instead.`;\nconst mixColor = (from, to) => {\n let fromColorType = getColorType(from);\n let toColorType = getColorType(to);\n invariant(!!fromColorType, notAnimatable(from));\n invariant(!!toColorType, notAnimatable(to));\n let fromColor = fromColorType.parse(from);\n let toColor = toColorType.parse(to);\n if (fromColorType === hsla) {\n fromColor = hslaToRgba(fromColor);\n fromColorType = rgba;\n }\n if (toColorType === hsla) {\n toColor = hslaToRgba(toColor);\n toColorType = rgba;\n }\n const blended = Object.assign({}, fromColor);\n return (v) => {\n for (const key in blended) {\n if (key !== \"alpha\") {\n blended[key] = mixLinearColor(fromColor[key], toColor[key], v);\n }\n }\n blended.alpha = mix(fromColor.alpha, toColor.alpha, v);\n return fromColorType.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","import { isString } from '../utils.mjs';\nimport { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return isString(v)\n ? v\n : v.hasOwnProperty('red')\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n};\n\nexport { color };\n","import { color } from '../color/index.mjs';\nimport { number } from '../numbers/index.mjs';\nimport { isString, floatRegex, colorRegex, sanitize } from '../utils.mjs';\n\nconst colorToken = '${c}';\nconst numberToken = '${n}';\nfunction test(v) {\n var _a, _b, _c, _d;\n return (isNaN(v) &&\n isString(v) &&\n ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0);\n}\nfunction analyse(v) {\n if (typeof v === 'number')\n v = `${v}`;\n const values = [];\n let numColors = 0;\n const colors = v.match(colorRegex);\n if (colors) {\n numColors = colors.length;\n v = v.replace(colorRegex, colorToken);\n values.push(...colors.map(color.parse));\n }\n const numbers = v.match(floatRegex);\n if (numbers) {\n v = v.replace(floatRegex, numberToken);\n values.push(...numbers.map(number.parse));\n }\n return { values, numColors, tokenised: v };\n}\nfunction parse(v) {\n return analyse(v).values;\n}\nfunction createTransformer(v) {\n const { values, numColors, tokenised } = analyse(v);\n const numValues = values.length;\n return (v) => {\n let output = tokenised;\n for (let i = 0; i < numValues; i++) {\n output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i]));\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === 'number' ? 0 : v;\nfunction getAnimatableNone(v) {\n const parsed = parse(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = { test, parse, createTransformer, getAnimatableNone };\n\nexport { complex };\n","const combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","import { complex, color } from 'style-value-types';\nimport { mix } from './mix.mjs';\nimport { mixColor } from './mix-color.mjs';\nimport { isNum } from './inc.mjs';\nimport { pipe } from './pipe.mjs';\nimport { warning } from 'hey-listen';\n\nfunction getMixer(origin, target) {\n if (isNum(origin)) {\n return (v) => mix(origin, target, v);\n }\n else if (color.test(origin)) {\n return mixColor(origin, target);\n }\n else {\n return mixComplex(origin, target);\n }\n}\nconst mixArray = (from, to) => {\n const output = [...from];\n const numValues = output.length;\n const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i]));\n return (v) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](v);\n }\n return output;\n };\n};\nconst mixObject = (origin, target) => {\n const output = Object.assign(Object.assign({}, origin), target);\n const blendValue = {};\n for (const key in output) {\n if (origin[key] !== undefined && target[key] !== undefined) {\n blendValue[key] = getMixer(origin[key], target[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n};\nfunction analyse(value) {\n const parsed = complex.parse(value);\n const numValues = parsed.length;\n let numNumbers = 0;\n let numRGB = 0;\n let numHSL = 0;\n for (let i = 0; i < numValues; i++) {\n if (numNumbers || typeof parsed[i] === \"number\") {\n numNumbers++;\n }\n else {\n if (parsed[i].hue !== undefined) {\n numHSL++;\n }\n else {\n numRGB++;\n }\n }\n }\n return { parsed, numNumbers, numRGB, numHSL };\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyse(origin);\n const targetStats = analyse(target);\n const canInterpolate = originStats.numHSL === targetStats.numHSL &&\n originStats.numRGB === targetStats.numRGB &&\n originStats.numNumbers >= targetStats.numNumbers;\n if (canInterpolate) {\n return pipe(mixArray(originStats.parsed, targetStats.parsed), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);\n return (p) => `${p > 0 ? target : origin}`;\n }\n};\n\nexport { mixArray, mixComplex, mixObject };\n","const zeroPoint = {\n x: 0,\n y: 0,\n z: 0\n};\nconst isNum = (v) => typeof v === 'number';\n\nexport { isNum, zeroPoint };\n","import { progress } from './progress.mjs';\nimport { mix } from './mix.mjs';\nimport { mixColor } from './mix-color.mjs';\nimport { mixComplex, mixArray, mixObject } from './mix-complex.mjs';\nimport { color } from 'style-value-types';\nimport { clamp } from './clamp.mjs';\nimport { pipe } from './pipe.mjs';\nimport { invariant } from 'hey-listen';\n\nconst mixNumber = (from, to) => (p) => mix(from, to, p);\nfunction detectMixerFactory(v) {\n if (typeof v === 'number') {\n return mixNumber;\n }\n else if (typeof v === 'string') {\n if (color.test(v)) {\n return mixColor;\n }\n else {\n return mixComplex;\n }\n }\n else if (Array.isArray(v)) {\n return mixArray;\n }\n else if (typeof v === 'object') {\n return mixObject;\n }\n}\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || detectMixerFactory(output[0]);\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\nfunction fastInterpolate([from, to], [mixer]) {\n return (v) => mixer(progress(from, to, v));\n}\nfunction slowInterpolate(input, mixers) {\n const inputLength = input.length;\n const lastInputIndex = inputLength - 1;\n return (v) => {\n let mixerIndex = 0;\n let foundMixerIndex = false;\n if (v <= input[0]) {\n foundMixerIndex = true;\n }\n else if (v >= input[lastInputIndex]) {\n mixerIndex = lastInputIndex - 1;\n foundMixerIndex = true;\n }\n if (!foundMixerIndex) {\n let i = 1;\n for (; i < inputLength; i++) {\n if (input[i] > v || i === lastInputIndex) {\n break;\n }\n }\n mixerIndex = i - 1;\n }\n const progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v);\n return mixers[mixerIndex](progressInRange);\n };\n}\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, 'Both input and output ranges must be the same length');\n invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.');\n if (input[0] > input[inputLength - 1]) {\n input = [].concat(input);\n output = [].concat(output);\n input.reverse();\n output.reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const interpolator = inputLength === 2\n ? fastInterpolate(input, mixers)\n : slowInterpolate(input, mixers);\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","const reverseEasing = easing => p => 1 - easing(1 - p);\nconst mirrorEasing = easing => p => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\nconst createExpoIn = (power) => p => Math.pow(p, power);\nconst createBackIn = (power) => p => p * p * ((power + 1) * p - power);\nconst createAnticipate = (power) => {\n const backEasing = createBackIn(power);\n return p => (p *= 2) < 1\n ? 0.5 * backEasing(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n};\n\nexport { createAnticipate, createBackIn, createExpoIn, mirrorEasing, reverseEasing };\n","import { createExpoIn, reverseEasing, mirrorEasing, createBackIn, createAnticipate } from './utils.mjs';\n\nconst DEFAULT_OVERSHOOT_STRENGTH = 1.525;\nconst BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0;\nconst BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0;\nconst BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0;\nconst linear = p => p;\nconst easeIn = createExpoIn(2);\nconst easeOut = reverseEasing(easeIn);\nconst easeInOut = mirrorEasing(easeIn);\nconst circIn = p => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circOut);\nconst backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH);\nconst backOut = reverseEasing(backIn);\nconst backInOut = mirrorEasing(backIn);\nconst anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH);\nconst ca = 4356.0 / 361.0;\nconst cb = 35442.0 / 1805.0;\nconst cc = 16061.0 / 1805.0;\nconst bounceOut = (p) => {\n if (p === 1 || p === 0)\n return p;\n const p2 = p * p;\n return p < BOUNCE_FIRST_THRESHOLD\n ? 7.5625 * p2\n : p < BOUNCE_SECOND_THRESHOLD\n ? 9.075 * p2 - 9.9 * p + 3.4\n : p < BOUNCE_THIRD_THRESHOLD\n ? ca * p2 - cb * p + cc\n : 10.8 * p * p - 20.52 * p + 10.72;\n};\nconst bounceIn = reverseEasing(bounceOut);\nconst bounceInOut = (p) => p < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0))\n : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5;\n\nexport { anticipate, backIn, backInOut, backOut, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, easeIn, easeInOut, easeOut, linear };\n","import { interpolate } from '../../utils/interpolate.mjs';\nimport { easeInOut } from '../../easing/index.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction defaultOffset(values) {\n const numValues = values.length;\n return values.map((_value, i) => i !== 0 ? i / (numValues - 1) : 0);\n}\nfunction convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\nfunction keyframes({ from = 0, to = 1, ease, offset, duration = 300, }) {\n const state = { done: false, value: from };\n const values = Array.isArray(to) ? to : [from, to];\n const times = convertOffsetToTimes(offset && offset.length === values.length\n ? offset\n : defaultOffset(values), duration);\n function createInterpolator() {\n return interpolate(times, values, {\n ease: Array.isArray(ease) ? ease : defaultEasing(values, ease),\n });\n }\n let interpolator = createInterpolator();\n return {\n next: (t) => {\n state.value = interpolator(t);\n state.done = t >= duration;\n return state;\n },\n flipTarget: () => {\n values.reverse();\n interpolator = createInterpolator();\n },\n };\n}\n\nexport { convertOffsetToTimes, defaultEasing, defaultOffset, keyframes };\n","import { spring } from '../generators/spring.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { decay } from '../generators/decay.mjs';\n\nconst types = { keyframes, spring, decay };\nfunction detectAnimationFromOptions(config) {\n if (Array.isArray(config.to)) {\n return keyframes;\n }\n else if (types[config.type]) {\n return types[config.type];\n }\n const keys = new Set(Object.keys(config));\n if (keys.has(\"ease\") ||\n (keys.has(\"duration\") && !keys.has(\"dampingRatio\"))) {\n return keyframes;\n }\n else if (keys.has(\"dampingRatio\") ||\n keys.has(\"stiffness\") ||\n keys.has(\"mass\") ||\n keys.has(\"damping\") ||\n keys.has(\"restSpeed\") ||\n keys.has(\"restDelta\")) {\n return spring;\n }\n return keyframes;\n}\n\nexport { detectAnimationFromOptions };\n","function decay({ velocity = 0, from = 0, power = 0.8, timeConstant = 350, restDelta = 0.5, modifyTarget, }) {\n const state = { done: false, value: from };\n let amplitude = power * velocity;\n const ideal = from + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n if (target !== ideal)\n amplitude = target - from;\n return {\n next: (t) => {\n const delta = -amplitude * Math.exp(-t / timeConstant);\n state.done = !(delta > restDelta || delta < -restDelta);\n state.value = state.done ? target : target + delta;\n return state;\n },\n flipTarget: () => { },\n };\n}\n\nexport { decay };\n","function loopElapsed(elapsed, duration, delay = 0) {\n return elapsed - duration - delay;\n}\nfunction reverseElapsed(elapsed, duration, delay = 0, isForwardPlayback = true) {\n return isForwardPlayback\n ? loopElapsed(duration + -elapsed, duration, delay)\n : duration - (elapsed - duration) + delay;\n}\nfunction hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) {\n return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay;\n}\n\nexport { hasRepeatDelayElapsed, loopElapsed, reverseElapsed };\n","import { __rest } from 'tslib';\nimport { detectAnimationFromOptions } from './utils/detect-animation-from-options.mjs';\nimport sync, { cancelSync } from 'framesync';\nimport { interpolate } from '../utils/interpolate.mjs';\nimport { hasRepeatDelayElapsed, reverseElapsed, loopElapsed } from './utils/elapsed.mjs';\n\nconst framesync = (update) => {\n const passTimestamp = ({ delta }) => update(delta);\n return {\n start: () => sync.update(passTimestamp, true),\n stop: () => cancelSync.update(passTimestamp),\n };\n};\nfunction animate(_a) {\n var _b, _c;\n var { from, autoplay = true, driver = framesync, elapsed = 0, repeat: repeatMax = 0, repeatType = \"loop\", repeatDelay = 0, onPlay, onStop, onComplete, onRepeat, onUpdate } = _a, options = __rest(_a, [\"from\", \"autoplay\", \"driver\", \"elapsed\", \"repeat\", \"repeatType\", \"repeatDelay\", \"onPlay\", \"onStop\", \"onComplete\", \"onRepeat\", \"onUpdate\"]);\n let { to } = options;\n let driverControls;\n let repeatCount = 0;\n let computedDuration = options.duration;\n let latest;\n let isComplete = false;\n let isForwardPlayback = true;\n let interpolateFromNumber;\n const animator = detectAnimationFromOptions(options);\n if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) {\n interpolateFromNumber = interpolate([0, 100], [from, to], {\n clamp: false,\n });\n from = 0;\n to = 100;\n }\n const animation = animator(Object.assign(Object.assign({}, options), { from, to }));\n function repeat() {\n repeatCount++;\n if (repeatType === \"reverse\") {\n isForwardPlayback = repeatCount % 2 === 0;\n elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback);\n }\n else {\n elapsed = loopElapsed(elapsed, computedDuration, repeatDelay);\n if (repeatType === \"mirror\")\n animation.flipTarget();\n }\n isComplete = false;\n onRepeat && onRepeat();\n }\n function complete() {\n driverControls.stop();\n onComplete && onComplete();\n }\n function update(delta) {\n if (!isForwardPlayback)\n delta = -delta;\n elapsed += delta;\n if (!isComplete) {\n const state = animation.next(Math.max(0, elapsed));\n latest = state.value;\n if (interpolateFromNumber)\n latest = interpolateFromNumber(latest);\n isComplete = isForwardPlayback ? state.done : elapsed <= 0;\n }\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest);\n if (isComplete) {\n if (repeatCount === 0)\n computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed);\n if (repeatCount < repeatMax) {\n hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat();\n }\n else {\n complete();\n }\n }\n }\n function play() {\n onPlay === null || onPlay === void 0 ? void 0 : onPlay();\n driverControls = driver(update);\n driverControls.start();\n }\n autoplay && play();\n return {\n stop: () => {\n onStop === null || onStop === void 0 ? void 0 : onStop();\n driverControls.stop();\n },\n };\n}\n\nexport { animate };\n","function velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\nvar secondsToMilliseconds = function (seconds) { return seconds * 1000; };\n\nexport { secondsToMilliseconds };\n","import { linear } from './index.mjs';\n\nconst a = (a1, a2) => 1.0 - 3.0 * a2 + 3.0 * a1;\nconst b = (a1, a2) => 3.0 * a2 - 6.0 * a1;\nconst c = (a1) => 3.0 * a1;\nconst calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\nconst getSlope = (t, a1, a2) => 3.0 * a(a1, a2) * t * t + 2.0 * b(a1, a2) * t + c(a1);\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 10;\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n }\n else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nconst newtonIterations = 8;\nconst newtonMinSlope = 0.001;\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for (let i = 0; i < newtonIterations; ++i) {\n const currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n const currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\nconst kSplineTableSize = 11;\nconst kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n if (mX1 === mY1 && mX2 === mY2)\n return linear;\n const sampleValues = new Float32Array(kSplineTableSize);\n for (let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n const lastSample = kSplineTableSize - 1;\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n const dist = (aX - sampleValues[currentSample]) /\n (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n const guessForT = intervalStart + dist * kSampleStepSize;\n const initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= newtonMinSlope) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n }\n else if (initialSlope === 0.0) {\n return guessForT;\n }\n else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n","import { __read } from 'tslib';\nimport { invariant } from 'hey-listen';\nimport { cubicBezier, linear, easeIn, easeInOut, easeOut, circIn, circInOut, circOut, backIn, backInOut, backOut, anticipate, bounceIn, bounceInOut, bounceOut } from 'popmotion';\n\nvar easingLookup = {\n linear: linear,\n easeIn: easeIn,\n easeInOut: easeInOut,\n easeOut: easeOut,\n circIn: circIn,\n circInOut: circInOut,\n circOut: circOut,\n backIn: backIn,\n backInOut: backInOut,\n backOut: backOut,\n anticipate: anticipate,\n bounceIn: bounceIn,\n bounceInOut: bounceInOut,\n bounceOut: bounceOut,\n};\nvar easingDefinitionToFunction = function (definition) {\n if (Array.isArray(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, \"Cubic bezier arrays must contain four numerical values.\");\n var _a = __read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3];\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (typeof definition === \"string\") {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, \"Invalid easing type '\".concat(definition, \"'\"));\n return easingLookup[definition];\n }\n return definition;\n};\nvar isEasingArray = function (ease) {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { easingDefinitionToFunction, isEasingArray };\n","import { complex } from 'style-value-types';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nvar isAnimatable = function (key, value) {\n // If the list of keys tat might be non-animatable grows, replace with Set\n if (key === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n complex.test(value) && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n","import { __assign } from 'tslib';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\nvar underDampedSpring = function () { return ({\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}); };\nvar criticallyDampedSpring = function (to) { return ({\n type: \"spring\",\n stiffness: 550,\n damping: to === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n}); };\nvar linearTween = function () { return ({\n type: \"keyframes\",\n ease: \"linear\",\n duration: 0.3,\n}); };\nvar keyframes = function (values) { return ({\n type: \"keyframes\",\n duration: 0.8,\n values: values,\n}); };\nvar defaultTransitions = {\n x: underDampedSpring,\n y: underDampedSpring,\n z: underDampedSpring,\n rotate: underDampedSpring,\n rotateX: underDampedSpring,\n rotateY: underDampedSpring,\n rotateZ: underDampedSpring,\n scaleX: criticallyDampedSpring,\n scaleY: criticallyDampedSpring,\n scale: criticallyDampedSpring,\n opacity: linearTween,\n backgroundColor: linearTween,\n color: linearTween,\n default: criticallyDampedSpring,\n};\nvar getDefaultTransition = function (valueKey, to) {\n var transitionFactory;\n if (isKeyframesTarget(to)) {\n transitionFactory = keyframes;\n }\n else {\n transitionFactory =\n defaultTransitions[valueKey] || defaultTransitions.default;\n }\n return __assign({ to: to }, transitionFactory(to));\n};\n\nexport { criticallyDampedSpring, getDefaultTransition, linearTween, underDampedSpring };\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils.mjs';\n\nconst maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']);\nfunction applyDefaultFilter(v) {\n let [name, value] = v.slice(0, -1).split('(');\n if (name === 'drop-shadow')\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, '');\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + '(' + defaultValue + unit + ')';\n}\nconst functionRegex = /([a-z-]*)\\(.*?\\)/g;\nconst filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(' ') : v;\n } });\n\nexport { filter };\n","import { __assign } from 'tslib';\nimport { color, filter } from 'style-value-types';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nvar defaultValueTypes = __assign(__assign({}, numberValueTypes), { \n // Color props\n color: color, backgroundColor: color, outlineColor: color, fill: color, stroke: color, \n // Border props\n borderColor: color, borderTopColor: color, borderRightColor: color, borderBottomColor: color, borderLeftColor: color, filter: filter, WebkitFilter: filter });\n/**\n * Gets the default ValueType for the provided value key\n */\nvar getDefaultValueType = function (key) { return defaultValueTypes[key]; };\n\nexport { defaultValueTypes, getDefaultValueType };\n","import { filter, complex } from 'style-value-types';\nimport { getDefaultValueType } from './defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n var _a;\n var defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value);\n}\n\nexport { getAnimatableNone };\n","var instantAnimationState = {\n current: false,\n};\n\nexport { instantAnimationState };\n","import { __assign, __rest, __spreadArray, __read } from 'tslib';\nimport { inertia, animate } from 'popmotion';\nimport { secondsToMilliseconds } from '../../utils/time-conversion.mjs';\nimport { isEasingArray, easingDefinitionToFunction } from './easing.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\nimport { getDefaultTransition } from './default-transitions.mjs';\nimport { warning } from 'hey-listen';\nimport { getAnimatableNone } from '../../render/dom/value-types/animatable-none.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined(_a) {\n _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = __rest(_a, [\"when\", \"delay\", \"delayChildren\", \"staggerChildren\", \"staggerDirection\", \"repeat\", \"repeatType\", \"repeatDelay\", \"from\"]);\n return !!Object.keys(transition).length;\n}\nvar legacyRepeatWarning = false;\n/**\n * Convert Framer Motion's Transition type into Popmotion-compatible options.\n */\nfunction convertTransitionToAnimationOptions(_a) {\n var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, [\"ease\", \"times\", \"yoyo\", \"flip\", \"loop\"]);\n var options = __assign({}, transition);\n if (times)\n options[\"offset\"] = times;\n /**\n * Convert any existing durations from seconds to milliseconds\n */\n if (transition.duration)\n options[\"duration\"] = secondsToMilliseconds(transition.duration);\n if (transition.repeatDelay)\n options.repeatDelay = secondsToMilliseconds(transition.repeatDelay);\n /**\n * Map easing names to Popmotion's easing functions\n */\n if (ease) {\n options[\"ease\"] = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n }\n /**\n * Support legacy transition API\n */\n if (transition.type === \"tween\")\n options.type = \"keyframes\";\n /**\n * TODO: These options are officially removed from the API.\n */\n if (yoyo || loop || flip) {\n warning(!legacyRepeatWarning, \"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options.\");\n legacyRepeatWarning = true;\n if (yoyo) {\n options.repeatType = \"reverse\";\n }\n else if (loop) {\n options.repeatType = \"loop\";\n }\n else if (flip) {\n options.repeatType = \"mirror\";\n }\n options.repeat = loop || yoyo || flip || transition.repeat;\n }\n /**\n * TODO: Popmotion 9 has the ability to automatically detect whether to use\n * a keyframes or spring animation, but does so by detecting velocity and other spring options.\n * It'd be good to introduce a similar thing here.\n */\n if (transition.type !== \"spring\")\n options.type = \"keyframes\";\n return options;\n}\n/**\n * Get the delay for a value by checking Transition with decreasing specificity.\n */\nfunction getDelayFromTransition(transition, key) {\n var _a, _b;\n var valueTransition = getValueTransition(transition, key) || {};\n return (_b = (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : transition.delay) !== null && _b !== void 0 ? _b : 0;\n}\nfunction hydrateKeyframes(options) {\n if (Array.isArray(options.to) && options.to[0] === null) {\n options.to = __spreadArray([], __read(options.to), false);\n options.to[0] = options.from;\n }\n return options;\n}\nfunction getPopmotionAnimationOptions(transition, options, key) {\n var _a;\n if (Array.isArray(options.to)) {\n (_a = transition.duration) !== null && _a !== void 0 ? _a : (transition.duration = 0.8);\n }\n hydrateKeyframes(options);\n /**\n * Get a default transition if none is determined to be defined.\n */\n if (!isTransitionDefined(transition)) {\n transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to));\n }\n return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition));\n}\n/**\n *\n */\nfunction getAnimation(key, value, target, transition, onComplete) {\n var _a;\n var valueTransition = getValueTransition(transition, key);\n var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get();\n var isTargetAnimatable = isAnimatable(key, target);\n if (origin === \"none\" && isTargetAnimatable && typeof target === \"string\") {\n /**\n * If we're trying to animate from \"none\", try and get an animatable version\n * of the target. This could be improved to work both ways.\n */\n origin = getAnimatableNone(key, target);\n }\n else if (isZero(origin) && typeof target === \"string\") {\n origin = getZeroUnit(target);\n }\n else if (!Array.isArray(target) &&\n isZero(target) &&\n typeof origin === \"string\") {\n target = getZeroUnit(origin);\n }\n var isOriginAnimatable = isAnimatable(key, origin);\n warning(isOriginAnimatable === isTargetAnimatable, \"You are trying to animate \".concat(key, \" from \\\"\").concat(origin, \"\\\" to \\\"\").concat(target, \"\\\". \").concat(origin, \" is not an animatable value - to enable this animation set \").concat(origin, \" to a value animatable to \").concat(target, \" via the `style` property.\"));\n function start() {\n var options = {\n from: origin,\n to: target,\n velocity: value.getVelocity(),\n onComplete: onComplete,\n onUpdate: function (v) { return value.set(v); },\n };\n return valueTransition.type === \"inertia\" ||\n valueTransition.type === \"decay\"\n ? inertia(__assign(__assign({}, options), valueTransition))\n : animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) {\n var _a;\n options.onUpdate(v);\n (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v);\n }, onComplete: function () {\n var _a;\n options.onComplete();\n (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition);\n } }));\n }\n function set() {\n var _a, _b;\n var finalTarget = resolveFinalValueInKeyframes(target);\n value.set(finalTarget);\n onComplete();\n (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, finalTarget);\n (_b = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _b === void 0 ? void 0 : _b.call(valueTransition);\n return { stop: function () { } };\n }\n return !isOriginAnimatable ||\n !isTargetAnimatable ||\n valueTransition.type === false\n ? set\n : start;\n}\nfunction isZero(value) {\n return (value === 0 ||\n (typeof value === \"string\" &&\n parseFloat(value) === 0 &&\n value.indexOf(\" \") === -1));\n}\nfunction getZeroUnit(potentialUnitType) {\n return typeof potentialUnitType === \"number\"\n ? 0\n : getAnimatableNone(\"\", potentialUnitType);\n}\nfunction getValueTransition(transition, key) {\n return transition[key] || transition[\"default\"] || transition;\n}\n/**\n * Start animation on a MotionValue. This function is an interface between\n * Framer Motion and Popmotion\n *\n * @internal\n */\nfunction startAnimation(key, value, target, transition) {\n if (transition === void 0) { transition = {}; }\n if (instantAnimationState.current) {\n transition = { type: false };\n }\n return value.start(function (onComplete) {\n var delayTimer;\n var controls;\n var animation = getAnimation(key, value, target, transition, onComplete);\n var delay = getDelayFromTransition(transition, key);\n var start = function () { return (controls = animation()); };\n if (delay) {\n delayTimer = setTimeout(start, secondsToMilliseconds(delay));\n }\n else {\n start();\n }\n return function () {\n clearTimeout(delayTimer);\n controls === null || controls === void 0 ? void 0 : controls.stop();\n };\n });\n}\n\nexport { convertTransitionToAnimationOptions, getDelayFromTransition, getPopmotionAnimationOptions, getValueTransition, getZeroUnit, hydrateKeyframes, isTransitionDefined, isZero, startAnimation };\n","import { animate } from './index.mjs';\nimport { velocityPerSecond } from '../utils/velocity-per-second.mjs';\nimport { getFrameData } from 'framesync';\n\nfunction inertia({ from = 0, velocity = 0, min, max, power = 0.8, timeConstant = 750, bounceStiffness = 500, bounceDamping = 10, restDelta = 1, modifyTarget, driver, onUpdate, onComplete, onStop, }) {\n let currentAnimation;\n function isOutOfBounds(v) {\n return (min !== undefined && v < min) || (max !== undefined && v > max);\n }\n function boundaryNearest(v) {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n }\n function startAnimation(options) {\n currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop();\n currentAnimation = animate(Object.assign(Object.assign({}, options), { driver, onUpdate: (v) => {\n var _a;\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v);\n (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v);\n }, onComplete,\n onStop }));\n }\n function startSpring(options) {\n startAnimation(Object.assign({ type: \"spring\", stiffness: bounceStiffness, damping: bounceDamping, restDelta }, options));\n }\n if (isOutOfBounds(from)) {\n startSpring({ from, velocity, to: boundaryNearest(from) });\n }\n else {\n let target = power * velocity + from;\n if (typeof modifyTarget !== \"undefined\")\n target = modifyTarget(target);\n const boundary = boundaryNearest(target);\n const heading = boundary === min ? -1 : 1;\n let prev;\n let current;\n const checkBoundary = (v) => {\n prev = current;\n current = v;\n velocity = velocityPerSecond(v - prev, getFrameData().delta);\n if ((heading === 1 && v > boundary) ||\n (heading === -1 && v < boundary)) {\n startSpring({ from: v, to: boundary, velocity });\n }\n };\n startAnimation({\n type: \"decay\",\n from,\n velocity,\n timeConstant,\n power,\n restDelta,\n modifyTarget,\n onUpdate: isOutOfBounds(target) ? checkBoundary : undefined,\n });\n }\n return {\n stop: () => currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(),\n };\n}\n\nexport { inertia };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nvar isNumericalString = function (v) { return /^\\-?\\d*\\.?\\d+$/.test(v); };\n\nexport { isNumericalString };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nvar isZeroValueString = function (v) { return /^0[^.\\s]+$/.test(v); };\n\nexport { isZeroValueString };\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nvar SubscriptionManager = /** @class */ (function () {\n function SubscriptionManager() {\n this.subscriptions = [];\n }\n SubscriptionManager.prototype.add = function (handler) {\n var _this = this;\n addUniqueItem(this.subscriptions, handler);\n return function () { return removeItem(_this.subscriptions, handler); };\n };\n SubscriptionManager.prototype.notify = function (a, b, c) {\n var numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (var i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n var handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n };\n SubscriptionManager.prototype.getSize = function () {\n return this.subscriptions.length;\n };\n SubscriptionManager.prototype.clear = function () {\n this.subscriptions.length = 0;\n };\n return SubscriptionManager;\n}());\n\nexport { SubscriptionManager };\n","import { __read } from 'tslib';\n\nfunction addUniqueItem(arr, item) {\n arr.indexOf(item) === -1 && arr.push(item);\n}\nfunction removeItem(arr, item) {\n var index = arr.indexOf(item);\n index > -1 && arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem(_a, fromIndex, toIndex) {\n var _b = __read(_a), arr = _b.slice(0);\n var startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n var endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n var _c = __read(arr.splice(fromIndex, 1), 1), item = _c[0];\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n","import sync, { getFrameData } from 'framesync';\nimport { velocityPerSecond } from 'popmotion';\nimport { SubscriptionManager } from '../utils/subscription-manager.mjs';\n\nvar isFloat = function (value) {\n return !isNaN(parseFloat(value));\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nvar MotionValue = /** @class */ (function () {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n *\n * @internal\n */\n function MotionValue(init) {\n var _this = this;\n /**\n * Duration, in milliseconds, since last updating frame.\n *\n * @internal\n */\n this.timeDelta = 0;\n /**\n * Timestamp of the last time this `MotionValue` was updated.\n *\n * @internal\n */\n this.lastUpdated = 0;\n /**\n * Functions to notify when the `MotionValue` updates.\n *\n * @internal\n */\n this.updateSubscribers = new SubscriptionManager();\n /**\n * Functions to notify when the velocity updates.\n *\n * @internal\n */\n this.velocityUpdateSubscribers = new SubscriptionManager();\n /**\n * Functions to notify when the `MotionValue` updates and `render` is set to `true`.\n *\n * @internal\n */\n this.renderSubscribers = new SubscriptionManager();\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = false;\n this.updateAndNotify = function (v, render) {\n if (render === void 0) { render = true; }\n _this.prev = _this.current;\n _this.current = v;\n // Update timestamp\n var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp;\n if (_this.lastUpdated !== timestamp) {\n _this.timeDelta = delta;\n _this.lastUpdated = timestamp;\n sync.postRender(_this.scheduleVelocityCheck);\n }\n // Update update subscribers\n if (_this.prev !== _this.current) {\n _this.updateSubscribers.notify(_this.current);\n }\n // Update velocity subscribers\n if (_this.velocityUpdateSubscribers.getSize()) {\n _this.velocityUpdateSubscribers.notify(_this.getVelocity());\n }\n // Update render subscribers\n if (render) {\n _this.renderSubscribers.notify(_this.current);\n }\n };\n /**\n * Schedule a velocity check for the next frame.\n *\n * This is an instanced and bound function to prevent generating a new\n * function once per frame.\n *\n * @internal\n */\n this.scheduleVelocityCheck = function () { return sync.postRender(_this.velocityCheck); };\n /**\n * Updates `prev` with `current` if the value hasn't been updated this frame.\n * This ensures velocity calculations return `0`.\n *\n * This is an instanced and bound function to prevent generating a new\n * function once per frame.\n *\n * @internal\n */\n this.velocityCheck = function (_a) {\n var timestamp = _a.timestamp;\n if (timestamp !== _this.lastUpdated) {\n _this.prev = _this.current;\n _this.velocityUpdateSubscribers.notify(_this.getVelocity());\n }\n };\n this.hasAnimated = false;\n this.prev = this.current = init;\n this.canTrackVelocity = isFloat(this.current);\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.onChange(updateOpacity)\n * const unsubscribeY = y.onChange(updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @internalremarks\n *\n * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.\n *\n * ```jsx\n * useOnChange(x, () => {})\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @public\n */\n MotionValue.prototype.onChange = function (subscription) {\n return this.updateSubscribers.add(subscription);\n };\n MotionValue.prototype.clearListeners = function () {\n this.updateSubscribers.clear();\n };\n /**\n * Adds a function that will be notified when the `MotionValue` requests a render.\n *\n * @param subscriber - A function that's provided the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @internal\n */\n MotionValue.prototype.onRenderRequest = function (subscription) {\n // Render immediately\n subscription(this.get());\n return this.renderSubscribers.add(subscription);\n };\n /**\n * Attaches a passive effect to the `MotionValue`.\n *\n * @internal\n */\n MotionValue.prototype.attach = function (passiveEffect) {\n this.passiveEffect = passiveEffect;\n };\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n MotionValue.prototype.set = function (v, render) {\n if (render === void 0) { render = true; }\n if (!render || !this.passiveEffect) {\n this.updateAndNotify(v, render);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n };\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n MotionValue.prototype.get = function () {\n return this.current;\n };\n /**\n * @public\n */\n MotionValue.prototype.getPrevious = function () {\n return this.prev;\n };\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n MotionValue.prototype.getVelocity = function () {\n // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful\n return this.canTrackVelocity\n ? // These casts could be avoided if parseFloat would be typed better\n velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prev), this.timeDelta)\n : 0;\n };\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n *\n * @internal\n */\n MotionValue.prototype.start = function (animation) {\n var _this = this;\n this.stop();\n return new Promise(function (resolve) {\n _this.hasAnimated = true;\n _this.stopAnimation = animation(resolve);\n }).then(function () { return _this.clearAnimation(); });\n };\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n MotionValue.prototype.stop = function () {\n if (this.stopAnimation)\n this.stopAnimation();\n this.clearAnimation();\n };\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n MotionValue.prototype.isAnimating = function () {\n return !!this.stopAnimation;\n };\n MotionValue.prototype.clearAnimation = function () {\n this.stopAnimation = null;\n };\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n MotionValue.prototype.destroy = function () {\n this.updateSubscribers.clear();\n this.renderSubscribers.clear();\n this.stop();\n };\n return MotionValue;\n}());\n/**\n * @internal\n */\nfunction motionValue(init) {\n return new MotionValue(init);\n}\n\nexport { MotionValue, motionValue };\n","/**\n * Tests a provided value against a ValueType\n */\nvar testValueType = function (v) { return function (type) { return type.test(v); }; };\n\nexport { testValueType };\n","var AnimationType;\n(function (AnimationType) {\n AnimationType[\"Animate\"] = \"animate\";\n AnimationType[\"Hover\"] = \"whileHover\";\n AnimationType[\"Tap\"] = \"whileTap\";\n AnimationType[\"Drag\"] = \"whileDrag\";\n AnimationType[\"Focus\"] = \"whileFocus\";\n AnimationType[\"InView\"] = \"whileInView\";\n AnimationType[\"Exit\"] = \"exit\";\n})(AnimationType || (AnimationType = {}));\n\nexport { AnimationType };\n","import { number, px, percent, degrees, vw, vh } from 'style-value-types';\nimport { testValueType } from './test.mjs';\nimport { auto } from './type-auto.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nvar dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nvar findDimensionValueType = function (v) {\n return dimensionValueTypes.find(testValueType(v));\n};\n\nexport { dimensionValueTypes, findDimensionValueType };\n","/**\n * ValueType for \"auto\"\n */\nvar auto = {\n test: function (v) { return v === \"auto\"; },\n parse: function (v) { return v; },\n};\n\nexport { auto };\n","import { __spreadArray, __read } from 'tslib';\nimport { color, complex } from 'style-value-types';\nimport { dimensionValueTypes } from './dimensions.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nvar valueTypes = __spreadArray(__spreadArray([], __read(dimensionValueTypes), false), [color, complex], false);\n/**\n * Tests a value against the list of ValueTypes\n */\nvar findValueType = function (v) { return valueTypes.find(testValueType(v)); };\n\nexport { findValueType };\n","import { __rest, __assign, __spreadArray, __read } from 'tslib';\nimport { complex } from 'style-value-types';\nimport { isNumericalString } from '../../utils/is-numerical-string.mjs';\nimport { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\nimport { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { getAnimatableNone } from '../dom/value-types/animatable-none.mjs';\nimport { findValueType } from '../dom/value-types/find.mjs';\nimport { resolveVariant } from './variants.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction setTarget(visualElement, definition) {\n var resolved = resolveVariant(visualElement, definition);\n var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, [\"transitionEnd\", \"transition\"]);\n target = __assign(__assign({}, target), transitionEnd);\n for (var key in target) {\n var value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\nfunction setVariants(visualElement, variantLabels) {\n var reversedLabels = __spreadArray([], __read(variantLabels), false).reverse();\n reversedLabels.forEach(function (key) {\n var _a;\n var variant = visualElement.getVariant(key);\n variant && setTarget(visualElement, variant);\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n setVariants(child, variantLabels);\n });\n });\n}\nfunction setValues(visualElement, definition) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition);\n }\n else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition]);\n }\n else {\n setTarget(visualElement, definition);\n }\n}\nfunction checkTargetForNewValues(visualElement, target, origin) {\n var _a, _b, _c;\n var _d;\n var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); });\n var numNewValues = newValueKeys.length;\n if (!numNewValues)\n return;\n for (var i = 0; i < numNewValues; i++) {\n var key = newValueKeys[i];\n var targetValue = target[key];\n var value = null;\n /**\n * If the target is a series of keyframes, we can use the first value\n * in the array. If this first value is null, we'll still need to read from the DOM.\n */\n if (Array.isArray(targetValue)) {\n value = targetValue[0];\n }\n /**\n * If the target isn't keyframes, or the first keyframe was null, we need to\n * first check if an origin value was explicitly defined in the transition as \"from\",\n * if not read the value from the DOM. As an absolute fallback, take the defined target value.\n */\n if (value === null) {\n value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];\n }\n /**\n * If value is still undefined or null, ignore it. Preferably this would throw,\n * but this was causing issues in Framer.\n */\n if (value === undefined || value === null)\n continue;\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(targetValue)) {\n value = getAnimatableNone(key, targetValue);\n }\n visualElement.addValue(key, motionValue(value));\n (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value);\n visualElement.setBaseTarget(key, value);\n }\n}\nfunction getOriginFromTransition(key, transition) {\n if (!transition)\n return;\n var valueTransition = transition[key] || transition[\"default\"] || transition;\n return valueTransition.from;\n}\nfunction getOrigin(target, transition, visualElement) {\n var _a, _b;\n var origin = {};\n for (var key in target) {\n origin[key] =\n (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get();\n }\n return origin;\n}\n\nexport { checkTargetForNewValues, getOrigin, getOriginFromTransition, setTarget, setValues };\n","import { __read, __rest, __assign } from 'tslib';\nimport { startAnimation } from '../../animation/utils/transitions.mjs';\nimport { setTarget } from './setters.mjs';\nimport { resolveVariant } from './variants.mjs';\n\n/**\n * @internal\n */\nfunction animateVisualElement(visualElement, definition, options) {\n if (options === void 0) { options = {}; }\n visualElement.notifyAnimationStart(definition);\n var animation;\n if (Array.isArray(definition)) {\n var animations = definition.map(function (variant) {\n return animateVariant(visualElement, variant, options);\n });\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n var resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = animateTarget(visualElement, resolvedDefinition, options);\n }\n return animation.then(function () {\n return visualElement.notifyAnimationComplete(definition);\n });\n}\nfunction animateVariant(visualElement, variant, options) {\n var _a;\n if (options === void 0) { options = {}; }\n var resolved = resolveVariant(visualElement, variant, options.custom);\n var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b;\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n var getAnimation = resolved\n ? function () { return animateTarget(visualElement, resolved, options); }\n : function () { return Promise.resolve(); };\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size)\n ? function (forwardDelay) {\n if (forwardDelay === void 0) { forwardDelay = 0; }\n var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : function () { return Promise.resolve(); };\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n var when = transition.when;\n if (when) {\n var _c = __read(when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1];\n return first().then(last);\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\n/**\n * @internal\n */\nfunction animateTarget(visualElement, definition, _a) {\n var _b;\n var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type;\n var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, [\"transition\", \"transitionEnd\"]);\n if (transitionOverride)\n transition = transitionOverride;\n var animations = [];\n var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]);\n for (var key in target) {\n var value = visualElement.getValue(key);\n var valueTarget = target[key];\n if (!value ||\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n var animation = startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition));\n animations.push(animation);\n }\n return Promise.all(animations).then(function () {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n}\nfunction animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) {\n if (delayChildren === void 0) { delayChildren = 0; }\n if (staggerChildren === void 0) { staggerChildren = 0; }\n if (staggerDirection === void 0) { staggerDirection = 1; }\n var animations = [];\n var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n var generateStaggerDuration = staggerDirection === 1\n ? function (i) {\n if (i === void 0) { i = 0; }\n return i * staggerChildren;\n }\n : function (i) {\n if (i === void 0) { i = 0; }\n return maxStaggerDuration - i * staggerChildren;\n };\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach(function (child, i) {\n animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));\n });\n return Promise.all(animations);\n}\nfunction stopAnimation(visualElement) {\n visualElement.forEachValue(function (value) { return value.stop(); });\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(_a, key) {\n var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating;\n var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\n\nexport { animateVisualElement, sortByTreeOrder, stopAnimation };\n","import { __spreadArray, __read, __assign, __rest } from 'tslib';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\nimport { animateVisualElement } from './animation.mjs';\nimport { AnimationType } from './types.mjs';\nimport { isVariantLabels, resolveVariant, isVariantLabel } from './variants.mjs';\n\nvar variantPriorityOrder = [\n AnimationType.Animate,\n AnimationType.InView,\n AnimationType.Focus,\n AnimationType.Hover,\n AnimationType.Tap,\n AnimationType.Drag,\n AnimationType.Exit,\n];\nvar reversePriorityOrder = __spreadArray([], __read(variantPriorityOrder), false).reverse();\nvar numAnimationTypes = variantPriorityOrder.length;\nfunction animateList(visualElement) {\n return function (animations) {\n return Promise.all(animations.map(function (_a) {\n var animation = _a.animation, options = _a.options;\n return animateVisualElement(visualElement, animation, options);\n }));\n };\n}\nfunction createAnimationState(visualElement) {\n var animate = animateList(visualElement);\n var state = createState();\n var allAnimatedKeys = {};\n var isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n var buildResolvedTypeValues = function (acc, definition) {\n var resolved = resolveVariant(visualElement, definition);\n if (resolved) {\n resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, [\"transition\", \"transitionEnd\"]);\n acc = __assign(__assign(__assign({}, acc), target), transitionEnd);\n }\n return acc;\n };\n function isAnimated(key) {\n return allAnimatedKeys[key] !== undefined;\n }\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(options, changedActiveType) {\n var _a;\n var props = visualElement.getProps();\n var context = visualElement.getVariantContext(true) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n var animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n var removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n var encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n var removedVariantIndex = Infinity;\n var _loop_1 = function (i) {\n var type = reversePriorityOrder[i];\n var typeState = state[type];\n var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type];\n var propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n var activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n var isInherited = prop === context[type] && prop !== props[type] && propIsVariant;\n /**\n *\n */\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = __assign({}, encounteredKeys);\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n return \"continue\";\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n var shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n var definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;\n var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues);\n var markToAnimate = function (key) {\n shouldAnimateType = true;\n removedKeys.delete(key);\n typeState.needsAnimating[key] = true;\n };\n for (var key in allKeys) {\n var next = resolvedValues[key];\n var prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n if (next !== prev) {\n /**\n * If both values are keyframes, we need to shallow compare them to\n * detect whether any value has changed. If it has, we animate it.\n */\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n if (!shallowCompare(next, prev) || variantDidChange) {\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we want to ensure it doesn't animate by\n * adding it to the list of protected keys.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n else if (next !== undefined) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n /**\n *\n */\n if (typeState.isActive) {\n encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues);\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to hard-block animations\n * TODO: Test as this should probably still handle animations triggered\n * by removed values?\n */\n if (shouldAnimateType && !isInherited) {\n animations.push.apply(animations, __spreadArray([], __read(definitionList.map(function (animation) { return ({\n animation: animation,\n options: __assign({ type: type }, options),\n }); })), false));\n }\n };\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (var i = 0; i < numAnimationTypes; i++) {\n _loop_1(i);\n }\n allAnimatedKeys = __assign({}, encounteredKeys);\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n var fallbackAnimation_1 = {};\n removedKeys.forEach(function (key) {\n var fallbackTarget = visualElement.getBaseTarget(key);\n if (fallbackTarget !== undefined) {\n fallbackAnimation_1[key] = fallbackTarget;\n }\n });\n animations.push({ animation: fallbackAnimation_1 });\n }\n var shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n props.initial === false &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive, options) {\n var _a;\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });\n state[type].isActive = isActive;\n return animateChanges(options, type);\n }\n return {\n isAnimated: isAnimated,\n animateChanges: animateChanges,\n setActive: setActive,\n setAnimateFunction: setAnimateFunction,\n getState: function () { return state; },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (isVariantLabels(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive) {\n if (isActive === void 0) { isActive = false; }\n return {\n isActive: isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n var _a;\n return _a = {},\n _a[AnimationType.Animate] = createTypeState(true),\n _a[AnimationType.InView] = createTypeState(),\n _a[AnimationType.Hover] = createTypeState(),\n _a[AnimationType.Tap] = createTypeState(),\n _a[AnimationType.Drag] = createTypeState(),\n _a[AnimationType.Focus] = createTypeState(),\n _a[AnimationType.Exit] = createTypeState(),\n _a;\n}\n\nexport { checkVariantsDidChange, createAnimationState, variantPriorityOrder };\n","var makeRenderlessComponent = function (hook) { return function (props) {\n hook(props);\n return null;\n}; };\n\nexport { makeRenderlessComponent };\n","import { __read } from 'tslib';\nimport { useEffect, useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { usePresence } from '../../components/AnimatePresence/use-presence.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { createAnimationState } from '../../render/utils/animation-state.mjs';\nimport { AnimationType } from '../../render/utils/types.mjs';\nimport { makeRenderlessComponent } from '../utils/make-renderless-component.mjs';\n\nvar animations = {\n animation: makeRenderlessComponent(function (_a) {\n var visualElement = _a.visualElement, animate = _a.animate;\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement));\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n if (isAnimationControls(animate)) {\n useEffect(function () { return animate.subscribe(visualElement); }, [animate]);\n }\n }),\n exit: makeRenderlessComponent(function (props) {\n var custom = props.custom, visualElement = props.visualElement;\n var _a = __read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1];\n var presenceContext = useContext(PresenceContext);\n useEffect(function () {\n var _a, _b;\n visualElement.isPresent = isPresent;\n var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom });\n !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove));\n }, [isPresent]);\n }),\n};\n\nexport { animations };\n","import { useEffect } from 'react';\n\nfunction addDomEvent(target, eventName, handler, options) {\n target.addEventListener(eventName, handler, options);\n return function () { return target.removeEventListener(eventName, handler, options); };\n}\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return <div ref={ref} />\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nfunction useDomEvent(ref, eventName, handler, options) {\n useEffect(function () {\n var element = ref.current;\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options);\n }\n }, [ref, eventName, handler, options]);\n}\n\nexport { addDomEvent, useDomEvent };\n","function isMouseEvent(event) {\n // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check.\n if (typeof PointerEvent !== \"undefined\" && event instanceof PointerEvent) {\n return !!(event.pointerType === \"mouse\");\n }\n return event instanceof MouseEvent;\n}\nfunction isTouchEvent(event) {\n var hasTouches = !!event.touches;\n return hasTouches;\n}\n\nexport { isMouseEvent, isTouchEvent };\n","import { isTouchEvent } from '../gestures/utils/event-type.mjs';\n\n/**\n * Filters out events not attached to the primary pointer (currently left mouse button)\n * @param eventHandler\n */\nfunction filterPrimaryPointer(eventHandler) {\n return function (event) {\n var isMouseEvent = event instanceof MouseEvent;\n var isPrimaryPointer = !isMouseEvent ||\n (isMouseEvent && event.button === 0);\n if (isPrimaryPointer) {\n eventHandler(event);\n }\n };\n}\nvar defaultPagePoint = { pageX: 0, pageY: 0 };\nfunction pointFromTouch(e, pointType) {\n if (pointType === void 0) { pointType = \"page\"; }\n var primaryTouch = e.touches[0] || e.changedTouches[0];\n var point = primaryTouch || defaultPagePoint;\n return {\n x: point[pointType + \"X\"],\n y: point[pointType + \"Y\"],\n };\n}\nfunction pointFromMouse(point, pointType) {\n if (pointType === void 0) { pointType = \"page\"; }\n return {\n x: point[pointType + \"X\"],\n y: point[pointType + \"Y\"],\n };\n}\nfunction extractEventInfo(event, pointType) {\n if (pointType === void 0) { pointType = \"page\"; }\n return {\n point: isTouchEvent(event)\n ? pointFromTouch(event, pointType)\n : pointFromMouse(event, pointType),\n };\n}\nvar wrapHandler = function (handler, shouldFilterPrimaryPointer) {\n if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; }\n var listener = function (event) {\n return handler(event, extractEventInfo(event));\n };\n return shouldFilterPrimaryPointer\n ? filterPrimaryPointer(listener)\n : listener;\n};\n\nexport { extractEventInfo, wrapHandler };\n","import { useDomEvent, addDomEvent } from './use-dom-event.mjs';\nimport { wrapHandler } from './event-info.mjs';\nimport { supportsPointerEvents, supportsTouchEvents, supportsMouseEvents } from './utils.mjs';\n\nvar mouseEventNames = {\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointercancel: \"mousecancel\",\n pointerover: \"mouseover\",\n pointerout: \"mouseout\",\n pointerenter: \"mouseenter\",\n pointerleave: \"mouseleave\",\n};\nvar touchEventNames = {\n pointerdown: \"touchstart\",\n pointermove: \"touchmove\",\n pointerup: \"touchend\",\n pointercancel: \"touchcancel\",\n};\nfunction getPointerEventName(name) {\n if (supportsPointerEvents()) {\n return name;\n }\n else if (supportsTouchEvents()) {\n return touchEventNames[name];\n }\n else if (supportsMouseEvents()) {\n return mouseEventNames[name];\n }\n return name;\n}\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === \"pointerdown\"), options);\n}\nfunction usePointerEvent(ref, eventName, handler, options) {\n return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === \"pointerdown\"), options);\n}\n\nexport { addPointerEvent, usePointerEvent };\n","import { isBrowser } from '../utils/is-browser.mjs';\n\n// We check for event support via functions in case they've been mocked by a testing suite.\nvar supportsPointerEvents = function () {\n return isBrowser && window.onpointerdown === null;\n};\nvar supportsTouchEvents = function () {\n return isBrowser && window.ontouchstart === null;\n};\nvar supportsMouseEvents = function () {\n return isBrowser && window.onmousedown === null;\n};\n\nexport { supportsMouseEvents, supportsPointerEvents, supportsTouchEvents };\n","function createLock(name) {\n var lock = null;\n return function () {\n var openLock = function () {\n lock = null;\n };\n if (lock === null) {\n lock = name;\n return openLock;\n }\n return false;\n };\n}\nvar globalHorizontalLock = createLock(\"dragHorizontal\");\nvar globalVerticalLock = createLock(\"dragVertical\");\nfunction getGlobalLock(drag) {\n var lock = false;\n if (drag === \"y\") {\n lock = globalVerticalLock();\n }\n else if (drag === \"x\") {\n lock = globalHorizontalLock();\n }\n else {\n var openHorizontal_1 = globalHorizontalLock();\n var openVertical_1 = globalVerticalLock();\n if (openHorizontal_1 && openVertical_1) {\n lock = function () {\n openHorizontal_1();\n openVertical_1();\n };\n }\n else {\n // Release the locks because we don't use them\n if (openHorizontal_1)\n openHorizontal_1();\n if (openVertical_1)\n openVertical_1();\n }\n }\n return lock;\n}\nfunction isDragActive() {\n // Check the gesture lock - if we get it, it means no drag gesture is active\n // and we can safely fire the tap gesture.\n var openGestureLock = getGlobalLock(true);\n if (!openGestureLock)\n return true;\n openGestureLock();\n return false;\n}\n\nexport { createLock, getGlobalLock, isDragActive };\n","import { isMouseEvent } from './utils/event-type.mjs';\nimport { AnimationType } from '../render/utils/types.mjs';\nimport { usePointerEvent } from '../events/use-pointer-event.mjs';\nimport { isDragActive } from './drag/utils/lock.mjs';\n\nfunction createHoverEvent(visualElement, isActive, callback) {\n return function (event, info) {\n var _a;\n if (!isMouseEvent(event) || isDragActive())\n return;\n /**\n * Ensure we trigger animations before firing event callback\n */\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive);\n callback === null || callback === void 0 ? void 0 : callback(event, info);\n };\n}\nfunction useHoverGesture(_a) {\n var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;\n usePointerEvent(visualElement, \"pointerenter\", onHoverStart || whileHover\n ? createHoverEvent(visualElement, true, onHoverStart)\n : undefined);\n usePointerEvent(visualElement, \"pointerleave\", onHoverEnd || whileHover\n ? createHoverEvent(visualElement, false, onHoverEnd)\n : undefined);\n}\n\nexport { useHoverGesture };\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nvar isNodeOrChild = function (parent, child) {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n","import { __rest, __assign } from 'tslib';\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nvar observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nvar observers = new WeakMap();\nvar fireObserverCallback = function (entry) {\n var _a;\n (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n};\nvar fireAllObserverCallbacks = function (entries) {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver(_a) {\n var root = _a.root, options = __rest(_a, [\"root\"]);\n var lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n var rootObservers = observers.get(lookupRoot);\n var key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __assign({ root: root }, options));\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n var rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return function () {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n","import { useRef, useEffect } from 'react';\nimport { AnimationType } from '../../../render/utils/types.mjs';\nimport { warnOnce } from '../../../utils/warn-once.mjs';\nimport { observeIntersection } from './observers.mjs';\n\nfunction useViewport(_a) {\n var visualElement = _a.visualElement, whileInView = _a.whileInView, onViewportEnter = _a.onViewportEnter, onViewportLeave = _a.onViewportLeave, _b = _a.viewport, viewport = _b === void 0 ? {} : _b;\n var state = useRef({\n hasEnteredView: false,\n isInView: false,\n });\n var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave);\n if (viewport.once && state.current.hasEnteredView)\n shouldObserve = false;\n var useObserver = typeof IntersectionObserver === \"undefined\"\n ? useMissingIntersectionObserver\n : useIntersectionObserver;\n useObserver(shouldObserve, state.current, visualElement, viewport);\n}\nvar thresholdNames = {\n some: 0,\n all: 1,\n};\nfunction useIntersectionObserver(shouldObserve, state, visualElement, _a) {\n var root = _a.root, rootMargin = _a.margin, _b = _a.amount, amount = _b === void 0 ? \"some\" : _b, once = _a.once;\n useEffect(function () {\n if (!shouldObserve)\n return;\n var options = {\n root: root === null || root === void 0 ? void 0 : root.current,\n rootMargin: rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n var intersectionCallback = function (entry) {\n var _a;\n var isIntersecting = entry.isIntersecting;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (state.isInView === isIntersecting)\n return;\n state.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && state.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n state.hasEnteredView = true;\n }\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, isIntersecting);\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n var props = visualElement.getProps();\n var callback = isIntersecting\n ? props.onViewportEnter\n : props.onViewportLeave;\n callback === null || callback === void 0 ? void 0 : callback(entry);\n };\n return observeIntersection(visualElement.getInstance(), options, intersectionCallback);\n }, [shouldObserve, root, rootMargin, amount]);\n}\n/**\n * If IntersectionObserver is missing, we activate inView and fire onViewportEnter\n * on mount. This way, the page will be in the state the author expects users\n * to see it in for everyone.\n */\nfunction useMissingIntersectionObserver(shouldObserve, state, visualElement) {\n useEffect(function () {\n if (!shouldObserve)\n return;\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, \"IntersectionObserver not available on this device. whileInView animations will trigger on mount.\");\n }\n /**\n * Fire this in an rAF because, at this point, the animation state\n * won't have flushed for the first time and there's certain logic in\n * there that behaves differently on the initial animation.\n *\n * This hook should be quite rarely called so setting this in an rAF\n * is preferred to changing the behaviour of the animation state.\n */\n requestAnimationFrame(function () {\n var _a;\n state.hasEnteredView = true;\n var onViewportEnter = visualElement.getProps().onViewportEnter;\n onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null);\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, true);\n });\n }, [shouldObserve]);\n}\n\nexport { useViewport };\n","import { useFocusGesture } from '../../gestures/use-focus-gesture.mjs';\nimport { useHoverGesture } from '../../gestures/use-hover-gesture.mjs';\nimport { useTapGesture } from '../../gestures/use-tap-gesture.mjs';\nimport { useViewport } from './viewport/use-viewport.mjs';\nimport { makeRenderlessComponent } from '../utils/make-renderless-component.mjs';\n\nvar gestureAnimations = {\n inView: makeRenderlessComponent(useViewport),\n tap: makeRenderlessComponent(useTapGesture),\n focus: makeRenderlessComponent(useFocusGesture),\n hover: makeRenderlessComponent(useHoverGesture),\n};\n\nexport { gestureAnimations };\n","import { useRef } from 'react';\nimport { isNodeOrChild } from './utils/is-node-or-child.mjs';\nimport { usePointerEvent, addPointerEvent } from '../events/use-pointer-event.mjs';\nimport { useUnmountEffect } from '../utils/use-unmount-effect.mjs';\nimport { pipe } from 'popmotion';\nimport { AnimationType } from '../render/utils/types.mjs';\nimport { isDragActive } from './drag/utils/lock.mjs';\n\n/**\n * @param handlers -\n * @internal\n */\nfunction useTapGesture(_a) {\n var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement;\n var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;\n var isPressing = useRef(false);\n var cancelPointerEndListeners = useRef(null);\n function removePointerEndListener() {\n var _a;\n (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);\n cancelPointerEndListeners.current = null;\n }\n function checkPointerEnd() {\n var _a;\n removePointerEndListener();\n isPressing.current = false;\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false);\n return !isDragActive();\n }\n function onPointerUp(event, info) {\n if (!checkPointerEnd())\n return;\n /**\n * We only count this as a tap gesture if the event.target is the same\n * as, or a child of, this component's element\n */\n !isNodeOrChild(visualElement.getInstance(), event.target)\n ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info)\n : onTap === null || onTap === void 0 ? void 0 : onTap(event, info);\n }\n function onPointerCancel(event, info) {\n if (!checkPointerEnd())\n return;\n onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info);\n }\n function onPointerDown(event, info) {\n var _a;\n removePointerEndListener();\n if (isPressing.current)\n return;\n isPressing.current = true;\n cancelPointerEndListeners.current = pipe(addPointerEvent(window, \"pointerup\", onPointerUp), addPointerEvent(window, \"pointercancel\", onPointerCancel));\n /**\n * Ensure we trigger animations before firing event callback\n */\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true);\n onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);\n }\n usePointerEvent(visualElement, \"pointerdown\", hasPressListeners ? onPointerDown : undefined);\n useUnmountEffect(removePointerEndListener);\n}\n\nexport { useTapGesture };\n","import { AnimationType } from '../render/utils/types.mjs';\nimport { useDomEvent } from '../events/use-dom-event.mjs';\n\n/**\n *\n * @param props\n * @param ref\n * @internal\n */\nfunction useFocusGesture(_a) {\n var whileFocus = _a.whileFocus, visualElement = _a.visualElement;\n var onFocus = function () {\n var _a;\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true);\n };\n var onBlur = function () {\n var _a;\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false);\n };\n useDomEvent(visualElement, \"focus\", whileFocus ? onFocus : undefined);\n useDomEvent(visualElement, \"blur\", whileFocus ? onBlur : undefined);\n}\n\nexport { useFocusGesture };\n","import { __spreadArray, __read } from 'tslib';\nimport { SubscriptionManager } from '../../utils/subscription-manager.mjs';\n\nvar names = [\n \"LayoutMeasure\",\n \"BeforeLayoutMeasure\",\n \"LayoutUpdate\",\n \"ViewportBoxUpdate\",\n \"Update\",\n \"Render\",\n \"AnimationComplete\",\n \"LayoutAnimationComplete\",\n \"AnimationStart\",\n \"SetAxisTarget\",\n \"Unmount\",\n];\nfunction createLifecycles() {\n var managers = names.map(function () { return new SubscriptionManager(); });\n var propSubscriptions = {};\n var lifecycles = {\n clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); },\n updatePropListeners: function (props) {\n names.forEach(function (name) {\n var _a;\n var on = \"on\" + name;\n var propListener = props[on];\n // Unsubscribe existing subscription\n (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions);\n // Add new subscription\n if (propListener) {\n propSubscriptions[name] = lifecycles[on](propListener);\n }\n });\n },\n };\n managers.forEach(function (manager, i) {\n lifecycles[\"on\" + names[i]] = function (handler) { return manager.add(handler); };\n lifecycles[\"notify\" + names[i]] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n manager.notify.apply(manager, __spreadArray([], __read(args), false));\n };\n });\n return lifecycles;\n}\n\nexport { createLifecycles };\n","import { __assign, __spreadArray, __read } from 'tslib';\nimport sync, { cancelSync } from 'framesync';\nimport { motionValue } from '../value/index.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { variantPriorityOrder } from './utils/animation-state.mjs';\nimport { createLifecycles } from './utils/lifecycles.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { checkIfControllingVariants, checkIfVariantNode, isVariantLabel } from './utils/variants.mjs';\n\nvar visualElement = function (_a) {\n var _b = _a.treeType, treeType = _b === void 0 ? \"\" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps;\n return function (_a, options) {\n var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState;\n if (options === void 0) { options = {}; }\n var isMounted = false;\n var latestValues = visualState.latestValues, renderState = visualState.renderState;\n /**\n * The instance of the render-specific node that will be hydrated by the\n * exposed React ref. So for example, this visual element can host a\n * HTMLElement, plain object, or Three.js object. The functions provided\n * in VisualElementConfig allow us to interface with this instance.\n */\n var instance;\n /**\n * Manages the subscriptions for a visual element's lifecycle, for instance\n * onRender\n */\n var lifecycles = createLifecycles();\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n var values = new Map();\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n var valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n var prevMotionValues = {};\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n var baseTarget = __assign({}, latestValues);\n // Internal methods ========================\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n var removeFromVariantTree;\n /**\n * Render the element with the latest styles outside of the React\n * render lifecycle\n */\n function render() {\n if (!instance || !isMounted)\n return;\n triggerBuild();\n renderInstance(instance, renderState, props.style, element.projection);\n }\n function triggerBuild() {\n build(element, renderState, latestValues, options, props);\n }\n function update() {\n lifecycles.notifyUpdate(latestValues);\n }\n /**\n *\n */\n function bindToMotionValue(key, value) {\n var removeOnChange = value.onChange(function (latestValue) {\n latestValues[key] = latestValue;\n props.onUpdate && sync.update(update, false, true);\n });\n var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender);\n valueSubscriptions.set(key, function () {\n removeOnChange();\n removeOnRenderRequest();\n });\n }\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't neccessarily a breaking change,\n * more a reflection of the test.\n */\n var initialMotionValues = scrapeMotionValuesFromProps(props);\n for (var key in initialMotionValues) {\n var value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key], false);\n }\n }\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n var isControllingVariants = checkIfControllingVariants(props);\n var isVariantNode = checkIfVariantNode(props);\n var element = __assign(__assign({ treeType: treeType, \n /**\n * This is a mirror of the internal instance prop, which keeps\n * VisualElement type-compatible with React's RefObject.\n */\n current: null, \n /**\n * The depth of this visual element within the visual element tree.\n */\n depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(), \n /**\n *\n */\n presenceId: presenceId, \n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren: isVariantNode ? new Set() : undefined, \n /**\n * Whether this instance is visible. This can be changed imperatively\n * by the projection tree, is analogous to CSS's visibility in that\n * hidden elements should take up layout, and needs enacting by the configured\n * render function.\n */\n isVisible: undefined, \n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()), \n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: blockInitialAnimation, \n /**\n * Determine whether this component has mounted yet. This is mostly used\n * by variant children to determine whether they need to trigger their\n * own animations on mount.\n */\n isMounted: function () { return Boolean(instance); }, mount: function (newInstance) {\n isMounted = true;\n instance = element.current = newInstance;\n if (element.projection) {\n element.projection.mount(newInstance);\n }\n if (isVariantNode && parent && !isControllingVariants) {\n removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element);\n }\n parent === null || parent === void 0 ? void 0 : parent.children.add(element);\n element.setProps(props);\n }, \n /**\n *\n */\n unmount: function () {\n var _a;\n (_a = element.projection) === null || _a === void 0 ? void 0 : _a.unmount();\n cancelSync.update(update);\n cancelSync.render(render);\n valueSubscriptions.forEach(function (remove) { return remove(); });\n removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree();\n parent === null || parent === void 0 ? void 0 : parent.children.delete(element);\n lifecycles.clearAllListeners();\n instance = undefined;\n isMounted = false;\n }, \n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild: function (child) {\n var _a;\n var closestVariantNode = element.getClosestVariantNode();\n if (closestVariantNode) {\n (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child);\n return function () {\n return closestVariantNode.variantChildren.delete(child);\n };\n }\n }, sortNodePosition: function (other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!sortNodePosition || treeType !== other.treeType)\n return 0;\n return sortNodePosition(element.getInstance(), other.getInstance());\n }, \n /**\n * Returns the closest variant node in the tree starting from\n * this visual element.\n */\n getClosestVariantNode: function () {\n return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode();\n }, \n /**\n * Expose the latest layoutId prop.\n */\n getLayoutId: function () { return props.layoutId; }, \n /**\n * Returns the current instance.\n */\n getInstance: function () { return instance; }, \n /**\n * Get/set the latest static values.\n */\n getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); }, \n /**\n * Returns the latest motion value state. Currently only used to take\n * a snapshot of the visual element - perhaps this can return the whole\n * visual state\n */\n getLatestValues: function () { return latestValues; }, \n /**\n * Set the visiblity of the visual element. If it's changed, schedule\n * a render to reflect these changes.\n */\n setVisibility: function (visibility) {\n if (element.isVisible === visibility)\n return;\n element.isVisible = visibility;\n element.scheduleRender();\n }, \n /**\n * Make a target animatable by Popmotion. For instance, if we're\n * trying to animate width from 100px to 100vw we need to measure 100vw\n * in pixels to determine what we really need to animate to. This is also\n * pluggable to support Framer's custom value types like Color,\n * and CSS variables.\n */\n makeTargetAnimatable: function (target, canMutate) {\n if (canMutate === void 0) { canMutate = true; }\n return makeTargetAnimatable(element, target, props, canMutate);\n }, \n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox: function () {\n return measureViewportBox(instance, props);\n }, \n // Motion values ========================\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue: function (key, value) {\n // Remove existing value if it exists\n if (element.hasValue(key))\n element.removeValue(key);\n values.set(key, value);\n latestValues[key] = value.get();\n bindToMotionValue(key, value);\n }, \n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue: function (key) {\n var _a;\n values.delete(key);\n (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a();\n valueSubscriptions.delete(key);\n delete latestValues[key];\n removeValueFromRenderState(key, renderState);\n }, \n /**\n * Check whether we have a motion value for this key\n */\n hasValue: function (key) { return values.has(key); }, \n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue: function (key, defaultValue) {\n var value = values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue);\n element.addValue(key, value);\n }\n return value;\n }, \n /**\n * Iterate over our motion values.\n */\n forEachValue: function (callback) { return values.forEach(callback); }, \n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue: function (key) {\n var _a;\n return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options);\n }, \n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget: function (key, value) {\n baseTarget[key] = value;\n }, \n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget: function (key) {\n if (getBaseTarget) {\n var target = getBaseTarget(props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n }\n return baseTarget[key];\n } }, lifecycles), { \n /**\n * Build the renderer state based on the latest visual state.\n */\n build: function () {\n triggerBuild();\n return renderState;\n }, \n /**\n * Schedule a render on the next animation frame.\n */\n scheduleRender: function () {\n sync.render(render, false, true);\n }, \n /**\n * Synchronously fire render. It's prefered that we batch renders but\n * in many circumstances, like layout measurement, we need to run this\n * synchronously. However in those instances other measures should be taken\n * to batch reads/writes.\n */\n syncRender: render, \n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n setProps: function (newProps) {\n props = newProps;\n lifecycles.updatePropListeners(newProps);\n prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues);\n }, getProps: function () { return props; }, \n // Variants ==============================\n /**\n * Returns the variant definition with a given name.\n */\n getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; }, \n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition: function () { return props.transition; }, getTransformPagePoint: function () {\n return props.transformPagePoint;\n }, \n /**\n * Used by child variant nodes to get the closest ancestor variant props.\n */\n getVariantContext: function (startAtParent) {\n if (startAtParent === void 0) { startAtParent = false; }\n if (startAtParent)\n return parent === null || parent === void 0 ? void 0 : parent.getVariantContext();\n if (!isControllingVariants) {\n var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {};\n if (props.initial !== undefined) {\n context_1.initial = props.initial;\n }\n return context_1;\n }\n var context = {};\n for (var i = 0; i < numVariantProps; i++) {\n var name_1 = variantProps[i];\n var prop = props[name_1];\n if (isVariantLabel(prop) || prop === false) {\n context[name_1] = prop;\n }\n }\n return context;\n } });\n return element;\n };\n};\nvar variantProps = __spreadArray([\"initial\"], __read(variantPriorityOrder), false);\nvar numVariantProps = variantProps.length;\n\nexport { visualElement };\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction updateMotionValuesFromProps(element, next, prev) {\n var _a;\n for (var key in next) {\n var nextValue = next[key];\n var prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping to a new motion value, create a new motion value\n * from that\n */\n element.addValue(key, motionValue(nextValue));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n var existingValue = element.getValue(key);\n // TODO: Only update values that aren't being animated or even looked at\n !existingValue.hasAnimated && existingValue.set(nextValue);\n }\n else {\n element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue));\n }\n }\n }\n // Handle removed values\n for (var key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n","import { __rest, __assign, __read } from 'tslib';\nimport { invariant } from 'hey-listen';\n\nfunction isCSSVariable(value) {\n return typeof value === \"string\" && value.startsWith(\"var(--\");\n}\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nvar cssVariableRegex = /var\\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\\)/;\nfunction parseCSSVariable(current) {\n var match = cssVariableRegex.exec(current);\n if (!match)\n return [,];\n var _a = __read(match, 3), token = _a[1], fallback = _a[2];\n return [token, fallback];\n}\nvar maxDepth = 4;\nfunction getVariableValue(current, element, depth) {\n if (depth === void 0) { depth = 1; }\n invariant(depth <= maxDepth, \"Max CSS variable fallback depth detected in property \\\"\".concat(current, \"\\\". This may indicate a circular fallback dependency.\"));\n var _a = __read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1];\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n var resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n return resolved.trim();\n }\n else if (isCSSVariable(fallback)) {\n // The fallback might itself be a CSS variable, in which case we attempt to resolve it too.\n return getVariableValue(fallback, element, depth + 1);\n }\n else {\n return fallback;\n }\n}\n/**\n * Resolve CSS variables from\n *\n * @internal\n */\nfunction resolveCSSVariables(visualElement, _a, transitionEnd) {\n var _b;\n var target = __rest(_a, []);\n var element = visualElement.getInstance();\n if (!(element instanceof Element))\n return { target: target, transitionEnd: transitionEnd };\n // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`\n // only if they change but I think this reads clearer and this isn't a performance-critical path.\n if (transitionEnd) {\n transitionEnd = __assign({}, transitionEnd);\n }\n // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved\n visualElement.forEachValue(function (value) {\n var current = value.get();\n if (!isCSSVariable(current))\n return;\n var resolved = getVariableValue(current, element);\n if (resolved)\n value.set(resolved);\n });\n // Cycle through every target property and resolve CSS variables. Currently\n // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)`\n for (var key in target) {\n var current = target[key];\n if (!isCSSVariable(current))\n continue;\n var resolved = getVariableValue(current, element);\n if (!resolved)\n continue;\n // Clone target if it hasn't already been\n target[key] = resolved;\n // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved\n // CSS variable. This will ensure that after the animation the component will reflect\n // changes in the value of the CSS variable.\n if (transitionEnd)\n (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current);\n }\n return { target: target, transitionEnd: transitionEnd };\n}\n\nexport { cssVariableRegex, parseCSSVariable, resolveCSSVariables };\n","import { __assign, __read } from 'tslib';\nimport { number, px } from 'style-value-types';\nimport { isKeyframesTarget } from '../../../animation/utils/is-keyframes-target.mjs';\nimport { invariant } from 'hey-listen';\nimport { transformProps } from '../../html/utils/transform.mjs';\nimport { findDimensionValueType } from '../value-types/dimensions.mjs';\n\nvar positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n \"x\",\n \"y\",\n]);\nvar isPositionalKey = function (key) { return positionalKeys.has(key); };\nvar hasPositionalKey = function (target) {\n return Object.keys(target).some(isPositionalKey);\n};\nvar setAndResetVelocity = function (value, to) {\n // Looks odd but setting it twice doesn't render, it'll just\n // set both prev and current to the latest value\n value.set(to, false);\n value.set(to);\n};\nvar isNumOrPxType = function (v) {\n return v === number || v === px;\n};\nvar BoundingBoxDimension;\n(function (BoundingBoxDimension) {\n BoundingBoxDimension[\"width\"] = \"width\";\n BoundingBoxDimension[\"height\"] = \"height\";\n BoundingBoxDimension[\"left\"] = \"left\";\n BoundingBoxDimension[\"right\"] = \"right\";\n BoundingBoxDimension[\"top\"] = \"top\";\n BoundingBoxDimension[\"bottom\"] = \"bottom\";\n})(BoundingBoxDimension || (BoundingBoxDimension = {}));\nvar getPosFromMatrix = function (matrix, pos) {\n return parseFloat(matrix.split(\", \")[pos]);\n};\nvar getTranslateFromMatrix = function (pos2, pos3) {\n return function (_bbox, _a) {\n var transform = _a.transform;\n if (transform === \"none\" || !transform)\n return 0;\n var matrix3d = transform.match(/^matrix3d\\((.+)\\)$/);\n if (matrix3d) {\n return getPosFromMatrix(matrix3d[1], pos3);\n }\n else {\n var matrix = transform.match(/^matrix\\((.+)\\)$/);\n if (matrix) {\n return getPosFromMatrix(matrix[1], pos2);\n }\n else {\n return 0;\n }\n }\n };\n};\nvar transformKeys = new Set([\"x\", \"y\", \"z\"]);\nvar nonTranslationalTransformKeys = transformProps.filter(function (key) { return !transformKeys.has(key); });\nfunction removeNonTranslationalTransform(visualElement) {\n var removedTransforms = [];\n nonTranslationalTransformKeys.forEach(function (key) {\n var value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n // Apply changes to element before measurement\n if (removedTransforms.length)\n visualElement.syncRender();\n return removedTransforms;\n}\nvar positionalValues = {\n // Dimensions\n width: function (_a, _b) {\n var x = _a.x;\n var _c = _b.paddingLeft, paddingLeft = _c === void 0 ? \"0\" : _c, _d = _b.paddingRight, paddingRight = _d === void 0 ? \"0\" : _d;\n return x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight);\n },\n height: function (_a, _b) {\n var y = _a.y;\n var _c = _b.paddingTop, paddingTop = _c === void 0 ? \"0\" : _c, _d = _b.paddingBottom, paddingBottom = _d === void 0 ? \"0\" : _d;\n return y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom);\n },\n top: function (_bbox, _a) {\n var top = _a.top;\n return parseFloat(top);\n },\n left: function (_bbox, _a) {\n var left = _a.left;\n return parseFloat(left);\n },\n bottom: function (_a, _b) {\n var y = _a.y;\n var top = _b.top;\n return parseFloat(top) + (y.max - y.min);\n },\n right: function (_a, _b) {\n var x = _a.x;\n var left = _b.left;\n return parseFloat(left) + (x.max - x.min);\n },\n // Transform\n x: getTranslateFromMatrix(4, 13),\n y: getTranslateFromMatrix(5, 14),\n};\nvar convertChangedValueTypes = function (target, visualElement, changedKeys) {\n var originBbox = visualElement.measureViewportBox();\n var element = visualElement.getInstance();\n var elementComputedStyle = getComputedStyle(element);\n var display = elementComputedStyle.display;\n var origin = {};\n // If the element is currently set to display: \"none\", make it visible before\n // measuring the target bounding box\n if (display === \"none\") {\n visualElement.setStaticValue(\"display\", target.display || \"block\");\n }\n /**\n * Record origins before we render and update styles\n */\n changedKeys.forEach(function (key) {\n origin[key] = positionalValues[key](originBbox, elementComputedStyle);\n });\n // Apply the latest values (as set in checkAndConvertChangedValueTypes)\n visualElement.syncRender();\n var targetBbox = visualElement.measureViewportBox();\n changedKeys.forEach(function (key) {\n // Restore styles to their **calculated computed style**, not their actual\n // originally set style. This allows us to animate between equivalent pixel units.\n var value = visualElement.getValue(key);\n setAndResetVelocity(value, origin[key]);\n target[key] = positionalValues[key](targetBbox, elementComputedStyle);\n });\n return target;\n};\nvar checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) {\n if (origin === void 0) { origin = {}; }\n if (transitionEnd === void 0) { transitionEnd = {}; }\n target = __assign({}, target);\n transitionEnd = __assign({}, transitionEnd);\n var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);\n // We want to remove any transform values that could affect the element's bounding box before\n // it's measured. We'll reapply these later.\n var removedTransformValues = [];\n var hasAttemptedToRemoveTransformValues = false;\n var changedValueTypeKeys = [];\n targetPositionalKeys.forEach(function (key) {\n var value = visualElement.getValue(key);\n if (!visualElement.hasValue(key))\n return;\n var from = origin[key];\n var fromType = findDimensionValueType(from);\n var to = target[key];\n var toType;\n // TODO: The current implementation of this basically throws an error\n // if you try and do value conversion via keyframes. There's probably\n // a way of doing this but the performance implications would need greater scrutiny,\n // as it'd be doing multiple resize-remeasure operations.\n if (isKeyframesTarget(to)) {\n var numKeyframes = to.length;\n var fromIndex = to[0] === null ? 1 : 0;\n from = to[fromIndex];\n fromType = findDimensionValueType(from);\n for (var i = fromIndex; i < numKeyframes; i++) {\n if (!toType) {\n toType = findDimensionValueType(to[i]);\n invariant(toType === fromType ||\n (isNumOrPxType(fromType) && isNumOrPxType(toType)), \"Keyframes must be of the same dimension as the current value\");\n }\n else {\n invariant(findDimensionValueType(to[i]) === toType, \"All keyframes must be of the same type\");\n }\n }\n }\n else {\n toType = findDimensionValueType(to);\n }\n if (fromType !== toType) {\n // If they're both just number or px, convert them both to numbers rather than\n // relying on resize/remeasure to convert (which is wasteful in this situation)\n if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {\n var current = value.get();\n if (typeof current === \"string\") {\n value.set(parseFloat(current));\n }\n if (typeof to === \"string\") {\n target[key] = parseFloat(to);\n }\n else if (Array.isArray(to) && toType === px) {\n target[key] = to.map(parseFloat);\n }\n }\n else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) &&\n (toType === null || toType === void 0 ? void 0 : toType.transform) &&\n (from === 0 || to === 0)) {\n // If one or the other value is 0, it's safe to coerce it to the\n // type of the other without measurement\n if (from === 0) {\n value.set(toType.transform(from));\n }\n else {\n target[key] = fromType.transform(to);\n }\n }\n else {\n // If we're going to do value conversion via DOM measurements, we first\n // need to remove non-positional transform values that could affect the bbox measurements.\n if (!hasAttemptedToRemoveTransformValues) {\n removedTransformValues =\n removeNonTranslationalTransform(visualElement);\n hasAttemptedToRemoveTransformValues = true;\n }\n changedValueTypeKeys.push(key);\n transitionEnd[key] =\n transitionEnd[key] !== undefined\n ? transitionEnd[key]\n : target[key];\n setAndResetVelocity(value, to);\n }\n }\n });\n if (changedValueTypeKeys.length) {\n var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);\n // If we removed transform values, reapply them before the next render\n if (removedTransformValues.length) {\n removedTransformValues.forEach(function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n visualElement.getValue(key).set(value);\n });\n }\n // Reapply original values\n visualElement.syncRender();\n return { target: convertedTarget, transitionEnd: transitionEnd };\n }\n else {\n return { target: target, transitionEnd: transitionEnd };\n }\n};\n/**\n * Convert value types for x/y/width/height/top/left/bottom/right\n *\n * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'`\n *\n * @internal\n */\nfunction unitConversion(visualElement, target, origin, transitionEnd) {\n return hasPositionalKey(target)\n ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd)\n : { target: target, transitionEnd: transitionEnd };\n}\n\nexport { BoundingBoxDimension, positionalValues, unitConversion };\n","import { resolveCSSVariables } from './css-variables-conversion.mjs';\nimport { unitConversion } from './unit-conversion.mjs';\n\n/**\n * Parse a DOM variant to make it animatable. This involves resolving CSS variables\n * and ensuring animations like \"20%\" => \"calc(50vw)\" are performed in pixels.\n */\nvar parseDomVariant = function (visualElement, target, origin, transitionEnd) {\n var resolved = resolveCSSVariables(visualElement, target, transitionEnd);\n target = resolved.target;\n transitionEnd = resolved.transitionEnd;\n return unitConversion(visualElement, target, origin, transitionEnd);\n};\n\nexport { parseDomVariant };\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n var viewportBox = measureViewportBox(element, transformPagePoint);\n var scroll = rootProjectionNode.scroll;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.x);\n translateAxis(viewportBox.y, scroll.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox(_a) {\n var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom;\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox(_a) {\n var x = _a.x, y = _a.y;\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n var topLeft = transformPoint({ x: point.left, y: point.top });\n var bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n","import { __rest, __assign } from 'tslib';\nimport { visualElement } from '../index.mjs';\nimport { getOrigin, checkTargetForNewValues } from '../utils/setters.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { isCSSVariable } from '../dom/utils/is-css-variable.mjs';\nimport { parseDomVariant } from '../dom/utils/parse-dom-variant.mjs';\nimport { isTransformProp } from './utils/transform.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nvar htmlConfig = {\n treeType: \"dom\",\n readValueFromInstance: function (domElement, key) {\n if (isTransformProp(key)) {\n var defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n else {\n var computedStyle = getComputedStyle(domElement);\n return ((isCSSVariable(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0);\n }\n },\n sortNodePosition: function (a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n },\n getBaseTarget: function (props, key) {\n var _a;\n return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key];\n },\n measureViewportBox: function (element, _a) {\n var transformPagePoint = _a.transformPagePoint;\n return measureViewportBox(element, transformPagePoint);\n },\n /**\n * Reset the transform on the current Element. This is called as part\n * of a batched process across the entire layout tree. To remove this write\n * cycle it'd be interesting to see if it's possible to \"undo\" all the current\n * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms\n * works\n */\n resetTransform: function (element, domElement, props) {\n var transformTemplate = props.transformTemplate;\n domElement.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n // Ensure that whatever happens next, we restore our transform on the next frame\n element.scheduleRender();\n },\n restoreTransform: function (instance, mutableState) {\n instance.style.transform = mutableState.style.transform;\n },\n removeValueFromRenderState: function (key, _a) {\n var vars = _a.vars, style = _a.style;\n delete vars[key];\n delete style[key];\n },\n /**\n * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color`\n * can be animated by Motion.\n */\n makeTargetAnimatable: function (element, _a, _b, isMounted) {\n var transformValues = _b.transformValues;\n if (isMounted === void 0) { isMounted = true; }\n var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, [\"transition\", \"transitionEnd\"]);\n var origin = getOrigin(target, transition || {}, element);\n /**\n * If Framer has provided a function to convert `Color` etc value types, convert them\n */\n if (transformValues) {\n if (transitionEnd)\n transitionEnd = transformValues(transitionEnd);\n if (target)\n target = transformValues(target);\n if (origin)\n origin = transformValues(origin);\n }\n if (isMounted) {\n checkTargetForNewValues(element, target, origin);\n var parsed = parseDomVariant(element, target, origin, transitionEnd);\n transitionEnd = parsed.transitionEnd;\n target = parsed.target;\n }\n return __assign({ transition: transition, transitionEnd: transitionEnd }, target);\n },\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n build: function (element, renderState, latestValues, options, props) {\n if (element.isVisible !== undefined) {\n renderState.style.visibility = element.isVisible\n ? \"visible\"\n : \"hidden\";\n }\n buildHTMLStyles(renderState, latestValues, options, props.transformTemplate);\n },\n render: renderHTML,\n};\nvar htmlVisualElement = visualElement(htmlConfig);\n\nexport { getComputedStyle, htmlConfig, htmlVisualElement };\n","import { __assign } from 'tslib';\nimport { visualElement } from '../index.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { htmlConfig } from '../html/visual-element.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isTransformProp } from '../html/utils/transform.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\n\nvar svgVisualElement = visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) {\n return props[key];\n }, readValueFromInstance: function (domElement, key) {\n var _a;\n if (isTransformProp(key)) {\n return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return domElement.getAttribute(key);\n }, scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, build: function (_element, renderState, latestValues, options, props) {\n buildSVGAttrs(renderState, latestValues, options, props.transformTemplate);\n }, render: renderSVG }));\n\nexport { svgVisualElement };\n","import { __assign } from 'tslib';\nimport { animations } from '../../motion/features/animations.mjs';\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\nimport { createDomVisualElement } from './create-visual-element.mjs';\n\n/**\n * @public\n */\nvar domAnimation = __assign(__assign({ renderer: createDomVisualElement }, animations), gestureAnimations);\n\nexport { domAnimation };\n","import { htmlVisualElement } from '../html/visual-element.mjs';\nimport { svgVisualElement } from '../svg/visual-element.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nvar createDomVisualElement = function (Component, options) {\n return isSVGComponent(Component)\n ? svgVisualElement(options, { enableHardwareAcceleration: false })\n : htmlVisualElement(options, { enableHardwareAcceleration: true });\n};\n\nexport { createDomVisualElement };\n","import { __assign } from 'tslib';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { featureDefinitions } from './definitions.mjs';\nimport { invariant } from 'hey-listen';\nimport { LazyContext } from '../../context/LazyContext.mjs';\n\nvar featureNames = Object.keys(featureDefinitions);\nvar numFeatures = featureNames.length;\n/**\n * Load features via renderless components based on the provided MotionProps.\n */\nfunction useFeatures(props, visualElement, preloadedFeatures) {\n var features = [];\n var lazyContext = useContext(LazyContext);\n if (!visualElement)\n return null;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n lazyContext.strict) {\n invariant(false, \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\");\n }\n for (var i = 0; i < numFeatures; i++) {\n var name_1 = featureNames[i];\n var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component;\n /**\n * It might be possible in the future to use this moment to\n * dynamically request functionality. In initial tests this\n * was producing a lot of duplication amongst bundles.\n */\n if (isEnabled(props) && Component) {\n features.push(React.createElement(Component, __assign({ key: name_1 }, props, { visualElement: visualElement })));\n }\n }\n return features;\n}\n\nexport { useFeatures };\n","import { createContext, useContext } from 'react';\n\nvar MotionContext = createContext({});\nfunction useVisualElementContext() {\n return useContext(MotionContext).visualElement;\n}\n\nexport { MotionContext, useVisualElementContext };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nvar useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","import { useContext, useRef, useEffect } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useVisualElementContext } from '../../context/MotionContext/index.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { LazyContext } from '../../context/LazyContext.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement) {\n var lazyContext = useContext(LazyContext);\n var parent = useVisualElementContext();\n var presenceContext = useContext(PresenceContext);\n var visualElementRef = useRef(undefined);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n if (!createVisualElement)\n createVisualElement = lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState: visualState,\n parent: parent,\n props: props,\n presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id,\n blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false,\n });\n }\n var visualElement = visualElementRef.current;\n useIsomorphicLayoutEffect(function () {\n visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender();\n });\n useEffect(function () {\n var _a;\n (_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges();\n });\n useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []);\n return visualElement;\n}\n\nexport { useVisualElement };\n","function isRefObject(ref) {\n return (typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n\nexport { isRefObject };\n","import { useMemo, useContext } from 'react';\nimport { MotionContext } from './index.mjs';\nimport { getCurrentTreeVariants } from './utils.mjs';\n\nfunction useCreateMotionContext(props) {\n var _a = getCurrentTreeVariants(props, useContext(MotionContext)), initial = _a.initial, animate = _a.animate;\n return useMemo(function () { return ({ initial: initial, animate: animate }); }, [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n\nexport { useCreateMotionContext };\n","import { checkIfControllingVariants, isVariantLabel } from '../../render/utils/variants.mjs';\n\nfunction getCurrentTreeVariants(props, context) {\n if (checkIfControllingVariants(props)) {\n var initial = props.initial, animate = props.animate;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n\nexport { getCurrentTreeVariants };\n","import { __spreadArray, __read, __assign } from 'tslib';\nimport sync, { cancelSync, flushSync } from 'framesync';\nimport { mix } from 'popmotion';\nimport { animate } from '../../animation/animate.mjs';\nimport { SubscriptionManager } from '../../utils/subscription-manager.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { getValueTransition } from '../../animation/utils/transitions.mjs';\nimport { boxEquals, isDeltaZero } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { hasTransform, hasScale } from '../utils/has-transform.mjs';\nimport { transformAxes } from '../../render/html/utils/transform.mjs';\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nvar animationTarget = 1000;\n/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nvar globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\nfunction createProjectionNode(_a) {\n var attachResizeListener = _a.attachResizeListener, defaultParent = _a.defaultParent, measureScroll = _a.measureScroll, resetTransform = _a.resetTransform;\n return /** @class */ (function () {\n function ProjectionNode(id, latestValues, parent) {\n var _this = this;\n if (latestValues === void 0) { latestValues = {}; }\n if (parent === void 0) { parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent(); }\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to actually\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n // Note: Currently only running on root node\n this.potentialNodes = new Map();\n this.checkUpdateFailed = function () {\n if (_this.isUpdating) {\n _this.isUpdating = false;\n _this.clearAllSnapshots();\n }\n };\n this.updateProjection = function () {\n _this.nodes.forEach(resolveTargetDelta);\n _this.nodes.forEach(calcProjection);\n };\n this.hasProjected = false;\n this.isVisible = true;\n /**\n * Animation\n */\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.id = id;\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? __spreadArray(__spreadArray([], __read(parent.path), false), [parent], false) : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n id && this.root.registerPotentialNode(id, this);\n for (var i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n ProjectionNode.prototype.addEventListener = function (name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n };\n ProjectionNode.prototype.notifyListeners = function (name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager === null || subscriptionManager === void 0 ? void 0 : subscriptionManager.notify.apply(subscriptionManager, __spreadArray([], __read(args), false));\n };\n ProjectionNode.prototype.hasListeners = function (name) {\n return this.eventHandlers.has(name);\n };\n ProjectionNode.prototype.registerPotentialNode = function (id, node) {\n this.potentialNodes.set(id, node);\n };\n /**\n * Lifecycles\n */\n ProjectionNode.prototype.mount = function (instance, isLayoutDirty) {\n var _this = this;\n var _a;\n if (isLayoutDirty === void 0) { isLayoutDirty = false; }\n if (this.instance)\n return;\n this.isSVG =\n instance instanceof SVGElement && instance.tagName !== \"svg\";\n this.instance = instance;\n var _b = this.options, layoutId = _b.layoutId, layout = _b.layout, visualElement = _b.visualElement;\n if (visualElement && !visualElement.getInstance()) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n (_a = this.parent) === null || _a === void 0 ? void 0 : _a.children.add(this);\n this.id && this.root.potentialNodes.delete(this.id);\n if (isLayoutDirty && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n var unblockTimeout_1;\n var resizeUnblockUpdate_1 = function () {\n return (_this.root.updateBlockedByResize = false);\n };\n attachResizeListener(instance, function () {\n _this.root.updateBlockedByResize = true;\n clearTimeout(unblockTimeout_1);\n unblockTimeout_1 = setTimeout(resizeUnblockUpdate_1, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n _this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", function (_a) {\n var _b, _c, _d, _e, _f;\n var delta = _a.delta, hasLayoutChanged = _a.hasLayoutChanged, hasRelativeTargetChanged = _a.hasRelativeTargetChanged, newLayout = _a.layout;\n if (_this.isTreeAnimationBlocked()) {\n _this.target = undefined;\n _this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n var layoutTransition = (_c = (_b = _this.options.transition) !== null && _b !== void 0 ? _b : visualElement.getDefaultTransition()) !== null && _c !== void 0 ? _c : defaultLayoutTransition;\n var onLayoutAnimationComplete = visualElement.getProps().onLayoutAnimationComplete;\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n var targetChanged = !_this.targetLayout ||\n !boxEquals(_this.targetLayout, newLayout) ||\n hasRelativeTargetChanged;\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n var hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;\n if (((_d = _this.resumeFrom) === null || _d === void 0 ? void 0 : _d.instance) ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (targetChanged || !_this.currentAnimation))) {\n if (_this.resumeFrom) {\n _this.resumingFrom = _this.resumeFrom;\n _this.resumingFrom.resumingFrom = undefined;\n }\n _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n _this.startAnimation(__assign(__assign({}, getValueTransition(layoutTransition, \"layout\")), { onComplete: onLayoutAnimationComplete }));\n }\n else {\n _this.isLead() && ((_f = (_e = _this.options).onExitComplete) === null || _f === void 0 ? void 0 : _f.call(_e));\n }\n _this.targetLayout = newLayout;\n });\n }\n };\n ProjectionNode.prototype.unmount = function () {\n var _a, _b;\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.remove(this);\n (_b = this.parent) === null || _b === void 0 ? void 0 : _b.children.delete(this);\n this.instance = undefined;\n cancelSync.preRender(this.updateProjection);\n };\n // only on the root\n ProjectionNode.prototype.blockUpdate = function () {\n this.updateManuallyBlocked = true;\n };\n ProjectionNode.prototype.unblockUpdate = function () {\n this.updateManuallyBlocked = false;\n };\n ProjectionNode.prototype.isUpdateBlocked = function () {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n };\n ProjectionNode.prototype.isTreeAnimationBlocked = function () {\n var _a;\n return (this.isAnimationBlocked ||\n ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimationBlocked()) ||\n false);\n };\n // Note: currently only running on root node\n ProjectionNode.prototype.startUpdate = function () {\n var _a;\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n (_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach(resetRotation);\n };\n ProjectionNode.prototype.willUpdate = function (shouldNotifyListeners) {\n var _a, _b, _c;\n if (shouldNotifyListeners === void 0) { shouldNotifyListeners = true; }\n if (this.root.isUpdateBlocked()) {\n (_b = (_a = this.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a);\n return;\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (var i = 0; i < this.path.length; i++) {\n var node = this.path[i];\n node.shouldResetTransform = true;\n /**\n * TODO: Check we haven't updated the scroll\n * since the last didUpdate\n */\n node.updateScroll();\n }\n var _d = this.options, layoutId = _d.layoutId, layout = _d.layout;\n if (layoutId === undefined && !layout)\n return;\n var transformTemplate = (_c = this.options.visualElement) === null || _c === void 0 ? void 0 : _c.getProps().transformTemplate;\n this.prevTransformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, \"\");\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n };\n // Note: Currently only running on root node\n ProjectionNode.prototype.didUpdate = function () {\n var updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n if (!this.isUpdating)\n return;\n this.isUpdating = false;\n /**\n * Search for and mount newly-added projection elements.\n *\n * TODO: Every time a new component is rendered we could search up the tree for\n * the closest mounted node and query from there rather than document.\n */\n if (this.potentialNodes.size) {\n this.potentialNodes.forEach(mountNodeEarly);\n this.potentialNodes.clear();\n }\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n this.clearAllSnapshots();\n // Flush any scheduled updates\n flushSync.update();\n flushSync.preRender();\n flushSync.render();\n };\n ProjectionNode.prototype.clearAllSnapshots = function () {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n };\n ProjectionNode.prototype.scheduleUpdateProjection = function () {\n sync.preRender(this.updateProjection, false, true);\n };\n ProjectionNode.prototype.scheduleCheckAfterUnmount = function () {\n var _this = this;\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n sync.postRender(function () {\n if (_this.isLayoutDirty) {\n _this.root.didUpdate();\n }\n else {\n _this.root.checkUpdateFailed();\n }\n });\n };\n /**\n * Update measurements\n */\n ProjectionNode.prototype.updateSnapshot = function () {\n if (this.snapshot || !this.instance)\n return;\n var measured = this.measure();\n var layout = this.removeTransform(this.removeElementScroll(measured));\n roundBox(layout);\n this.snapshot = {\n measured: measured,\n layout: layout,\n latestValues: {},\n };\n };\n ProjectionNode.prototype.updateLayout = function () {\n var _a;\n if (!this.instance)\n return;\n // TODO: Incorporate into a forwarded scroll offset\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (var i = 0; i < this.path.length; i++) {\n var node = this.path[i];\n node.updateScroll();\n }\n }\n var measured = this.measure();\n roundBox(measured);\n var prevLayout = this.layout;\n this.layout = {\n measured: measured,\n actual: this.removeElementScroll(measured),\n };\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.actual);\n (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.notifyLayoutMeasure(this.layout.actual, prevLayout === null || prevLayout === void 0 ? void 0 : prevLayout.actual);\n };\n ProjectionNode.prototype.updateScroll = function () {\n if (this.options.layoutScroll && this.instance) {\n this.scroll = measureScroll(this.instance);\n }\n };\n ProjectionNode.prototype.resetTransform = function () {\n var _a;\n if (!resetTransform)\n return;\n var isResetRequested = this.isLayoutDirty || this.shouldResetTransform;\n var hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate;\n var transformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, \"\");\n var transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n };\n ProjectionNode.prototype.measure = function () {\n var visualElement = this.options.visualElement;\n if (!visualElement)\n return createBox();\n var box = visualElement.measureViewportBox();\n // Remove viewport scroll to give page-relative coordinates\n var scroll = this.root.scroll;\n if (scroll) {\n translateAxis(box.x, scroll.x);\n translateAxis(box.y, scroll.y);\n }\n return box;\n };\n ProjectionNode.prototype.removeElementScroll = function (box) {\n var boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (var i = 0; i < this.path.length; i++) {\n var node = this.path[i];\n var scroll_1 = node.scroll, options = node.options;\n if (node !== this.root && scroll_1 && options.layoutScroll) {\n translateAxis(boxWithoutScroll.x, scroll_1.x);\n translateAxis(boxWithoutScroll.y, scroll_1.y);\n }\n }\n return boxWithoutScroll;\n };\n ProjectionNode.prototype.applyTransform = function (box, transformOnly) {\n if (transformOnly === void 0) { transformOnly = false; }\n var withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (var i = 0; i < this.path.length; i++) {\n var node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.x,\n y: -node.scroll.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n };\n ProjectionNode.prototype.removeTransform = function (box) {\n var _a;\n var boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (var i = 0; i < this.path.length; i++) {\n var node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n var sourceBox = createBox();\n var nodeBox = node.measure();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, (_a = node.snapshot) === null || _a === void 0 ? void 0 : _a.layout, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n };\n /**\n *\n */\n ProjectionNode.prototype.setTargetDelta = function (delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n };\n ProjectionNode.prototype.setOptions = function (options) {\n var _a;\n this.options = __assign(__assign(__assign({}, this.options), options), { crossfade: (_a = options.crossfade) !== null && _a !== void 0 ? _a : true });\n };\n ProjectionNode.prototype.clearMeasurements = function () {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n };\n /**\n * Frame calculations\n */\n ProjectionNode.prototype.resolveTargetDelta = function () {\n var _a;\n var _b = this.options, layout = _b.layout, layoutId = _b.layoutId;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n // TODO If this is unsuccessful this currently happens every frame\n if (!this.targetDelta && !this.relativeTarget) {\n // TODO: This is a semi-repetition of further down this function, make DRY\n this.relativeParent = this.getClosestProjectingParent();\n if (this.relativeParent && this.relativeParent.layout) {\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.layout.actual, this.relativeParent.layout.actual);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n ((_a = this.relativeParent) === null || _a === void 0 ? void 0 : _a.target)) {\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.actual);\n }\n else {\n copyBoxInto(this.target, this.layout.actual);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.actual);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n this.relativeParent = this.getClosestProjectingParent();\n if (this.relativeParent &&\n Boolean(this.relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !this.relativeParent.options.layoutScroll &&\n this.relativeParent.target) {\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.target, this.relativeParent.target);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n }\n };\n ProjectionNode.prototype.getClosestProjectingParent = function () {\n if (!this.parent || hasTransform(this.parent.latestValues))\n return undefined;\n if ((this.parent.relativeTarget || this.parent.targetDelta) &&\n this.parent.layout) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n };\n ProjectionNode.prototype.calcProjection = function () {\n var _a;\n var _b = this.options, layout = _b.layout, layoutId = _b.layoutId;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n var lead = this.getLead();\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.actual);\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, Boolean(this.resumingFrom) || this !== lead);\n var target = lead.target;\n if (!target)\n return;\n if (!this.projectionDelta) {\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n var prevTreeScaleX = this.treeScale.x;\n var prevTreeScaleY = this.treeScale.y;\n var prevProjectionTransform = this.projectionTransform;\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);\n if (this.projectionTransform !== prevProjectionTransform ||\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n };\n ProjectionNode.prototype.hide = function () {\n this.isVisible = false;\n // TODO: Schedule render\n };\n ProjectionNode.prototype.show = function () {\n this.isVisible = true;\n // TODO: Schedule render\n };\n ProjectionNode.prototype.scheduleRender = function (notifyAll) {\n var _a, _b, _c;\n if (notifyAll === void 0) { notifyAll = true; }\n (_b = (_a = this.options).scheduleRender) === null || _b === void 0 ? void 0 : _b.call(_a);\n notifyAll && ((_c = this.getStack()) === null || _c === void 0 ? void 0 : _c.scheduleRender());\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n };\n ProjectionNode.prototype.setAnimationOrigin = function (delta, hasOnlyRelativeTargetChanged) {\n var _this = this;\n var _a;\n if (hasOnlyRelativeTargetChanged === void 0) { hasOnlyRelativeTargetChanged = false; }\n var snapshot = this.snapshot;\n var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {};\n var mixedValues = __assign({}, this.latestValues);\n var targetDelta = createDelta();\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n var relativeLayout = createBox();\n var isSharedLayoutAnimation = snapshot === null || snapshot === void 0 ? void 0 : snapshot.isShared;\n var isOnlyMember = (((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.members.length) || 0) <= 1;\n var shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.mixTargetDelta = function (latest) {\n var _a;\n var progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n _this.setTargetDelta(targetDelta);\n if (_this.relativeTarget &&\n _this.relativeTargetOrigin &&\n _this.layout &&\n ((_a = _this.relativeParent) === null || _a === void 0 ? void 0 : _a.layout)) {\n calcRelativePosition(relativeLayout, _this.layout.actual, _this.relativeParent.layout.actual);\n mixBox(_this.relativeTarget, _this.relativeTargetOrigin, relativeLayout, progress);\n }\n if (isSharedLayoutAnimation) {\n _this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, _this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n _this.root.scheduleUpdateProjection();\n _this.scheduleRender();\n };\n this.mixTargetDelta(0);\n };\n ProjectionNode.prototype.startAnimation = function (options) {\n var _this = this;\n var _a, _b;\n (_a = this.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop();\n if (this.resumingFrom) {\n (_b = this.resumingFrom.currentAnimation) === null || _b === void 0 ? void 0 : _b.stop();\n }\n if (this.pendingAnimation) {\n cancelSync.update(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = sync.update(function () {\n globalProjectionState.hasAnimatedSinceResize = true;\n _this.currentAnimation = animate(0, animationTarget, __assign(__assign({}, options), { onUpdate: function (latest) {\n var _a;\n _this.mixTargetDelta(latest);\n (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, latest);\n }, onComplete: function () {\n var _a;\n (_a = options.onComplete) === null || _a === void 0 ? void 0 : _a.call(options);\n _this.completeAnimation();\n } }));\n if (_this.resumingFrom) {\n _this.resumingFrom.currentAnimation = _this.currentAnimation;\n }\n _this.pendingAnimation = undefined;\n });\n };\n ProjectionNode.prototype.completeAnimation = function () {\n var _a;\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n };\n ProjectionNode.prototype.finishAnimation = function () {\n var _a;\n if (this.currentAnimation) {\n (_a = this.mixTargetDelta) === null || _a === void 0 ? void 0 : _a.call(this, animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n };\n ProjectionNode.prototype.applyTransformsToTarget = function () {\n var _a = this.getLead(), targetWithTransforms = _a.targetWithTransforms, target = _a.target, layout = _a.layout, latestValues = _a.latestValues;\n if (!targetWithTransforms || !target || !layout)\n return;\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its actual layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n };\n ProjectionNode.prototype.registerSharedNode = function (layoutId, node) {\n var _a, _b, _c;\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n var stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n node.promote({\n transition: (_a = node.options.initialPromotionConfig) === null || _a === void 0 ? void 0 : _a.transition,\n preserveFollowOpacity: (_c = (_b = node.options.initialPromotionConfig) === null || _b === void 0 ? void 0 : _b.shouldPreserveFollowOpacity) === null || _c === void 0 ? void 0 : _c.call(_b, node),\n });\n };\n ProjectionNode.prototype.isLead = function () {\n var stack = this.getStack();\n return stack ? stack.lead === this : true;\n };\n ProjectionNode.prototype.getLead = function () {\n var _a;\n var layoutId = this.options.layoutId;\n return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;\n };\n ProjectionNode.prototype.getPrevLead = function () {\n var _a;\n var layoutId = this.options.layoutId;\n return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;\n };\n ProjectionNode.prototype.getStack = function () {\n var layoutId = this.options.layoutId;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n };\n ProjectionNode.prototype.promote = function (_a) {\n var _b = _a === void 0 ? {} : _a, needsReset = _b.needsReset, transition = _b.transition, preserveFollowOpacity = _b.preserveFollowOpacity;\n var stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition: transition });\n };\n ProjectionNode.prototype.relegate = function () {\n var stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n };\n ProjectionNode.prototype.resetRotation = function () {\n var visualElement = this.options.visualElement;\n if (!visualElement)\n return;\n // If there's no detected rotation values, we can early return without a forced render.\n var hasRotate = false;\n // Keep a record of all the values we've reset\n var resetValues = {};\n // Check the rotate value of all axes and reset to 0\n for (var i = 0; i < transformAxes.length; i++) {\n var axis = transformAxes[i];\n var key = \"rotate\" + axis;\n // If this rotation doesn't exist as a motion value, then we don't\n // need to reset it\n if (!visualElement.getStaticValue(key)) {\n continue;\n }\n hasRotate = true;\n // Record the rotation and then temporarily set it to 0\n resetValues[key] = visualElement.getStaticValue(key);\n visualElement.setStaticValue(key, 0);\n }\n // If there's no rotation values, we don't need to do any more.\n if (!hasRotate)\n return;\n // Force a render of this element to apply the transform with all rotations\n // set to 0.\n visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender();\n // Put back all the values we reset\n for (var key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n };\n ProjectionNode.prototype.getProjectionStyles = function (styleProp) {\n var _a, _b, _c, _d, _e, _f;\n if (styleProp === void 0) { styleProp = {}; }\n // TODO: Return lifecycle-persistent object\n var styles = {};\n if (!this.instance || this.isSVG)\n return styles;\n if (!this.isVisible) {\n return { visibility: \"hidden\" };\n }\n else {\n styles.visibility = \"\";\n }\n var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate;\n if (this.needsReset) {\n this.needsReset = false;\n styles.opacity = \"\";\n styles.pointerEvents =\n resolveMotionValue(styleProp.pointerEvents) || \"\";\n styles.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return styles;\n }\n var lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n var emptyStyles = {};\n if (this.options.layoutId) {\n emptyStyles.opacity = (_b = this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1;\n emptyStyles.pointerEvents =\n resolveMotionValue(styleProp.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n emptyStyles.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return emptyStyles;\n }\n var valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n styles.transform = transformTemplate(valuesToRender, styles.transform);\n }\n var _g = this.projectionDelta, x = _g.x, y = _g.y;\n styles.transformOrigin = \"\".concat(x.origin * 100, \"% \").concat(y.origin * 100, \"% 0\");\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n styles.opacity =\n lead === this\n ? (_d = (_c = valuesToRender.opacity) !== null && _c !== void 0 ? _c : this.latestValues.opacity) !== null && _d !== void 0 ? _d : 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its actual\n * opacity and other components to hidden.\n */\n styles.opacity =\n lead === this\n ? (_e = valuesToRender.opacity) !== null && _e !== void 0 ? _e : \"\"\n : (_f = valuesToRender.opacityExit) !== null && _f !== void 0 ? _f : 0;\n }\n /**\n * Apply scale correction\n */\n for (var key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n var _h = scaleCorrectors[key], correct = _h.correct, applyTo = _h.applyTo;\n var corrected = correct(valuesToRender[key], lead);\n if (applyTo) {\n var num = applyTo.length;\n for (var i = 0; i < num; i++) {\n styles[applyTo[i]] = corrected;\n }\n }\n else {\n styles[key] = corrected;\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n styles.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp.pointerEvents) || \"\"\n : \"none\";\n }\n return styles;\n };\n ProjectionNode.prototype.clearSnapshot = function () {\n this.resumeFrom = this.snapshot = undefined;\n };\n // Only run on root\n ProjectionNode.prototype.resetTree = function () {\n this.root.nodes.forEach(function (node) { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n };\n return ProjectionNode;\n }());\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n var _a, _b, _c, _d;\n var snapshot = (_b = (_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) !== null && _b !== void 0 ? _b : node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n var _e = node.layout, layout_1 = _e.actual, measuredLayout = _e.measured;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (node.options.animationType === \"size\") {\n eachAxis(function (axis) {\n var axisSnapshot = snapshot.isShared\n ? snapshot.measured[axis]\n : snapshot.layout[axis];\n var length = calcLength(axisSnapshot);\n axisSnapshot.min = layout_1[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (node.options.animationType === \"position\") {\n eachAxis(function (axis) {\n var axisSnapshot = snapshot.isShared\n ? snapshot.measured[axis]\n : snapshot.layout[axis];\n var length = calcLength(layout_1[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n var layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout_1, snapshot.layout);\n var visualDelta = createDelta();\n if (snapshot.isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measured);\n }\n else {\n calcBoxDelta(visualDelta, layout_1, snapshot.layout);\n }\n var hasLayoutChanged = !isDeltaZero(layoutDelta);\n var hasRelativeTargetChanged = false;\n if (!node.resumeFrom) {\n node.relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (node.relativeParent && !node.relativeParent.resumeFrom) {\n var _f = node.relativeParent, parentSnapshot = _f.snapshot, parentLayout = _f.layout;\n if (parentSnapshot && parentLayout) {\n var relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layout, parentSnapshot.layout);\n var relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout_1, parentLayout.actual);\n if (!boxEquals(relativeSnapshot, relativeLayout)) {\n hasRelativeTargetChanged = true;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout: layout_1,\n snapshot: snapshot,\n delta: visualDelta,\n layoutDelta: layoutDelta,\n hasLayoutChanged: hasLayoutChanged,\n hasRelativeTargetChanged: hasRelativeTargetChanged,\n });\n }\n else if (node.isLead()) {\n (_d = (_c = node.options).onExitComplete) === null || _d === void 0 ? void 0 : _d.call(_c);\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction resetTransformStyle(node) {\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetRotation(node) {\n node.resetRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mix(delta.translate, 0, p);\n output.scale = mix(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mix(from.min, to.min, p);\n output.max = mix(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nvar defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nfunction mountNodeEarly(node, id) {\n /**\n * Rather than searching the DOM from document we can search the\n * path for the deepest mounted ancestor and search from there\n */\n var searchNode = node.root;\n for (var i = node.path.length - 1; i >= 0; i--) {\n if (Boolean(node.path[i].instance)) {\n searchNode = node.path[i];\n break;\n }\n }\n var searchElement = searchNode && searchNode !== node.root ? searchNode.instance : document;\n var element = searchElement.querySelector(\"[data-projection-id=\\\"\".concat(id, \"\\\"]\"));\n if (element)\n node.mount(element, true);\n}\nfunction roundAxis(axis) {\n axis.min = Math.round(axis.min);\n axis.max = Math.round(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\n\nexport { createProjectionNode, globalProjectionState, mixAxis, mixAxisDelta, mixBox };\n","import { useConstant } from '../../utils/use-constant.mjs';\nimport { globalProjectionState } from './create-projection-node.mjs';\n\nvar id = 1;\nfunction useProjectionId() {\n return useConstant(function () {\n if (globalProjectionState.hasEverUpdated) {\n return id++;\n }\n });\n}\n\nexport { useProjectionId };\n","import { createContext } from 'react';\n\n/**\n * @internal\n */\nvar SwitchLayoutGroupContext = createContext({});\n\nexport { SwitchLayoutGroupContext };\n","import { __extends } from 'tslib';\nimport React__default from 'react';\n\nvar VisualElementHandler = /** @class */ (function (_super) {\n __extends(VisualElementHandler, _super);\n function VisualElementHandler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Update visual element props as soon as we know this update is going to be commited.\n */\n VisualElementHandler.prototype.getSnapshotBeforeUpdate = function () {\n this.updateProps();\n return null;\n };\n VisualElementHandler.prototype.componentDidUpdate = function () { };\n VisualElementHandler.prototype.updateProps = function () {\n var _a = this.props, visualElement = _a.visualElement, props = _a.props;\n if (visualElement)\n visualElement.setProps(props);\n };\n VisualElementHandler.prototype.render = function () {\n return this.props.children;\n };\n return VisualElementHandler;\n}(React__default.Component));\n\nexport { VisualElementHandler };\n","import { __assign } from 'tslib';\nimport * as React from 'react';\nimport { forwardRef, useContext } from 'react';\nimport { useFeatures } from './features/use-features.mjs';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { loadFeatures, featureDefinitions } from './features/definitions.mjs';\nimport { isBrowser } from '../utils/is-browser.mjs';\nimport { useProjectionId } from '../projection/node/id.mjs';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { useProjection } from './features/use-projection.mjs';\nimport { VisualElementHandler } from './utils/VisualElementHandler.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n *\n * @internal\n */\nfunction createMotionComponent(_a) {\n var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;\n preloadedFeatures && loadFeatures(preloadedFeatures);\n function MotionComponent(props, externalRef) {\n var layoutId = useLayoutId(props);\n props = __assign(__assign({}, props), { layoutId: layoutId });\n /**\n * If we're rendering in a static environment, we only visually update the component\n * as a result of a React-rerender rather than interactions or animations. This\n * means we don't need to load additional memory structures like VisualElement,\n * or any gesture/animation features.\n */\n var config = useContext(MotionConfigContext);\n var features = null;\n var context = useCreateMotionContext(props);\n /**\n * Create a unique projection ID for this component. If a new component is added\n * during a layout animation we'll use this to query the DOM and hydrate its ref early, allowing\n * us to measure it as soon as any layout effect flushes pending layout animations.\n *\n * Performance note: It'd be better not to have to search the DOM for these elements.\n * For newly-entering components it could be enough to only correct treeScale, in which\n * case we could mount in a scale-correction mode. This wouldn't be enough for\n * shared element transitions however. Perhaps for those we could revert to a root node\n * that gets forceRendered and layout animations are triggered on its layout effect.\n */\n var projectionId = config.isStatic ? undefined : useProjectionId();\n /**\n *\n */\n var visualState = useVisualState(props, config.isStatic);\n if (!config.isStatic && isBrowser) {\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, __assign(__assign({}, config), props), createVisualElement);\n useProjection(projectionId, props, context.visualElement, projectionNodeConstructor ||\n featureDefinitions.projectionNodeConstructor);\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n features = useFeatures(props, context.visualElement, preloadedFeatures);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (React.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign(__assign({}, config), props) },\n features,\n React.createElement(MotionContext.Provider, { value: context }, useRender(Component, props, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement))));\n }\n return forwardRef(MotionComponent);\n}\nfunction useLayoutId(_a) {\n var _b;\n var layoutId = _a.layoutId;\n var layoutGroupId = (_b = useContext(LayoutGroupContext)) === null || _b === void 0 ? void 0 : _b.id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\n\nexport { createMotionComponent };\n","import { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { useContext } from 'react';\nimport { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';\n\nfunction useProjection(projectionId, _a, visualElement, ProjectionNodeConstructor) {\n var _b;\n var layoutId = _a.layoutId, layout = _a.layout, drag = _a.drag, dragConstraints = _a.dragConstraints, layoutScroll = _a.layoutScroll;\n var initialPromotionConfig = useContext(SwitchLayoutGroupContext);\n if (!ProjectionNodeConstructor ||\n !visualElement ||\n (visualElement === null || visualElement === void 0 ? void 0 : visualElement.projection)) {\n return;\n }\n visualElement.projection = new ProjectionNodeConstructor(projectionId, visualElement.getLatestValues(), (_b = visualElement.parent) === null || _b === void 0 ? void 0 : _b.projection);\n visualElement.projection.setOptions({\n layoutId: layoutId,\n layout: layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement: visualElement,\n scheduleRender: function () { return visualElement.scheduleRender(); },\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig: initialPromotionConfig,\n layoutScroll: layoutScroll,\n });\n}\n\nexport { useProjection };\n","import { useCallback } from 'react';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nfunction useMotionRef(visualState, visualElement, externalRef) {\n return useCallback(function (instance) {\n var _a;\n instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance));\n if (visualElement) {\n instance\n ? visualElement.mount(instance)\n : visualElement.unmount();\n }\n if (externalRef) {\n if (typeof externalRef === \"function\") {\n externalRef(instance);\n }\n else if (isRefObject(externalRef)) {\n externalRef.current = instance;\n }\n }\n }, \n /**\n * Only pass a new ref callback to React if we've received a visual element\n * factory. Otherwise we'll be mounting/remounting every time externalRef\n * or other dependencies change.\n */\n [visualElement]);\n}\n\nexport { useMotionRef };\n","var createHtmlRenderState = function () { return ({\n style: {},\n transform: {},\n transformKeys: [],\n transformOrigin: {},\n vars: {},\n}); };\n\nexport { createHtmlRenderState };\n","import { __assign } from 'tslib';\nimport { useMemo } from 'react';\nimport { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nfunction copyRawValuesOnly(target, source, props) {\n for (var key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues(_a, visualState, isStatic) {\n var transformTemplate = _a.transformTemplate;\n return useMemo(function () {\n var state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);\n var vars = state.vars, style = state.style;\n return __assign(__assign({}, vars), style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState, isStatic) {\n var styleProp = props.style || {};\n var style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState, isStatic));\n if (props.transformValues) {\n style = props.transformValues(style);\n }\n return style;\n}\nfunction useHTMLProps(props, visualState, isStatic) {\n // The `any` isn't ideal but it is the type of createElement props argument\n var htmlProps = {};\n var style = useStyle(props, visualState, isStatic);\n if (Boolean(props.drag) && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : \"pan-\".concat(props.drag === \"x\" ? \"y\" : \"x\");\n }\n htmlProps.style = style;\n return htmlProps;\n}\n\nexport { copyRawValuesOnly, useHTMLProps, useStyle };\n","/**\n * A list of all valid MotionProps.\n *\n * @internalremarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nvar validMotionProps = new Set([\n \"initial\",\n \"animate\",\n \"exit\",\n \"style\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"transformValues\",\n \"custom\",\n \"inherit\",\n \"layout\",\n \"layoutId\",\n \"layoutDependency\",\n \"onLayoutAnimationComplete\",\n \"onLayoutMeasure\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"drag\",\n \"dragControls\",\n \"dragListener\",\n \"dragConstraints\",\n \"dragDirectionLock\",\n \"dragSnapToOrigin\",\n \"_dragX\",\n \"_dragY\",\n \"dragElastic\",\n \"dragMomentum\",\n \"dragPropagation\",\n \"dragTransition\",\n \"whileDrag\",\n \"onPan\",\n \"onPanStart\",\n \"onPanEnd\",\n \"onPanSessionStart\",\n \"onTap\",\n \"onTapStart\",\n \"onTapCancel\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"whileFocus\",\n \"whileTap\",\n \"whileHover\",\n \"whileInView\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"viewport\",\n \"layoutScroll\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nfunction isValidMotionProp(key) {\n return validMotionProps.has(key);\n}\n\nexport { isValidMotionProp };\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nvar shouldForward = function (key) { return !isValidMotionProp(key); };\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n var emotionIsPropValid_1 = require(\"@emotion/is-prop-valid\").default;\n shouldForward = function (key) {\n // Handle events explicitly as Emotion validates them all as true\n if (key.startsWith(\"on\")) {\n return !isValidMotionProp(key);\n }\n else {\n return emotionIsPropValid_1(key);\n }\n };\n}\ncatch (_a) {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n var filteredProps = {};\n for (var key in props) {\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] && key.startsWith(\"onDrag\"))) {\n filteredProps[key] = props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps };\n","import { __assign } from 'tslib';\nimport { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\n\nvar createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); };\n\nexport { createSvgRenderState };\n","import { __assign } from 'tslib';\nimport { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\n\nfunction useSVGProps(props, visualState) {\n var visualProps = useMemo(function () {\n var state = createSvgRenderState();\n buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate);\n return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) });\n }, [visualState]);\n if (props.style) {\n var rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = __assign(__assign({}, rawStyles), visualProps.style);\n }\n return visualProps;\n}\n\nexport { useSVGProps };\n","import { __assign } from 'tslib';\nimport { createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\n\nfunction createUseRender(forwardMotionProps) {\n if (forwardMotionProps === void 0) { forwardMotionProps = false; }\n var useRender = function (Component, props, projectionId, ref, _a, isStatic) {\n var latestValues = _a.latestValues;\n var useVisualProps = isSVGComponent(Component)\n ? useSVGProps\n : useHTMLProps;\n var visualProps = useVisualProps(props, latestValues, isStatic);\n var filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n var elementProps = __assign(__assign(__assign({}, filteredProps), visualProps), { ref: ref });\n if (projectionId) {\n elementProps[\"data-projection-id\"] = projectionId;\n }\n return createElement(Component, elementProps);\n };\n return useRender;\n}\n\nexport { createUseRender };\n","import { isCustomValue } from '../../utils/resolve-value.mjs';\nimport { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n *\n * TODO: Remove and move to library\n *\n * @internal\n */\nfunction resolveMotionValue(value) {\n var unwrappedValue = isMotionValue(value) ? value.get() : value;\n return isCustomValue(unwrappedValue)\n ? unwrappedValue.toValue()\n : unwrappedValue;\n}\n\nexport { resolveMotionValue };\n","import { __rest } from 'tslib';\nimport { useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { checkIfControllingVariants, checkIfVariantNode, resolveVariantFromProps } from '../../render/utils/variants.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\n\nfunction makeState(_a, props, context, presenceContext) {\n var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount;\n var state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n if (onMount) {\n state.mount = function (instance) { return onMount(props, instance, state); };\n }\n return state;\n}\nvar makeUseVisualState = function (config) {\n return function (props, isStatic) {\n var context = useContext(MotionContext);\n var presenceContext = useContext(PresenceContext);\n return isStatic\n ? makeState(config, props, context, presenceContext)\n : useConstant(function () {\n return makeState(config, props, context, presenceContext);\n });\n };\n};\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n var values = {};\n var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false;\n var motionValues = scrapeMotionValues(props);\n for (var key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n var initial = props.initial, animate = props.animate;\n var isControllingVariants = checkIfControllingVariants(props);\n var isVariantNode = checkIfVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n initial !== null && initial !== void 0 ? initial : (initial = context.initial);\n animate !== null && animate !== void 0 ? animate : (animate = context.animate);\n }\n var initialAnimationIsBlocked = blockInitialAnimation || initial === false;\n var variantToSet = initialAnimationIsBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n list.forEach(function (definition) {\n var resolved = resolveVariantFromProps(props, definition);\n if (!resolved)\n return;\n var transitionEnd = resolved.transitionEnd; resolved.transition; var target = __rest(resolved, [\"transitionEnd\", \"transition\"]);\n for (var key in target) {\n var valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n var index = initialAnimationIsBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (var key in transitionEnd)\n values[key] = transitionEnd[key];\n });\n }\n return values;\n}\n\nexport { makeUseVisualState };\n","import { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\n\nvar svgMotionConfig = {\n useVisualState: makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n onMount: function (props, instance, _a) {\n var renderState = _a.renderState, latestValues = _a.latestValues;\n try {\n renderState.dimensions =\n typeof instance.getBBox ===\n \"function\"\n ? instance.getBBox()\n : instance.getBoundingClientRect();\n }\n catch (e) {\n // Most likely trying to measure an unrendered element under Firefox\n renderState.dimensions = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, props.transformTemplate);\n // TODO: Replace with direct assignment\n renderSVG(instance, renderState);\n },\n }),\n};\n\nexport { svgMotionConfig };\n","import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nvar htmlMotionConfig = {\n useVisualState: makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n }),\n};\n\nexport { htmlMotionConfig };\n","import { createMotionProxy } from './motion-proxy.mjs';\nimport { createDomMotionConfig } from './utils/create-config.mjs';\n\n/**\n * @public\n */\nvar m = createMotionProxy(createDomMotionConfig);\n\nexport { m };\n","import { createMotionComponent } from '../../motion/index.mjs';\n\n/**\n * Convert any React component into a `motion` component. The provided component\n * **must** use `React.forwardRef` to the underlying DOM component you want to animate.\n *\n * ```jsx\n * const Component = React.forwardRef((props, ref) => {\n * return <div ref={ref} />\n * })\n *\n * const MotionComponent = motion(Component)\n * ```\n *\n * @public\n */\nfunction createMotionProxy(createConfig) {\n function custom(Component, customMotionComponentConfig) {\n if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; }\n return createMotionComponent(createConfig(Component, customMotionComponentConfig));\n }\n if (typeof Proxy === \"undefined\") {\n return custom;\n }\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n var componentCache = new Map();\n return new Proxy(custom, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: function (_target, key) {\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(key, custom(key));\n }\n return componentCache.get(key);\n },\n });\n}\n\nexport { createMotionProxy };\n","import { __assign } from 'tslib';\nimport { isSVGComponent } from './is-svg-component.mjs';\nimport { createUseRender } from '../use-render.mjs';\nimport { svgMotionConfig } from '../../svg/config-motion.mjs';\nimport { htmlMotionConfig } from '../../html/config-motion.mjs';\n\nfunction createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement, projectionNodeConstructor) {\n var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;\n var baseConfig = isSVGComponent(Component)\n ? svgMotionConfig\n : htmlMotionConfig;\n return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement, projectionNodeConstructor: projectionNodeConstructor, Component: Component });\n}\n\nexport { createDomMotionConfig };\n","var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g;\nvar REPLACE_TEMPLATE = \"$1-$2\";\n/**\n * Convert camelCase to dash-case properties.\n */\nvar camelToDash = function (str) {\n return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase();\n};\n\nexport { camelToDash };\n","/**\n * Returns true if the provided key is a CSS variable\n */\nfunction isCSSVariable(key) {\n return key.startsWith(\"--\");\n}\n\nexport { isCSSVariable };\n","/**\n * We keep these listed seperately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nvar lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n\nexport { lowercaseSVGElements };\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\n\nfunction isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/.test(Component)) {\n return true;\n }\n return false;\n}\n\nexport { isSVGComponent };\n","import { __assign } from 'tslib';\nimport { number } from 'style-value-types';\n\nvar int = __assign(__assign({}, number), { transform: Math.round });\n\nexport { int };\n","import { px, degrees, scale, alpha, progressPercentage } from 'style-value-types';\nimport { int } from './type-int.mjs';\n\nvar numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n size: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n // Transform props\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale: scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n // Misc\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { sortTransformProps } from './transform.mjs';\n\nvar translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(_a, _b, transformIsDefault, transformTemplate) {\n var transform = _a.transform, transformKeys = _a.transformKeys;\n var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d;\n // The transform string we're going to build into.\n var transformString = \"\";\n // Transform keys into their default order - this will determine the output order.\n transformKeys.sort(sortTransformProps);\n // Track whether the defined transform has a defined z so we don't add a\n // second to enable hardware acceleration\n var transformHasZ = false;\n // Loop over each transform and build them into transformString\n var numTransformKeys = transformKeys.length;\n for (var i = 0; i < numTransformKeys; i++) {\n var key = transformKeys[i];\n transformString += \"\".concat(translateAlias[key] || key, \"(\").concat(transform[key], \") \");\n if (key === \"z\")\n transformHasZ = true;\n }\n if (!transformHasZ && enableHardwareAcceleration) {\n transformString += \"translateZ(0)\";\n }\n else {\n transformString = transformString.trim();\n }\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (allowTransformNone && transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n/**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\nfunction buildTransformOrigin(_a) {\n var _b = _a.originX, originX = _b === void 0 ? \"50%\" : _b, _c = _a.originY, originY = _c === void 0 ? \"50%\" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d;\n return \"\".concat(originX, \" \").concat(originY, \" \").concat(originZ);\n}\n\nexport { buildTransform, buildTransformOrigin };\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nvar getValueAsType = function (value, type) {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n","import { buildTransform, buildTransformOrigin } from './build-transform.mjs';\nimport { isCSSVariable } from '../../dom/utils/is-css-variable.mjs';\nimport { isTransformProp, isTransformOriginProp } from './transform.mjs';\nimport { getValueAsType } from '../../dom/value-types/get-as-type.mjs';\nimport { numberValueTypes } from '../../dom/value-types/number.mjs';\n\nfunction buildHTMLStyles(state, latestValues, options, transformTemplate) {\n var _a;\n var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin;\n // Empty the transformKeys array. As we're throwing out refs to its items\n // this might not be as cheap as suspected. Maybe using the array as a buffer\n // with a manual incrementation would be better.\n transformKeys.length = 0;\n // Track whether we encounter any transform or transformOrigin values.\n var hasTransform = false;\n var hasTransformOrigin = false;\n // Does the calculated transform essentially equal \"none\"?\n var transformIsNone = true;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept seperately for further processing.\n */\n for (var key in latestValues) {\n var value = latestValues[key];\n /**\n * If this is a CSS variable we don't do any further processing.\n */\n if (isCSSVariable(key)) {\n vars[key] = value;\n continue;\n }\n // Convert the value to its default value type, ie 0 -> \"0px\"\n var valueType = numberValueTypes[key];\n var valueAsType = getValueAsType(value, valueType);\n if (isTransformProp(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n transform[key] = valueAsType;\n transformKeys.push(key);\n // If we already know we have a non-default transform, early return\n if (!transformIsNone)\n continue;\n // Otherwise check to see if this is a default transform\n if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0))\n transformIsNone = false;\n }\n else if (isTransformOriginProp(key)) {\n transformOrigin[key] = valueAsType;\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n }\n else {\n style[key] = valueAsType;\n }\n }\n if (hasTransform) {\n style.transform = buildTransform(state, options, transformIsNone, transformTemplate);\n }\n else if (transformTemplate) {\n style.transform = transformTemplate({}, \"\");\n }\n if (hasTransformOrigin) {\n style.transformOrigin = buildTransformOrigin(transformOrigin);\n }\n}\n\nexport { buildHTMLStyles };\n","function renderHTML(element, _a, styleProp, projection) {\n var style = _a.style, vars = _a.vars;\n Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));\n // Loop over any CSS variables and assign those.\n for (var key in vars) {\n element.style.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n","import { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\nimport { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props) {\n var style = props.style;\n var newValues = {};\n for (var key in style) {\n if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","/**\n * A list of all transformable axes. We'll use this list to generated a version\n * of each axes for each transform.\n */\nvar transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * An ordered array of each transformable value. By default, transform values\n * will be sorted to this order.\n */\nvar order = [\"translate\", \"scale\", \"rotate\", \"skew\"];\n/**\n * Generate a list of every possible transform key.\n */\nvar transformProps = [\"transformPerspective\", \"x\", \"y\", \"z\"];\norder.forEach(function (operationKey) {\n return transformAxes.forEach(function (axesKey) {\n return transformProps.push(operationKey + axesKey);\n });\n});\n/**\n * A function to use with Array.sort to sort transform keys by their default order.\n */\nfunction sortTransformProps(a, b) {\n return transformProps.indexOf(a) - transformProps.indexOf(b);\n}\n/**\n * A quick lookup for transform props.\n */\nvar transformPropSet = new Set(transformProps);\nfunction isTransformProp(key) {\n return transformPropSet.has(key);\n}\n/**\n * A quick lookup for transform origin props\n */\nvar transformOriginProps = new Set([\"originX\", \"originY\", \"originZ\"]);\nfunction isTransformOriginProp(key) {\n return transformOriginProps.has(key);\n}\n\nexport { isTransformOriginProp, isTransformProp, sortTransformProps, transformAxes, transformProps };\n","import { px } from 'style-value-types';\n\nfunction calcOrigin(origin, offset, size) {\n return typeof origin === \"string\"\n ? origin\n : px.transform(offset + size * origin);\n}\n/**\n * The SVG transform origin defaults are different to CSS and is less intuitive,\n * so we use the measured dimensions of the SVG to reconcile these.\n */\nfunction calcSVGTransformOrigin(dimensions, originX, originY) {\n var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);\n var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);\n return \"\".concat(pxOriginX, \" \").concat(pxOriginY);\n}\n\nexport { calcSVGTransformOrigin };\n","import { px } from 'style-value-types';\n\nvar dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nvar camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n */\nfunction buildSVGPath(attrs, length, spacing, offset, useDashCase) {\n if (spacing === void 0) { spacing = 1; }\n if (offset === void 0) { offset = 0; }\n if (useDashCase === void 0) { useDashCase = true; }\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n var keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n var pathLength = px.transform(length);\n var pathSpacing = px.transform(spacing);\n attrs[keys.array] = \"\".concat(pathLength, \" \").concat(pathSpacing);\n}\n\nexport { buildSVGPath };\n","import { __rest } from 'tslib';\nimport { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { calcSVGTransformOrigin } from './transform-origin.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * Build SVG visual attrbutes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, _a, options, transformTemplate) {\n var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, \n // This is object creation, which we try to avoid per-frame.\n latest = __rest(_a, [\"attrX\", \"attrY\", \"originX\", \"originY\", \"pathLength\", \"pathSpacing\", \"pathOffset\"]);\n buildHTMLStyles(state, latest, options, transformTemplate);\n state.attrs = state.style;\n state.style = {};\n var attrs = state.attrs, style = state.style, dimensions = state.dimensions;\n /**\n * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs\n * and copy it into style.\n */\n if (attrs.transform) {\n if (dimensions)\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n // Parse transformOrigin\n if (dimensions &&\n (originX !== undefined || originY !== undefined || style.transform)) {\n style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);\n }\n // Treat x/y not as shortcuts but as actual attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nvar camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n]);\n\nexport { camelCaseAttributes };\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState) {\n renderHTML(element, renderState);\n for (var key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props) {\n var newValues = scrapeMotionValuesFromProps$1(props);\n for (var key in props) {\n if (isMotionValue(props[key])) {\n var targetKey = key === \"x\" || key === \"y\" ? \"attr\" + key.toUpperCase() : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","/**\n * Decides if the supplied variable is an array of variant labels\n */\nfunction isVariantLabels(v) {\n return Array.isArray(v);\n}\n/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || isVariantLabels(v);\n}\n/**\n * Creates an object containing the latest state of every MotionValue on a VisualElement\n */\nfunction getCurrent(visualElement) {\n var current = {};\n visualElement.forEachValue(function (value, key) { return (current[key] = value.get()); });\n return current;\n}\n/**\n * Creates an object containing the latest velocity of every MotionValue on a VisualElement\n */\nfunction getVelocity(visualElement) {\n var velocity = {};\n visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); });\n return velocity;\n}\nfunction resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) {\n var _a;\n if (currentValues === void 0) { currentValues = {}; }\n if (currentVelocity === void 0) { currentVelocity = {}; }\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity);\n }\n return definition;\n}\nfunction resolveVariant(visualElement, definition, custom) {\n var props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement));\n}\nfunction checkIfControllingVariants(props) {\n var _a;\n return (typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === \"function\" ||\n isVariantLabel(props.initial) ||\n isVariantLabel(props.animate) ||\n isVariantLabel(props.whileHover) ||\n isVariantLabel(props.whileDrag) ||\n isVariantLabel(props.whileTap) ||\n isVariantLabel(props.whileFocus) ||\n isVariantLabel(props.exit));\n}\nfunction checkIfVariantNode(props) {\n return Boolean(checkIfControllingVariants(props) || props.variants);\n}\n\nexport { checkIfControllingVariants, checkIfVariantNode, isVariantLabel, isVariantLabels, resolveVariant, resolveVariantFromProps };\n","var isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n","import { isKeyframesTarget } from '../animation/utils/is-keyframes-target.mjs';\n\nvar isCustomValue = function (v) {\n return Boolean(v && typeof v === \"object\" && v.mix && v.toValue);\n};\nvar resolveFinalValueInKeyframes = function (v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n};\n\nexport { isCustomValue, resolveFinalValueInKeyframes };\n","import { useRef } from 'react';\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nfunction useConstant(init) {\n var ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n\nexport { useConstant };\n","import { __read } from 'tslib';\nimport sync from 'framesync';\nimport { useRef, useState, useCallback } from 'react';\nimport { useUnmountEffect } from './use-unmount-effect.mjs';\n\nfunction useForceUpdate() {\n var isUnmountingRef = useRef(false);\n var _a = __read(useState(0), 2), forcedRenderCount = _a[0], setForcedRenderCount = _a[1];\n useUnmountEffect(function () { return (isUnmountingRef.current = true); });\n var forceRender = useCallback(function () {\n !isUnmountingRef.current && setForcedRenderCount(forcedRenderCount + 1);\n }, [forcedRenderCount]);\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n var deferredForceRender = useCallback(function () { return sync.postRender(forceRender); }, [forceRender]);\n return [deferredForceRender, forcedRenderCount];\n}\n\nexport { useForceUpdate };\n","import { useEffect } from 'react';\n\nfunction useUnmountEffect(callback) {\n return useEffect(function () { return function () { return callback(); }; }, []);\n}\n\nexport { useUnmountEffect };\n","var isMotionValue = function (value) {\n return Boolean(value !== null && typeof value === \"object\" && value.getVelocity);\n};\n\nexport { isMotionValue };\n","const defaultTimestep = (1 / 60) * 1000;\nconst getCurrentTime = typeof performance !== \"undefined\"\n ? () => performance.now()\n : () => Date.now();\nconst onNextFrame = typeof window !== \"undefined\"\n ? (callback) => window.requestAnimationFrame(callback)\n : (callback) => setTimeout(() => callback(getCurrentTime()), defaultTimestep);\n\nexport { defaultTimestep, onNextFrame };\n","import { onNextFrame, defaultTimestep } from './on-next-frame.mjs';\nimport { createRenderStep } from './create-render-step.mjs';\n\nconst maxElapsed = 40;\nlet useDefaultElapsed = true;\nlet runNextFrame = false;\nlet isProcessing = false;\nconst frame = {\n delta: 0,\n timestamp: 0,\n};\nconst stepsOrder = [\n \"read\",\n \"update\",\n \"preRender\",\n \"render\",\n \"postRender\",\n];\nconst steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(() => (runNextFrame = true));\n return acc;\n}, {});\nconst sync = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n startLoop();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n}, {});\nconst cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = steps[key].cancel;\n return acc;\n}, {});\nconst flushSync = stepsOrder.reduce((acc, key) => {\n acc[key] = () => steps[key].process(frame);\n return acc;\n}, {});\nconst processStep = (stepId) => steps[stepId].process(frame);\nconst processFrame = (timestamp) => {\n runNextFrame = false;\n frame.delta = useDefaultElapsed\n ? defaultTimestep\n : Math.max(Math.min(timestamp - frame.timestamp, maxElapsed), 1);\n frame.timestamp = timestamp;\n isProcessing = true;\n stepsOrder.forEach(processStep);\n isProcessing = false;\n if (runNextFrame) {\n useDefaultElapsed = false;\n onNextFrame(processFrame);\n }\n};\nconst startLoop = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!isProcessing)\n onNextFrame(processFrame);\n};\nconst getFrameData = () => frame;\n\nexport default sync;\nexport { cancelSync, flushSync, getFrameData };\n","function createRenderStep(runNextFrame) {\n let toRun = [];\n let toRunNextFrame = [];\n let numToRun = 0;\n let isProcessing = false;\n let flushNextFrame = false;\n const toKeepAlive = new WeakSet();\n const step = {\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const buffer = addToCurrentFrame ? toRun : toRunNextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (buffer.indexOf(callback) === -1) {\n buffer.push(callback);\n if (addToCurrentFrame && isProcessing)\n numToRun = toRun.length;\n }\n return callback;\n },\n cancel: (callback) => {\n const index = toRunNextFrame.indexOf(callback);\n if (index !== -1)\n toRunNextFrame.splice(index, 1);\n toKeepAlive.delete(callback);\n },\n process: (frameData) => {\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [toRun, toRunNextFrame] = [toRunNextFrame, toRun];\n toRunNextFrame.length = 0;\n numToRun = toRun.length;\n if (numToRun) {\n for (let i = 0; i < numToRun; i++) {\n const callback = toRun[i];\n callback(frameData);\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n }\n }\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { clamp } from '../utils.mjs';\n\nconst number = {\n test: (v) => typeof v === 'number',\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = Object.assign(Object.assign({}, number), { transform: clamp(0, 1) });\nconst scale = Object.assign(Object.assign({}, number), { default: 1 });\n\nexport { alpha, number, scale };\n","import { isString } from '../utils.mjs';\n\nconst createUnitType = (unit) => ({\n test: (v) => isString(v) && v.endsWith(unit) && v.split(' ').length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = createUnitType('deg');\nconst percent = createUnitType('%');\nconst px = createUnitType('px');\nconst vh = createUnitType('vh');\nconst vw = createUnitType('vw');\nconst progressPercentage = Object.assign(Object.assign({}, percent), { parse: (v) => percent.parse(v) / 100, transform: (v) => percent.transform(v * 100) });\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","const clamp = (min, max) => (v) => Math.max(Math.min(v, max), min);\nconst sanitize = (v) => (v % 1 ? Number(v.toFixed(5)) : v);\nconst floatRegex = /(-)?([\\d]*\\.?[\\d])+/g;\nconst colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2,3}\\s*\\/*\\s*[\\d\\.]+%?\\))/gi;\nconst singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2,3}\\s*\\/*\\s*[\\d\\.]+%?\\))$/i;\nfunction isString(v) {\n return typeof v === 'string';\n}\n\nexport { clamp, colorRegex, floatRegex, isString, sanitize, singleColorRegex };\n"],"names":["die","error","args","msg","Error","length","map","s","join","isDraft","value","DRAFT_STATE","isDraftable","proto","Object","getPrototypeOf","Ctor","hasOwnProperty","call","constructor","Function","toString","objectCtorString","Array","isArray","DRAFTABLE","isMap","isSet","each","obj","iter","enumerableOnly","getArchtype","keys","ownKeys","forEach","key","entry","index","thing","state","type_","has","prop","prototype","get","set","propOrOldValue","t","delete","add","is","x","y","target","hasMap","Map","hasSet","Set","latest","copy_","base_","shallowCopy","base","slice","descriptors","getOwnPropertyDescriptors","i","desc","writable","configurable","enumerable","create","freeze","deep","isFrozen","clear","dontMutateFrozenCollections","getPlugin","pluginKey","plugin","plugins","loadPlugin","implementation","getCurrentScope","currentScope","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","drafts_","revokeDraft","parent_","enterScope","immer","immer_","canAutoFreeze_","unfinalizedDrafts_","draft","revoke_","revoked_","processResult","result","baseDraft","isReplaced","useProxies_","willFinalizeES5_","modified_","finalize","maybeFreeze","generateReplacementPatches_","NOTHING","rootScope","path","childValue","finalizeProperty","scope_","finalized_","draft_","generatePatches_","parentState","targetObject","rootPath","res","assigned_","concat","undefined","autoFreeze_","peek","getDescriptorFromProto","source","getOwnPropertyDescriptor","markChanged","prepareCopy","createProxy","parent","proxyMap_","proxySet_","isManual_","traps","objectTraps","arrayTraps","Proxy","revocable","revoke","proxy","createES5Proxy_","push","current","currentImpl","copy","archType","hasChanges_","copyHelper","from","enableES5","proxyProperty","this","markChangesSweep","drafts","hasArrayChanges","hasObjectChanges","baseValue","baseIsDraft","descriptor","defineProperty","markChangesRecursively","object","min","Math","hasSymbol","Symbol","hasProxies","Reflect","for","G","iterator","getOwnPropertySymbols","getOwnPropertyNames","_desc$get","currentState","deleteProperty","owner","setPrototypeOf","fn","arguments","apply","Immer","e","config","recipe","defaultBase","self","_this","produce","_this2","hasError","Promise","then","arg1","arg2","produceWithPatches","p","ip","patches","inversePatches","useProxies","setUseProxies","autoFreeze","setAutoFreeze","createDraft","finishDraft","applyPatches","patch","op","applyPatchesImpl","applyPatches_","bind","createThunkMiddleware","extraArgument","_ref","dispatch","getState","next","action","thunk","withExtraArgument","composeWithDevTools","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","__REDUX_DEVTOOLS_EXTENSION__","isPlainObject","baseProto","MiddlewareArray","__extends","species","arr","_super","curryGetDefaultMiddleware","options","_c","middlewareArray","isBoolean","thunkMiddleware","process","getDefaultMiddleware","configureStore","rootReducer","curriedGetDefaultMiddleware","_d","reducer","_e","middleware","_f","devTools","_g","preloadedState","_h","enhancers","combineReducers","finalMiddleware","middlewareEnhancer","applyMiddleware","finalCompose","compose2","__spreadValues","trace","storeEnhancers","composedEnhancer","createStore","createAction","type","prepareAction","prepared","payload","meta","actionCreator","match","executeReducerBuilderCallback","builderCallback","defaultCaseReducer","actionsMap","actionMatchers","builder","addCase","typeOrActionCreator","addMatcher","matcher","addDefaultCase","createSlice","name","_reducer","initialState","default2","reducers","reducerNames","sliceCaseReducersByName","sliceCaseReducersByType","actionCreators","extraReducers","finalCaseReducers","mapOrBuilderCallback","getInitialState","finalActionMatchers","finalDefaultCaseReducer","isStateFunction","frozenInitialState_1","createNextState","caseReducers","filter","reducer2","cr","reduce","previousState","caseReducer","isDraft2","createReducer","reducerName","prepareCallback","maybeReducerWithPrepare","prepare","buildReducer","actions","nanoid","size","id","random","assertFunction","func","expected","TypeError","noop","catchRejection","promise","onError","catch","addAbortSignalListener","abortSignal","callback","addEventListener","once","abortControllerWithReason","abortController","reason","signal","aborted","abort","listenerCancelled","listener","code","message","task","validateActive","TaskAbortError","promisifyAbortSignal","_","reject","notifyRejection","createPause","race","output","createDelay","pause","timeoutMs","resolve","setTimeout","INTERNAL_NIL_TOKEN","alm","createFork","parentAbortSignal","taskExecutor","controller","childAbortController","AbortController","task2","cleanUp","delay","result2","status","cancel","createTakePattern","startListening","predicate","timeout","unsubscribe","tuplePromise","effect","listenerApi","getOriginalState","promises","take","getListenerEntryPropsFrom","safelyNotifyError","errorHandler","errorToNotify","errorInfo","errorHandlerError","addListener","clearAllListeners","removeListener","defaultErrorHandler","console","cancelActiveListeners","pending","createListenerMiddleware","middlewareOptions","listenerMap","extra","findListenerEntry","comparator","values","_i","existingEntry","createListenerEntry","cancelOptions","cancelActive","insertEntry","stopListening","entry2","notifyListener","api","internalTaskController","assign","condition","Boolean","fork","subscribe","listenerError_1","raisedBy","clearListenerMiddleware","createClearListenerMiddleware","originalState","listenerEntries","runListener","predicateError","clearListeners","Action","PopStateEventType","createBrowserHistory","getUrlBasedHistory","globalHistory","pathname","search","hash","location","createLocation","usr","to","createPath","invariant","getHistoryState","idx","parsePath","substr","charAt","parsedPath","hashIndex","indexOf","searchIndex","getLocation","createHref","validateLocation","document","defaultView","v5Compat","history","Pop","getIndex","handlePop","nextIndex","delta","createURL","origin","href","URL","replaceState","listen","removeEventListener","encodeLocation","url","Push","historyState","pushState","replace","Replace","go","n","ResultType","validMutationMethodsArr","validRequestMethodsArr","createElement","exports","byteLength","b64","lens","getLens","validLen","placeHoldersLen","toByteArray","tmp","Arr","_byteLength","curByte","len","revLookup","charCodeAt","fromByteArray","uint8","extraBytes","parts","maxChunkLength","len2","encodeChunk","lookup","Uint8Array","start","end","num","base64","require","ieee754","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","RangeError","__proto__","arg","encodingOrOffset","allocUnsafe","ArrayBuffer","array","byteOffset","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","fromString","isBuffer","checked","buffer","val","data","fromObject","assertSize","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","b","m","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","String","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","utf8Write","blitBuffer","asciiWrite","str","byteArray","asciiToBytes","latin1Write","base64Write","ucs2Write","units","c","hi","lo","utf16leToBytes","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","global","foo","subarray","typedArraySupport","poolSize","_augment","fill","allocUnsafeSlow","_isBuffer","compare","a","list","pos","swap16","swap32","swap64","equals","inspect","max","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","INVALID_BASE64_RE","Infinity","leadSurrogate","trim","stringtrim","base64clean","src","dst","module","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","displayName","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","d","f","g","h","k","l","q","r","v","w","z","u","$$typeof","A","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","Fragment","Lazy","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","rt","abs","log","LN2","TYPES","IMediaAPI","IAuthAPI","IMediaDiffAPI","ISiteDataAPI","injectMediaAPI","container","injectOrBuildContainer","bindMediaAPI","unbindMediaAPI","remove","injectAuthAPI","bindAuthAPI","unbindAuthAPI","injectMediaDiffAPI","bindMediaDiffAPI","unbindMediaDiffAPI","injectSiteDataAPI","bindSiteDataAPI","unbindSiteDataAPI","MediumStatus","DEFAULT_TIMEOUT_MS","_isIAuthenticateResponse","isNullOrUndefined","_typeof","record","access_token","userName","token_type","expires_in","refresh_token","_request","query","extension","clientId","clientSecret","grantType","username","password","authParams","client_id","client_secret","grant_type","method","body","assemble","headers","_authenticate","fetcher","logger","retryCount","req","apiUrl","apiExtension","_context","JSON","stringify","response","statusCode","isStatusOk","fetchLoader","errors","assert","_iterator","_context2","auth","authenticate","buildBindable","dependencies","UTIL_TYPES","build","injectFetch","injectLog","configAPI","injectConfigAPI","injectQueryURL","authImpl","_build","inject","STORAGEENGINE","indexeddb","idb","db","err","memory","mem","OPTIONS_DEFAULTS","version","engine","mappings","OPTIONS_OVERRIDES","_options","_open","optionsIn","_expand","open","expand","setDefaults","settings","loggingEnabled","isProduction","_isProduction","logging","enable","disable","isEnabled","_noop","_logInfo","info","_logWarn","warn","_logError","params","requestDto","siteId","siteHash","requests","existingMedia","medium","mediumHash","mapMediumToBodyRequest","apiHref","authToken","expectedResponseType","_isMediaDiffResponse","requester","apiHrefs","mediaDiff","_loop","_ret","getMediaDiff","DEFAULT_TIMEOUT","download","promiser","async","progressCallback","request","onProgress","RESPONSETYPE_MAP","Blob","none","requestForURL","_hasHttpPrefix","startsWith","_requestFromConfig","mediaId","media","templatedPath","resolvedPath","_requestFromConfigWithToken","accessToken","mediaWithAccessToken","requestURL","parameters","resolver","canResolveMedium","getMedia","mediaUtil","mediaDownload","injectProgressPromise","mediaImpl","mediaAPI","_isBlob","_downloadSiteData","_isISiteData","currentHash","previousHash","_unzipSiteData","zip","srcData","unzipFile","dataFile","dataStr","text","arrayBuffer","jsonData","parse","zipper","siteData","siteDataBinary","_context3","_context4","unzipPromise","injectZip","getSiteData","apiURL","getSiteDataAPI","buildBinderListings","authApiBinder","mediaDiffApiBinder","mediaApiBinder","siteDataApiBinder","IAuthenticationManager","IMediaManager","IUserStateManager","injectMediaManager","injectAuthManager","injectUserStateManager","authAPI","initState","manager","pendingRenew","expiry","Date","hasExpired","threshold","getTime","renew","renewResult","authResponse","serialize","getSeconds","initString","CONTROLLER_TYPES","API_TYPES","downloadToBinary","database","cacheController","mediaAPIs","cacheOnly","isMediumCached","cachedResponse","token","mediaBinary","close","mimeType","downloadToBinaries","mediaIds","all","results","blob","createObjectURL","blobs","urls","downloadToUrl","downloadToUrls","style","shouldOpenClose","isOpen","queryIds","backgroundImageMediumId","foregroundImageMediumId","menuImageMediumId","mediumId","mediaForStyling","mediaForSiteObject","siteObject","language","translations","allTranslations","matchTranslations","sot","languageId","downloadList","styleId","localMediaIds","allLocalMedia","_toConsumableArray","mediaUsedForSiteObjectTranslationsInLanguage","allSiteObjectTranslations","allMediaWithTranslations","matchMediaTranslations","allMedia","allMediaWithTranslationsIds","mediaUniversal","downloadMedia","_siteObjectsForTour","tour","tourRelatedSiteObjects","siteObjectIds","tourId","siteObjectId","siteObjects","_context5","mediaList","tourStyle","so","soMedia","mediaUsedForLanguage","mediaForLanguageWithTour","apis","find","item","downloadToURL","downloadToURLs","ids","isAllMediaCached","removeMediumCache","mediaForLanguage","mediaFilter","resolveUrlWithToken","_resolveUrlWithToken","CACHE_TYPES","injectMediaCacheController","mediaManager","StoreSymbol","globalObject","_GetValue","collection","_SetValue","store","_saveUserState","_init","startingData","callbacks","getProperty","getPropertyWithDefault","defaultValue","setProperty","subscribeChanges","subscriberKey","unsubscribeChanges","subscriber","records","primaryMatch","at","flatten","load","_loadFromStore","dataObject","userState","authBinder","mediaBinder","userStateBinder","MappedVersions","IBackgroundModeDto","IBeaconDto","IBeaconSensitivityDto","IFloorPlanDto","IFontAlignmentDto","IFontFamilyDto","IFontSizeUnitDto","IFontStyleDto","ILanguageDto","IMediumDto","IMenuItemDto","IMenuItemTranslationDto","IPinTypeDto","IScreenOrientationDto","ISiteDto","ISiteObjectOnFloorPlanDto","ISiteObjectDto","ISiteObjectTranslationDto","ISiteObjectTypeDto","ISiteSupportedLanguageDto","IStyleDto","ITourMenuItemDto","ITourRelatedSiteObjectDto","ITourDto","ITourStatusDto","ITourSubTypeDto","ITourSupportedLanguageDto","ITourTranslationDto","ITourTypeDto","ICountryDto","IDeviceAccountDto","IFloorPlanTourDto","IFloorPlanTranslationDto","IMenuItemKeywordDto","IRoleDto","ISiteObjectKeywordDto","IUserDto","ILegacy_FloorPlanDto","ITourTranslationDto_tmp","ISiteObjectOnFloorPlanDto_tmp","description","mappingsChanges","Schema","VALUES_FIELD_BYTEVALUE","All","BYTEVALUE_LANDSCAPE_ALL","Landscape","BYTEVALUE_LANDSCAPE_LEFT","Portrait","upgrade","transaction","table","toArray","allFloorplansLegacy","bulkAdd","toCollection","floorPlanLegacyPrimaryKeys","bulkDelete","modify","ScreenOrientation_FIELD_BYTEVALUE","preInsertCleanup","dataIn","dataOut","floorplans","primaryFloorplan","tableOld","tableNew","items","v1","v2","v3","v4","v5","v6","versions","primaryKey","customProps","sourceObject","isEntity","mapToExternalProps","props","property","newValue","saveKey","localName","externalName","removeValueOnExport","customExport","_iterator2","mapToInternalProps","removeValueOnImport","customImport","customProperties","fromEntries","intProperties","mapping","newEntity","model","_site","site","_translations","floorPlanId","translation","floorplanTourId","_image","imageMediumId","_language","_style","_allSiteObjectsOnFloorplan","floorPlanTranslationId","matches","_siteObjectOnFloorplan","soFPs","image","allSiteObjectsOnFloorplan","siteObjectOnFloorplan","optional","_languages","_this$id","allSOTs","matchSOTs","languageIds","languages","_menuItem","menuItemId","menuItem","_imageLogo","logoMediumId","_screenOrientation","screenOrientationId","_languageSelectionStyle","languageSelectionStyleId","_tourSelectionStyle","tourSelectionStyleId","_siteSupportedLanguages","ssl","sslMatch","imageLogo","screenOrientation","languageSelectionStyle","tourSelectionStyle","siteSupportedLanguages","_type","siteObjectTypeId","_beacon","beaconId","_beaconSensitivity","beaconSensitivityId","_nextObject","nextObjectId","_relatedObject1","relatedObject1Id","_relatedObject2","relatedObject2Id","_relatedObject3","relatedObject3Id","_relatedObject4","relatedObject4Id","_relatedObject5","relatedObject5Id","_foregroundImageMedium","_backgroundImageMedium","_menuImageMedium","_translation","_relatedObjects","objects","beacon","beaconSensitivity","nextObject","relatedObject1","relatedObject2","relatedObject3","relatedObject4","relatedObject5","foregroundImageMedium","backgroundImageMedium","menuImageMedium","relatedObjects","sourceInput","siteObjectKeywords","keyword","keywords","isTag","_siteObject","_floorPlan","_pinType","pinTypeId","floorPlan","pinType","_medium","_parent","parentId","_backgroundMode","backgroundModeId","_primaryFontFamily","primaryFontFamilyId","_primaryFontStyle","primaryFontStyleId","_primaryFontSizeUnit","primaryFontSizeUnitId","_primaryFontAlignment","primaryFontAlignmentId","_secondaryFontFamily","secondaryFontFamilyId","_secondaryFontStyle","secondaryFontStyleId","_secondaryFontSizeUnit","secondaryFontSizeUnitId","_secondaryFontAlignment","secondaryFontAlignmentId","_tertiaryFontFamily","tertiaryFontFamilyId","_tertiaryFontStyle","tertiaryFontStyleId","_tertiaryFontSizeUnit","tertiaryFontSizeUnitId","_tertiaryFontAlignment","tertiaryFontAlignmentId","backgroundMode","primaryFontFamily","primaryFontStyle","primaryFontSizeUnit","primaryFontAlignment","secondaryFontFamily","secondaryFontStyle","secondaryFontSizeUnit","secondaryFontAlignment","tertiaryFontFamily","tertiaryFontStyle","tertiaryFontSizeUnit","tertiaryFontAlignment","_tourType","tourTypeId","_tourSubType","tourSubTypeId","_tourStatus","tourStatusId","_tourSupportedLanguages","matchTSL","matchTSLIds","tourSupportedLanguageId","allSSL","matchSSL","matchSSLIds","allTSL","siteSupportedLanguageId","tourTranslations","matchTranslation","_floorplans","thisId","allFloorPlanTours","matchFPTours","fpTour","matchFloorPlans","tourType","tourSubType","tourStatus","tourSupportedLanguages","_tour","_siteSupportedLanguage","siteSupportedLanguage","_tourSupportedLanguage","tourSupportedLanguage","InstantiateMap","transformerCreate","linkables","instantiate","className","allInterfaces","_isEntity","ContainerTable","_classCallCheck","_defineProperty","_table","_entityName","count","entityName","primaryItem","instantiator","pk","insItems","bulkAddOrUpdate","ContainerDB","modelInstantiator","migrators","database_","_db","sort","itemA","itemB","migrator","storesTask","upgradeTask","stores","_modelInstantiator","_migrators","_openCount","_migrator$preInsertCl2","tableName","tableConstructor","itemsData","itemData","databaseMigrator","openCount","dbOpen","_close","_isOpen","_newController","containerDB","recordName","existing","noCache","DB_TYPES","MODEL_TYPES","bindWorkspaceDB","unbindWorkspaceDB","injectModelInstantiator","migration","injectWorkspaceDB","dbInst","_isMedium","onProgressCallback","progressPerItem","entries","_step$value","progress","_removeMedia","mediaDelete","DEFAULT_MEDIUM_SIZE","_clamp","_isMediumDto","fileName","mediumSize","progressCb","fetchError","totalBytesToDownload","total","responses","progressUptoThisFetch","progressWeighting","progressCounterSoFar","fetchers","fetchErrors","progressNow","downloadMediaNoResponse","extendStatics","__","_hasOwnProperty","_objectKeys","keys_1","_deepClone","isInteger","charCode","escapePathComponent","unescapePathComponent","hasUndefined","i_1","objKeys","objKeysLength","patchErrorMessageFormatter","messageParts","PatchError","operation","tree","_newTarget","JsonPatchError","deepClone","objOps","newDocument","removed","move","getValueByPointer","originalValue","applyOperation","valueToCopy","test","_areEquals","_get","arrOps","splice","pointer","getOriginalDestination","validateOperation","mutateDocument","banPrototypeModifications","validator","returnValue","split","existingPathFragment","validateFunction","applyPatch","length_1","applyReducer","operationResult","pathLen","existingPathLen","validate","sequence","externalValidator","arrA","arrB","beforeDict","WeakMap","Mirror","observers","ObserverInfo","observer","unobserve","root","observe","mirror","getMirror","observerInfo","getObserverFromMirror","dirtyCheck","generate","fastCheck","clearTimeout","removeObserverFromMirror","invertible","_generate","temp","newKeys","oldKeys","deleted","oldVal","newVal","tree1","tree2","patchData","jsonpatch","TABLE_NAME","TABLE_MAPPINGS","_isPatchStorage","DB","addOrUpdate","save","storage","_addItems","patchPaths","progressPerPath","patchPath","ENTITY_MAPPING","LOOKUP_MAP","LOOKUP_MAP_BUILT","entityname","_buildMap","pathCompare","_isObject","_isArrayRecords","siteDataResponseToEntityMap","applicator","entityNameFromPatchPath","siteAPI","existingPatch","urlAPI","siteFetcher","newPatch","updateSite","tasks","updateSiteBinder","downloadBinder","deleteMedia","deleteBinder","bindJobs","unbindJobs","injectJobs","jobsInst","bindModelInstantiator","unbindModelInstantiator","modelInstBinder","DEFAULT_ISESSIONDATA","_instantiate","session","exists","captureState","isSessionData","_remove","sessionDB","_save","sessionSerialize","authInst","mediaInst","userInst","authArgs","nameIn","apiUsername","apiPassword","buildFromArgs","buildFromSessionData","memoryCache","sessionDelete","activeSession","activeRecords","active","setActive","sessionNew","subscribeActiveChanged","unsubscribeActiveChanged","callback_","_activeRecords$find","sessionCache","sessionObj","sessionBuilder","sessionData","cached","sessionCallback","bindAPISession","unbindAPISession","injectAPISession","sessionObject","sessionInst","restore","sessionIn","CACHE_SEARCH_PARAMS","ignoreMethod","ignoreSearch","ignoreVary","mediaRequestList","urlResolver","requestList","urlFetch","Request","cacheResponsesForRequests","cache","deleteMediaIdsFromCache","allRequests","flat","openCache","caches","_isCachedItem","cacheResolver","cacheUtil","mediaIdArgument","cacheResponses","missingCacheValues","some","isCached","isAllCached","mediaIdIArgument","put","_context6","responseList","cacheName","mediaIdResolver","cacheHandle","handle","cachedCacheResolver","_isCached","removeFromCache","_removeFromCache","addToCache","_addToCache","_cachedResponse","_isCachedMedium","cacheList","cc","_iterator3","cacheSource","addCacheResolver","removeCacheResolver","matchingControllers","cacheItem","_isCachedMedia","_cachedResponseMedium","bindMediaCacheController","unbindMediaCacheController","cacheImpl","bindablesPrivate","cacheInst","bindApi","bindDB","bindController","bindablesPublic","bindSession","bindModel","IUserProperties","IWorkspaceDBInstantiate","IJobs","IModelInstantiator","newArray","filterAsync","first","siteLookup","tours","tourLanguages","tsl","allSiteSupportedLanguages","allSiteSupportedLanguageIds","SiteSupportedLanguages","allLanguagesUsedInTours","invertResult","origPromise","sslMatchIds","tslMatch","tslMatchTourIds","ToursForLanguage","ISessionInstantiator","useActiveSession","sessionFetcher","useState","setSession","useEffect","_useActiveSessionUserStateValue","saveVal","setSaveVal","useActiveSessionLanguageId","useActiveSessionTourId","useActiveSessionLanguage","useActiveSessionTour","useSiteName","userSession","siteName","setSiteName","updateTranslation","EXTENSIONS_IMAGE","EXTENSIONS_VIDEO","EXTENSIONS_AUDIO","EXTENSIONS_ZIP","MIME_TYPES_ZIP","_fileExtension","isImage","isAudio","isVideo","isZip","IMediaCacheController","StyleElem","DEFAULTS","BackgroundOverlay","Container","TitleContainer","BodyContainer","ButtonContainer","ButtonAccept","ButtonDecline","ButtonPrivacyPolicy","PROPS_APPLICATOR","classNameForElement","element","styles","styleForElement","STYLE_HIDDEN","opacity","STYLE_VISIBLE","OverlayView","_jsx","initial","animate","exit","CookieView","useCallback","elem","_jsxs","role","children","headingText","bodyText","onClick","onDecline","declineText","onAccept","acceptText","privacyPolicyHref","privacyPolicyText","UserCookieStateValue","AnimatePresence","KEY_UserDownloadRequestState","UserCookieState","fallback","getItem","_GetKey","Unset","SetUserCookieState","setItem","_SetKey","TranslationKey","generateTranslatedText","manifest","translater","translate","originalText","COOKIE_HEADING_TEXT","COOKIE_BODY_TEXT","COOKIE_ACCEPT_TEXT","COOKIE_DECLINE_TEXT","COOKIE_PRIVACY_TEXT","env","getString","showDialog","setShowDialog","shouldTrack","setShouldTrack","hasInitializedPageTracker","setHasInitializedPageTracker","cookieState","Accepted","trackingId","ga4","goBack","goForward","IHistory","injectHistory","lastEvent","stack","_findPathPrefixIndex","locations","pathPrefix","update","PUSH","POP","REPLACE","previousLocation","findFirstPathPrefix","pathPrefixes","findPathPrefix","_addMultipleCallbackSupport","tracking","browserHistory","IRouter","routes","actionPopCount","popCount","canPop","actionPush","route","didLaunchAction","alternativeRouteSuggested","alternativeRoutePayload","registerRoute","unregisterRoute","popTo","routeTarget","curIdx","paths","pop","allRoutes","ROUTER_TYPES","HISTORY_TYPES","router","Router","buildHistory","buildRouter","buildA2HS","STORE_NAME","heading","fontFamily","fontSize","fontWeight","color","visible","subheading","appIconUrl","reset","updateHeadingText","newText","updateSubHeadingText","dataFromGlobalStore","globalStore","isDataStore","getStore","injectStoresData","useStore","useSelector","dispatchAction","injectStoresReducer","addSlice","initialize","AppIconView","alt","height","borderRadius","Heading","SubHeading","Footer","lineHeight","HeadingView","FooterView","IconAppleShare","paddingLeft","paddingRight","paddingBottom","InnerDiv","width","padding","textAlign","boxSizing","SubHeadingView","InstallBanner","IconCross","InstallBannerView","_buildLocalDependencies","_buildModule","deps","hasSetSiteName","renderer","useKVState","injectKVStorage","hasShown","setHasShown","canShow","browser","useBrowser","platform","IBrowserPlatform","isInstalled","useNeedsPopUp","MainView","APPSTATE_TYPES","bindA2HS","unbindA2HS","injectA2HS","binder","A2HS","IA2HS","IStoreMiddlewareType","IStoreMiddlewares","IStoresReducer","IStoresData","IStoresRenderer","injectStoresMiddleware","injectStoresRenderer","middlewares","interceptorMiddleware","middlewareAPI","chain","mw","verbose","middlewareLogger","middlewareEffect","middlewareInterceptor","interceptor","middlewareMap","Logger","SideEffect","injectENV","buildMiddlewares","_defaultReducer","initialReducers","subscribers","SliceAdded","ReducersChanged","combinedReducer","keysToRemove","getReducerMap","stateIn","newState","cb","event","register","Provider","reducerRegister","serializableCheck","replaceReducer","registry","bindMiddleware","bindReducer","bindStores","bindRender","BUILD_ENVIRONMENT","globalStorage","getContainerMap","setContainerMap","getBinderMap","setBinderMap","isBinder","expose","util","builderResult","srcContainer","dstContainer","existingModule","isBinderListings","bindersForSymbol","bindersForSymbols","allKeys","allBinders","listings","allListings","flatMap","listing","buildObjectContainer","parents","_map","_parents","valueMap","containerSearch","_this$_parents$find","_this$_parents$find2","importBindings","containerImport","unshift","_findBindable","_indexOfListing","itemSearch","_resolve","dependencyKey","buildBinderRegistry","parentContainers","publicListings","privateListings","binderRegistry","addListing","hidden","removeListing","addListings","removeListings","addBindable","removeBindable","resolvers","resolveAll","injectContainer","containers","utils","bindContainer","AlertContainer","AlertTitle","AlertOptionYes","AlertOptionNo","show","pointerEvents","title","textAccept","textDecline","onClickYes","preventDefault","onClickNo","Button","Icon","Text","MapBackgroundColor","inIcon","IToastIcon","Warning","Success","Information","MapTextColor","backgroundColor","icon","overrides","useHighlightRestore","opacityRestore","isHighlighted","setIsHighlighted","opacityDim","setHighlighted","setDefault","HighlightableLink","_props$style2","highlightCallbacks","highlightable","onTouchStart","onTouchEnd","onTouchCancel","onMouseDown","onMouseUp","onMouseLeave","hideOnAccessibilityTree","ref","variants","isLink","Link","passHref","scroll","prefetch","withNextLink","_props$style","HighlightableButton","StyleElement","Checkbox","Label","classLoad","returnClassName","properties","isOn","elements","querySelectorAll","onChange","onCheck","STORAGE_KEY","DEFAULT_SCROLL_POSITION","top","left","_isScrollPosition","round","position","Component","WithScrollRestore","_inherits","didSetInitialPosition","refComponent","createRef","positionSetTimeout","didScroll","scrollStorage","_createClass","stateNew","setState","updateState","reference","triggerUpdate","onScroll","_awaitUserScroll","scrollTop","scrollLeft","nextProperties","nextState","isEqual","ReactComponent","EVENT_ONLINE","EVENT_OFFLINE","_window","globalThis","_isOnline","navigator","onLine","isOnline","setIsOnline","newStatus","globalWindow","_subscribeOnlineStatusChange","_unsubscribeOnlineStatusChange","innerWidth","innerHeight","windowSize","setWindowSize","updateWindowSize","focusable","xmlns","viewBox","points","strokeLinecap","strokeLinejoin","strokeWidth","stroke","cx","cy","useIsOnline","setShow","_props$fallback2","IDimOverlayState","RUNTIME","Dimmed","Hidden","isDim","zIndex","animationVariantsForElement","transition","duration","animationStateForElement","LazyMotion","strict","features","domAnimation","_props$onClick","ImageLoadingStrategy","DEFAULT","Picture","Image","objectFit","mode","DEFAULT_LOADING_STRATEGY","LOADING_STRATEGY","_hideElementOnError","_showElementOnLoad","fallbackImageAsset","sourceElementUrls","onLoad","onLoaded","srcSet","sourceElement","decoding","loading","__assign","__spreadArray","pack","ar","roundNumber","decimal","toFixed","handleCallback","context","animations","easeOut","cos","PI","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","handleCancelAnimationFrame","animation","cancelAnimationFrame","handleCancelAnimation","contextInstance","mounted","velocity","handleSetupAnimation","animationName","animationTime","startTime","frameTime","step","animationType","requestAnimationFrame","targetState","isValid","positionX","positionY","scale","isValidTargetState","transformState","scaleDiff","positionXDiff","positionYDiff","setTransformState","calculateBounds","newScale","contentComponent","setup","centerZoomedOut","wrapperComponent","wrapperWidth","offsetWidth","wrapperHeight","offsetHeight","newContentWidth","newContentHeight","newDiffWidth","newDiffHeight","getComponentsSizes","bounds","diffWidth","diffHeight","scaleWidthFactor","scaleHeightFactor","minPositionX","maxPositionX","minPositionY","maxPositionY","getBounds","handleCalculateBounds","getMouseBoundedPosition","limitToBounds","paddingValueX","paddingValueY","paddingX","paddingY","boundLimiter","minBound","maxBound","isActive","handleCalculateZoomPositions","mouseX","mouseY","scaleDifference","checkZoomBounds","zoom","minScale","maxScale","zoomPadding","enablePadding","minScaleWithPadding","isPanningStartAllowed","panning","excluded","isWrapperChild","contains","isInitialized","isExcludedNode","isPanningAllowed","isPanning","disabled","getPaddingValue","getVelocityPosition","newPosition","startPosition","currentPosition","isLocked","minPosition","maxPosition","minTarget","maxTarget","calculatedPosition","handleCalculateVelocity","isAllowed","velocityAnimation","isVelocityCalculationAllowed","velocityTime","equalToMove","now","lastMousePosition","sizeMultiplier","getSizeMultiplier","distanceX","distanceY","velocityX","velocityY","interval","speed","sqrt","handlePanningStart","touches","clientX","clientY","startCoords","handleTouchPanningSetup","handlePanningSetup","handlePanning","alignmentAnimation","sizeX","sizeY","lockAxisY","lockAxisX","getPanningClientPosition","newPositionX","newPositionY","handleNewPosition","handlePanningEnd","velocityDisabled","wrapperRect","getBoundingClientRect","contentRect","contentWidth","contentHeight","isZoomed","isVelocityAllowed","zoomAnimation","alignAnimationTime","moveAnimationTime","sensitivity","getVelocityMoveTime","finalAnimationTime","maxTargetX","minTargetX","maxTargetY","minTargetY","startState","animationProgress","alignStep","alignAnimation","customStep","currentPositionX","currentPositionY","handleVelocityPanning","handleAlignToBounds","xChanged","yChanged","handlePanToBounds","handleAlignToScaleBounds","mousePositionX","mousePositionY","isDisabled","handleZoomToPoint","previousScale","contextInitialState","setComponents","initialSetup","centerOnInit","wheel","wheelDisabled","touchPadDisabled","activationKeys","pinch","doubleClick","velocityAlignmentTime","createState","initialScale","_a","_b","initialPositionX","initialPositionY","createSetup","newSetup","validValue","dataType","isObject","handleCalculateButtonZoom","targetScale","exp","handleZoomToViewCenter","resetTransformations","initialTransformation","newBounds","boundedPositions","zoomIn","zoomOut","setTransform","resetTransform","centerView","getCenterPosition","zoomToElement","node","getElementById","isValidZoomNode","customZoom","nodeRect","el","offsetLeft","offsetTop","offsetParent","getOffset","nodeLeft","nodeTop","nodeWidth","nodeHeight","scaleX","scaleY","offsetX","offsetY","calculateZoomToNode","getContext","instance","makePassiveEventOption","passive","targetTagName","tagName","toUpperCase","tag","classList","cancelTimeout","getTransformStyles","isWheelAllowed","ctrlKey","getMousePosition","touch","isPinchStartAllowed","isPinchAllowed","pinchStartDistance","getTouchDistance","pageX","pageY","handleWheelStart","onWheelStart","onZoomStart","wheelStopEventTimer","handleWheelZoom","onWheel","onZoom","stopPropagation","customDelta","deltaY","getDelta","disablePadding","getTarget","paddingEnabled","handleCalculateWheelZoom","mousePosition","isLimitedToBounds","previousWheelEvent","handleWheelStop","onWheelStop","onZoomStop","wheelAnimationTimer","hasStoppedZooming","sign","handleWheelZoomStop","handlePinchStart","distance","lastDistance","pinchStartScale","handlePinchZoom","midPoint","firstPointX","firstPointY","calculateTouchMidPoint","currentDistance","calculatePinchZoom","pinchMidpoint","handlePinchStop","handleDoubleClick","isDoubleClickAllowed","Context","React","wrapper","onWheelZoom","onDoubleClick","onTouchPanningStart","onTouchPanning","onTouchPanningStop","applyTransformation","forceUpdate","setCenter","isPressingKeys","onPanningStart","onPanning","onPanningStop","onPinchingStart","onPinching","onPinchingStop","lastTouch","isPanningAction","isPinchAction","onPinchStart","onPinch","onPinchStop","pressedKeys","handleInitializeWrapperEvents","handleInitialize","handleRef","onInit","transform","setRef","TransformContext","clearPanning","setKeyUnPressed","setKeyPressed","oldProps","content","TransformWrapper","innerRef","useImperativeHandle","css","insertAt","head","getElementsByTagName","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TransformComponent","wrapperClass","contentClass","wrapperStyle","contentStyle","useContext","wrapperRef","useRef","contentRef","_className","forwardRef","isValidReference","referenceCast","isInternalReference","startZoom","startX","startY","minZoom","maxZoom","Div","SVG","PROPSSTATE_APPLICATOR","borderColor","strokeColor","borderWidth","strokeSize","arrowColor","IconView","IconChevronLeft","onHighlight","stateOld","onRestore","nativeEvent","stopImmediatePropagation","DEFAULT_BUTTON_SIZE","totalPages","ButtonArrowLeft","ButtonArrowRight","ButtonDot","marginLeft","marginRight","IconArrowLeft","IconArrowRight","IconDot","activeIndex","display","dotSize","dotSpacing","tintColor","pageCountIterator","showArrowButtons","onLeftClick","onIndexClick","_props$onIndexClick","onRightClick","IconChevronRight","isSuspenseSupported","_isSuspenseSupported","DEFAULT_DOMAIN","globalKey","storageObject","_buildGlobalStorage","domain","SPINNER_WIDTH","Spinner","borderBottom","spinnerColor","bufferingText","_props$bufferingText","_props$bufferingText2","_props$bufferingText3","_props$bufferingText4","_props$bufferingText5","_BufferingText","bufferingCounter","setBufferingCounter","styleOverrides","SegmentItem1","SegmentItem2","SegmentItem3","SegmentItem4","SegmentItem5","SegmentItem6","SegmentItem7","SegmentItem8","SegmentItem9","SegmentItem10","SegmentItem11","SegmentItem12","SegmentContainer1","SegmentContainer2","SegmentContainer3","SegmentContainer4","SegmentContainer5","SegmentContainer6","SegmentContainer7","SegmentContainer8","SegmentContainer9","SegmentContainer10","SegmentContainer11","SegmentContainer12","_ITEM_APPLICATOR","_NOOP_APPLICATOR","isAnimating","DEFAULT_PROPS","DEFAULT_STYLES","Bar","progressToText","barColor","textColor","progressDescription","TRANSITION","ease","MINOPACITY","MAXOPACITY","byteSizeToDescription","byteSize","sizeDivisor","decimalPlaces","unit","sizeValue","moduleLoader","lazy","setModuleLoader","loader","factory","_isPositionStorage","scrollX","scrollY","_readFromStorage","_saveToStorage","_deleteFromStorage","removeItem","rowViewRef","saveCurrentScrollPosition","_rowViewRef$current","_rowViewRef$current2","restoreScrollPosition","scrollTo","behavior","clearScrollPosition","progressBar","progressVisible","updateSession","updateLanguageId","updateTourId","hideProgressBar","showProgressBar","setProgress","dispatcher","Store","DEFAULTS_MESSAGE","removeOnHide","defaults","dialog","hide","isShowing","updateText","updateCallbacks","DEFAULT_PARAMS","DELETE_COMPLETE","DELETE_FAILURE","DELETE_POPUP_DESCRIPTION","DELETE_POPUP_ACCEPT","DELETE_POPUP_DECLINE","Message","translator","activeLanguage","languageChangeCallbacks","translationChangeCallbacks","defaultParams","updateLanguage","languageCode","subscribeLanguageChanged","unsubscribeLanguageChanged","updateDefaultParams","subscribeTranslationChanged","unsubscribeTranslationChanged","MessageTranslationKey","DeletionCompleted","DeletionFailed_UnexpectedError","KEY_PREFIX","DEFAULT_MESSAGE","_isShowingToast","toast","_hideToast","isAnyShowing","_showToast","hideAll","_hideViews","_showProgress","deletionList","jobs","newBarProgress","subscribeOnLanguageChange","_subscribeOnLanguageChange","subscribeOnTourChange","_subscribeOnTourChange","subscribeOnSessionChange","_subscribeOnSessionChange","_session","_active","STYLING_DEFAULT","right","transitionDuration","PROPS_DEFAULT","ProgressBar","_updateDeleteText","sites","urlsForMedium","IMediaType","downloadUrls","urlContentLength","requiredSizes","requiredSize","previous","sizeDesc","_sites$at","translationStorage","injectTranslationStorage","serviceWorkerController","injectServiceWorkerController","toastModule","injectToast","sessionModule","toaster","dialogue","serviceWorker","injectDialog","isShowable","IDeleteState","dataResolver","_initializeState","_addEffects","updateTranslations","buildDefaultResolver","localDependencies","DELETETOUR_TYPES","DIALOG_TYPES","TOAST_TYPES","WORKER_TYPES","bindDeleteTour","unbindDeleteTour","injectDeleteTour","setBuildDependencies","IDeleteTour","MESSAGE_DEFAULTS","constructMessage","_indexesInStore","_updateStore","newData","stateReturn","matchingIndexes","showPopUp","hidePopUp","removePopUp","updatePopUp","isDialogMessage","_item$options","_item$options2","messages","_createElement","PopUpView","alert","AlertView","_defaultAction","newItem","bindDialog","unbindDialog","IDialog","currentSize","storageQuota","estimate","quota","usage","freeSpace","DOWNLOAD_COMPLETE","DOWNLOAD_FAILED_OFFLINE","DOWNLOAD_FAILED","DOWNLOAD_FAILED_NOT_ENOUGH_SPACE","DOWNLOAD_POPUP_DESCRIPTION","DOWNLOAD_POPUP_ACCEPT","DOWNLOAD_POPUP_DECLINE","DownloadCompleted","DownloadFailed_Offline","DownloadFailed_UnexpectedError","DownloadFailed_NotEnoughSpace","MAX_SAFE_INTEGER","availableSpace","downloadURLs","downloadRequests","_deps$serviceWorker$a","addRequestsToCache","_updateDownloadSizeText","_sites$at2","dialogModule","IDownloadState","DOWNLOADLANGUAGE_TYPES","bindDownloadLanguage","unbindDownloadLanguage","injectDownloadLanguage","IDownloadLanguage","allDownloadList","isCachedStatus","missingDownloadList","downloadSize","allUrls","workerController","worker","IServiceWorkerStatus","DOWNLOADTOUR_TYPES","bindDownloadTour","unbindDownloadTour","injectDownloadTour","IDownloadTour","MarkerContainer","STYLING","cursor","marginTop","handleClick","useOnClick","isVisible","IconMapMarker","SIZE_ZERO","_markerStylePositionX","_markerStylePositionY","ItemView","imageSize","imageUrls","setImageSize","picture","srcset","append","sizeNew","useImageSize","triggerRender","setValue","useForceUpdate","hasLoadedImage","imageScale","imageRef","_properties$imageRef$2","markerStyle","ZoomView","memo","ZoomPanPinch","WSImage","markers","MarkerView","ItemContainer","Item","PageControl","ButtonPlus","ButtonMinus","IconPlus","IconMinus","zoomControlsBackgroundColor","zoomControlsTintColor","_referencesFromItems","itemsIn","pageIndex","setPageIndex","itemReferences","references","setReferences","useItemReferences","ItemViews","itemReference","_item$imageUrls$at","FadeTransition","BackLink","backButton","_history$previousLoca2","onBack","_itemReferences$pageI","_itemReferences$pageI2","_itemReferences$pageI3","_itemReferences$pageI4","MainViewList","ILanguageSelectType","SuspenseWrapper","TOAST_MESSAGE","_toaster","_toaster4","_toaster2","_toaster3","subscribeOnlineStatusChange","unsubscribeOnlineStatusChange","OFFLINE_DESCRIPTION","IsOffline","messageDetails","shouldShow","events","bindOfflineAlert","unbindOfflineAlert","injectOfflineAlert","IOfflineAlert","MainViewAudio","MainViewVideo","MainViewHTML","MainViewRubaway","MainViewBrowse","AudioView","VideoView","HTMLView","RubawayView","BrowseView","ISiteObjectType","updateMessage","displayMessage","hideMessage","isToastMessage","ToastBackgroundColor","ToastTextColor","MAP_TOAST_TYPE_ICON","success","ANIMATION_STATES","IconExclamation","IconTick","IconQuestionMark","IconInfo","VARIANTS","SIZE_CONTAINERHEIGHT_VH","enter","STYLE_CONTAINER","STYLE_VIEW","ToastView","AllMessagesView","actionMessage","messageIn","allMessages","bindToast","unbindToast","IToast","MainViewHamburger","MainViewKeypad","IndexView","ITourType","ITourSelectType","MainViewGrid","Renderer","List","GridTile","GridFeatured","LOG_LEVEL","injectBrowser","bindBrowser","unbindBrowser","injectCache","bindCache","unbindCache","injectCacheController","bindCacheController","unbindCacheController","IConfigLogLevel","IConfigLogDestination","injectConfigLog","bindConfigLog","unbindConfigLog","bindConfigAPI","unbindConfigAPI","injectConfigManifest","bindConfigManifest","unbindConfigManifest","injectConfigCache","bindConfigCache","unbindConfigCache","bindENV","unbindENV","IFeatureStatus","IFeatureType","injectFeatureQuery","bindFeatureQuery","unbindFeatureQuery","bindFetch","unbindFetch","KEY_ALL_MODELOVERRIDES","getProjectOverrides","allOverrides","getValueWithDefault","overrideMapper","bindKVStorage","unbindKVStorage","bindLog","unbindLog","injectMimeType","bindMimeType","unbindMimeType","bindProgressPromise","unbindProgressPromise","bindQueryURL","unbindQueryURL","bindTranslationStorage","unbindTranslationStorage","bindZip","unbindZip","USER_AGENTS_IOS","_navigator","_document","_platform","nav","userAgent","exec","isMac","_isMobile","_isInstalled","valueOf","referrer","win","matchMedia","bcp47","_BCP47ToISO6391","userLanguage","isMobile","associatedObject","isExtensible","searchObject","keySearch","Cache","_isCache","globalCacheObj","getAssociatedCache","getGlobalCache","BOOLEAN_PHRASES_ENABLED","BOOLEAN_PHRASES_DISABLED","VALUE_PARSERS","number","bigint","BigInt","boolean","stringValue","symbol","function","_queryStorage","environmentStorage","environmentName","_getValue","mergedValues","getValue","parserType","parser","_getValueWithDefault","getNumber","_getNumber","getBoolean","readValue","_getBoolean","_getString","allValues","PROMISE_SUPPORTED","PROMISE_UNSUPPORTED","MAP_FEATURE","featureString","_canPlayMediaType","mediaType","canPlayType","MAP_DUMMY_BASE64_DATA","_canDisplayImageType","imageMimeType","encodedData","MAP_MIMETYPE_DEFAULTS","_reduceFeatureStatuses","statuses","_defaultQuery","CACHED_RESULTS_MIMETYPE","CACHED_RESULTS_FEATURE","mimeTypes","textResolver","imageResolver","avResolver","_MAP_MIMETYPE_DEFAULT","feature","_step2$value","mediaSupported","featuresSupported","featureQuery","requestPayload","databaseName","storeName","databaseVersion","withDatabase","openRequest","indexedDB","_openRequest$error","onupgradeneeded","createObjectStore","onsuccess","withStore","oncomplete","objectStore","_request$error","_request$error2","_request$error3","_request$error4","_request$error5","kvStorage","_isLogLevelEnabled","logLevel","loggingLevelsEnabled","LOGGER_RESOLVERS","logLevels","localConfig","outputConfiguration","outputDestinations","loggers","newLoggers","logAll","logMessage","currentMessage","milestone","warning","fatal","assertAll","addMiddleware","removeMiddleware","MIME_MAP","mimeTypeToFileExtension","mime","fileExtensionToMimeType","filePathInput","fileExtensionSearch","isMimeType","_classExtractFieldDescriptor","receiver","privateMap","_classPrivateFieldSet","classApplyDescriptorSet","classExtractFieldDescriptor","escapeStringRegexp","extractPathRegex","pathRegex","homeDir","os","AggregateError","pretty","basePath","basePathRegex","RegExp","line","pathMatches","p1","cleanStack","indent","includeEmptyLines","regex","repeat","indentString","super","classApplyDescriptorGet","pMapSkip","pTimes","mapper","iterable","concurrency","POSITIVE_INFINITY","stopOnError","reject_","asyncIterator","isSafeInteger","skippedIndexesMap","isRejected","isResolved","isIterableDone","resolvingCount","currentIndex","nextItem","done","pureResult","pMap","sum","PProgress","pProgress","every","progressMap","reportProgress","nextValue","percentage","executor","_progress","_listeners","_setProgress","onFulfilled","onRejected","child","input","_async","retry","_retry","delayBetweenRetries","promiseUtil","queryString","keyIn","valueIn","decodeURIComponent","queryArgs","questionMarkPrefix","strPairs","encodedStr","encodeURIComponent","queryURL","BINDER_LOADERS","browserBind","cacheBind","cachecontrollerBind","envBind","featureQueryBind","fetchBind","kvStorageBind","logBind","mimeTypeBind","promiseBind","querystringBind","translationstorageBind","zipBind","arrayBufferToString","TextDecoder","decode","stringToArrayBuffer","string_","TextEncoder","encode","bufferToArrayBuffer","bufferView","arrayBufferToBuffer","isArrayBuffer","_bufferLike","bufferLike","_isBufferLike","useInjector","useKVStorage","useTranslationStorage","kvFetch","kv","getVal","setVal","updateVal","partial","sPrev","_createKeyFromArray","argList","stringList","arrayItem","memoize","argsSerializer","presetValues","argsValue","keyArg1","keyArg2","keyArg3","keyArg4","keyArg5","serializedKey","memoFn","arg3","arg4","arg5","cacheKey","cachedResult","memoizeAsync","memoAsyncFn","editNestedKeyValue","objectSearch","valueReplace","objectCast","keyObj","valueObj","replaceLeading","removal","replacement","sequenceRepeats","regexPattern","reg","replaceTrailing","trimLeading","trimTrailing","removeLeading","removeTrailing","addLeading","character","addTrailing","endsWith","removeDoubleSlashes","replaceAll","ensureStartingSlash","removeTrailingSlash","_NoOp","UrlDefaults","requireLeadingSlash","operators","allOperators","sanitizePath","currentValue","clamp","errorResult","promiseError","ms","anyInOrder","SymbolNames","IBrowser","ICache","ICacheController","IConfigLog","IConfigAPI","IConfigManifest","IConfigCache","IEnv","IFeatureQuery","IFetch","IKVStorage","ILog","IMimeType","IProgressPromiseGenerator","IQueryURL","ITranslationStorage","IZip","IMessageInstantiator","injectMessageInstantiator","IServiceWorkerController","addCacheFirst","maxAge","maxEntries","cacheQueryOptions","fetchOptions","construct","regexParser","postMessage","addOAuthTokenCache","pathSuffix","addZipPathFetchResponder","zipPath","relativeRespondPath","addHeader","headerKey","headerVal","expiration","fetchToCache","port","callbackChannel","keepAlive","isLocalHost","hostName","hostname","_fetchServiceWorker","swUrl","fetch","_checkValidServiceWorker","didFindFile","isJavascriptFile","_response$headers$get2","_canRegister","canRegister","host","_yield$_checkValidSer","_registerWorker","_addRegistrationCallbacks","registration","_processState","onInstall","onReady","onupdatefound","newWorker","installing","onstatechange","waiting","startRegistration","onRegister","ready","unregister","reload","readyState","stop","_isConfigToken","tokenPath","_isConfigAsset","_assetConfigs","bridge","_tokenConfigs","_requestInNamedCache","hasCachedValue","_notifyCallbacksOfStatusChange","statusChangeCallbacks","isInterceptingNetworkRequests","hasInstalledRules","_installRules","rules","checkControllerStatus","subscribeStatusChange","statusChangeCallback","swCallback","unsubscribeStatusChange","_installWorker","headerValue","isRequestCached","cacheNames","requestCheck","anyCacheHits","wrappedPromise","channelID","_requests","channel","channelController","subKey","fetchDeps","keepAliveTimer","setInterval","cleanup","clearInterval","processMessage","IChannelStatus","_downloadRequests","wakeLock","release","lock","newProgress","activeWorker","terminate","MESSAGE_TYPES","injectRegexSerializer","injectChannelController","MESSAGE_TYPE","isMatch","_record$payload","_record$payload2","_record$payload3","_record$payload4","AddCacheFirst","cacheFirstResponder","AddHeader","headerAppendResponder","AddOAuthTokenCache","oAuthTokenResponder","AddPreCache","preCacheResponder","AddZipPathRelativeResponder","AddKeepAliveMessageResponder","keepAliveResponder","LogDiagnostics","logDiagnosticsResponder","FetchToCache","fetchToCacheResponder","_isInCache","insert","bindCacheStorage","unbindCacheStorage","injectCacheStorage","cacheStorage","injectCallbackBuilder","existingRecords","eventListeners","callbackRegistry","callbackBuilder","PROMISE_RESOLVED_TRUE","PROMISE_RESOLVED_VOID","sleep","time","resolveWith","randomToken","substring","lastMs","additional","microSeconds","isNode","channelName","messagesCallback","bc","BroadcastChannel","subFns","onmessage","channelState","onMessage","messageJson","canBeUsed","_pubkey","averageResponseTime","micro","ttl","ObliviousSet","_to","obliviousSet","olderThen","removeTooOldValues","fillOptionsWithDefaults","originalOptions","webWorkerSupport","fallbackInterval","onclose","localstorage","removeTimeout","methods","maxParallelWrites","useFastPath","OBJECT_STORE_ID","TRANSACTION_SETTINGS","durability","getIdb","mozIndexedDB","webkitIndexedDB","msIndexedDB","commitIndexedDBTransaction","tx","commit","getMessagesHigherThan","lastCursorId","keyRangeValue","IDBKeyRange","bound","getAll","getAllRequest","rej","onerror","openCursorRequest","openCursor","ev","cleanOldMessages","msgObk","getOldMessages","tooOld","deleteRequest","removeMessagesById","_readLoop","closed","readNewMessages","newerMessages","useMessages","msgObj","uuid","eMIs","messagesCallbackTime","_filterMessage","msgObjA","msgObjB","dbName","keyPath","autoIncrement","createDatabase","writeBlockPromise","readQueuePromises","readerUuid","writeObject","writeMessage","getLocalStorage","localStorage","storageKey","ls","addStorageEventListener","writeObj","createEvent","initEvent","dispatchEvent","defaultTime","SIMULATE_CHANNELS","METHODS","NativeMethod","IndexeDbMethod","LocalstorageMethod","ENFORCED_OPTIONS","OPEN_BROADCAST_CHANNELS","lastId","chooseMethods","SimulateMethod","useMethod","chooseMethod","_iL","_onML","_addEL","internal","_uMP","_befC","_prepP","maybePromise","_state","_prepareChannel","_post","broadcastChannel","sendPromise","_hasMessageListeners","_addListenerObject","listenerFn","listenerObject","hundredMsInMicro","minMessageTime","_startListening","_removeListenerObject","o","_stopListening","postInternal","listenObj","awaitPrepare","isClosed","WorkerGlobalScope","USE_METHOD","NodeMethod","BrowserMethod","LISTENERS","startedListening","runAll","run","LeaderElection","isLeader","hasLeader","isDead","_aplQ","_aplQC","_unl","_lstns","_dpL","_dpLC","hasLeaderListener","_sendMessage","leaderElector","msgJson","applyOnce","isFromFallbackInterval","applyRun","stopCriteriaPromiseResolve","stopCriteria","stopCriteriaPromise","recieved","handleMessage","waitForAnswerTime","responseTime","unloadFn","unloadAdd","isLeaderListener","beLeader","awaitLeadership","_aLP","resolved","finish","whenDeathListener","tryOnFallBack","_awaitLeadershipOnce","onduplicate","_this3","uFn","handler","createChannel","bindChannelController","unbindChannelController","_responseWithProgressCallbacks","contentLength","stream","ReadableStream","reader","getReader","readerIndex","lastProgress","_yield$reader$read$ca","progressDelta","enqueue","Response","fetchWithProgress","timeoutId","hasProgressSupport","isCorsRequest","responseReturn","bindFetchHelper","unbindFetchHelper","injectFetchHelper","logMap","MILESTONE","TRACE","debug","VERBOSE","INFO","WARN","ERROR","FATAL","ASSERT","_consoleLog","levels","fireBoolean","fireNumber","fireString","level","ENV_IS_DEVELOPMENT","LOG_LEVEL_DEV","LOG_LEVEL_PROD","consoleLoggerInstantiator","_buildLoggers","isLogLevelEnabled","logNoop","encodeURI","pattern","flags","ignoreCase","multiline","lastIndex","_serialize","decodeURI","_isRegexSerialized","regExp","bindRegexSerializer","unbindRegexSerializer","_serializeHeaders","serialized","serializeRequest","credentials","redirect","referrerPolicy","isHistoryNavigation","isReloadNavigation","integrity","destination","clone","deserializeRequest","requestIn","Headers","bindRequestSerializer","unbindRequestSerializer","injectRequestSerializer","requestJSON","serializeResponse","statusText","deserializeResponse","bindResponseSerializer","unbindResponseSerializer","injectResponseSerializer","responseJSON","bindSettingsStorage","unbindSettingsStorage","injectSettingsStorage","_zipFile","sourceData","unzip","_isArrayBuffer","_unzipEntry","zipFile","matchedEntries","_extractEntry","extractedFiles","blobData","zipEntry","lastModifiedDate","lastModDate","_unzipFile","unzipAll","_unzipAll","fileInfo","_fileInfo","callbackBind","channelBind","fetchHelperBind","loggerBind","regexJSONBind","requestJSONBind","responseJSONBind","bindClient","bindUtil","bindMessage","ICacheStorage","IChannelController","ICallbackBuilder","IFetchHelper","ISettingsStorage","IRegexSerializer","IRequestSerializer","IResponseSerializer","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","marker","runClearTimeout","nextTick","argv","on","off","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","umask","hasElementType","hasArrayBuffer","equal","it","titleCase","redactingEmail","_str","toTitleCase","redactEmail","smallWords","GA4","_gtag","_interopRequireDefault","_format","_excluded","_excluded2","_excluded3","__esModule","_objectWithoutProperties","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_arrayLikeToArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","symbols","sym","_objectSpread","defineProperties","_slicedToArray","_arrayWithHoles","_s","_x","_r","_n","_iterableToArrayLimit","_nonIterableRest","minLen","arr2","_defineProperties","_toPropertyKey","hint","prim","toPrimitive","_toPrimitive","Constructor","_testMode","_currentMeasurementId","_hasLoadedGA","_isQueuing","_queueGtag","_len","_key","GA_MEASUREMENT_ID","nonce","gtagUrl","script","setAttribute","dataLayer","gtag","gaOptions","mapFields","cookieUpdate","cookieExpires","cookieDomain","cookieFlags","userId","anonymizeIp","contentGroup1","contentGroup2","contentGroup3","contentGroup4","contentGroup5","allowAdFeatures","allowAdPersonalizationSignals","nonInteraction","page","hitCallback","prev","_ref2","initConfigs","gtagOptions","_options$testMode","testMode","_loadGA","mergedGtagOptions","_toGtagOptions","queues","shift","fieldsObject","_gaCommand","eventCategory","eventAction","eventLabel","eventValue","event_category","event_label","non_interaction","_len2","_key2","_gaCommandSendEvent","_args$","rest","hitType","timingCategory","timingVar","timingValue","timingLabel","_this$_toGtagOptions","page_path","page_title","page_location","_len3","_key3","_gaCommandSendPageview","_args$2","_len4","_key4","_gaCommandSendEventParameters","_gaCommandSendPageviewParameters","_gaCommandSendTiming","_len5","_key5","command","_len6","_key6","_gaCommandSend","_gaCommandSet","_len7","_key7","readyCallback","ga","optionsOrName","category","label","transport","fieldObject","protoProps","staticProps","_default","_ga","nodeInterop","_getRequireWildcardCache","newObj","hasPropertyDescriptor","_interopRequireWildcard","cacheBabelInterop","cacheNodeInterop","ReactReduxContext","batch","getBatch","nullListeners","notify","createSubscription","parentSub","handleChangeWrapper","subscription","onStateChange","trySubscribe","addNestedSub","last","isSubscribed","createListenerCollection","notifyNestedSubs","tryUnsubscribe","getListeners","useIsomorphicLayoutEffect","useLayoutEffect","contextValue","useMemo","useReduxContext","refEquality","createSelectorHook","useDefaultReduxContext","selector","equalityFn","_useReduxContext","selectedState","contextSub","forceRender","useReducer","latestSubscriptionCallbackError","latestSelector","latestStoreState","latestSelectedState","storeState","newSelectedState","checkForUpdates","newStoreState","_newSelectedState","useSelectorWithStoreAndSubscription","useDebugValue","newBatch","_objectSpread2","formatProdErrorMessage","$$observable","observable","randomString","ActionTypes","INIT","PROBE_UNKNOWN_ACTION","enhancer","currentReducer","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","nextReducer","outerSubscribe","observeState","reducerKeys","finalReducers","shapeAssertionError","finalReducerKeys","assertReducerShape","hasChanged","previousStateForKey","nextStateForKey","funcs","_dispatch","__rest","__values","__read","readBlobAsArrayBuffer","FileReader","readAsArrayBuffer","readBlobAsUint8Array","isBlob","isSharedArrayBuffer","SharedArrayBuffer","electron","ArrayBufferReader","arrayBufferOrView","typedArray","BlobReader","_check","bl","nbuf","_decodeTiny","lmap","LL","bitsE","_bitsE","get17","_get17","lit","ll","ni","_copyOut","mx","tl","makeCodes","MAX_BITS","bits","max_code","bl_count","U","next_code","codes2map","r15","rev15","cl","i0","i1","revCodes","imb","dt","_bitsF","u16","Uint16Array","u32","Uint32Array","ordr","of0","exb","ldef","df0","dxb","ddef","flmap","fltree","fdmap","fdtree","ltree","ttree","dmap","dtree","imap","itree","lhst","dhst","ihst","lits","strt","pushV","tgt","sv","crc","tab","inflateRaw","file","u8","bitsF","decodeTiny","noBuf","BFINAL","BTYPE","HLIT","HDIST","HCLEN","ML","MD","mx0","mx1","ebs","dcode","dlit","dbs","p8","inflate","numWorkers","workerURL","useWorkers","nextId","canUseWorkers","workers","availableWorkers","waitingForWorkerQueue","currentlyProcessingIdToRequestMap","handleResult","makeWorkerAvailable","startWorker","Worker","workerHelper","ok","btoa","processWaitingForWorkerQueue","inflateRawLocal","uncompressedSize","createWorker","getAvailableWorker","transferables","inflateRawAsync","ZipEntry","rawEntry","date","_reader","_rawEntry","nameBytes","compressedSize","comment","commentBytes","compressionMethod","lastModFileDate","lastModFileTime","isDirectory","encrypted","generalPurposeBitFlag","externalFileAttributes","versionMadeBy","decompress","fileDataStart","readEntryDataHeader","typedArrayOrBlob","readAsBlobOrTypedArray","readEntryDataAsBlob","dataView","readAs","readEntryDataAsArrayBuffer","decodeBuffer","sliceAsBlob","crc$1","unsigned","getUint16LE","uint8View","getUint32LE","getUint64LE","utf8Decoder","isUTF8","readZip64CentralDirectory","zip64EocdlOffset","eocdl","zip64EocdrOffset","zip64Eocdr","entryCount","centralDirectorySize","readEntries","centralDirectoryOffset","rawEntryCount","readEntryCursor","allEntriesBuffer","rawEntries","signature","versionNeededToExtract","crc32","fileNameLength","extraFieldLength","fileCommentLength","internalFileAttributes","relativeOffsetOfLocalHeader","fileCommentStart","extraFieldBuffer","extraFields","headerId","dataStart","dataEnd","zip64ExtraField","zip64EiefBuffer","nameField","expectedCompressedSize","totalLength","getLength","localFileHeaderEnd","fileDataEnd","unzipRaw","EOCDR_WITHOUT_COMMENT_SIZE","readStart","eocdr","diskNumber","commentLength","expectedCommentLength","findEndOfCentralDirector","buildToast","buildDialog","buildDownloadTour","buildDeleteTour","buildDownloadLanguage","buildOfflineToast","BackgroundImage","LoadingIcon","ImageIcon","TextStatus","TextDetail","detail","onResolved","views","setViews","startNextJob","currentViews","requestIdleCallback","View","MotionConfig","MotionConfigContext","isStatic","transitionDependency","transformPagePoint","__jsx","Analytics","asPath","IAssetFetcher","FLAG_SIZE","AssetFlagData","flagCode","AssetAppIcons","iconSize","favico","AssetSplashIcons","splashSize","Flag","AppIcon","Splash","Misc","Alpha","Alpha_Debug","_weightings","valuesIn","targetValue","weightGenerator","weightingsAll","weightingsMin","weightingsMax","weightingsDelta","weightingsNormalized","weight","minValue","maxValue","weightings","_imageAsset","group","DATA_IMAGE","_imageAssetGroup","_imageAssetGroupClosestMatch","targetWidth","targetHeight","allImages","_weightedImages$shift","weightingsAR","weightingsWidth","weightingsHeight","weightedImages","aspectRatio","asset","_closestImage","imageAsset","imageAssetGroup","imageAssetGroupClosestMatch","EXPIRATION_THRESHOLD","EXPIRATION_DAYS","LOGGINGLEVELSENABLED","OUTPUTDESTINATIONS","OUTPUTCONFIGURATION","MANIFEST_JSON","bindTourDataResolver","unbindTourDataResolver","injectTourDataResolver","tourDataResolver","banishList","bindables","bindApiService","bindAppState","bindUIWorkspace","bindConfig","bindWorker","bindAppCommon","dep","bindableDownloadLanguage","bindableDownloadTour","bindableDeleteTour","_overrides","_windowBind","_nodeBind","createContext","globalBinder","isReady","setReady","bindOfflineNotification","StoreProvider","_injectStoresRenderer","Render","swEnableOverride","hasServiceWorker","baseURI","startServiceWorker","useLazyBinder","injectable","onCompletion","pageProps","siteConfig","injectSiteConfig","LazyToast","LazyOffline","LazyDialog","LazyDownloadTour","LazyDeleteTour","LazyA2HS","appLongName","Head","ContainerProvider","DelayedRender","AwaitOnlineRender","LazyResolver","AnalyticsWrapper","exitBeforeEnter","globalContainer","configString","asset_copy","public_url","appShortName","appDescription","appTintColor","appBackgroundColor","_isSiteConfig","SITE_DATA","interfaceName","entity","_SITE_DATA$interfaceN","insertValues","primaryKeys","newValues","_SITE_DATA$interfaceN2","_SITE_DATA$interfaceN3","_SITE_DATA$interfaceN4","ITourDataResolver","resolverData","mediaPrefix","mediaSchema","MIMETYPE_WEIGHTING_MAP_STREAM","MIMETYPE_WEIGHTING_MAP_DOWNLOAD","MIMETYPE_WEIGHTING_MAP_ALL","_prioritizeAssets","sortAssets","priorities","mimeTypeResolver","_itemA$mimeType","_itemB$mimeType","_priorities$mimeTypeA","_priorities$mimeTypeB","mimeTypeA","mimeTypeB","_urlBuilder","_asset$dependencies","publicUrl","publicPrefix","_asset$prefix","prefix","urlPath","urlTools","pathUrl","_assetFromUrl","_resolverData$mediaSc","_resolverData$mediaSc2","stringTools","versionPath","_item$dependencies","assetFromUrl","assetSupportResolver","_ref3","_asset$mimeType","supportResolver","_assetSupportResolver","urlBuilder","_resolverData$downloa","types","_resolverData$mediaSc3","_resolverData$mediaSc4","sourceGuid","mimeTypePriorities","_asset$size","_react","default","_router","_router1","_useIntersection","prefetched","as","isLocalURL","curLocale","locale","useRouter","resolveHref","resolvedHref","resolvedAs","previousHref","previousAs","shallow","childRef","Children","only","useIntersection","rootMargin","setIntersectionRef","resetVisible","shouldPrefetch","isPrefetched","childProps","defaultPrevented","currentTarget","nodeName","metaKey","shiftKey","altKey","which","isModifiedEvent","linkClicked","onMouseEnter","priority","localeDomain","isLocaleDomain","getDomainLocale","locales","domainLocales","addBasePath","addLocale","defaultLocale","cloneElement","rootRef","hasIntersectionObserver","setVisible","setRoot","margin","idList","IntersectionObserver","isIntersecting","intersectionRatio","createObserver","disconnect","findIndex","idleCallback","_requestIdleCallback","cancelIdleCallback","AmpStateContext","isInAmpMode","useAmp","_ampContext","ampFirst","hybrid","hasQuery","defaultHead","_sideEffect","_headManagerContext","_amp","inAmpMode","charSet","onlyReactElement","fragmentList","fragmentChild","METATYPES","reduceComponents","headElements","headElement","headElementChildren","reverse","tags","metaTypes","metaCategories","isUnique","hasKey","metatype","categories","unique","newProps","ampState","headManager","HeadManagerContext","reduceComponentsToState","_class","emitChange","_hasHeadManager","updateHead","mountedInstances","__NEXT_P","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","_getPrototypeOf","_setPrototypeOf","subClass","superClass","_possibleConstructorReturn","ReferenceError","assertThisInitialized","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","arrayLikeToArray","arrayWithoutHoles","iterableToArray","nonIterableSpread","isAnimationControls","isKeyframesTarget","presenceId","getPresenceId","PresenceChild","isPresent","onExitComplete","custom","presenceAffectsLayout","presenceChildren","newChildrenMap","childId","e_1","e_1_1","return","PresenceContext","getChildKey","forceRenderLayoutGroup","LayoutGroupContext","isInitialRender","isMounted","filteredChildren","filtered","isValidElement","onlyElements","presentChildren","allChildren","exiting","updateChildLookup","childrenToRender","presentKeys","targetKeys","numPresent","insertionIndex","removeIndex","presentChild","setIsLoaded","isLazyBundle","loadedRenderer","loadedFeatures","LazyContext","createDefinition","propNames","featureDefinitions","measureLayout","drag","focus","hover","tap","pan","inView","loadFeatures","projectionNodeConstructor","scaleCorrectors","isForcedMotionValue","layout","layoutId","counter","incrementId","useUniqueId","shallowCompare","prevLength","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","initialGuess","approximateRoot","stiffness","damping","durationKeys","physicsKeys","isSpringType","spring","restSpeed","restDelta","isResolvedFromDuration","springOptions","derived","getSpringOptions","resolveSpring","zero","resolveVelocity","createSpring","initialVelocity","initialDelta","undampedAngularFreq","angularFreq","sin","dampedAngularFreq","freqForT","sinh","cosh","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","flipTarget","needsInterpolation","_t","toFromDifference","mix","isColorString","testProp","splitColor","aName","bName","cName","alpha","parseFloat","clampRgbUnit","rgbUnit","rgba","red","green","blue","alpha$1","hex","hsla","hue","saturation","lightness","hueToRgb","hslaToRgba","mixLinearColor","fromExpo","toExpo","colorTypes","getColorType","notAnimatable","mixColor","fromColorType","toColorType","fromColor","toColor","blended","colorToken","numberToken","analyse","numColors","colors","numbers","tokenised","createTransformer","numValues","convertNumbersToZero","complex","getAnimatableNone","transformer","combineFunctions","pipe","transformers","getMixer","mixComplex","mixArray","blendValue","fromThis","mixObject","numNumbers","numRGB","numHSL","template","originStats","targetStats","mixNumber","createMixers","customMixer","mixers","mixerFactory","numMixers","mixer","easingFunction","interpolate","isClamp","inputLength","interpolator","fastInterpolate","lastInputIndex","mixerIndex","foundMixerIndex","progressInRange","slowInterpolate","reverseEasing","easing","mirrorEasing","createBackIn","power","easeIn","easeInOut","circIn","acos","circOut","circInOut","backIn","backOut","backInOut","anticipate","backEasing","createAnticipate","bounceOut","p2","bounceIn","defaultEasing","keyframes","times","convertOffsetToTimes","_value","defaultOffset","createInterpolator","timeConstant","modifyTarget","amplitude","ideal","loopElapsed","elapsed","framesync","passTimestamp","autoplay","driver","repeatMax","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate","driverControls","interpolateFromNumber","repeatCount","computedDuration","isComplete","isForwardPlayback","animator","detectAnimationFromOptions","reverseElapsed","hasRepeatDelayElapsed","velocityPerSecond","frameDuration","secondsToMilliseconds","seconds","a1","a2","calcBezier","getSlope","kSampleStepSize","cubicBezier","mX1","mY1","mX2","mY2","sampleValues","Float32Array","getTForX","aX","intervalStart","currentSample","kSplineTableSize","guessForT","initialSlope","aGuessT","currentSlope","newtonRaphsonIterate","aA","aB","currentX","currentT","binarySubdivide","easingLookup","bounceInOut","easingDefinitionToFunction","definition","isAnimatable","underDampedSpring","criticallyDampedSpring","linearTween","defaultTransitions","rotate","rotateX","rotateY","rotateZ","maxDefaults","applyDefaultFilter","functionRegex","functions","defaultValueTypes","outlineColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","getDefaultValueType","defaultValueType","instantAnimationState","convertTransitionToAnimationOptions","yoyo","flip","loop","isEasingArray","getPopmotionAnimationOptions","hydrateKeyframes","when","delayChildren","staggerChildren","staggerDirection","isTransitionDefined","valueKey","transitionFactory","getDefaultTransition","getAnimation","valueTransition","getValueTransition","isTargetAnimatable","isZero","getZeroUnit","isOriginAnimatable","getVelocity","bounceStiffness","bounceDamping","currentAnimation","isOutOfBounds","boundaryNearest","startAnimation","startSpring","boundary","checkBoundary","inertia","finalTarget","potentialUnitType","delayTimer","controls","getDelayFromTransition","isZeroValueString","SubscriptionManager","subscriptions","numSubscriptions","getSize","MotionValue","init","timeDelta","lastUpdated","updateSubscribers","velocityUpdateSubscribers","renderSubscribers","canTrackVelocity","updateAndNotify","timestamp","scheduleVelocityCheck","velocityCheck","hasAnimated","onRenderRequest","attach","passiveEffect","getPrevious","stopAnimation","clearAnimation","destroy","motionValue","AnimationType","testValueType","dimensionValueTypes","px","vw","vh","findDimensionValueType","valueTypes","findValueType","setMotionValue","visualElement","hasValue","addValue","setTarget","makeTargetAnimatable","transitionEnd","getOriginFromTransition","animateVariant","variant","transitionOverride","animateTarget","getChildAnimations","variantChildren","forwardDelay","maxStaggerDuration","generateStaggerDuration","sortByTreeOrder","notifyAnimationComplete","animateChildren","animationTypeState","animationState","valueTarget","shouldBlockAnimation","sortNodePosition","protectedKeys","needsAnimating","shouldBlock","variantPriorityOrder","Animate","InView","Focus","Hover","Tap","Drag","Exit","reversePriorityOrder","numAnimationTypes","animateList","notifyAnimationStart","resolvedDefinition","animateVisualElement","createAnimationState","createTypeState","allAnimatedKeys","buildResolvedTypeValues","acc","animateChanges","changedActiveType","getProps","getVariantContext","removedKeys","encounteredKeys","removedVariantIndex","_loop_1","typeState","propIsVariant","activeDelta","isInherited","manuallyAnimateOnMount","prevProp","variantDidChange","checkVariantsDidChange","shouldAnimateType","definitionList","resolvedValues","prevResolvedValues","markToAnimate","blockInitialAnimation","fallbackAnimation_1","fallbackTarget","getBaseTarget","shouldAnimate","isAnimated","setAnimateFunction","makeAnimator","makeRenderlessComponent","hook","usePresence","safeToRemove","presenceContext","addDomEvent","eventName","useDomEvent","isTouchEvent","defaultPagePoint","pointFromTouch","pointType","point","changedTouches","pointFromMouse","wrapHandler","shouldFilterPrimaryPointer","eventHandler","extractEventInfo","isMouseEvent","MouseEvent","button","mouseEventNames","pointerdown","pointermove","pointerup","pointercancel","pointerover","pointerout","pointerenter","pointerleave","touchEventNames","getPointerEventName","onpointerdown","ontouchstart","onmousedown","addPointerEvent","usePointerEvent","createLock","globalHorizontalLock","globalVerticalLock","isDragActive","openGestureLock","openHorizontal_1","openVertical_1","getGlobalLock","createHoverEvent","PointerEvent","pointerType","isNodeOrChild","parentElement","observerCallbacks","fireObserverCallback","fireAllObserverCallbacks","observeIntersection","rootInteresectionObserver","lookupRoot","rootObservers","initIntersectionObserver","thresholdNames","useIntersectionObserver","shouldObserve","amount","getInstance","isInView","hasEnteredView","onViewportEnter","onViewportLeave","useMissingIntersectionObserver","gestureAnimations","whileInView","viewport","onTap","onTapStart","onTapCancel","whileTap","hasPressListeners","isPressing","cancelPointerEndListeners","removePointerEndListener","checkPointerEnd","onPointerUp","onPointerCancel","whileFocus","onHoverStart","onHoverEnd","whileHover","names","treeType","measureViewportBox","renderInstance","readValueFromInstance","removeValueFromRenderState","scrapeMotionValuesFromProps","visualState","removeFromVariantTree","latestValues","renderState","lifecycles","managers","propSubscriptions","updatePropListeners","propListener","createLifecycles","valueSubscriptions","prevMotionValues","baseTarget","triggerBuild","projection","notifyUpdate","initialMotionValues","isControllingVariants","isVariantNode","depth","mount","newInstance","addVariantChild","setProps","unmount","closestVariantNode","getClosestVariantNode","other","getLayoutId","getStaticValue","setStaticValue","getLatestValues","setVisibility","visibility","scheduleRender","canMutate","removeValue","removeOnChange","latestValue","removeOnRenderRequest","bindToMotionValue","forEachValue","setBaseTarget","syncRender","prevValue","existingValue","updateMotionValuesFromProps","getVariant","getTransformPagePoint","startAtParent","context_1","numVariantProps","name_1","variantProps","isCSSVariable","cssVariableRegex","getVariableValue","parseCSSVariable","getComputedStyle","getPropertyValue","BoundingBoxDimension","positionalKeys","isPositionalKey","setAndResetVelocity","isNumOrPxType","getPosFromMatrix","matrix","getTranslateFromMatrix","pos2","pos3","_bbox","matrix3d","transformKeys","nonTranslationalTransformKeys","positionalValues","paddingTop","bottom","checkAndConvertChangedValueTypes","targetPositionalKeys","removedTransformValues","hasAttemptedToRemoveTransformValues","changedValueTypeKeys","toType","fromType","numKeyframes","fromIndex","removedTransforms","removeNonTranslationalTransform","convertedTarget","changedKeys","originBbox","elementComputedStyle","targetBbox","convertChangedValueTypes","unitConversion","hasPositionalKey","parseDomVariant","resolveCSSVariables","transformPoint","convertBoundingBoxToBox","topLeft","bottomRight","transformBoxPoints","htmlConfig","domElement","defaultType","computedStyle","compareDocumentPosition","transformTemplate","restoreTransform","mutableState","vars","transformValues","getOrigin","newValueKeys","numNewValues","checkTargetForNewValues","htmlVisualElement","svgVisualElement","getAttribute","_element","enableHardwareAcceleration","featureNames","numFeatures","MotionContext","useVisualElement","createVisualElement","lazyContext","visualElementRef","notifyUnmount","isRefObject","useCreateMotionContext","inherit","getCurrentTreeVariants","variantLabelsAsDependency","globalProjectionState","hasAnimatedSinceResize","hasEverUpdated","SwitchLayoutGroupContext","VisualElementHandler","getSnapshotBeforeUpdate","updateProps","componentDidUpdate","createMotionComponent","preloadedFeatures","useRender","useVisualState","externalRef","layoutGroupId","useLayoutId","projectionId","ProjectionNodeConstructor","dragConstraints","layoutScroll","initialPromotionConfig","setOptions","alwaysMeasureLayout","useProjection","useFeatures","useMotionRef","createHtmlRenderState","transformOrigin","copyRawValuesOnly","useStyle","useInitialMotionValues","useHTMLProps","htmlProps","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","validMotionProps","isValidMotionProp","shouldForward","emotionIsPropValid_1","createSvgRenderState","attrs","useSVGProps","visualProps","rawStyles","createUseRender","forwardMotionProps","filteredProps","isDom","filterProps","elementProps","unwrappedValue","toValue","makeState","createRenderState","onMount","makeLatestValues","makeUseVisualState","scrapeMotionValues","motionValues","initialAnimationIsBlocked","variantToSet","svgMotionConfig","dimensions","getBBox","htmlMotionConfig","createConfig","customMotionComponentConfig","componentCache","_target","createMotionProxy","baseConfig","CAMEL_CASE_PATTERN","camelToDash","lowercaseSVGElements","isSVGComponent","numberValueTypes","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","marginBottom","scaleZ","skew","skewX","skewY","translateX","translateY","translateZ","perspective","transformPerspective","originX","originY","originZ","fillOpacity","strokeOpacity","numOctaves","translateAlias","getValueAsType","buildHTMLStyles","hasTransform","hasTransformOrigin","transformIsNone","valueType","valueAsType","transformIsDefault","allowTransformNone","transformString","transformHasZ","numTransformKeys","buildTransform","buildTransformOrigin","renderHTML","styleProp","getProjectionStyles","transformAxes","transformProps","sortTransformProps","operationKey","axesKey","transformPropSet","isTransformProp","transformOriginProps","isTransformOriginProp","calcOrigin","dashKeys","camelKeys","buildSVGAttrs","attrX","attrY","pathLength","pathSpacing","pathOffset","pxOriginX","pxOriginY","calcSVGTransformOrigin","spacing","useDashCase","buildSVGPath","camelCaseAttributes","renderSVG","isVariantLabels","isVariantLabel","resolveVariantFromProps","currentValues","resolveVariant","getCurrent","checkIfControllingVariants","whileDrag","checkIfVariantNode","isBrowser","isCustomValue","resolveFinalValueInKeyframes","useConstant","isUnmountingRef","forcedRenderCount","setForcedRenderCount","useUnmountEffect","isMotionValue","defaultTimestep","getCurrentTime","performance","onNextFrame","useDefaultElapsed","runNextFrame","isProcessing","stepsOrder","steps","toRun","toRunNextFrame","numToRun","flushNextFrame","toKeepAlive","WeakSet","schedule","immediate","addToCurrentFrame","frameData","createRenderStep","sync","startLoop","cancelSync","processStep","stepId","processFrame","getFrameData","createUnitType","degrees","percent","progressPercentage","sanitize","floatRegex","colorRegex","singleColorRegex","isString"],"sourceRoot":""}