@fluid-topics/ft-search-result-title 1.1.68 → 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.
@@ -1,7 +1,7 @@
1
1
  !function(t,o,e,r,a){var i,n,l,c,f,p,s,d,h,g,y,b,u,m,O,N,x,S;!function(t){!function(o){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function i(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var o={next:function(){var o=t.shift();return{done:void 0===o,value:o}}};return e.iterable&&(o[Symbol.iterator]=function(){return o}),o}function c(t){this.map={},t instanceof c?t.forEach((function(t,o){this.append(o,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(o){this.append(o,t[o])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(o,e){t.onload=function(){o(t.result)},t.onerror=function(){e(t.error)}}))}function s(t){var o=new FileReader,e=p(o);return o.readAsArrayBuffer(t),e}function d(t){if(t.slice)return t.slice(0);var o=new Uint8Array(t.byteLength);return o.set(new Uint8Array(t)),o.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){var o;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((o=t)&&DataView.prototype.isPrototypeOf(o))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||a(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var t,o,e,r=f(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,o=new FileReader,e=p(o),o.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var o=new Uint8Array(t),e=new Array(o.length),r=0;r<o.length;r++)e[r]=String.fromCharCode(o[r]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(t,o){t=i(t),o=n(o);var e=this.map[t];this.map[t]=e?e+", "+o:o},c.prototype.delete=function(t){delete this.map[i(t)]},c.prototype.get=function(t){return t=i(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(i(t))},c.prototype.set=function(t,o){this.map[i(t)]=n(o)},c.prototype.forEach=function(t,o){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(o,this.map[e],e,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(o,e){t.push(e)})),l(t)},c.prototype.values=function(){var t=[];return this.forEach((function(o){t.push(o)})),l(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(o,e){t.push([e,o])})),l(t)},e.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,o){var e,r,a=(o=o||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,o.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,a||null==t._bodyInit||(a=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=o.credentials||this.credentials||"same-origin",!o.headers&&this.headers||(this.headers=new c(o.headers)),this.method=(e=o.method||this.method||"GET",r=e.toUpperCase(),g.indexOf(r)>-1?r:e),this.mode=o.mode||this.mode||null,this.signal=o.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function b(t){var o=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),r=e.shift().replace(/\+/g," "),a=e.join("=").replace(/\+/g," ");o.append(decodeURIComponent(r),decodeURIComponent(a))}})),o}function u(t,o){o||(o={}),this.type="default",this.status=void 0===o.status?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new c(o.headers),this.url=o.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},h.call(y.prototype),h.call(u.prototype),u.prototype.clone=function(){return new u(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},u.error=function(){var t=new u(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];u.redirect=function(t,o){if(-1===m.indexOf(o))throw new RangeError("Invalid status code");return new u(null,{status:o,headers:{location:t}})},o.DOMException=t.DOMException;try{new o.DOMException}catch(t){o.DOMException=function(t,o){this.message=t,this.name=o;var e=Error(t);this.stack=e.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function O(t,r){return new Promise((function(a,i){var n=new y(t,r);if(n.signal&&n.signal.aborted)return i(new o.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function f(){l.abort()}l.onload=function(){var t,o,e={status:l.status,statusText:l.statusText,headers:(t=l.getAllResponseHeaders()||"",o=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),r=e.shift().trim();if(r){var a=e.join(":").trim();o.append(r,a)}})),o)};e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var r="response"in l?l.response:l.responseText;a(new u(r,e))},l.onerror=function(){i(new TypeError("Network request failed"))},l.ontimeout=function(){i(new TypeError("Network request failed"))},l.onabort=function(){i(new o.DOMException("Aborted","AbortError"))},l.open(n.method,n.url,!0),"include"===n.credentials?l.withCredentials=!0:"omit"===n.credentials&&(l.withCredentials=!1),"responseType"in l&&e.blob&&(l.responseType="blob"),n.headers.forEach((function(t,o){l.setRequestHeader(o,t)})),n.signal&&(n.signal.addEventListener("abort",f),l.onreadystatechange=function(){4===l.readyState&&n.signal.removeEventListener("abort",f)}),l.send(void 0===n._bodyInit?null:n._bodyInit)}))}O.polyfill=!0,t.fetch||(t.fetch=O,t.Headers=c,t.Request=y,t.Response=u),o.Headers=c,o.Request=y,o.Response=u,o.fetch=O,Object.defineProperty(o,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(i||(i={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(n||(n={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(l||(l={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(c||(c={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(f||(f={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(p||(p={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(s||(s={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(d||(d={})),function(t){t.ASC="ASC",t.DESC="DESC"}(h||(h={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(g||(g={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(y||(y={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(b||(b={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(u||(u={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(m||(m={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(O||(O={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(N||(N={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(x||(x={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(S||(S={})),x.PERSONAL_BOOK_SHARE_USER,x.PERSONAL_BOOK_USER,x.HTML_EXPORT_USER,x.PERSONAL_BOOK_USER,x.PDF_EXPORT_USER,x.PERSONAL_BOOK_USER,x.KHUB_ADMIN,x.CONTENT_PUBLISHER,x.ADMIN,x.KHUB_ADMIN,x.USERS_ADMIN,x.PORTAL_ADMIN,x.DEVELOPER,x.BETA_USER,x.DEBUG_USER;const w=e.css`
2
2
  `,v=o.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 E{static get(t){const{baseUrl:o,apiIntegrationIdentifier:e}=v.getState(),r=null!=t?t:e;if(o&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,r,!0)}static await(t){return new Promise((o=>{let e=E.get(t);if(e)o(e);else{const r=v.subscribe((()=>{e=E.get(t),e&&(r(),o(e))}))}}))}}class I{constructor(t=!0,e){var r;this.overrideApi=e;let a=this.constructor;a.commonCache=null!==(r=a.commonCache)&&void 0!==r?r:new o.CacheRegistry,this.cache=t?a.commonCache:new o.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:E.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:E.await()}clearCache(){this.cache.clearAll()}}var C;const U=Symbol("clearAfterUnitTest");class R extends I{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[C]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=v.getState().uiLocale,v.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=v.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var r;if(t=t.toLowerCase(),Object.keys(e).length>0){const a={...null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},...e};o.deepEqual(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...r){var a,i,n;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(i=null===(a=this.cache.getNow(t))||void 0===a?void 0:a.messages)&&void 0!==i?i:{};return new o.ParametrizedLabelResolver(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},l).resolve(e,...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,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}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=>o.delay(0).then((()=>t())).catch((()=>null)))))}}C=U,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends R{constructor(){super((async(t,o)=>(await this.awaitApi).getFluidTopicsMessageContext(t,o)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends R{constructor(){super((async(t,o)=>(await this.awaitApi).getCustomMessageContext(t,o)))}});const W=window.FluidTopicsI18nService;var L=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class Z extends o.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=()=>E.get(),this.messageContexts=[],this.cache=new o.CacheRegistry,this.cleanSessionDebouncer=new o.Debouncer}render(){return e.html`
3
3
  <slot></slot>
4
- `}update(t){super.update(t),t.has("baseUrl")&&(v.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&v.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&v.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&v.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&v.actions.noCustom(this.noCustom),t.has("editorMode")&&v.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&v.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&v.actions.session(this.session),t.has("availableUiLocales")&&v.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>W.addContext(t))),t.has("openExternalDocumentInNewTab")&&v.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&v.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&v.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()))}}Z.elementDefinitions={},Z.styles=w,L([r.property()],Z.prototype,"baseUrl",void 0),L([r.property()],Z.prototype,"apiIntegrationIdentifier",void 0),L([r.property()],Z.prototype,"uiLocale",void 0),L([o.jsonProperty(null)],Z.prototype,"availableUiLocales",void 0),L([o.jsonProperty(null)],Z.prototype,"metadataConfiguration",void 0),L([r.property({type:Boolean})],Z.prototype,"editorMode",void 0),L([r.property({type:Boolean})],Z.prototype,"noCustom",void 0),L([r.property({type:Boolean})],Z.prototype,"openExternalDocumentInNewTab",void 0),L([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Z.prototype,"noCustomComponent",void 0),L([r.property({type:Boolean})],Z.prototype,"withManualResources",void 0),L([r.property({type:Boolean})],Z.prototype,"navigatorOnline",void 0),L([r.property({type:Boolean})],Z.prototype,"forcedOffline",void 0),L([r.property({type:Object})],Z.prototype,"apiProvider",void 0),L([o.jsonProperty([])],Z.prototype,"messageContexts",void 0),L([o.jsonProperty(void 0)],Z.prototype,"session",void 0);class K extends I{async listMySearches(){let t=v.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class z extends I{async listMyBookmarks(){let t=v.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const A=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=v.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new z,this.savedSearchesService=new K,v.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=v.getState();o.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),A.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),A.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();A.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 o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;A.actions.bookmarks(o)}}},o.customElement("ft-app-context")(Z);class k extends Event{constructor(){super(k.eventName)}}k.eventName="search-context-clear-all-filters";var D=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class $ extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const F=Symbol("registerInterval");class B extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[F]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[F]):this.dispatchEvent(new $)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=F,D([r.state()],e.prototype,"stateManager",void 0),e}(o.FtLitElementRedux)){}var H=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class T extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const P=Symbol("registerInterval");class _ extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[P]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[P]):this.dispatchEvent(new T)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return o=P,H([r.property({attribute:!1})],e.prototype,"cluster",void 0),H([r.property({attribute:!1})],e.prototype,"result",void 0),H([r.property({attribute:!1,type:Number})],e.prototype,"rank",void 0),e}(B)){}const G={highlightBackgroundColor:o.FtCssVariableFactory.create("--ft-srt-highlight-background-color","","COLOR","transparent")},M=e.css`
4
+ `}update(t){super.update(t),t.has("baseUrl")&&(v.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&v.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&v.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&v.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&v.actions.noCustom(this.noCustom),t.has("editorMode")&&v.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&v.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&v.actions.session(this.session),t.has("availableUiLocales")&&v.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>W.addContext(t))),t.has("openExternalDocumentInNewTab")&&v.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&v.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&v.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()))}}Z.elementDefinitions={},Z.styles=w,L([r.property()],Z.prototype,"baseUrl",void 0),L([r.property()],Z.prototype,"apiIntegrationIdentifier",void 0),L([r.property()],Z.prototype,"uiLocale",void 0),L([o.jsonProperty(null)],Z.prototype,"availableUiLocales",void 0),L([o.jsonProperty(null)],Z.prototype,"metadataConfiguration",void 0),L([r.property({type:Boolean})],Z.prototype,"editorMode",void 0),L([r.property({type:Boolean})],Z.prototype,"noCustom",void 0),L([r.property({type:Boolean})],Z.prototype,"openExternalDocumentInNewTab",void 0),L([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Z.prototype,"noCustomComponent",void 0),L([r.property({type:Boolean})],Z.prototype,"withManualResources",void 0),L([r.property({type:Boolean})],Z.prototype,"navigatorOnline",void 0),L([r.property({type:Boolean})],Z.prototype,"forcedOffline",void 0),L([r.property({type:Object})],Z.prototype,"apiProvider",void 0),L([o.jsonProperty([])],Z.prototype,"messageContexts",void 0),L([o.jsonProperty(void 0)],Z.prototype,"session",void 0);class K extends I{async listMySearches(){let t=v.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class z extends I{async listMyBookmarks(){let t=v.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const A=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=v.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new z,this.savedSearchesService=new K,v.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=v.getState();o.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),A.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),A.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();A.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 o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;A.actions.bookmarks(o)}}};window.FluidTopicsAppInfoStoreService=new class{addCommand(t,o=!1){v.commands.add(t,o)}consumeCommand(t){return v.commands.consume(t)}};window.FluidTopicsHighlightHtmlService=new class{highlightHtml(t,e){o.highlightHtml(t,e)}},o.customElement("ft-app-context")(Z);class k extends Event{constructor(){super(k.eventName)}}k.eventName="search-context-clear-all-filters";var D=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class $ extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const F=Symbol("registerInterval");class B extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[F]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[F]):this.dispatchEvent(new $)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=F,D([r.state()],e.prototype,"stateManager",void 0),e}(o.FtLitElementRedux)){}var H=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class T extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const P=Symbol("registerInterval");class _ extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[P]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[P]):this.dispatchEvent(new T)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return o=P,H([r.property({attribute:!1})],e.prototype,"cluster",void 0),H([r.property({attribute:!1})],e.prototype,"result",void 0),H([r.property({attribute:!1,type:Number})],e.prototype,"rank",void 0),e}(B)){}const G={highlightBackgroundColor:o.FtCssVariableFactory.create("--ft-srt-highlight-background-color","","COLOR","transparent")},M=e.css`
5
5
  .kwicmatch {
6
6
  font-weight: 700;
7
7
  background-color: ${G.highlightBackgroundColor};