@fluid-topics/ft-reader-search-in-document 1.1.67 → 1.1.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1048,9 +1048,9 @@ const Ae=Symbol.for(""),De=t=>{if(t?.r===Ae)return t?._$litStatic$},Fe=t=>({_$li
1048
1048
  }
1049
1049
  `,Or=o.css`
1050
1050
  `,wr=o.css`
1051
- `,Sr=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class Nr{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Sr.getState(),r=null!=t?t:o;if(e&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,r,!0)}static await(t){return new Promise((e=>{let o=Nr.get(t);if(o)e(o);else{const r=Sr.subscribe((()=>{o=Nr.get(t),o&&(r(),e(o))}))}}))}}class Cr{constructor(t=!0,o){var r;this.overrideApi=o;let i=this.constructor;i.commonCache=null!==(r=i.commonCache)&&void 0!==r?r:new e.CacheRegistry,this.cache=t?i.commonCache:new e.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Nr.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Nr.await()}clearCache(){this.cache.clearAll()}}var $r;const Er=Symbol("clearAfterUnitTest");class Ir extends Cr{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[$r]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Sr.getState().uiLocale,Sr.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Sr.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var r;if(t=t.toLowerCase(),Object.keys(o).length>0){const i={...null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},...o};e.deepEqual(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...r){var i,n,a;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(n=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},l).resolve(o,...r)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>e.delay(0).then((()=>t())).catch((()=>null)))))}}$r=Er,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Ir{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Ir{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Rr=window.FluidTopicsI18nService,kr=window.FluidTopicsCustomI18nService;var Ur=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Lr extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Nr.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
1051
+ `,Sr=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});class Nr{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Sr.getState(),r=null!=t?t:o;if(e&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,r,!0)}static await(t){return new Promise((e=>{let o=Nr.get(t);if(o)e(o);else{const r=Sr.subscribe((()=>{o=Nr.get(t),o&&(r(),e(o))}))}}))}}class Cr{constructor(t=!0,o){var r;this.overrideApi=o;let i=this.constructor;i.commonCache=null!==(r=i.commonCache)&&void 0!==r?r:new e.CacheRegistry,this.cache=t?i.commonCache:new e.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Nr.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Nr.await()}clearCache(){this.cache.clearAll()}}var $r;const Er=Symbol("clearAfterUnitTest");class Ir extends Cr{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[$r]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Sr.getState().uiLocale,Sr.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Sr.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var r;if(t=t.toLowerCase(),Object.keys(o).length>0){const i={...null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},...o};e.deepEqual(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...r){var i,n,a;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(n=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},l).resolve(o,...r)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>e.delay(0).then((()=>t())).catch((()=>null)))))}}$r=Er,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Ir{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Ir{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Rr=window.FluidTopicsI18nService,kr=window.FluidTopicsCustomI18nService;var Ur=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Lr extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>Nr.get(),this.messageContexts=[],this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
1052
1052
  <slot></slot>
1053
- `}update(t){super.update(t),t.has("baseUrl")&&(Sr.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Sr.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Sr.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Sr.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Sr.actions.noCustom(this.noCustom),t.has("editorMode")&&Sr.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Sr.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Sr.actions.session(this.session),t.has("availableUiLocales")&&Sr.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Rr.addContext(t))),t.has("openExternalDocumentInNewTab")&&Sr.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Lr.elementDefinitions={},Lr.styles=wr,Ur([r.property()],Lr.prototype,"baseUrl",void 0),Ur([r.property()],Lr.prototype,"apiIntegrationIdentifier",void 0),Ur([r.property()],Lr.prototype,"uiLocale",void 0),Ur([e.jsonProperty(null)],Lr.prototype,"availableUiLocales",void 0),Ur([e.jsonProperty(null)],Lr.prototype,"metadataConfiguration",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"editorMode",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"noCustom",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"openExternalDocumentInNewTab",void 0),Ur([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Lr.prototype,"noCustomComponent",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"withManualResources",void 0),Ur([e.jsonProperty([])],Lr.prototype,"messageContexts",void 0),Ur([e.jsonProperty(void 0)],Lr.prototype,"session",void 0),Ur([r.property({type:Object})],Lr.prototype,"apiProvider",void 0);class Wr extends Cr{async listMySearches(){let t=Sr.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class zr extends Cr{async listMyBookmarks(){let t=Sr.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const Zr=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Kr=new class{constructor(){this.currentSession=Sr.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new zr,this.savedSearchesService=new Wr,Sr.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Sr.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Zr.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Zr.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();Zr.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Zr.actions.bookmarks(e)}}};e.customElement("ft-app-context")(Lr);var Ar=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Dr=Symbol("i18nAttributes"),Fr=Symbol("i18nProperties"),Br=Symbol("i18nUnsubs");function Tr(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?kr:Rr}i18n(t,e,...o){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const i=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...i)}onI18nUpdate(t){var e,o;null===(e=this[Dr])||void 0===e||e.forEach(((e,o)=>{var r;const i=this.getI18nAttributeValue(o);(null===(r=null==i?void 0:i.context)||void 0===r?void 0:r.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,i,e)})),null===(o=this[Fr])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Dr])||void 0===e||e.forEach(((e,o)=>{const r=this.getI18nAttributeValue(o);(null==r?void 0:r.context)&&r.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(r.context),this.updateI18nAttributeMessage(o,r,e))})),null===(o=this[Fr])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,r;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Fr])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(r=null===(o=this[Dr])||void 0===o?void 0:o.keys())&&void 0!==r?r:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Br].has(t)||this[Br].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Br].forEach((t=>t())),this[Br].clear()}}return e=Br,Ar([r.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Hr extends(Tr(e.FtLitElement)){}class Pr extends(Tr(e.FtLitElementRedux)){}var Mr=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class jr extends Pr{constructor(){super(),this.editorMode=!1,this.addStore(Sr)}render(){return this.key&&this.context?o.html`
1053
+ `}update(t){super.update(t),t.has("baseUrl")&&(Sr.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Sr.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Sr.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Sr.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Sr.actions.noCustom(this.noCustom),t.has("editorMode")&&Sr.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Sr.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Sr.actions.session(this.session),t.has("availableUiLocales")&&Sr.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Rr.addContext(t))),t.has("openExternalDocumentInNewTab")&&Sr.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&Sr.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&Sr.actions.forcedOffline(this.forcedOffline),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Lr.elementDefinitions={},Lr.styles=wr,Ur([r.property()],Lr.prototype,"baseUrl",void 0),Ur([r.property()],Lr.prototype,"apiIntegrationIdentifier",void 0),Ur([r.property()],Lr.prototype,"uiLocale",void 0),Ur([e.jsonProperty(null)],Lr.prototype,"availableUiLocales",void 0),Ur([e.jsonProperty(null)],Lr.prototype,"metadataConfiguration",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"editorMode",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"noCustom",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"openExternalDocumentInNewTab",void 0),Ur([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Lr.prototype,"noCustomComponent",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"withManualResources",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"navigatorOnline",void 0),Ur([r.property({type:Boolean})],Lr.prototype,"forcedOffline",void 0),Ur([r.property({type:Object})],Lr.prototype,"apiProvider",void 0),Ur([e.jsonProperty([])],Lr.prototype,"messageContexts",void 0),Ur([e.jsonProperty(void 0)],Lr.prototype,"session",void 0);class Wr extends Cr{async listMySearches(){let t=Sr.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class zr extends Cr{async listMyBookmarks(){let t=Sr.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const Zr=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Kr=new class{constructor(){this.currentSession=Sr.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new zr,this.savedSearchesService=new Wr,Sr.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Sr.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Zr.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Zr.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();Zr.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Zr.actions.bookmarks(e)}}};window.FluidTopicsAppInfoStoreService=new class{addCommand(t,e=!1){Sr.commands.add(t,e)}consumeCommand(t){return Sr.commands.consume(t)}};window.FluidTopicsHighlightHtmlService=new class{highlightHtml(t,o){e.highlightHtml(t,o)}},e.customElement("ft-app-context")(Lr);var Ar=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Dr=Symbol("i18nAttributes"),Fr=Symbol("i18nProperties"),Br=Symbol("i18nUnsubs");function Tr(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?kr:Rr}i18n(t,e,...o){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const i=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...i)}onI18nUpdate(t){var e,o;null===(e=this[Dr])||void 0===e||e.forEach(((e,o)=>{var r;const i=this.getI18nAttributeValue(o);(null===(r=null==i?void 0:i.context)||void 0===r?void 0:r.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,i,e)})),null===(o=this[Fr])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Dr])||void 0===e||e.forEach(((e,o)=>{const r=this.getI18nAttributeValue(o);(null==r?void 0:r.context)&&r.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(r.context),this.updateI18nAttributeMessage(o,r,e))})),null===(o=this[Fr])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,r;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Fr])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(r=null===(o=this[Dr])||void 0===o?void 0:o.keys())&&void 0!==r?r:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Br].has(t)||this[Br].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Br].forEach((t=>t())),this[Br].clear()}}return e=Br,Ar([r.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Hr extends(Tr(e.FtLitElement)){}class Pr extends(Tr(e.FtLitElementRedux)){}var Mr=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class jr extends Pr{constructor(){super(),this.editorMode=!1,this.addStore(Sr)}render(){return this.key&&this.context?o.html`
1054
1054
  <span class="ft-i18n">
1055
1055
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
1056
1056
  </span>