@fluid-topics/ft-app-context 2.0.12 → 2.0.14

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,5 +1,5 @@
1
- "use strict";(()=>{var yt=Object.create;var oe=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var mt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Tt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Et(t))!gt.call(e,a)&&a!==s&&oe(e,a,{get:()=>t[a],enumerable:!(n=At(t,a))||n.enumerable});return e};var _=(e,t,s)=>(s=e!=null?yt(mt(e)):{},Tt(t||!e||!e.__esModule?oe(s,"default",{value:e,enumerable:!0}):s,e));var b=B((bt,ue)=>{ue.exports=ftGlobals.wcUtils});var X=B((Ot,ce)=>{ce.exports=ftGlobals.lit});var pe=B((It,de)=>{de.exports=ftGlobals.litDecorators});var ge=B((x,me)=>{var V=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,q=function(){function e(){this.fetch=!1,this.DOMException=V.DOMException}return e.prototype=V,new e}();(function(e){var t=function(s){var n=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function l(r){return r&&DataView.prototype.isPrototypeOf(r)}if(a.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(r){return r&&d.indexOf(Object.prototype.toString.call(r))>-1};function S(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function O(r){return typeof r!="string"&&(r=String(r)),r}function z(r){var i={next:function(){var u=r.shift();return{done:u===void 0,value:u}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function A(r){this.map={},r instanceof A?r.forEach(function(i,u){this.append(u,i)},this):Array.isArray(r)?r.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(i){this.append(i,r[i])},this)}A.prototype.append=function(r,i){r=S(r),i=O(i);var u=this.map[r];this.map[r]=u?u+", "+i:i},A.prototype.delete=function(r){delete this.map[S(r)]},A.prototype.get=function(r){return r=S(r),this.has(r)?this.map[r]:null},A.prototype.has=function(r){return this.map.hasOwnProperty(S(r))},A.prototype.set=function(r,i){this.map[S(r)]=O(i)},A.prototype.forEach=function(r,i){for(var u in this.map)this.map.hasOwnProperty(u)&&r.call(i,this.map[u],u,this)},A.prototype.keys=function(){var r=[];return this.forEach(function(i,u){r.push(u)}),z(r)},A.prototype.values=function(){var r=[];return this.forEach(function(i){r.push(i)}),z(r)},A.prototype.entries=function(){var r=[];return this.forEach(function(i,u){r.push([u,i])}),z(r)},a.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function W(r){if(!r._noBody){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}}function ne(r){return new Promise(function(i,u){r.onload=function(){i(r.result)},r.onerror=function(){u(r.error)}})}function lt(r){var i=new FileReader,u=ne(i);return i.readAsArrayBuffer(r),u}function ot(r){var i=new FileReader,u=ne(i),p=/charset=([A-Za-z0-9_-]+)/.exec(r.type),y=p?p[1]:"utf-8";return i.readAsText(r,y),u}function ut(r){for(var i=new Uint8Array(r),u=new Array(i.length),p=0;p<i.length;p++)u[p]=String.fromCharCode(i[p]);return u.join("")}function ie(r){if(r.slice)return r.slice(0);var i=new Uint8Array(r.byteLength);return i.set(new Uint8Array(r)),i.buffer}function ae(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:a.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:a.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():a.arrayBuffer&&a.blob&&l(r)?(this._bodyArrayBuffer=ie(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||h(r))?this._bodyArrayBuffer=ie(r):this._bodyText=r=Object.prototype.toString.call(r):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var r=W(this);if(r)return r;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(){if(this._bodyArrayBuffer){var r=W(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(lt);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var r=W(this);if(r)return r;if(this._bodyBlob)return ot(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ut(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(pt)}),this.json=function(){return this.text().then(JSON.parse)},this}var ct=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function dt(r){var i=r.toUpperCase();return ct.indexOf(i)>-1?i:r}function I(r,i){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var u=i.body;if(r instanceof I){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,i.headers||(this.headers=new A(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!u&&r._bodyInit!=null&&(u=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new A(i.headers)),this.method=dt(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in n){var c=new AbortController;return c.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&u)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(u),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var p=/([?&])_=[^&]*/;if(p.test(this.url))this.url=this.url.replace(p,"$1_="+new Date().getTime());else{var y=/\?/;this.url+=(y.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function pt(r){var i=new FormData;return r.trim().split("&").forEach(function(u){if(u){var p=u.split("="),y=p.shift().replace(/\+/g," "),c=p.join("=").replace(/\+/g," ");i.append(decodeURIComponent(y),decodeURIComponent(c))}}),i}function ht(r){var i=new A,u=r.replace(/\r?\n[\t ]+/g," ");return u.split("\r").map(function(p){return p.indexOf(`
2
- `)===0?p.substr(1,p.length):p}).forEach(function(p){var y=p.split(":"),c=y.shift().trim();if(c){var H=y.join(":").trim();try{i.append(c,H)}catch(Q){console.warn("Response "+Q.message)}}}),i}ae.call(I.prototype);function C(r,i){if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new A(i.headers),this.url=i.url||"",this._initBody(r)}ae.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},C.error=function(){var r=new C(null,{status:200,statusText:""});return r.ok=!1,r.status=0,r.type="error",r};var ft=[301,302,303,307,308];C.redirect=function(r,i){if(ft.indexOf(i)===-1)throw new RangeError("Invalid status code");return new C(null,{status:i,headers:{location:r}})},s.DOMException=n.DOMException;try{new s.DOMException}catch{s.DOMException=function(i,u){this.message=i,this.name=u;var p=Error(i);this.stack=p.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function Y(r,i){return new Promise(function(u,p){var y=new I(r,i);if(y.signal&&y.signal.aborted)return p(new s.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function H(){c.abort()}c.onload=function(){var g={statusText:c.statusText,headers:ht(c.getAllResponseHeaders()||"")};y.url.indexOf("file://")===0&&(c.status<200||c.status>599)?g.status=200:g.status=c.status,g.url="responseURL"in c?c.responseURL:g.headers.get("X-Request-URL");var D="response"in c?c.response:c.responseText;setTimeout(function(){u(new C(D,g))},0)},c.onerror=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){p(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){p(new s.DOMException("Aborted","AbortError"))},0)};function Q(g){try{return g===""&&n.location.href?n.location.href:g}catch{return g}}if(c.open(y.method,Q(y.url),!0),y.credentials==="include"?c.withCredentials=!0:y.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(a.blob?c.responseType="blob":a.arrayBuffer&&(c.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof A||n.Headers&&i.headers instanceof n.Headers)){var le=[];Object.getOwnPropertyNames(i.headers).forEach(function(g){le.push(S(g)),c.setRequestHeader(g,O(i.headers[g]))}),y.headers.forEach(function(g,D){le.indexOf(D)===-1&&c.setRequestHeader(D,g)})}else y.headers.forEach(function(g,D){c.setRequestHeader(D,g)});y.signal&&(y.signal.addEventListener("abort",H),c.onreadystatechange=function(){c.readyState===4&&y.signal.removeEventListener("abort",H)}),c.send(typeof y._bodyInit>"u"?null:y._bodyInit)})}return Y.polyfill=!0,n.fetch||(n.fetch=Y,n.Headers=A,n.Request=I,n.Response=C),s.Headers=A,s.Request=I,s.Response=C,s.fetch=Y,s}({})})(q);q.fetch.ponyfill=!0;delete q.fetch.polyfill;var F=V.fetch?V:q;x=F.fetch;x.default=F.fetch;x.fetch=F.fetch;x.Headers=F.Headers;x.Request=F.Request;x.Response=F.Response;me.exports=x});var at=_(b());var it=_(X()),T=_(pe()),R=_(b());var he=_(X());var fe=he.css`
3
- `;var j=_(b()),St="ft-app-info",U=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};U.eventName="authentication-change";var _t={session:(e,t)=>{(0,j.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>o.dispatchEvent(new U(t.payload)),0))}},o=j.FtReduxStore.get({name:St,reducers:_t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var J=_(b());var w=class e{static get(t){let{baseUrl:s,apiIntegrationIdentifier:n}=o.getState(),a=t??n;if(s&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(s,a,!0)}static await(t){return new Promise(s=>{let n=e.get(t);if(n)s(n);else{let a=o.subscribe(()=>{n=e.get(t),n&&(a(),s(n))})}})}};var K=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:w.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):w.await()}};var P=class extends K{constructor(t=!0,s){var n;super(s),this.sortObjectFields=(l,d)=>typeof d!="object"||d==null||Array.isArray(d)?d:Object.fromEntries(Object.entries(d).sort(([h],[S])=>h.localeCompare(S)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new J.CacheRegistry,this.cache=t?a.commonCache:new J.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((s,n)=>0|31*s+n.charCodeAt(0),0))}};var Z=class{addCommand(t,s=!1){o.commands.add(t,s)}consumeCommand(t){return o.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new Z;var v=_(b());var ye,M=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},vt=Symbol("clearAfterUnitTest"),G=class extends(0,v.withEventBus)(P){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ye]=()=>{this.defaultMessages={},this.cache=new v.CacheRegistry,this.listeners={}},this.currentUiLocale=o.getState().uiLocale,o.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=o.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let s=t.name.toLowerCase();this.cache.setFinal(s,t),this.notify(s)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,s){var n;if(t=t.toLowerCase(),s&&Object.keys(s).length>0){let a={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...s};(0,v.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var s,n;return this.fetchContext(t),(n=(s=this.cache.getNow(t))===null||s===void 0?void 0:s.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,s){let n=t.toLowerCase();return this.resolveContext(n)[s]}resolveMessage(t,s,...n){var a;let l=t.toLowerCase(),d=this.resolveContext(l);return new v.ParametrizedLabelResolver((a=this.defaultMessages[l])!==null&&a!==void 0?a:{},d).resolve(s,...n)}async fetchContext(t){let s=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),s&&await this.notify(t)}catch(a){!(a instanceof v.CanceledPromiseError)&&s&&console.error(a)}return n}subscribe(t,s){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(s),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(s)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new M({loadedContexts:t})),this.dispatchEvent(new M({loadedContexts:t})),await Promise.all(t.map(s=>this.notify(s,!1)))}async notify(t,s=!0){s&&(document.body.dispatchEvent(new M({loadedContexts:[t]})),this.dispatchEvent(new M({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,v.delay)(0).then(()=>n()).catch(()=>null)))}};ye=vt;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Ae=window.FluidTopicsI18nService,Vt=window.FluidTopicsCustomI18nService;var Ee=_(b()),ee=class{highlightHtml(t,s,n){(0,Ee.highlightHtml)(t,s,n)}};window.FluidTopicsHighlightHtmlService=new ee;var Ct=_(ge(),1);var Te;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Te||(Te={}));var Se;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Se||(Se={}));var _e;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(_e||(_e={}));var ve;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(ve||(ve={}));var Ce;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Ce||(Ce={}));var Re;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Re||(Re={}));var be;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(be||(be={}));var Oe;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(Oe||(Oe={}));var Ie;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(Ie||(Ie={}));var xe;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(xe||(xe={}));var Le;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Le||(Le={}));var De;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(De||(De={}));var Ue;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Ue||(Ue={}));var we;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(we||(we={}));var Pe;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Pe||(Pe={}));var Ne;(function(e){e.ASC="ASC",e.DESC="DESC"})(Ne||(Ne={}));var Me;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Me||(Me={}));var Fe;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Fe||(Fe={}));var ke;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ke||(ke={}));var He;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(He||(He={}));var Be;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Be||(Be={}));var je;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(je||(je={}));var Ke;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ke||(Ke={}));var Ge;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ge||(Ge={}));var Ve;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ve||(Ve={}));var E;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(E||(E={}));var qe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(qe||(qe={}));var $e;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})($e||($e={}));var ze;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(ze||(ze={}));var We;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.OTHER="OTHER"})(We||(We={}));var Ye;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ye||(Ye={}));var Qe;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Qe||(Qe={}));var Xe;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(Xe||(Xe={}));var Je;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Je||(Je={}));var Ze;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Ze||(Ze={}));var et;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(et||(et={}));var rr={[E.PERSONAL_BOOK_SHARE_USER]:[E.PERSONAL_BOOK_USER],[E.HTML_EXPORT_USER]:[E.PERSONAL_BOOK_USER],[E.PDF_EXPORT_USER]:[E.PERSONAL_BOOK_USER],[E.KHUB_ADMIN]:[E.CONTENT_PUBLISHER],[E.ADMIN]:[E.KHUB_ADMIN,E.USERS_ADMIN,E.PORTAL_ADMIN,E.BEHAVIOR_DATA_USER],[E.GENERATIVE_AI_EXPORT_USER]:[E.GENERATIVE_AI_USER]};var tt=_(b());var te=class{isDate(t){var s,n,a,l;return(l=(a=((n=(s=o.getState().metadataConfiguration)===null||s===void 0?void 0:s.descriptors)!==null&&n!==void 0?n:[]).find(h=>h.key===t))===null||a===void 0?void 0:a.date)!==null&&l!==void 0?l:!1}format(t,s){var n,a,l,d;if(t==null)return"";try{return tt.DateFormatter.format(t,(n=s?.locale)!==null&&n!==void 0?n:o.getState().uiLocale,(a=s?.longFormat)!==null&&a!==void 0?a:!1,(l=s?.withTime)!==null&&l!==void 0?l:!1,(d=s?.onlyTime)!==null&&d!==void 0?d:!1)}catch(h){throw console.error(`Date ${JSON.stringify(t)} is not valid`,h),h}}};window.FluidTopicsDateService=new te;var rt=_(b());var k=class{static get(t,s){var n,a;let l=o.getState(),{lang:d,region:h}=(a=(n=l.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new rt.SearchPlaceConverter(l.baseUrl,t??20,l.searchInAllLanguagesAllowed,s??`${d}-${h}`)}};var re=class{urlToSearchRequest(t){return k.get().parse(t)}searchRequestToUrl(t){return k.get().serialize(t)}};window.FluidTopicsUrlService=new re;var L=_(b());var N=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};N.eventName="change";var se=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let s=sessionStorage.getItem(this.itemName(t));return s?JSON.parse(s):void 0}set(t,s){sessionStorage.setItem(this.itemName(t),JSON.stringify(s))}},st=new se;var $=class e extends L.WithEventBus{static build(){return new e(window.history,st,()=>window.location,!1)}constructor(t,s,n,a){var l,d;super(),this.history=t,this.historyStorage=s,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(d=(l=t.state)===null||l===void 0?void 0:l.index)!==null&&d!==void 0?d:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,s=!1){let n=s&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,L.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new N(this.currentItem())),0)}installProxies(){let t=s=>(n,a,[l,d,h])=>{let S=s(),O={...S===this.currentIndex?this.currentState:void 0,...l,index:S,href:typeof h=="string"?h:(h??this.windowLocation()).href};n.apply(a,[O,d,h]),this.setCurrentState(O,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let s=this.history.length-1;s>=0;s--)t?this.states[s]=this.historyStorage.get(s):setTimeout(()=>this.states[s]=this.historyStorage.get(s),this.history.length-s)}updateCurrentState(t){var s;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(s=t?.title)!==null&&s!==void 0?s:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(N.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(N.eventName,t)}currentItem(){return(0,L.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,L.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,L.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var s;let n=(s=this.states[t])===null||s===void 0?void 0:s.majorStateId;if(!n)return t;let a=t,l=t+1;for(;this.states.length>l&&!this.isDifferentMajorState(l,n);)this.hasState(l)&&(a=l),l++;return a}buildCurrentState(){var t,s;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(s=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&s!==void 0?s:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,s){var n;if(!this.hasState(t))return!1;let a=s??this.currentState.majorStateId,l=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return l==null||l!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=$.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});function nt(e,t){let{authenticationRequired:s,session:n}=o.getState();return s&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var m=function(e,t,s,n){var a=arguments.length,l=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,s):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,s,n);else for(var h=e.length-1;h>=0;h--)(d=e[h])&&(l=(a<3?d(l):a>3?d(t,s,l):d(t,s))||l);return a>3&&l&&Object.defineProperty(t,s,l),l},f=class extends R.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",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=()=>w.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new R.CacheRegistry,this.cleanSessionDebouncer=new R.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return it.html`
1
+ "use strict";(()=>{var Et=Object.create;var oe=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var _t=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tt(t))!St.call(e,a)&&a!==n&&oe(e,a,{get:()=>t[a],enumerable:!(s=mt(t,a))||s.enumerable});return e};var _=(e,t,n)=>(n=e!=null?Et(gt(e)):{},_t(t||!e||!e.__esModule?oe(n,"default",{value:e,enumerable:!0}):n,e));var O=B((It,ue)=>{ue.exports=ftGlobals.wcUtils});var X=B((xt,ce)=>{ce.exports=ftGlobals.lit});var pe=B((Lt,de)=>{de.exports=ftGlobals.litDecorators});var Te=B((x,me)=>{var V=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,q=function(){function e(){this.fetch=!1,this.DOMException=V.DOMException}return e.prototype=V,new e}();(function(e){var t=function(n){var s=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function l(r){return r&&DataView.prototype.isPrototypeOf(r)}if(a.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(r){return r&&d.indexOf(Object.prototype.toString.call(r))>-1};function S(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function b(r){return typeof r!="string"&&(r=String(r)),r}function z(r){var i={next:function(){var u=r.shift();return{done:u===void 0,value:u}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function A(r){this.map={},r instanceof A?r.forEach(function(i,u){this.append(u,i)},this):Array.isArray(r)?r.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(i){this.append(i,r[i])},this)}A.prototype.append=function(r,i){r=S(r),i=b(i);var u=this.map[r];this.map[r]=u?u+", "+i:i},A.prototype.delete=function(r){delete this.map[S(r)]},A.prototype.get=function(r){return r=S(r),this.has(r)?this.map[r]:null},A.prototype.has=function(r){return this.map.hasOwnProperty(S(r))},A.prototype.set=function(r,i){this.map[S(r)]=b(i)},A.prototype.forEach=function(r,i){for(var u in this.map)this.map.hasOwnProperty(u)&&r.call(i,this.map[u],u,this)},A.prototype.keys=function(){var r=[];return this.forEach(function(i,u){r.push(u)}),z(r)},A.prototype.values=function(){var r=[];return this.forEach(function(i){r.push(i)}),z(r)},A.prototype.entries=function(){var r=[];return this.forEach(function(i,u){r.push([u,i])}),z(r)},a.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function W(r){if(!r._noBody){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}}function se(r){return new Promise(function(i,u){r.onload=function(){i(r.result)},r.onerror=function(){u(r.error)}})}function ut(r){var i=new FileReader,u=se(i);return i.readAsArrayBuffer(r),u}function ct(r){var i=new FileReader,u=se(i),p=/charset=([A-Za-z0-9_-]+)/.exec(r.type),y=p?p[1]:"utf-8";return i.readAsText(r,y),u}function dt(r){for(var i=new Uint8Array(r),u=new Array(i.length),p=0;p<i.length;p++)u[p]=String.fromCharCode(i[p]);return u.join("")}function ie(r){if(r.slice)return r.slice(0);var i=new Uint8Array(r.byteLength);return i.set(new Uint8Array(r)),i.buffer}function ae(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:a.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:a.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():a.arrayBuffer&&a.blob&&l(r)?(this._bodyArrayBuffer=ie(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||h(r))?this._bodyArrayBuffer=ie(r):this._bodyText=r=Object.prototype.toString.call(r):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var r=W(this);if(r)return r;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(){if(this._bodyArrayBuffer){var r=W(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(ut);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var r=W(this);if(r)return r;if(this._bodyBlob)return ct(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(dt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(ft)}),this.json=function(){return this.text().then(JSON.parse)},this}var pt=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function ht(r){var i=r.toUpperCase();return pt.indexOf(i)>-1?i:r}function I(r,i){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var u=i.body;if(r instanceof I){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,i.headers||(this.headers=new A(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!u&&r._bodyInit!=null&&(u=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new A(i.headers)),this.method=ht(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in s){var c=new AbortController;return c.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&u)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(u),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var p=/([?&])_=[^&]*/;if(p.test(this.url))this.url=this.url.replace(p,"$1_="+new Date().getTime());else{var y=/\?/;this.url+=(y.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function ft(r){var i=new FormData;return r.trim().split("&").forEach(function(u){if(u){var p=u.split("="),y=p.shift().replace(/\+/g," "),c=p.join("=").replace(/\+/g," ");i.append(decodeURIComponent(y),decodeURIComponent(c))}}),i}function yt(r){var i=new A,u=r.replace(/\r?\n[\t ]+/g," ");return u.split("\r").map(function(p){return p.indexOf(`
2
+ `)===0?p.substr(1,p.length):p}).forEach(function(p){var y=p.split(":"),c=y.shift().trim();if(c){var H=y.join(":").trim();try{i.append(c,H)}catch(Q){console.warn("Response "+Q.message)}}}),i}ae.call(I.prototype);function C(r,i){if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new A(i.headers),this.url=i.url||"",this._initBody(r)}ae.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},C.error=function(){var r=new C(null,{status:200,statusText:""});return r.ok=!1,r.status=0,r.type="error",r};var At=[301,302,303,307,308];C.redirect=function(r,i){if(At.indexOf(i)===-1)throw new RangeError("Invalid status code");return new C(null,{status:i,headers:{location:r}})},n.DOMException=s.DOMException;try{new n.DOMException}catch{n.DOMException=function(i,u){this.message=i,this.name=u;var p=Error(i);this.stack=p.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function Y(r,i){return new Promise(function(u,p){var y=new I(r,i);if(y.signal&&y.signal.aborted)return p(new n.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function H(){c.abort()}c.onload=function(){var T={statusText:c.statusText,headers:yt(c.getAllResponseHeaders()||"")};y.url.indexOf("file://")===0&&(c.status<200||c.status>599)?T.status=200:T.status=c.status,T.url="responseURL"in c?c.responseURL:T.headers.get("X-Request-URL");var D="response"in c?c.response:c.responseText;setTimeout(function(){u(new C(D,T))},0)},c.onerror=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){p(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){p(new n.DOMException("Aborted","AbortError"))},0)};function Q(T){try{return T===""&&s.location.href?s.location.href:T}catch{return T}}if(c.open(y.method,Q(y.url),!0),y.credentials==="include"?c.withCredentials=!0:y.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(a.blob?c.responseType="blob":a.arrayBuffer&&(c.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof A||s.Headers&&i.headers instanceof s.Headers)){var le=[];Object.getOwnPropertyNames(i.headers).forEach(function(T){le.push(S(T)),c.setRequestHeader(T,b(i.headers[T]))}),y.headers.forEach(function(T,D){le.indexOf(D)===-1&&c.setRequestHeader(D,T)})}else y.headers.forEach(function(T,D){c.setRequestHeader(D,T)});y.signal&&(y.signal.addEventListener("abort",H),c.onreadystatechange=function(){c.readyState===4&&y.signal.removeEventListener("abort",H)}),c.send(typeof y._bodyInit>"u"?null:y._bodyInit)})}return Y.polyfill=!0,s.fetch||(s.fetch=Y,s.Headers=A,s.Request=I,s.Response=C),n.Headers=A,n.Request=I,n.Response=C,n.fetch=Y,n}({})})(q);q.fetch.ponyfill=!0;delete q.fetch.polyfill;var F=V.fetch?V:q;x=F.fetch;x.default=F.fetch;x.fetch=F.fetch;x.Headers=F.Headers;x.Request=F.Request;x.Response=F.Response;me.exports=x});var ot=_(O());var lt=_(X()),g=_(pe()),R=_(O());var he=_(X());var fe=he.css`
3
+ `;var j=_(O()),vt="ft-app-info",U=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};U.eventName="authentication-change";var Ct={session:(e,t)=>{(0,j.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>o.dispatchEvent(new U(t.payload)),0))}},o=j.FtReduxStore.get({name:vt,reducers:Ct,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var J=_(O());var w=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:s}=o.getState(),a=t??s;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let s=e.get(t);if(s)n(s);else{let a=o.subscribe(()=>{s=e.get(t),s&&(a(),n(s))})}})}};var K=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:w.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):w.await()}};var P=class extends K{constructor(t=!0,n){var s;super(n),this.sortObjectFields=(l,d)=>typeof d!="object"||d==null||Array.isArray(d)?d:Object.fromEntries(Object.entries(d).sort(([h],[S])=>h.localeCompare(S)));let a=this.constructor;a.commonCache=(s=a.commonCache)!==null&&s!==void 0?s:new J.CacheRegistry,this.cache=t?a.commonCache:new J.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,s)=>0|31*n+s.charCodeAt(0),0))}};var Z=class{addCommand(t,n=!1){o.commands.add(t,n)}consumeCommand(t){return o.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new Z;var v=_(O());var ye,M=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Rt=Symbol("clearAfterUnitTest"),G=class extends(0,v.withEventBus)(P){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ye]=()=>{this.defaultMessages={},this.cache=new v.CacheRegistry,this.listeners={}},this.currentUiLocale=o.getState().uiLocale,o.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=o.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var s;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(s=this.defaultMessages[t])!==null&&s!==void 0?s:{},...n};(0,v.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,s;return this.fetchContext(t),(s=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&s!==void 0?s:{}}resolveRawMessage(t,n){let s=t.toLowerCase();return this.resolveContext(s)[n]}resolveMessage(t,n,...s){var a;let l=t.toLowerCase(),d=this.resolveContext(l);return new v.ParametrizedLabelResolver((a=this.defaultMessages[l])!==null&&a!==void 0?a:{},d).resolve(n,...s)}async fetchContext(t){let n=!this.cache.has(t),s;try{s=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof v.CanceledPromiseError)&&n&&console.error(a)}return s}subscribe(t,n){var s;return t=t.toLowerCase(),this.listeners[t]=(s=this.listeners[t])!==null&&s!==void 0?s:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new M({loadedContexts:t})),this.dispatchEvent(new M({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new M({loadedContexts:[t]})),this.dispatchEvent(new M({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(s=>(0,v.delay)(0).then(()=>s()).catch(()=>null)))}};ye=Rt;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Ae=window.FluidTopicsI18nService,$t=window.FluidTopicsCustomI18nService;var Ee=_(O()),ee=class{highlightHtml(t,n,s){(0,Ee.highlightHtml)(t,n,s)}};window.FluidTopicsHighlightHtmlService=new ee;var Ot=_(Te(),1);var ge;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(ge||(ge={}));var Se;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Se||(Se={}));var _e;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(_e||(_e={}));var ve;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(ve||(ve={}));var Ce;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Ce||(Ce={}));var Re;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Re||(Re={}));var Oe;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(Oe||(Oe={}));var be;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(be||(be={}));var Ie;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Ie||(Ie={}));var xe;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(xe||(xe={}));var Le;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(Le||(Le={}));var De;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(De||(De={}));var Ue;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Ue||(Ue={}));var we;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(we||(we={}));var Pe;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Pe||(Pe={}));var Ne;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Ne||(Ne={}));var Me;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Me||(Me={}));var Fe;(function(e){e.ASC="ASC",e.DESC="DESC"})(Fe||(Fe={}));var ke;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(ke||(ke={}));var He;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(He||(He={}));var Be;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Be||(Be={}));var je;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(je||(je={}));var Ke;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Ke||(Ke={}));var Ge;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Ge||(Ge={}));var Ve;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ve||(Ve={}));var qe;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(qe||(qe={}));var $e;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})($e||($e={}));var E;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(E||(E={}));var ze;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(ze||(ze={}));var We;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(We||(We={}));var Ye;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Ye||(Ye={}));var Qe;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.OTHER="OTHER"})(Qe||(Qe={}));var Xe;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Xe||(Xe={}));var Je;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Je||(Je={}));var Ze;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(Ze||(Ze={}));var et;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(et||(et={}));var tt;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(tt||(tt={}));var rt;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(rt||(rt={}));var sr={[E.PERSONAL_BOOK_SHARE_USER]:[E.PERSONAL_BOOK_USER],[E.HTML_EXPORT_USER]:[E.PERSONAL_BOOK_USER],[E.PDF_EXPORT_USER]:[E.PERSONAL_BOOK_USER],[E.KHUB_ADMIN]:[E.CONTENT_PUBLISHER],[E.ADMIN]:[E.KHUB_ADMIN,E.USERS_ADMIN,E.PORTAL_ADMIN,E.BEHAVIOR_DATA_USER],[E.GENERATIVE_AI_EXPORT_USER]:[E.GENERATIVE_AI_USER]};var nt=_(O());var te=class{isDate(t){var n,s,a,l;return(l=(a=((s=(n=o.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]).find(h=>h.key===t))===null||a===void 0?void 0:a.date)!==null&&l!==void 0?l:!1}format(t,n){var s,a,l,d;if(t==null)return"";try{return nt.DateFormatter.format(t,(s=n?.locale)!==null&&s!==void 0?s:o.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(l=n?.withTime)!==null&&l!==void 0?l:!1,(d=n?.onlyTime)!==null&&d!==void 0?d:!1)}catch(h){throw console.error(`Date ${JSON.stringify(t)} is not valid`,h),h}}};window.FluidTopicsDateService=new te;var st=_(O());var k=class{static get(t,n){var s,a;let l=o.getState(),{lang:d,region:h}=(a=(s=l.defaultLocales)===null||s===void 0?void 0:s.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new st.SearchPlaceConverter(l.baseUrl,t??20,l.searchInAllLanguagesAllowed,n??`${d}-${h}`)}};var re=class{urlToSearchRequest(t){return k.get().parse(t)}searchRequestToUrl(t){return k.get().serialize(t)}};window.FluidTopicsUrlService=new re;var L=_(O());var N=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};N.eventName="change";var ne=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},it=new ne;var $=class e extends L.WithEventBus{static build(){return new e(window.history,it,()=>window.location,!1)}constructor(t,n,s,a){var l,d;super(),this.history=t,this.historyStorage=n,this.windowLocation=s,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(d=(l=t.state)===null||l===void 0?void 0:l.index)!==null&&d!==void 0?d:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let s=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,s&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,L.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new N(this.currentItem())),0)}installProxies(){let t=n=>(s,a,[l,d,h])=>{let S=n(),b={...S===this.currentIndex?this.currentState:void 0,...l,index:S,href:typeof h=="string"?h:(h??this.windowLocation()).href};s.apply(a,[b,d,h]),this.setCurrentState(b,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let s={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(s)}addHistoryChangeListener(t){this.addEventListener(N.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(N.eventName,t)}currentItem(){return(0,L.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,L.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,L.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var n;let s=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!s)return t;let a=t,l=t+1;for(;this.states.length>l&&!this.isDifferentMajorState(l,s);)this.hasState(l)&&(a=l),l++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var s;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,l=(s=this.states[t])===null||s===void 0?void 0:s.majorStateId;return l==null||l!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=$.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});function at(e,t){let{authenticationRequired:n,session:s}=o.getState();return n&&!s?.sessionAuthenticated?Promise.resolve(t):e()}var m=function(e,t,n,s){var a=arguments.length,l=a<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,s);else for(var h=e.length-1;h>=0;h--)(d=e[h])&&(l=(a<3?d(l):a>3?d(t,n,l):d(t,n))||l);return a>3&&l&&Object.defineProperty(t,n,l),l},f=class extends R.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",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=()=>w.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new R.CacheRegistry,this.cleanSessionDebouncer=new R.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return lt.html`
4
4
  <slot></slot>
5
- `}connectedCallback(){super.connectedCallback(),o.addEventListener(U.eventName,this.reloadConfiguration)}disconnectedCallback(){o.addEventListener(U.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var s,n,a,l,d,h,S;super.update(t),t.has("baseUrl")&&(o.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&o.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&o.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&o.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&o.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&o.actions.noCustom(this.noCustom),t.has("editorMode")&&o.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&o.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&o.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(O=>Ae.addContext(O)),t.has("openExternalDocumentInNewTab")&&o.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&o.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&o.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(o.actions.defaultLocales((s=this.localesConfiguration)===null||s===void 0?void 0:s.defaultLocales),o.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),o.actions.searchInAllLanguagesAllowed((d=(l=this.localesConfiguration)===null||l===void 0?void 0:l.allLanguagesAllowed)!==null&&d!==void 0?d:!1)),t.has("authenticationRequired")&&o.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&o.actions.availableContentLocales((S=(h=this.availableContentLocales)===null||h===void 0?void 0:h.contentLocales)!==null&&S!==void 0?S:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>nt(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};f.elementDefinitions={};f.styles=fe;m([(0,T.property)()],f.prototype,"baseUrl",void 0);m([(0,T.property)()],f.prototype,"apiIntegrationIdentifier",void 0);m([(0,T.property)()],f.prototype,"apiIntegrationAppVersion",void 0);m([(0,T.property)()],f.prototype,"uiLocale",void 0);m([(0,R.jsonProperty)(null)],f.prototype,"availableUiLocales",void 0);m([(0,R.jsonProperty)(null)],f.prototype,"metadataConfiguration",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"editorMode",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"noCustom",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"openExternalDocumentInNewTab",void 0);m([(0,T.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],f.prototype,"noCustomComponent",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"withManualResources",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"navigatorOnline",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"forcedOffline",void 0);m([(0,T.property)({type:Object})],f.prototype,"apiProvider",void 0);m([(0,T.property)({type:Boolean})],f.prototype,"authenticationRequired",void 0);m([(0,R.jsonProperty)([])],f.prototype,"messageContexts",void 0);m([(0,R.jsonProperty)(void 0)],f.prototype,"session",void 0);m([(0,T.state)()],f.prototype,"localesConfiguration",void 0);m([(0,T.state)()],f.prototype,"availableContentLocales",void 0);(0,at.customElement)("ft-app-context")(f);})();
5
+ `}connectedCallback(){super.connectedCallback(),o.addEventListener(U.eventName,this.reloadConfiguration)}disconnectedCallback(){o.addEventListener(U.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var n,s,a,l,d,h,S;super.update(t),t.has("baseUrl")&&(o.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&o.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&o.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&o.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&o.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&o.actions.noCustom(this.noCustom),t.has("editorMode")&&o.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&o.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&o.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(b=>Ae.addContext(b)),t.has("openExternalDocumentInNewTab")&&o.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&o.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&o.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(o.actions.defaultLocales((n=this.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales),o.actions.availableUiLocales((a=(s=this.localesConfiguration)===null||s===void 0?void 0:s.availableUiLocales)!==null&&a!==void 0?a:[]),o.actions.searchInAllLanguagesAllowed((d=(l=this.localesConfiguration)===null||l===void 0?void 0:l.allLanguagesAllowed)!==null&&d!==void 0?d:!1)),t.has("authenticationRequired")&&o.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&o.actions.availableContentLocales((S=(h=this.availableContentLocales)===null||h===void 0?void 0:h.contentLocales)!==null&&S!==void 0?S:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>at(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};f.elementDefinitions={};f.styles=fe;m([(0,g.property)()],f.prototype,"baseUrl",void 0);m([(0,g.property)()],f.prototype,"apiIntegrationIdentifier",void 0);m([(0,g.property)()],f.prototype,"apiIntegrationAppVersion",void 0);m([(0,g.property)()],f.prototype,"uiLocale",void 0);m([(0,R.jsonProperty)(null)],f.prototype,"availableUiLocales",void 0);m([(0,R.jsonProperty)(null)],f.prototype,"metadataConfiguration",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"editorMode",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"noCustom",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"openExternalDocumentInNewTab",void 0);m([(0,g.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],f.prototype,"noCustomComponent",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"withManualResources",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"navigatorOnline",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"forcedOffline",void 0);m([(0,g.property)({type:Object})],f.prototype,"apiProvider",void 0);m([(0,g.property)({type:Boolean})],f.prototype,"authenticationRequired",void 0);m([(0,R.jsonProperty)([])],f.prototype,"messageContexts",void 0);m([(0,R.jsonProperty)(void 0)],f.prototype,"session",void 0);m([(0,g.state)()],f.prototype,"localesConfiguration",void 0);m([(0,g.state)()],f.prototype,"availableContentLocales",void 0);(0,ot.customElement)("ft-app-context")(f);})();