@fluid-topics/ft-text-input 1.3.46 → 1.3.47

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.
@@ -492,7 +492,7 @@ Also for action icons.`,s.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
492
492
  `;var Rr=b(P());var zl=b(P());var js=b(z()),me=b(ee()),je=b(P());var rs=b(z());var os=rs.css`
493
493
  `;var po=b(P()),pd="ft-app-info",Ht=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Ht.eventName="authentication-change";var ud={session:(e,t)=>{(0,po.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>N.dispatchEvent(new Ht(t.payload)),0))}},N=po.FtReduxStore.get({name:pd,reducers:ud,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 Gn=b(P());var Wt=class e{static get(t){let{baseUrl:o,apiIntegrationIdentifier:n}=N.getState(),a=t??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(t){return new Promise(o=>{let n=e.get(t);if(n)o(n);else{let a=N.subscribe(()=>{n=e.get(t),n&&(a(),o(n))})}})}};var uo=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Wt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Wt.await()}};var Re=class extends uo{constructor(t=!0,o){var n;super(o),this.sortObjectFields=(i,l)=>typeof l!="object"||l==null||Array.isArray(l)?l:Object.fromEntries(Object.entries(l).sort(([c],[p])=>c.localeCompare(p)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Gn.CacheRegistry,this.cache=t?a.commonCache:new Gn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var fo=class extends Re{async listMyBookmarks(){let t=N.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),5*60*1e3):[]}};var jn=class{addCommand(t,o=!1){N.commands.add(t,o)}consumeCommand(t){return N.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new jn;var Pe=b(P());var ns,gr=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},fd=Symbol("clearAfterUnitTest"),ho=class extends(0,Pe.withEventBus)(Re){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ns]=()=>{this.defaultMessages={},this.cache=new Pe.CacheRegistry,this.listeners={}},this.currentUiLocale=N.getState().uiLocale,N.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=N.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var n;if(t=t.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...o};(0,Pe.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var o,n;return this.fetchContext(t),(n=(o=this.cache.getNow(t))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,o){let n=t.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(t,o,...n){var a;let i=t.toLowerCase(),l=this.resolveContext(i);return new Pe.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},l).resolve(o,...n)}async fetchContext(t){let o=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),o&&await this.notify(t)}catch(a){!(a instanceof Pe.CanceledPromiseError)&&o&&console.error(a)}return n}subscribe(t,o){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(o),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new gr({loadedContexts:t})),this.dispatchEvent(new gr({loadedContexts:t})),await Promise.all(t.map(o=>this.notify(o,!1)))}async notify(t,o=!0){o&&(document.body.dispatchEvent(new gr({loadedContexts:[t]})),this.dispatchEvent(new gr({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,Pe.delay)(0).then(()=>n()).catch(()=>null)))}};ns=fd;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends ho{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends ho{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var br=window.FluidTopicsI18nService,yo=window.FluidTopicsCustomI18nService;var as=b(P()),Vn=class{highlightHtml(t,o,n){(0,as.highlightHtml)(t,o,n)}};window.FluidTopicsHighlightHtmlService=new Vn;var yd=b(ss(),1);var ls;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(ls||(ls={}));var cs;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(cs||(cs={}));var ds;(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"})(ds||(ds={}));var ps;(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"})(ps||(ps={}));var us;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(us||(us={}));var fs;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(fs||(fs={}));var hs;(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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",e.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",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__DISPLAY="TOPIC__DISPLAY",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"})(hs||(hs={}));var ys;(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"})(ys||(ys={}));var ms;(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"})(ms||(ms={}));var gs;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(gs||(gs={}));var bs;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(bs||(bs={}));var xs;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(xs||(xs={}));var vs;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(vs||(vs={}));var Ss;(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"})(Ss||(Ss={}));var Cs;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Cs||(Cs={}));var Os;(function(e){e.ASC="ASC",e.DESC="DESC"})(Os||(Os={}));var Es;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Es||(Es={}));var As;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(As||(As={}));var ws;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ws||(ws={}));var Rs;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Rs||(Rs={}));var Is;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Is||(Is={}));var Ls;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Ls||(Ls={}));var Ts;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC"})(Ts||(Ts={}));var Ns;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ns||(Ns={}));var _s;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(_s||(_s={}));var se;(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.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(se||(se={}));var ke;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(ke||(ke={}));var Ps;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Ps||(Ps={}));var ks;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(ks||(ks={}));var Ds;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(Ds||(Ds={}));var Bs;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Bs||(Bs={}));var Ms;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Ms||(Ms={}));var hd={[se.PERSONAL_BOOK_SHARE_USER]:[se.PERSONAL_BOOK_USER],[se.HTML_EXPORT_USER]:[se.PERSONAL_BOOK_USER],[se.PDF_EXPORT_USER]:[se.PERSONAL_BOOK_USER],[se.KHUB_ADMIN]:[se.CONTENT_PUBLISHER],[se.ADMIN]:[se.KHUB_ADMIN,se.USERS_ADMIN,se.PORTAL_ADMIN],[se.GENERATIVE_AI_EXPORT_USER]:[se.GENERATIVE_AI_USER]};function $s(e,t){return e===t||(hd[e]??[]).some(o=>$s(o,t))}function Us(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>$s(n,t))}var bo=class extends Re{async listMySearches(){let{session:t}=N.getState();return Us(t,se.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),5*60*1e3):[]}};var Fs=b(P());var Kn=class{isDate(t){var o,n,a,i;return(i=(a=((n=(o=N.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,o){var n,a,i;return Fs.DateFormatter.format(t,(n=o?.locale)!==null&&n!==void 0?n:N.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Kn;var zs=b(P());var Fr=class{static get(t,o){var n,a;let i=N.getState(),{lang:l,region:c}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new zs.SearchPlaceConverter(i.baseUrl,t??20,i.searchInAllLanguagesAllowed,o??`${l}-${c}`)}};var Zn=class{urlToSearchRequest(t){return Fr.get().parse(t)}searchRequestToUrl(t){return Fr.get().serialize(t)}};window.FluidTopicsUrlService=new Zn;var Et=b(P());var Gt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Gt.eventName="change";var qn=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let o=sessionStorage.getItem(this.itemName(t));return o?JSON.parse(o):void 0}set(t,o){sessionStorage.setItem(this.itemName(t),JSON.stringify(o))}},Hs=new qn;var xo=class e extends Et.WithEventBus{static build(){return new e(window.history,Hs,()=>window.location,!1)}constructor(t,o,n,a){var i,l;super(),this.history=t,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(l=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&l!==void 0?l:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,o=!1){let n=o&&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,Et.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Gt(this.currentItem())),0)}installProxies(){let t=o=>(n,a,[i,l,c])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...i,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[u,l,c]),this.setCurrentState(u,!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 o=this.history.length-1;o>=0;o--)t?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(t){var o;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(o=t?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(Gt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Gt.eventName,t)}currentItem(){return(0,Et.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,Et.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,Et.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 o;let n=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;if(!n)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&o!==void 0?o:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,o){var n;if(!this.hasState(t))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=xo.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)});var Ws=N;function Gs(e,t){var o;return Ws.getState().authenticationRequired&&!(!((o=Ws.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(t):e()}var le=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},K=class extends je.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=()=>Wt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new je.CacheRegistry,this.cleanSessionDebouncer=new je.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return js.html`
494
494
  <slot></slot>
495
- `}connectedCallback(){super.connectedCallback(),N.addEventListener(Ht.eventName,this.reloadConfiguration)}disconnectedCallback(){N.addEventListener(Ht.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var o,n,a,i,l,c,p;super.update(t),t.has("baseUrl")&&(N.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&N.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&N.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&N.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&N.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&N.actions.noCustom(this.noCustom),t.has("editorMode")&&N.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&N.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&N.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>br.addContext(u)),t.has("openExternalDocumentInNewTab")&&N.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&N.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&N.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(N.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),N.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),N.actions.searchInAllLanguagesAllowed((l=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),t.has("authenticationRequired")&&N.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&N.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),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",()=>Gs(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};K.elementDefinitions={};K.styles=os;le([(0,me.property)()],K.prototype,"baseUrl",void 0);le([(0,me.property)()],K.prototype,"apiIntegrationIdentifier",void 0);le([(0,me.property)()],K.prototype,"apiIntegrationAppVersion",void 0);le([(0,me.property)()],K.prototype,"uiLocale",void 0);le([(0,je.jsonProperty)(null)],K.prototype,"availableUiLocales",void 0);le([(0,je.jsonProperty)(null)],K.prototype,"metadataConfiguration",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"editorMode",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"noCustom",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);le([(0,me.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],K.prototype,"noCustomComponent",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"withManualResources",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"navigatorOnline",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"forcedOffline",void 0);le([(0,me.property)({type:Object})],K.prototype,"apiProvider",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"authenticationRequired",void 0);le([(0,je.jsonProperty)([])],K.prototype,"messageContexts",void 0);le([(0,je.jsonProperty)(void 0)],K.prototype,"session",void 0);le([(0,me.state)()],K.prototype,"localesConfiguration",void 0);le([(0,me.state)()],K.prototype,"availableContentLocales",void 0);var va=b(ee());function md(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let o,n,a;if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!vo(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!vo(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let i=l=>Object.keys(l).filter(c=>l[c]!=null);if(a=i(e),o=a.length,o!==i(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;for(n=o;n--!==0;){let l=a[n];if(!vo(e[l],t[l]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function vo(e,t){try{return md(e,t)}catch{return!1}}function zr(e,t){return!vo(e,t)}function So(e,t){let o=n=>n[e]===!0;return n=>{if(o(n))return n;let a=t(n);return a[e]=!0,a}}var Vs=b(ee(),1);var Yn=e=>{let t=e??{};return(o,n)=>{var a;let i={hasChanged:zr,attribute:!1,...t};(0,Vs.property)(i)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=t.selector)!==null&&a!==void 0?a:c=>c[n],store:t.store})}};var Co=class{constructor(){this.queue=[]}add(t,o=!1){o&&this.clear(t.type),this.queue.push(t)}consume(t){let o=this.queue.find(n=>n.type===t);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(t){typeof t=="string"?this.queue=this.queue.filter(o=>o.type!==t):this.queue=this.queue.filter(o=>!t.test(o.type))}};var jt=b(ee(),1);var Ks=b(ee(),1);function Zs(e,t){let o=()=>JSON.parse(JSON.stringify(e));return(0,Ks.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:zr,...t??{}})}var Oo=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,o){return this.callbacks=[t],this.debounce(o)}queue(t,o){return this.callbacks.push(t),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,o;let n=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(c){a(c);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ys=b(z(),1);var Eo=globalThis,gd=Eo.ShadowRoot&&(Eo.ShadyCSS===void 0||Eo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wx=Symbol();var qs=(e,t)=>{if(gd)e.adoptedStyleSheets=t.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of t){let n=document.createElement("style"),a=Eo.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,e.appendChild(n)}};var Ao=class extends Ys.LitElement{createRenderRoot(){let t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach(([a,i])=>t.registry.define(a,i)));let o={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return qs(n,t.elementStyles),n}};function Xs(e,t,...o){var n;let a=e.querySelector(t);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var Sr=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},tl,Js=Symbol("constructorPrototype"),Qs=Symbol("constructorName"),rl=Symbol("exportpartsDebouncer"),el=Symbol("dynamicDependenciesLoaded"),vr=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};vr.eventName="exportparts-updated";var tt=class extends Ao{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[tl]=new Oo(5),this.scheduleExportpartsUpdate=()=>{var t,o,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[rl].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Qs]=this.constructor.name,this[Js]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Qs]&&Object.setPrototypeOf(this,this[Js])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let o=this.constructor;o[el]||(o[el]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(vr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(vr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new vr)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=Xs(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var o,n,a,i,l,c;let p=g=>g!=null&&g.trim().length>0,u=t.filter(p).map(g=>g.trim());if(u.length===0){this.exportparts=void 0;return}let m=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(i=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],v=(c=(l=g.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(L=>L.split(":")[1]))!==null&&c!==void 0?c:[],O=[...S,...v].filter(p).map(L=>L.trim());for(let L of O)m.add(L)}if(m.size===0){this.exportparts=void 0;return}let h=[...m.values()].flatMap(g=>u.map(S=>`${g}:${S}--${g}`));this.exportparts=[...this.part,...h].join(", ")}};tl=rl;Sr([(0,jt.property)()],tt.prototype,"exportpartsPrefix",void 0);Sr([Zs([])],tt.prototype,"exportpartsPrefixes",void 0);Sr([(0,jt.property)({reflect:!0})],tt.prototype,"exportparts",void 0);Sr([(0,jt.property)()],tt.prototype,"customStylesheet",void 0);Sr([(0,jt.property)()],tt.prototype,"elementToFocus",void 0);Sr([(0,jt.state)()],tt.prototype,"useAdoptedStyleSheets",void 0);function wo(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Hr=Symbol("internalReduxEventsUnsubscribers"),At=Symbol("internalStoresUnsubscribers"),Vt=Symbol("internalStores"),bd=So(Symbol("withRedux"),function(e){var t,o,n;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(c=>l.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[Vt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Vt].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[Vt].get(l)}addStore(l,c){var p;c=(p=c??l.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[Vt].set(c,l),this.subscribeToStore(c,l),this.updateFromStores()}removeStore(l){let c=typeof l=="string"?l:l.name;this.unsubscribeFromStore(c),this[Vt].delete(c)}setupStores(){this.unsubscribeFromStores(),this[Vt].forEach((l,c)=>this.subscribeToStore(c,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(l.store);u&&(l.store?this[At].has(l.store):this[At].size>0)&&(this[c]=l.selector(u.getState(),this))}})}subscribeToStore(l,c){var p;this[At].set(l,c.subscribe(()=>this.updateFromStores())),this[Hr].set(l,[]),wo(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,m)=>{if(typeof this[m]=="function"&&(!u.store||c.name===u.store)){let h=g=>this[m](g);c.addEventListener(u.eventName,h),this[Hr].get(l).push(()=>c.removeEventListener(u.eventName,h))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[At].forEach((l,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(l){var c;this[At].has(l)&&this[At].get(l)(),this[At].delete(l),(c=this[Hr].get(l))===null||c===void 0||c.forEach(p=>p()),this[Hr].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=At,o=Vt,n=Hr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),ol=class extends bd(tt){};function De(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(o.length?" "+o.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function pt(e){return!!e&&!!e[Z]}function Ve(e){var t;return!!e&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===wd}(e)||Array.isArray(e)||!!e[dl]||!!(!((t=e.constructor)===null||t===void 0)&&t[dl])||aa(e)||ia(e))}function Kt(e,t,o){o===void 0&&(o=!1),Er(e)===0?(o?Object.keys:Or)(e).forEach(function(n){o&&typeof n=="symbol"||t(n,e[n],e)}):e.forEach(function(n,a){return t(a,n,e)})}function Er(e){var t=e[Z];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:aa(e)?2:ia(e)?3:0}function Cr(e,t){return Er(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xd(e,t){return Er(e)===2?e.get(t):e[t]}function pl(e,t,o){var n=Er(e);n===2?e.set(t,o):n===3?e.add(o):e[t]=o}function ul(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function aa(e){return Ed&&e instanceof Map}function ia(e){return Ad&&e instanceof Set}function wt(e){return e.o||e.t}function sa(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=yl(e);delete t[Z];for(var o=Or(t),n=0;n<o.length;n++){var a=o[n],i=t[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),t)}function la(e,t){return t===void 0&&(t=!1),ca(e)||pt(e)||!Ve(e)||(Er(e)>1&&(e.set=e.add=e.clear=e.delete=vd),Object.freeze(e),t&&Kt(e,function(o,n){return la(n,!0)},!0)),e}function vd(){De(2)}function ca(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function rt(e){var t=na[e];return t||De(18,e),t}function Sd(e,t){na[e]||(na[e]=t)}function ta(){return Gr}function Xn(e,t){t&&(rt("Patches"),e.u=[],e.s=[],e.v=t)}function Ro(e){ra(e),e.p.forEach(Cd),e.p=null}function ra(e){e===Gr&&(Gr=e.l)}function nl(e){return Gr={p:[],l:Gr,h:e,m:!0,_:0}}function Cd(e){var t=e[Z];t.i===0||t.i===1?t.j():t.g=!0}function Jn(e,t){t._=t.p.length;var o=t.p[0],n=e!==void 0&&e!==o;return t.h.O||rt("ES5").S(t,e,n),n?(o[Z].P&&(Ro(t),De(4)),Ve(e)&&(e=Io(t,e),t.l||Lo(t,e)),t.u&&rt("Patches").M(o[Z].t,e,t.u,t.s)):e=Io(t,o,[]),Ro(t),t.u&&t.v(t.u,t.s),e!==hl?e:void 0}function Io(e,t,o){if(ca(t))return t;var n=t[Z];if(!n)return Kt(t,function(c,p){return al(e,n,t,c,p,o)},!0),t;if(n.A!==e)return t;if(!n.P)return Lo(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=sa(n.k):n.o,i=a,l=!1;n.i===3&&(i=new Set(a),a.clear(),l=!0),Kt(i,function(c,p){return al(e,n,a,c,p,o,l)}),Lo(e,a,!1),o&&e.u&&rt("Patches").N(n,o,e.u,e.s)}return n.o}function al(e,t,o,n,a,i,l){if(pt(a)){var c=Io(e,a,i&&t&&t.i!==3&&!Cr(t.R,n)?i.concat(n):void 0);if(pl(o,n,c),!pt(c))return;e.m=!1}else l&&o.add(a);if(Ve(a)&&!ca(a)){if(!e.h.D&&e._<1)return;Io(e,a),t&&t.A.l||Lo(e,a)}}function Lo(e,t,o){o===void 0&&(o=!1),!e.l&&e.h.D&&e.m&&la(t,o)}function Qn(e,t){var o=e[Z];return(o?wt(o):e)[t]}function il(e,t){if(t in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function Rt(e){e.P||(e.P=!0,e.l&&Rt(e.l))}function ea(e){e.o||(e.o=sa(e.t))}function oa(e,t,o){var n=aa(t)?rt("MapSet").F(t,o):ia(t)?rt("MapSet").T(t,o):e.O?function(a,i){var l=Array.isArray(a),c={i:l?1:0,A:i?i.A:ta(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},p=c,u=jr;l&&(p=[c],u=Wr);var m=Proxy.revocable(p,u),h=m.revoke,g=m.proxy;return c.k=g,c.j=h,g}(t,o):rt("ES5").J(t,o);return(o?o.A:ta()).p.push(n),n}function Od(e){return pt(e)||De(22,e),function t(o){if(!Ve(o))return o;var n,a=o[Z],i=Er(o);if(a){if(!a.P&&(a.i<4||!rt("ES5").K(a)))return a.t;a.I=!0,n=sl(o,i),a.I=!1}else n=sl(o,i);return Kt(n,function(l,c){a&&xd(a.t,l)===c||pl(n,l,t(c))}),i===3?new Set(n):n}(e)}function sl(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return sa(e)}function fl(){function e(l,c){var p=i[l];return p?p.enumerable=c:i[l]=p={configurable:!0,enumerable:c,get:function(){var u=this[Z];return jr.get(u,l)},set:function(u){var m=this[Z];jr.set(m,l,u)}},p}function t(l){for(var c=l.length-1;c>=0;c--){var p=l[c][Z];if(!p.P)switch(p.i){case 5:n(p)&&Rt(p);break;case 4:o(p)&&Rt(p)}}}function o(l){for(var c=l.t,p=l.k,u=Or(p),m=u.length-1;m>=0;m--){var h=u[m];if(h!==Z){var g=c[h];if(g===void 0&&!Cr(c,h))return!0;var S=p[h],v=S&&S[Z];if(v?v.t!==g:!ul(S,g))return!0}}var O=!!c[Z];return u.length!==Or(c).length+(O?0:1)}function n(l){var c=l.k;if(c.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function a(l){l.g&&De(3,JSON.stringify(wt(l)))}var i={};Sd("ES5",{J:function(l,c){var p=Array.isArray(l),u=function(h,g){if(h){for(var S=Array(g.length),v=0;v<g.length;v++)Object.defineProperty(S,""+v,e(v,!0));return S}var O=yl(g);delete O[Z];for(var L=Or(O),I=0;I<L.length;I++){var T=L[I];O[T]=e(T,h||!!O[T].enumerable)}return Object.create(Object.getPrototypeOf(g),O)}(p,l),m={i:p?5:4,A:c?c.A:ta(),P:!1,I:!1,R:{},l:c,t:l,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Z,{value:m,writable:!0}),u},S:function(l,c,p){p?pt(c)&&c[Z].A===l&&t(l.p):(l.u&&function u(m){if(m&&typeof m=="object"){var h=m[Z];if(h){var g=h.t,S=h.k,v=h.R,O=h.i;if(O===4)Kt(S,function($){$!==Z&&(g[$]!==void 0||Cr(g,$)?v[$]||u(S[$]):(v[$]=!0,Rt(h)))}),Kt(g,function($){S[$]!==void 0||Cr(S,$)||(v[$]=!1,Rt(h))});else if(O===5){if(n(h)&&(Rt(h),v.length=!0),S.length<g.length)for(var L=S.length;L<g.length;L++)v[L]=!1;else for(var I=g.length;I<S.length;I++)v[I]=!0;for(var T=Math.min(S.length,g.length),B=0;B<T;B++)S.hasOwnProperty(B)||(v[B]=!0),v[B]===void 0&&u(S[B])}}}}(l.p[0]),t(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var ll,Gr,da=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Ed=typeof Map<"u",Ad=typeof Set<"u",cl=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",hl=da?Symbol.for("immer-nothing"):((ll={})["immer-nothing"]=!0,ll),dl=da?Symbol.for("immer-draftable"):"__$immer_draftable",Z=da?Symbol.for("immer-state"):"__$immer_state";var wd=""+Object.prototype.constructor,Or=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,yl=Object.getOwnPropertyDescriptors||function(e){var t={};return Or(e).forEach(function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)}),t},na={},jr={get:function(e,t){if(t===Z)return e;var o=wt(e);if(!Cr(o,t))return function(a,i,l){var c,p=il(i,l);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(a.k):void 0}(e,o,t);var n=o[t];return e.I||!Ve(n)?n:n===Qn(e.t,t)?(ea(e),e.o[t]=oa(e.A.h,n,e)):n},has:function(e,t){return t in wt(e)},ownKeys:function(e){return Reflect.ownKeys(wt(e))},set:function(e,t,o){var n=il(wt(e),t);if(n?.set)return n.set.call(e.k,o),!0;if(!e.P){var a=Qn(wt(e),t),i=a?.[Z];if(i&&i.t===o)return e.o[t]=o,e.R[t]=!1,!0;if(ul(o,a)&&(o!==void 0||Cr(e.t,t)))return!0;ea(e),Rt(e)}return e.o[t]===o&&(o!==void 0||t in e.o)||Number.isNaN(o)&&Number.isNaN(e.o[t])||(e.o[t]=o,e.R[t]=!0),!0},deleteProperty:function(e,t){return Qn(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,ea(e),Rt(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=wt(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:o[t]}},defineProperty:function(){De(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){De(12)}},Wr={};Kt(jr,function(e,t){Wr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Wr.deleteProperty=function(e,t){return Wr.set.call(this,e,t,void 0)},Wr.set=function(e,t,o){return jr.set.call(this,e[0],t,o,e[0])};var Rd=function(){function e(o){var n=this;this.O=cl,this.D=!0,this.produce=function(a,i,l){if(typeof a=="function"&&typeof i!="function"){var c=i;i=a;var p=n;return function(O){var L=this;O===void 0&&(O=c);for(var I=arguments.length,T=Array(I>1?I-1:0),B=1;B<I;B++)T[B-1]=arguments[B];return p.produce(O,function($){var U;return(U=i).call.apply(U,[L,$].concat(T))})}}var u;if(typeof i!="function"&&De(6),l!==void 0&&typeof l!="function"&&De(7),Ve(a)){var m=nl(n),h=oa(n,a,void 0),g=!0;try{u=i(h),g=!1}finally{g?Ro(m):ra(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return Xn(m,l),Jn(O,m)},function(O){throw Ro(m),O}):(Xn(m,l),Jn(u,m))}if(!a||typeof a!="object"){if((u=i(a))===void 0&&(u=a),u===hl&&(u=void 0),n.D&&la(u,!0),l){var S=[],v=[];rt("Patches").M(a,u,S,v),l(S,v)}return u}De(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(u){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];return n.produceWithPatches(u,function(S){return a.apply(void 0,[S].concat(h))})};var l,c,p=n.produce(a,i,function(u,m){l=u,c=m});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,l,c]}):[p,l,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var t=e.prototype;return t.createDraft=function(o){Ve(o)||De(8),pt(o)&&(o=Od(o));var n=nl(this),a=oa(this,o,void 0);return a[Z].C=!0,ra(n),a},t.finishDraft=function(o,n){var a=o&&o[Z],i=a.A;return Xn(i,n),Jn(void 0,i)},t.setAutoFreeze=function(o){this.D=o},t.setUseProxies=function(o){o&&!cl&&De(20),this.O=o},t.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var l=rt("Patches").$;return pt(o)?l(o,n):this.produce(o,function(c){return l(c,n)})},e}(),Ie=new Rd,Id=Ie.produce,zx=Ie.produceWithPatches.bind(Ie),Hx=Ie.setAutoFreeze.bind(Ie),Wx=Ie.setUseProxies.bind(Ie),Gx=Ie.applyPatches.bind(Ie),jx=Ie.createDraft.bind(Ie),Vx=Ie.finishDraft.bind(Ie),To=Id;function Zt(e){"@babel/helpers - typeof";return Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(e)}function ml(e,t){if(Zt(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,t||"default");if(Zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gl(e){var t=ml(e,"string");return Zt(t)=="symbol"?t:t+""}function bl(e,t,o){return(t=gl(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function xl(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),o.push.apply(o,n)}return o}function pa(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?xl(Object(o),!0).forEach(function(n){bl(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):xl(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function be(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var vl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ua=function(){return Math.random().toString(36).substring(7).split("").join(".")},No={INIT:"@@redux/INIT"+ua(),REPLACE:"@@redux/REPLACE"+ua(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ua()}};function Ld(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function fa(e,t,o){var n;if(typeof t=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof o>"u"&&(o=t,t=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(be(1));return o(fa)(e,t)}if(typeof e!="function")throw new Error(be(2));var a=e,i=t,l=[],c=l,p=!1;function u(){c===l&&(c=l.slice())}function m(){if(p)throw new Error(be(3));return i}function h(O){if(typeof O!="function")throw new Error(be(4));if(p)throw new Error(be(5));var L=!0;return u(),c.push(O),function(){if(L){if(p)throw new Error(be(6));L=!1,u();var T=c.indexOf(O);c.splice(T,1),l=null}}}function g(O){if(!Ld(O))throw new Error(be(7));if(typeof O.type>"u")throw new Error(be(8));if(p)throw new Error(be(9));try{p=!0,i=a(i,O)}finally{p=!1}for(var L=l=c,I=0;I<L.length;I++){var T=L[I];T()}return O}function S(O){if(typeof O!="function")throw new Error(be(10));a=O,g({type:No.REPLACE})}function v(){var O,L=h;return O={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(be(11));function B(){T.next&&T.next(m())}B();var $=L(B);return{unsubscribe:$}}},O[vl]=function(){return this},O}return g({type:No.INIT}),n={dispatch:g,subscribe:h,getState:m,replaceReducer:S},n[vl]=v,n}function Td(e){Object.keys(e).forEach(function(t){var o=e[t],n=o(void 0,{type:No.INIT});if(typeof n>"u")throw new Error(be(12));if(typeof o(void 0,{type:No.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function Sl(e){for(var t=Object.keys(e),o={},n=0;n<t.length;n++){var a=t[n];typeof e[a]=="function"&&(o[a]=e[a])}var i=Object.keys(o),l,c;try{Td(o)}catch(p){c=p}return function(u,m){if(u===void 0&&(u={}),c)throw c;if(0)var h;for(var g=!1,S={},v=0;v<i.length;v++){var O=i[v],L=o[O],I=u[O],T=L(I,m);if(typeof T>"u"){var B=m&&m.type;throw new Error(be(14))}S[O]=T,g=g||T!==I}return g=g||i.length!==Object.keys(u).length,g?S:u}}function Ar(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Cl(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(be(15))},l={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},c=t.map(function(p){return p(l)});return i=Ar.apply(void 0,c)(a.dispatch),pa(pa({},a),{},{dispatch:i})}}}function Ol(e){var t=function(n){var a=n.dispatch,i=n.getState;return function(l){return function(c){return typeof c=="function"?c(a,i,e):l(c)}}};return t}var El=Ol();El.withExtraArgument=Ol;var ha=El;var Ll=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(t,o)};return function(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(t,o);function n(){this.constructor=t}t.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),Nd=function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(u){return function(m){return p([u,m])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,a=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(u[0]===6&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(m){u=[6,m],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},wr=function(e,t){for(var o=0,n=t.length,a=e.length;o<n;o++,a++)e[a]=t[o];return e},_d=Object.defineProperty,Pd=Object.defineProperties,kd=Object.getOwnPropertyDescriptors,Al=Object.getOwnPropertySymbols,Dd=Object.prototype.hasOwnProperty,Bd=Object.prototype.propertyIsEnumerable,wl=function(e,t,o){return t in e?_d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o},It=function(e,t){for(var o in t||(t={}))Dd.call(t,o)&&wl(e,o,t[o]);if(Al)for(var n=0,a=Al(t);n<a.length;n++){var o=a[n];Bd.call(t,o)&&wl(e,o,t[o])}return e},ya=function(e,t){return Pd(e,kd(t))},Md=function(e,t,o){return new Promise(function(n,a){var i=function(p){try{c(o.next(p))}catch(u){a(u)}},l=function(p){try{c(o.throw(p))}catch(u){a(u)}},c=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(i,l)};c((o=o.apply(e,t)).next())})};var $d=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ar:Ar.apply(null,arguments)},dv=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Ud(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var o=t;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return t===o}var Fd=function(e){Ll(t,e);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,t.prototype),a}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},t.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(t.bind.apply(t,wr([void 0],o[0].concat(this)))):new(t.bind.apply(t,wr([void 0],o.concat(this))))},t}(Array),zd=function(e){Ll(t,e);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,t.prototype),a}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},t.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(t.bind.apply(t,wr([void 0],o[0].concat(this)))):new(t.bind.apply(t,wr([void 0],o.concat(this))))},t}(Array);function ba(e){return Ve(e)?To(e,function(){}):e}function Hd(e){return typeof e=="boolean"}function Wd(){return function(t){return Gd(t)}}function Gd(e){e===void 0&&(e={});var t=e.thunk,o=t===void 0?!0:t,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,l=i===void 0?!0:i,c=new Fd;if(o&&(Hd(o)?c.push(ha):c.push(ha.withExtraArgument(o.extraArgument))),0){if(a)var p;if(l)var u}return c}var ma=!0;function Tl(e){var t=Wd(),o=e||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,l=i===void 0?t():i,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,m=u===void 0?void 0:u,h=o.enhancers,g=h===void 0?void 0:h,S;if(typeof a=="function")S=a;else if(Ud(a))S=Sl(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=l;if(typeof v=="function"&&(v=v(t),!ma&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ma&&v.some(function($){return typeof $!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Cl.apply(void 0,v),L=Ar;p&&(L=$d(It({trace:!ma},typeof p=="object"&&p)));var I=new zd(O),T=I;Array.isArray(g)?T=wr([O],g):typeof g=="function"&&(T=g(I));var B=L.apply(void 0,T);return fa(S,m,B)}function Lt(e,t){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return It(It({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return o.toString=function(){return""+e},o.type=e,o.match=function(n){return n.type===e},o}function Nl(e){var t={},o=[],n,a={addCase:function(i,l){var c=typeof i=="string"?i:i.type;if(c in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[c]=l,a},addMatcher:function(i,l){return o.push({matcher:i,reducer:l}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[t,o,n]}function jd(e){return typeof e=="function"}function Vd(e,t,o,n){o===void 0&&(o=[]);var a=typeof t=="function"?Nl(t):[t,o,n],i=a[0],l=a[1],c=a[2],p;if(jd(e))p=function(){return ba(e())};else{var u=ba(e);p=function(){return u}}function m(h,g){h===void 0&&(h=p());var S=wr([i[g.type]],l.filter(function(v){var O=v.matcher;return O(g)}).map(function(v){var O=v.reducer;return O}));return S.filter(function(v){return!!v}).length===0&&(S=[c]),S.reduce(function(v,O){if(O)if(pt(v)){var L=v,I=O(L,g);return I===void 0?v:I}else{if(Ve(v))return To(v,function(T){return O(T,g)});var I=O(v,g);if(I===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return v},h)}return m.getInitialState=p,m}function Kd(e,t){return e+"/"+t}function _l(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof e.initialState=="function"?e.initialState:ba(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},l={},c={};a.forEach(function(m){var h=n[m],g=Kd(t,m),S,v;"reducer"in h?(S=h.reducer,v=h.prepare):S=h,i[m]=S,l[g]=S,c[m]=v?Lt(g,v):Lt(g)});function p(){var m=typeof e.extraReducers=="function"?Nl(e.extraReducers):[e.extraReducers],h=m[0],g=h===void 0?{}:h,S=m[1],v=S===void 0?[]:S,O=m[2],L=O===void 0?void 0:O,I=It(It({},g),l);return Vd(o,function(T){for(var B in I)T.addCase(B,I[B]);for(var $=0,U=v;$<U.length;$++){var ve=U[$];T.addMatcher(ve.matcher,ve.reducer)}L&&T.addDefaultCase(L)})}var u;return{name:t,reducer:function(m,h){return u||(u=p()),u(m,h)},actions:c,caseReducers:i,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Zd="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",qd=function(e){e===void 0&&(e=21);for(var t="",o=e;o--;)t+=Zd[Math.random()*64|0];return t},Yd=["name","message","stack","code"],ga=function(){function e(t,o){this.payload=t,this.meta=o}return e}(),Rl=function(){function e(t,o){this.payload=t,this.meta=o}return e}(),Xd=function(e){if(typeof e=="object"&&e!==null){for(var t={},o=0,n=Yd;o<n.length;o++){var a=n[o];typeof e[a]=="string"&&(t[a]=e[a])}return t}return{message:String(e)}},hv=function(){function e(t,o,n){var a=Lt(t+"/fulfilled",function(m,h,g,S){return{payload:m,meta:ya(It({},S||{}),{arg:g,requestId:h,requestStatus:"fulfilled"})}}),i=Lt(t+"/pending",function(m,h,g){return{payload:void 0,meta:ya(It({},g||{}),{arg:h,requestId:m,requestStatus:"pending"})}}),l=Lt(t+"/rejected",function(m,h,g,S,v){return{payload:S,error:(n&&n.serializeError||Xd)(m||"Rejected"),meta:ya(It({},v||{}),{arg:g,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(h,g,S){var v=n?.idGenerator?n.idGenerator(m):qd(),O=new p,L,I=!1;function T($){L=$,O.abort()}var B=function(){return Md(this,null,function(){var $,U,ve,Xe,xe,Je,fe;return Nd(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),Xe=($=n?.condition)==null?void 0:$.call(n,m,{getState:g,extra:S}),Qd(Xe)?[4,Xe]:[3,2];case 1:Xe=y.sent(),y.label=2;case 2:if(Xe===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,xe=new Promise(function(x,D){return O.signal.addEventListener("abort",function(){return D({name:"AbortError",message:L||"Aborted"})})}),h(i(v,m,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:v,arg:m},{getState:g,extra:S}))),[4,Promise.race([xe,Promise.resolve(o(m,{dispatch:h,getState:g,extra:S,requestId:v,signal:O.signal,abort:T,rejectWithValue:function(x,D){return new ga(x,D)},fulfillWithValue:function(x,D){return new Rl(x,D)}})).then(function(x){if(x instanceof ga)throw x;return x instanceof Rl?a(x.payload,v,m,x.meta):a(x,v,m)})])];case 3:return ve=y.sent(),[3,5];case 4:return Je=y.sent(),ve=Je instanceof ga?l(null,v,m,Je.payload,Je.meta):l(Je,v,m),[3,5];case 5:return fe=n&&!n.dispatchConditionRejection&&l.match(ve)&&ve.meta.condition,fe||h(ve),[2,ve]}})})}();return Object.assign(B,{abort:T,requestId:v,arg:m,unwrap:function(){return B.then(Jd)}})}}return Object.assign(u,{pending:i,rejected:l,fulfilled:a,typePrefix:t})}return e.withTypes=function(){return e},e}();function Jd(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Qd(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Pl="listener",kl="completed",Dl="cancelled",yv="task-"+Dl,mv="task-"+kl,gv=Pl+"-"+Dl,bv=Pl+"-"+kl;var xa="listenerMiddleware";var xv=Lt(xa+"/add"),vv=Lt(xa+"/removeAll"),Sv=Lt(xa+"/remove");var Il,Cv=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Il||(Il=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},ep=function(e){return function(t){setTimeout(t,e)}},Ov=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ep(10);fl();var tp=So(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}),_o=class extends tp(Object){};window.ftReduxStores||(window.ftReduxStores={});var Bl=class e extends _o{static get(t){var o;let n=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[n];if(wo(i))return i;if(a==null)return;let l=_l({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),c=Tl({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:l.reducer(p,u)});return window.ftReduxStores[a.name]=new e(l,c,a.eventBus)}constructor(t,o,n){super(),this.reduxSlice=t,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Co;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,l,c)=>{let p=l,u=i[p];return u?(...m)=>{let h=u(...m.map(a));return this.reduxStore.dispatch(h),h}:m=>{this.setState({[p]:a(m)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Po=class{static format(t,o,n,a){return window.moment?window.moment(t).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(t,o,n,a)}static getMomentDateFormat(t,o){return t?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(t,o,n,a){let i=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(i);if(!a)return l;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(i);return`${l} ${c}`}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${t(Math.abs(o)/60)}:${t(Math.abs(o)%60)}`}};var Ml=b(P()),ko=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Kv=(0,Ml.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(N)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(c=>c.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?c=>Po.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ko([(0,va.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),ko([(0,va.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),ko([Yn({store:N.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),ko([Yn({store:N.name})],t.prototype,"uiLocale",void 0),t});var Mo=b(P());var Do=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=N.getState().session;return!!t?.sessionAuthenticated}};var Bo=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=N.getState().session;return!!t?.sessionAuthenticated}};var rp="ft-user-assets",op={setAssetCount:(e,t)=>{let{userAssetType:o,count:n}=t.payload.assetCount;e.assetCounts.allAsset[o]=n},clearAssetCount:e=>{Object.values(ke).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let o=t.payload.mapId;e.assetCounts.bookmarkByMap[o]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:o,mapId:n,asset:a}=t.payload;Ca(e,o,[...Sa(e,o),a]),$l(e,o,1,n),Ul(e,a)},editAsset:(e,t)=>{let{assetType:o,asset:n}=t.payload;Ca(e,o,Sa(e,o).map(a=>a.id===n.id?n:a)),Ul(e,n)},removeAsset:(e,t)=>{let{assetType:o,mapId:n,assetId:a}=t.payload;Ca(e,o,Sa(e,o).filter(i=>i.id!==a)),$l(e,o,-1,n)}},Fl={[ke.SEARCHES]:"savedSearches",[ke.BOOKMARKS]:"bookmarks",[ke.BOOKS]:void 0,[ke.COLLECTIONS]:void 0},Sa=(e,t)=>{var o;let n=Fl[t];return n?(o=e[n])!==null&&o!==void 0?o:[]:[]},Ca=(e,t,o)=>{let n=Fl[t];n&&(e[n]=o)},$l=(e,t,o,n)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+o),t===ke.BOOKMARKS&&n)){let i=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},Ul=(e,t)=>{let o=e.assetLabels.map(a=>a.title),n=t.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));e.assetLabels.push(...n)},Le=Mo.FtReduxStore.get({name:rp,reducers:op,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ke).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Oa=class{constructor(t=new Do,o=new Bo){this.assetCountsService=t,this.assetLabelsService=o,this.currentSession=N.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new fo,this.savedSearchesService=new bo,N.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:o}=N.getState();(0,Mo.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Le.actions.clearAssetCount(),Le.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Le.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Le.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();Le.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();Le.actions.assetLabels(t)}async loadAssetCount(t){let o=await this.assetCountsService.getUserAssetCount(t);o&&Le.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(t){let o=await this.assetCountsService.getUserBookmarkCountByMap(t);o&&Le.actions.setBookmarkCountByMap({count:o.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let o=Object.keys(Le.getState().assetCounts.bookmarkByMap).length!==0;t===ke.BOOKMARKS&&o&&Le.actions.clearBookmarkCountByMap(),Le.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let o=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Le.actions.bookmarks(o)}}},np=new Oa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=np);(0,zl.customElement)("ft-app-context")(K);var Gl=b(ee());var Ea=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,a]=t.split(".");return{context:n,key:a,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},Hl=new Ea;var ap=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},ip=Symbol("i18nAttributes"),sp=Symbol("i18nListAttributes"),jl=Symbol("i18nProperties"),$o=Symbol("i18nContexts"),Vr=Symbol("i18nUnsubs"),Fo=(0,Rr.applyMixinOnce)(Symbol("withI18n"),function(e){var t,o;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?yo:br}i18n(i){let{context:l,key:c,message:p}=i,{custom:u,args:m,argsProvider:h}=i;if(l&&c){this.hasI18nContext(l)||this.addI18nContext(l,void 0,u);let g=m??(h?h(this):[]);return this.getI18nService(u).resolveMessage(l,c,...g)}return p}async awaitI18n(i){let{context:l,custom:c}=i;return l&&await this.getI18nService(c).prepareContext(l),this.i18n(i)}customI18n(i,l){if(Hl.isI18nKey(i)){let[c,p]=i.split(".");return this.i18n({custom:!0,context:c,key:p,...l})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((l,c,p)=>i.has(c)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((l,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(l=>l.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var l,c;let p=this,u=(m,h,g)=>g?.context&&g.key&&i(m,h,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...m})}:g;(l=this[ip])===null||l===void 0||l.forEach((m,h)=>p[h]=u(m,h,p[h])),(c=this[sp])===null||c===void 0||c.forEach((m,h)=>{var g;return p[h]=(g=p[h])===null||g===void 0?void 0:g.map(S=>u(m,h,S))})}updateI18nProperties(i){var l;(l=this[jl])===null||l===void 0||l.forEach((c,p)=>{i(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(i,l,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,l,c)}addI18nContext(i,l,c){let p=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[$o].set(p,{isCustomContext:c}),this[Vr].has(p)||this[Vr].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,l)}hasI18nContext(i){return this[$o].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[$o].forEach((i,l)=>this.addI18nContext(l,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Vr].forEach(i=>i()),this[Vr].clear()}}return t=$o,o=Vr,ap([(0,Gl.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Wl=class extends Fo(Rr.FtLitElement){},Uo=class extends Fo(Rr.FtLitElementRedux){};var Kr=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Ke=class extends Uo{constructor(){super(),this.editorMode=!1,this.addStore(N)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":zo.nothing:zo.html`
495
+ `}connectedCallback(){super.connectedCallback(),N.addEventListener(Ht.eventName,this.reloadConfiguration)}disconnectedCallback(){N.addEventListener(Ht.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var o,n,a,i,l,c,p;super.update(t),t.has("baseUrl")&&(N.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&N.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&N.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&N.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&N.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&N.actions.noCustom(this.noCustom),t.has("editorMode")&&N.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&N.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&N.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>br.addContext(u)),t.has("openExternalDocumentInNewTab")&&N.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&N.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&N.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(N.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),N.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),N.actions.searchInAllLanguagesAllowed((l=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),t.has("authenticationRequired")&&N.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&N.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),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",()=>Gs(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};K.elementDefinitions={};K.styles=os;le([(0,me.property)()],K.prototype,"baseUrl",void 0);le([(0,me.property)()],K.prototype,"apiIntegrationIdentifier",void 0);le([(0,me.property)()],K.prototype,"apiIntegrationAppVersion",void 0);le([(0,me.property)()],K.prototype,"uiLocale",void 0);le([(0,je.jsonProperty)(null)],K.prototype,"availableUiLocales",void 0);le([(0,je.jsonProperty)(null)],K.prototype,"metadataConfiguration",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"editorMode",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"noCustom",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);le([(0,me.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],K.prototype,"noCustomComponent",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"withManualResources",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"navigatorOnline",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"forcedOffline",void 0);le([(0,me.property)({type:Object})],K.prototype,"apiProvider",void 0);le([(0,me.property)({type:Boolean})],K.prototype,"authenticationRequired",void 0);le([(0,je.jsonProperty)([])],K.prototype,"messageContexts",void 0);le([(0,je.jsonProperty)(void 0)],K.prototype,"session",void 0);le([(0,me.state)()],K.prototype,"localesConfiguration",void 0);le([(0,me.state)()],K.prototype,"availableContentLocales",void 0);var va=b(ee());function md(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let o,n,a;if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!vo(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!vo(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let i=l=>Object.keys(l).filter(c=>l[c]!=null);if(a=i(e),o=a.length,o!==i(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;for(n=o;n--!==0;){let l=a[n];if(!vo(e[l],t[l]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function vo(e,t){try{return md(e,t)}catch{return!1}}function zr(e,t){return!vo(e,t)}function So(e,t){let o=n=>n[e]===!0;return n=>{if(o(n))return n;let a=t(n);return a[e]=!0,a}}var Vs=b(ee(),1);var Yn=e=>{let t=e??{};return(o,n)=>{var a;let i={hasChanged:zr,attribute:!1,...t};(0,Vs.property)(i)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=t.selector)!==null&&a!==void 0?a:c=>c[n],store:t.store})}};var Co=class{constructor(){this.queue=[]}add(t,o=!1){o&&this.clear(t.type),this.queue.push(t)}consume(t){let o=this.queue.find(n=>n.type===t);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(t){typeof t=="string"?this.queue=this.queue.filter(o=>o.type!==t):this.queue=this.queue.filter(o=>!t.test(o.type))}};var jt=b(ee(),1);var Ks=b(ee(),1);function Zs(e,t){let o=()=>JSON.parse(JSON.stringify(e));return(0,Ks.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:zr,...t??{}})}var Oo=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,o){return this.callbacks=[t],this.debounce(o)}queue(t,o){return this.callbacks.push(t),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,o;let n=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(c){a(c);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ys=b(z(),1);var Eo=globalThis,gd=Eo.ShadowRoot&&(Eo.ShadyCSS===void 0||Eo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wx=Symbol();var qs=(e,t)=>{if(gd)e.adoptedStyleSheets=t.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of t){let n=document.createElement("style"),a=Eo.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,e.appendChild(n)}};var Ao=class extends Ys.LitElement{createRenderRoot(){let t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach(([a,i])=>t.registry.define(a,i)));let o={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return qs(n,t.elementStyles),n}};function Xs(e,t,...o){var n;let a=e.querySelector(t);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var Sr=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},tl,Js=Symbol("constructorPrototype"),Qs=Symbol("constructorName"),rl=Symbol("exportpartsDebouncer"),el=Symbol("dynamicDependenciesLoaded"),vr=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};vr.eventName="exportparts-updated";var tt=class extends Ao{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[tl]=new Oo(5),this.scheduleExportpartsUpdate=()=>{var t,o,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[rl].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Qs]=this.constructor.name,this[Js]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Qs]&&Object.setPrototypeOf(this,this[Js])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let o=this.constructor;o[el]||(o[el]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(vr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(vr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new vr)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=Xs(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var o,n,a,i,l,c;let p=g=>g!=null&&g.trim().length>0,u=t.filter(p).map(g=>g.trim());if(u.length===0){this.exportparts=void 0;return}let m=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(i=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],v=(c=(l=g.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(L=>L.split(":")[1]))!==null&&c!==void 0?c:[],O=[...S,...v].filter(p).map(L=>L.trim());for(let L of O)m.add(L)}if(m.size===0){this.exportparts=void 0;return}let h=[...m.values()].flatMap(g=>u.map(S=>`${g}:${S}--${g}`));this.exportparts=[...this.part,...h].join(", ")}};tl=rl;Sr([(0,jt.property)()],tt.prototype,"exportpartsPrefix",void 0);Sr([Zs([])],tt.prototype,"exportpartsPrefixes",void 0);Sr([(0,jt.property)({reflect:!0})],tt.prototype,"exportparts",void 0);Sr([(0,jt.property)()],tt.prototype,"customStylesheet",void 0);Sr([(0,jt.property)()],tt.prototype,"elementToFocus",void 0);Sr([(0,jt.state)()],tt.prototype,"useAdoptedStyleSheets",void 0);function wo(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Hr=Symbol("internalReduxEventsUnsubscribers"),At=Symbol("internalStoresUnsubscribers"),Vt=Symbol("internalStores"),bd=So(Symbol("withRedux"),function(e){var t,o,n;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(c=>l.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[Vt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Vt].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[Vt].get(l)}addStore(l,c){var p;c=(p=c??l.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[Vt].set(c,l),this.subscribeToStore(c,l),this.updateFromStores()}removeStore(l){let c=typeof l=="string"?l:l.name;this.unsubscribeFromStore(c),this[Vt].delete(c)}setupStores(){this.unsubscribeFromStores(),this[Vt].forEach((l,c)=>this.subscribeToStore(c,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(l.store);u&&(l.store?this[At].has(l.store):this[At].size>0)&&(this[c]=l.selector(u.getState(),this))}})}subscribeToStore(l,c){var p;this[At].set(l,c.subscribe(()=>this.updateFromStores())),this[Hr].set(l,[]),wo(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,m)=>{if(typeof this[m]=="function"&&(!u.store||c.name===u.store)){let h=g=>this[m](g);c.addEventListener(u.eventName,h),this[Hr].get(l).push(()=>c.removeEventListener(u.eventName,h))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[At].forEach((l,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(l){var c;this[At].has(l)&&this[At].get(l)(),this[At].delete(l),(c=this[Hr].get(l))===null||c===void 0||c.forEach(p=>p()),this[Hr].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=At,o=Vt,n=Hr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),ol=class extends bd(tt){};function De(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(o.length?" "+o.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function pt(e){return!!e&&!!e[Z]}function Ve(e){var t;return!!e&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===wd}(e)||Array.isArray(e)||!!e[dl]||!!(!((t=e.constructor)===null||t===void 0)&&t[dl])||aa(e)||ia(e))}function Kt(e,t,o){o===void 0&&(o=!1),Er(e)===0?(o?Object.keys:Or)(e).forEach(function(n){o&&typeof n=="symbol"||t(n,e[n],e)}):e.forEach(function(n,a){return t(a,n,e)})}function Er(e){var t=e[Z];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:aa(e)?2:ia(e)?3:0}function Cr(e,t){return Er(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xd(e,t){return Er(e)===2?e.get(t):e[t]}function pl(e,t,o){var n=Er(e);n===2?e.set(t,o):n===3?e.add(o):e[t]=o}function ul(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function aa(e){return Ed&&e instanceof Map}function ia(e){return Ad&&e instanceof Set}function wt(e){return e.o||e.t}function sa(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=yl(e);delete t[Z];for(var o=Or(t),n=0;n<o.length;n++){var a=o[n],i=t[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),t)}function la(e,t){return t===void 0&&(t=!1),ca(e)||pt(e)||!Ve(e)||(Er(e)>1&&(e.set=e.add=e.clear=e.delete=vd),Object.freeze(e),t&&Kt(e,function(o,n){return la(n,!0)},!0)),e}function vd(){De(2)}function ca(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function rt(e){var t=na[e];return t||De(18,e),t}function Sd(e,t){na[e]||(na[e]=t)}function ta(){return Gr}function Xn(e,t){t&&(rt("Patches"),e.u=[],e.s=[],e.v=t)}function Ro(e){ra(e),e.p.forEach(Cd),e.p=null}function ra(e){e===Gr&&(Gr=e.l)}function nl(e){return Gr={p:[],l:Gr,h:e,m:!0,_:0}}function Cd(e){var t=e[Z];t.i===0||t.i===1?t.j():t.g=!0}function Jn(e,t){t._=t.p.length;var o=t.p[0],n=e!==void 0&&e!==o;return t.h.O||rt("ES5").S(t,e,n),n?(o[Z].P&&(Ro(t),De(4)),Ve(e)&&(e=Io(t,e),t.l||Lo(t,e)),t.u&&rt("Patches").M(o[Z].t,e,t.u,t.s)):e=Io(t,o,[]),Ro(t),t.u&&t.v(t.u,t.s),e!==hl?e:void 0}function Io(e,t,o){if(ca(t))return t;var n=t[Z];if(!n)return Kt(t,function(c,p){return al(e,n,t,c,p,o)},!0),t;if(n.A!==e)return t;if(!n.P)return Lo(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=sa(n.k):n.o,i=a,l=!1;n.i===3&&(i=new Set(a),a.clear(),l=!0),Kt(i,function(c,p){return al(e,n,a,c,p,o,l)}),Lo(e,a,!1),o&&e.u&&rt("Patches").N(n,o,e.u,e.s)}return n.o}function al(e,t,o,n,a,i,l){if(pt(a)){var c=Io(e,a,i&&t&&t.i!==3&&!Cr(t.R,n)?i.concat(n):void 0);if(pl(o,n,c),!pt(c))return;e.m=!1}else l&&o.add(a);if(Ve(a)&&!ca(a)){if(!e.h.D&&e._<1)return;Io(e,a),t&&t.A.l||Lo(e,a)}}function Lo(e,t,o){o===void 0&&(o=!1),!e.l&&e.h.D&&e.m&&la(t,o)}function Qn(e,t){var o=e[Z];return(o?wt(o):e)[t]}function il(e,t){if(t in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function Rt(e){e.P||(e.P=!0,e.l&&Rt(e.l))}function ea(e){e.o||(e.o=sa(e.t))}function oa(e,t,o){var n=aa(t)?rt("MapSet").F(t,o):ia(t)?rt("MapSet").T(t,o):e.O?function(a,i){var l=Array.isArray(a),c={i:l?1:0,A:i?i.A:ta(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},p=c,u=jr;l&&(p=[c],u=Wr);var m=Proxy.revocable(p,u),h=m.revoke,g=m.proxy;return c.k=g,c.j=h,g}(t,o):rt("ES5").J(t,o);return(o?o.A:ta()).p.push(n),n}function Od(e){return pt(e)||De(22,e),function t(o){if(!Ve(o))return o;var n,a=o[Z],i=Er(o);if(a){if(!a.P&&(a.i<4||!rt("ES5").K(a)))return a.t;a.I=!0,n=sl(o,i),a.I=!1}else n=sl(o,i);return Kt(n,function(l,c){a&&xd(a.t,l)===c||pl(n,l,t(c))}),i===3?new Set(n):n}(e)}function sl(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return sa(e)}function fl(){function e(l,c){var p=i[l];return p?p.enumerable=c:i[l]=p={configurable:!0,enumerable:c,get:function(){var u=this[Z];return jr.get(u,l)},set:function(u){var m=this[Z];jr.set(m,l,u)}},p}function t(l){for(var c=l.length-1;c>=0;c--){var p=l[c][Z];if(!p.P)switch(p.i){case 5:n(p)&&Rt(p);break;case 4:o(p)&&Rt(p)}}}function o(l){for(var c=l.t,p=l.k,u=Or(p),m=u.length-1;m>=0;m--){var h=u[m];if(h!==Z){var g=c[h];if(g===void 0&&!Cr(c,h))return!0;var S=p[h],v=S&&S[Z];if(v?v.t!==g:!ul(S,g))return!0}}var O=!!c[Z];return u.length!==Or(c).length+(O?0:1)}function n(l){var c=l.k;if(c.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function a(l){l.g&&De(3,JSON.stringify(wt(l)))}var i={};Sd("ES5",{J:function(l,c){var p=Array.isArray(l),u=function(h,g){if(h){for(var S=Array(g.length),v=0;v<g.length;v++)Object.defineProperty(S,""+v,e(v,!0));return S}var O=yl(g);delete O[Z];for(var L=Or(O),I=0;I<L.length;I++){var T=L[I];O[T]=e(T,h||!!O[T].enumerable)}return Object.create(Object.getPrototypeOf(g),O)}(p,l),m={i:p?5:4,A:c?c.A:ta(),P:!1,I:!1,R:{},l:c,t:l,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Z,{value:m,writable:!0}),u},S:function(l,c,p){p?pt(c)&&c[Z].A===l&&t(l.p):(l.u&&function u(m){if(m&&typeof m=="object"){var h=m[Z];if(h){var g=h.t,S=h.k,v=h.R,O=h.i;if(O===4)Kt(S,function($){$!==Z&&(g[$]!==void 0||Cr(g,$)?v[$]||u(S[$]):(v[$]=!0,Rt(h)))}),Kt(g,function($){S[$]!==void 0||Cr(S,$)||(v[$]=!1,Rt(h))});else if(O===5){if(n(h)&&(Rt(h),v.length=!0),S.length<g.length)for(var L=S.length;L<g.length;L++)v[L]=!1;else for(var I=g.length;I<S.length;I++)v[I]=!0;for(var T=Math.min(S.length,g.length),B=0;B<T;B++)S.hasOwnProperty(B)||(v[B]=!0),v[B]===void 0&&u(S[B])}}}}(l.p[0]),t(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var ll,Gr,da=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Ed=typeof Map<"u",Ad=typeof Set<"u",cl=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",hl=da?Symbol.for("immer-nothing"):((ll={})["immer-nothing"]=!0,ll),dl=da?Symbol.for("immer-draftable"):"__$immer_draftable",Z=da?Symbol.for("immer-state"):"__$immer_state";var wd=""+Object.prototype.constructor,Or=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,yl=Object.getOwnPropertyDescriptors||function(e){var t={};return Or(e).forEach(function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)}),t},na={},jr={get:function(e,t){if(t===Z)return e;var o=wt(e);if(!Cr(o,t))return function(a,i,l){var c,p=il(i,l);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(a.k):void 0}(e,o,t);var n=o[t];return e.I||!Ve(n)?n:n===Qn(e.t,t)?(ea(e),e.o[t]=oa(e.A.h,n,e)):n},has:function(e,t){return t in wt(e)},ownKeys:function(e){return Reflect.ownKeys(wt(e))},set:function(e,t,o){var n=il(wt(e),t);if(n?.set)return n.set.call(e.k,o),!0;if(!e.P){var a=Qn(wt(e),t),i=a?.[Z];if(i&&i.t===o)return e.o[t]=o,e.R[t]=!1,!0;if(ul(o,a)&&(o!==void 0||Cr(e.t,t)))return!0;ea(e),Rt(e)}return e.o[t]===o&&(o!==void 0||t in e.o)||Number.isNaN(o)&&Number.isNaN(e.o[t])||(e.o[t]=o,e.R[t]=!0),!0},deleteProperty:function(e,t){return Qn(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,ea(e),Rt(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=wt(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:o[t]}},defineProperty:function(){De(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){De(12)}},Wr={};Kt(jr,function(e,t){Wr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Wr.deleteProperty=function(e,t){return Wr.set.call(this,e,t,void 0)},Wr.set=function(e,t,o){return jr.set.call(this,e[0],t,o,e[0])};var Rd=function(){function e(o){var n=this;this.O=cl,this.D=!0,this.produce=function(a,i,l){if(typeof a=="function"&&typeof i!="function"){var c=i;i=a;var p=n;return function(O){var L=this;O===void 0&&(O=c);for(var I=arguments.length,T=Array(I>1?I-1:0),B=1;B<I;B++)T[B-1]=arguments[B];return p.produce(O,function($){var U;return(U=i).call.apply(U,[L,$].concat(T))})}}var u;if(typeof i!="function"&&De(6),l!==void 0&&typeof l!="function"&&De(7),Ve(a)){var m=nl(n),h=oa(n,a,void 0),g=!0;try{u=i(h),g=!1}finally{g?Ro(m):ra(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return Xn(m,l),Jn(O,m)},function(O){throw Ro(m),O}):(Xn(m,l),Jn(u,m))}if(!a||typeof a!="object"){if((u=i(a))===void 0&&(u=a),u===hl&&(u=void 0),n.D&&la(u,!0),l){var S=[],v=[];rt("Patches").M(a,u,S,v),l(S,v)}return u}De(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(u){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];return n.produceWithPatches(u,function(S){return a.apply(void 0,[S].concat(h))})};var l,c,p=n.produce(a,i,function(u,m){l=u,c=m});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,l,c]}):[p,l,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var t=e.prototype;return t.createDraft=function(o){Ve(o)||De(8),pt(o)&&(o=Od(o));var n=nl(this),a=oa(this,o,void 0);return a[Z].C=!0,ra(n),a},t.finishDraft=function(o,n){var a=o&&o[Z],i=a.A;return Xn(i,n),Jn(void 0,i)},t.setAutoFreeze=function(o){this.D=o},t.setUseProxies=function(o){o&&!cl&&De(20),this.O=o},t.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var l=rt("Patches").$;return pt(o)?l(o,n):this.produce(o,function(c){return l(c,n)})},e}(),Ie=new Rd,Id=Ie.produce,zx=Ie.produceWithPatches.bind(Ie),Hx=Ie.setAutoFreeze.bind(Ie),Wx=Ie.setUseProxies.bind(Ie),Gx=Ie.applyPatches.bind(Ie),jx=Ie.createDraft.bind(Ie),Vx=Ie.finishDraft.bind(Ie),To=Id;function Zt(e){"@babel/helpers - typeof";return Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(e)}function ml(e,t){if(Zt(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,t||"default");if(Zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gl(e){var t=ml(e,"string");return Zt(t)=="symbol"?t:t+""}function bl(e,t,o){return(t=gl(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function xl(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),o.push.apply(o,n)}return o}function pa(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?xl(Object(o),!0).forEach(function(n){bl(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):xl(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function be(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var vl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ua=function(){return Math.random().toString(36).substring(7).split("").join(".")},No={INIT:"@@redux/INIT"+ua(),REPLACE:"@@redux/REPLACE"+ua(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ua()}};function Ld(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function fa(e,t,o){var n;if(typeof t=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof o>"u"&&(o=t,t=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(be(1));return o(fa)(e,t)}if(typeof e!="function")throw new Error(be(2));var a=e,i=t,l=[],c=l,p=!1;function u(){c===l&&(c=l.slice())}function m(){if(p)throw new Error(be(3));return i}function h(O){if(typeof O!="function")throw new Error(be(4));if(p)throw new Error(be(5));var L=!0;return u(),c.push(O),function(){if(L){if(p)throw new Error(be(6));L=!1,u();var T=c.indexOf(O);c.splice(T,1),l=null}}}function g(O){if(!Ld(O))throw new Error(be(7));if(typeof O.type>"u")throw new Error(be(8));if(p)throw new Error(be(9));try{p=!0,i=a(i,O)}finally{p=!1}for(var L=l=c,I=0;I<L.length;I++){var T=L[I];T()}return O}function S(O){if(typeof O!="function")throw new Error(be(10));a=O,g({type:No.REPLACE})}function v(){var O,L=h;return O={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(be(11));function B(){T.next&&T.next(m())}B();var $=L(B);return{unsubscribe:$}}},O[vl]=function(){return this},O}return g({type:No.INIT}),n={dispatch:g,subscribe:h,getState:m,replaceReducer:S},n[vl]=v,n}function Td(e){Object.keys(e).forEach(function(t){var o=e[t],n=o(void 0,{type:No.INIT});if(typeof n>"u")throw new Error(be(12));if(typeof o(void 0,{type:No.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function Sl(e){for(var t=Object.keys(e),o={},n=0;n<t.length;n++){var a=t[n];typeof e[a]=="function"&&(o[a]=e[a])}var i=Object.keys(o),l,c;try{Td(o)}catch(p){c=p}return function(u,m){if(u===void 0&&(u={}),c)throw c;if(0)var h;for(var g=!1,S={},v=0;v<i.length;v++){var O=i[v],L=o[O],I=u[O],T=L(I,m);if(typeof T>"u"){var B=m&&m.type;throw new Error(be(14))}S[O]=T,g=g||T!==I}return g=g||i.length!==Object.keys(u).length,g?S:u}}function Ar(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Cl(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(be(15))},l={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},c=t.map(function(p){return p(l)});return i=Ar.apply(void 0,c)(a.dispatch),pa(pa({},a),{},{dispatch:i})}}}function Ol(e){var t=function(n){var a=n.dispatch,i=n.getState;return function(l){return function(c){return typeof c=="function"?c(a,i,e):l(c)}}};return t}var El=Ol();El.withExtraArgument=Ol;var ha=El;var Ll=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(t,o)};return function(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(t,o);function n(){this.constructor=t}t.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),Nd=function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(u){return function(m){return p([u,m])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,a=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(u[0]===6&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(m){u=[6,m],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},wr=function(e,t){for(var o=0,n=t.length,a=e.length;o<n;o++,a++)e[a]=t[o];return e},_d=Object.defineProperty,Pd=Object.defineProperties,kd=Object.getOwnPropertyDescriptors,Al=Object.getOwnPropertySymbols,Dd=Object.prototype.hasOwnProperty,Bd=Object.prototype.propertyIsEnumerable,wl=function(e,t,o){return t in e?_d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o},It=function(e,t){for(var o in t||(t={}))Dd.call(t,o)&&wl(e,o,t[o]);if(Al)for(var n=0,a=Al(t);n<a.length;n++){var o=a[n];Bd.call(t,o)&&wl(e,o,t[o])}return e},ya=function(e,t){return Pd(e,kd(t))},Md=function(e,t,o){return new Promise(function(n,a){var i=function(p){try{c(o.next(p))}catch(u){a(u)}},l=function(p){try{c(o.throw(p))}catch(u){a(u)}},c=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(i,l)};c((o=o.apply(e,t)).next())})};var $d=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ar:Ar.apply(null,arguments)},dv=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Ud(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var o=t;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return t===o}var Fd=function(e){Ll(t,e);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,t.prototype),a}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},t.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(t.bind.apply(t,wr([void 0],o[0].concat(this)))):new(t.bind.apply(t,wr([void 0],o.concat(this))))},t}(Array),zd=function(e){Ll(t,e);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,t.prototype),a}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},t.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(t.bind.apply(t,wr([void 0],o[0].concat(this)))):new(t.bind.apply(t,wr([void 0],o.concat(this))))},t}(Array);function ba(e){return Ve(e)?To(e,function(){}):e}function Hd(e){return typeof e=="boolean"}function Wd(){return function(t){return Gd(t)}}function Gd(e){e===void 0&&(e={});var t=e.thunk,o=t===void 0?!0:t,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,l=i===void 0?!0:i,c=new Fd;if(o&&(Hd(o)?c.push(ha):c.push(ha.withExtraArgument(o.extraArgument))),0){if(a)var p;if(l)var u}return c}var ma=!0;function Tl(e){var t=Wd(),o=e||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,l=i===void 0?t():i,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,m=u===void 0?void 0:u,h=o.enhancers,g=h===void 0?void 0:h,S;if(typeof a=="function")S=a;else if(Ud(a))S=Sl(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=l;if(typeof v=="function"&&(v=v(t),!ma&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ma&&v.some(function($){return typeof $!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Cl.apply(void 0,v),L=Ar;p&&(L=$d(It({trace:!ma},typeof p=="object"&&p)));var I=new zd(O),T=I;Array.isArray(g)?T=wr([O],g):typeof g=="function"&&(T=g(I));var B=L.apply(void 0,T);return fa(S,m,B)}function Lt(e,t){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return It(It({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return o.toString=function(){return""+e},o.type=e,o.match=function(n){return n.type===e},o}function Nl(e){var t={},o=[],n,a={addCase:function(i,l){var c=typeof i=="string"?i:i.type;if(c in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[c]=l,a},addMatcher:function(i,l){return o.push({matcher:i,reducer:l}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[t,o,n]}function jd(e){return typeof e=="function"}function Vd(e,t,o,n){o===void 0&&(o=[]);var a=typeof t=="function"?Nl(t):[t,o,n],i=a[0],l=a[1],c=a[2],p;if(jd(e))p=function(){return ba(e())};else{var u=ba(e);p=function(){return u}}function m(h,g){h===void 0&&(h=p());var S=wr([i[g.type]],l.filter(function(v){var O=v.matcher;return O(g)}).map(function(v){var O=v.reducer;return O}));return S.filter(function(v){return!!v}).length===0&&(S=[c]),S.reduce(function(v,O){if(O)if(pt(v)){var L=v,I=O(L,g);return I===void 0?v:I}else{if(Ve(v))return To(v,function(T){return O(T,g)});var I=O(v,g);if(I===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return v},h)}return m.getInitialState=p,m}function Kd(e,t){return e+"/"+t}function _l(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof e.initialState=="function"?e.initialState:ba(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},l={},c={};a.forEach(function(m){var h=n[m],g=Kd(t,m),S,v;"reducer"in h?(S=h.reducer,v=h.prepare):S=h,i[m]=S,l[g]=S,c[m]=v?Lt(g,v):Lt(g)});function p(){var m=typeof e.extraReducers=="function"?Nl(e.extraReducers):[e.extraReducers],h=m[0],g=h===void 0?{}:h,S=m[1],v=S===void 0?[]:S,O=m[2],L=O===void 0?void 0:O,I=It(It({},g),l);return Vd(o,function(T){for(var B in I)T.addCase(B,I[B]);for(var $=0,U=v;$<U.length;$++){var ve=U[$];T.addMatcher(ve.matcher,ve.reducer)}L&&T.addDefaultCase(L)})}var u;return{name:t,reducer:function(m,h){return u||(u=p()),u(m,h)},actions:c,caseReducers:i,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Zd="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",qd=function(e){e===void 0&&(e=21);for(var t="",o=e;o--;)t+=Zd[Math.random()*64|0];return t},Yd=["name","message","stack","code"],ga=function(){function e(t,o){this.payload=t,this.meta=o}return e}(),Rl=function(){function e(t,o){this.payload=t,this.meta=o}return e}(),Xd=function(e){if(typeof e=="object"&&e!==null){for(var t={},o=0,n=Yd;o<n.length;o++){var a=n[o];typeof e[a]=="string"&&(t[a]=e[a])}return t}return{message:String(e)}},hv=function(){function e(t,o,n){var a=Lt(t+"/fulfilled",function(m,h,g,S){return{payload:m,meta:ya(It({},S||{}),{arg:g,requestId:h,requestStatus:"fulfilled"})}}),i=Lt(t+"/pending",function(m,h,g){return{payload:void 0,meta:ya(It({},g||{}),{arg:h,requestId:m,requestStatus:"pending"})}}),l=Lt(t+"/rejected",function(m,h,g,S,v){return{payload:S,error:(n&&n.serializeError||Xd)(m||"Rejected"),meta:ya(It({},v||{}),{arg:g,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(h,g,S){var v=n?.idGenerator?n.idGenerator(m):qd(),O=new p,L,I=!1;function T($){L=$,O.abort()}var B=function(){return Md(this,null,function(){var $,U,ve,Xe,xe,Je,fe;return Nd(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),Xe=($=n?.condition)==null?void 0:$.call(n,m,{getState:g,extra:S}),Qd(Xe)?[4,Xe]:[3,2];case 1:Xe=y.sent(),y.label=2;case 2:if(Xe===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,xe=new Promise(function(x,D){return O.signal.addEventListener("abort",function(){return D({name:"AbortError",message:L||"Aborted"})})}),h(i(v,m,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:v,arg:m},{getState:g,extra:S}))),[4,Promise.race([xe,Promise.resolve(o(m,{dispatch:h,getState:g,extra:S,requestId:v,signal:O.signal,abort:T,rejectWithValue:function(x,D){return new ga(x,D)},fulfillWithValue:function(x,D){return new Rl(x,D)}})).then(function(x){if(x instanceof ga)throw x;return x instanceof Rl?a(x.payload,v,m,x.meta):a(x,v,m)})])];case 3:return ve=y.sent(),[3,5];case 4:return Je=y.sent(),ve=Je instanceof ga?l(null,v,m,Je.payload,Je.meta):l(Je,v,m),[3,5];case 5:return fe=n&&!n.dispatchConditionRejection&&l.match(ve)&&ve.meta.condition,fe||h(ve),[2,ve]}})})}();return Object.assign(B,{abort:T,requestId:v,arg:m,unwrap:function(){return B.then(Jd)}})}}return Object.assign(u,{pending:i,rejected:l,fulfilled:a,typePrefix:t})}return e.withTypes=function(){return e},e}();function Jd(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Qd(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Pl="listener",kl="completed",Dl="cancelled",yv="task-"+Dl,mv="task-"+kl,gv=Pl+"-"+Dl,bv=Pl+"-"+kl;var xa="listenerMiddleware";var xv=Lt(xa+"/add"),vv=Lt(xa+"/removeAll"),Sv=Lt(xa+"/remove");var Il,Cv=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Il||(Il=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},ep=function(e){return function(t){setTimeout(t,e)}},Ov=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ep(10);fl();var tp=So(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}),_o=class extends tp(Object){};window.ftReduxStores||(window.ftReduxStores={});var Bl=class e extends _o{static get(t){var o;let n=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[n];if(wo(i))return i;if(a==null)return;let l=_l({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),c=Tl({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:l.reducer(p,u)});return window.ftReduxStores[a.name]=new e(l,c,a.eventBus)}constructor(t,o,n){super(),this.reduxSlice=t,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Co;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,l,c)=>{let p=l,u=i[p];return u?(...m)=>{let h=u(...m.map(a));return this.reduxStore.dispatch(h),h}:m=>{this.setState({[p]:a(m)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Po=class{static format(t,o,n,a){return window.moment?window.moment(t).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(t,o,n,a)}static getMomentDateFormat(t,o){return t?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(t,o,n,a){let i=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(i);if(!a)return l;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(i);return`${l} ${c}`}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${t(Math.abs(o)/60)}:${t(Math.abs(o)%60)}`}};var Ml=b(P()),ko=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Kv=(0,Ml.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(N)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(c=>c.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?c=>Po.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ko([(0,va.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),ko([(0,va.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),ko([Yn({store:N.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),ko([Yn({store:N.name})],t.prototype,"uiLocale",void 0),t});var Mo=b(P());var Do=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=N.getState().session;return!!t?.sessionAuthenticated}};var Bo=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=N.getState().session;return!!t?.sessionAuthenticated}};var rp="ft-user-assets",op={setAssetCount:(e,t)=>{let{userAssetType:o,count:n}=t.payload.assetCount;e.assetCounts.allAsset[o]=n},clearAssetCount:e=>{Object.values(ke).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let o=t.payload.mapId;e.assetCounts.bookmarkByMap[o]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:o,mapId:n,asset:a}=t.payload;Ca(e,o,[...Sa(e,o),a]),$l(e,o,1,n),Ul(e,a)},editAsset:(e,t)=>{let{assetType:o,asset:n}=t.payload;Ca(e,o,Sa(e,o).map(a=>a.id===n.id?n:a)),Ul(e,n)},removeAsset:(e,t)=>{let{assetType:o,mapId:n,assetId:a}=t.payload;Ca(e,o,Sa(e,o).filter(i=>i.id!==a)),$l(e,o,-1,n)}},Fl={[ke.SEARCHES]:"savedSearches",[ke.BOOKMARKS]:"bookmarks",[ke.BOOKS]:void 0,[ke.COLLECTIONS]:void 0},Sa=(e,t)=>{var o;let n=Fl[t];return n?(o=e[n])!==null&&o!==void 0?o:[]:[]},Ca=(e,t,o)=>{let n=Fl[t];n&&(e[n]=o)},$l=(e,t,o,n)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+o),t===ke.BOOKMARKS&&n)){let i=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},Ul=(e,t)=>{let o=e.assetLabels.map(a=>a.title),n=t.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));e.assetLabels.push(...n)},Le=Mo.FtReduxStore.get({name:rp,reducers:op,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ke).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Oa=class{constructor(t=new Do,o=new Bo){this.assetCountsService=t,this.assetLabelsService=o,this.currentSession=N.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new fo,this.savedSearchesService=new bo,N.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:o}=N.getState();(0,Mo.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Le.actions.clearAssetCount(),Le.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Le.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Le.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();Le.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();Le.actions.assetLabels(t)}async loadAssetCount(t){let o=await this.assetCountsService.getUserAssetCount(t);o&&Le.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(t){let o=await this.assetCountsService.getUserBookmarkCountByMap(t);o&&Le.actions.setBookmarkCountByMap({count:o.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let o=Object.keys(Le.getState().assetCounts.bookmarkByMap).length!==0;t===ke.BOOKMARKS&&o&&Le.actions.clearBookmarkCountByMap(),Le.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let o=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Le.actions.bookmarks(o)}}},np=new Oa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=np);(0,zl.customElement)("ft-app-context")(K);var Gl=b(ee());var Ea=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,a]=t.split(".");return{context:n,key:a,custom:!0,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},Hl=new Ea;var ap=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},ip=Symbol("i18nAttributes"),sp=Symbol("i18nListAttributes"),jl=Symbol("i18nProperties"),$o=Symbol("i18nContexts"),Vr=Symbol("i18nUnsubs"),Fo=(0,Rr.applyMixinOnce)(Symbol("withI18n"),function(e){var t,o;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?yo:br}i18n(i){let{context:l,key:c,message:p}=i,{custom:u,args:m,argsProvider:h}=i;if(l&&c){this.hasI18nContext(l)||this.addI18nContext(l,void 0,u);let g=m??(h?h(this):[]);return this.getI18nService(u).resolveMessage(l,c,...g)}return p}async awaitI18n(i){let{context:l,custom:c}=i;return l&&await this.getI18nService(c).prepareContext(l),this.i18n(i)}customI18n(i,l){if(Hl.isI18nKey(i)){let[c,p]=i.split(".");return this.i18n({custom:!0,context:c,key:p,...l})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((l,c,p)=>i.has(c)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((l,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(l=>l.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var l,c;let p=this,u=(m,h,g)=>g?.context&&g.key&&i(m,h,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...m})}:g;(l=this[ip])===null||l===void 0||l.forEach((m,h)=>p[h]=u(m,h,p[h])),(c=this[sp])===null||c===void 0||c.forEach((m,h)=>{var g;return p[h]=(g=p[h])===null||g===void 0?void 0:g.map(S=>u(m,h,S))})}updateI18nProperties(i){var l;(l=this[jl])===null||l===void 0||l.forEach((c,p)=>{i(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(i,l,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,l,c)}addI18nContext(i,l,c){let p=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[$o].set(p,{isCustomContext:c}),this[Vr].has(p)||this[Vr].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,l)}hasI18nContext(i){return this[$o].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[$o].forEach((i,l)=>this.addI18nContext(l,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Vr].forEach(i=>i()),this[Vr].clear()}}return t=$o,o=Vr,ap([(0,Gl.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Wl=class extends Fo(Rr.FtLitElement){},Uo=class extends Fo(Rr.FtLitElementRedux){};var Kr=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Ke=class extends Uo{constructor(){super(),this.editorMode=!1,this.addStore(N)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":zo.nothing:zo.html`
496
496
  <span class="ft-i18n">
497
497
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
498
498
  </span>
@@ -572,7 +572,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
572
572
  `;var sd=N`
573
573
  `;var Af="ft-app-info",nr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};nr.eventName="authentication-change";var Rf={session:(t,e)=>{Le(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>k.dispatchEvent(new nr(e.payload)),0))}},k=tr.get({name:Af,reducers:Rf,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 ir=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=k.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=k.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var Pn=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ir.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ir.await()}};var Me=class extends Pn{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new nt,this.cache=e?i.commonCache:new nt}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var kn=class extends Me{async listMyBookmarks(){let e=k.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Qa=class{addCommand(e,o=!1){k.commands.add(e,o)}consumeCommand(e){return k.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Qa;var ld,Vr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},If=Symbol("clearAfterUnitTest"),Dn=class extends Ho(Me){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ld]=()=>{this.defaultMessages={},this.cache=new nt,this.listeners={}},this.currentUiLocale=k.getState().uiLocale,k.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=k.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};Le(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new yo((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(i){!(i instanceof Gt)&&o&&console.error(i)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Vr({loadedContexts:e})),this.dispatchEvent(new Vr({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new Vr({loadedContexts:[e]})),this.dispatchEvent(new Vr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Uo(0).then(()=>n()).catch(()=>null)))}};ld=If;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Dn{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Dn{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Kr=window.FluidTopicsI18nService,Mn=window.FluidTopicsCustomI18nService;var es=class{highlightHtml(e,o,n){oa(e,o,n)}};window.FluidTopicsHighlightHtmlService=new es;var $n=class extends Me{async listMySearches(){let{session:e}=k.getState();return Ic(e,de.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ts=class{isDate(e){var o,n,i,a;return(a=(i=((n=(o=k.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a;return rr.format(e,(n=o?.locale)!==null&&n!==void 0?n:k.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new ts;var Eo=class{static get(e,o){var n,i;let a=k.getState(),{lang:s,region:l}=(i=(n=a.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Nr(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,o??`${s}-${l}`)}};var rs=class{urlToSearchRequest(e){return Eo.get().parse(e)}searchRequestToUrl(e){return Eo.get().serialize(e)}};window.FluidTopicsUrlService=new rs;var ar=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ar.eventName="change";var os=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},cd=new os;var Bn=class t extends ht{static build(){return new t(window.history,cd,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},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),Le(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ar(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,l])=>{let d=o(),u={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(i,[u,s,l]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.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(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(ar.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ar.eventName,e)}currentItem(){return no(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return no(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return no(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var dd=k;function pd(t,e){var o;return dd.getState().authenticationRequired&&!(!((o=dd.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var ue=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},oe=class extends H{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=()=>ir.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new nt,this.cleanSessionDebouncer=new _e,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return F`
574
574
  <slot></slot>
575
- `}connectedCallback(){super.connectedCallback(),k.addEventListener(nr.eventName,this.reloadConfiguration)}disconnectedCallback(){k.addEventListener(nr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,i,a,s,l,d;super.update(e),e.has("baseUrl")&&(k.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&k.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&k.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&k.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&k.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&k.actions.noCustom(this.noCustom),e.has("editorMode")&&k.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&k.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&k.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>Kr.addContext(u)),e.has("openExternalDocumentInNewTab")&&k.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&k.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&k.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(k.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),k.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),k.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&k.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&k.actions.availableContentLocales((d=(l=this.availableContentLocales)===null||l===void 0?void 0:l.contentLocales)!==null&&d!==void 0?d:[]),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 e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}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",()=>pd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};oe.elementDefinitions={};oe.styles=sd;ue([v()],oe.prototype,"baseUrl",void 0);ue([v()],oe.prototype,"apiIntegrationIdentifier",void 0);ue([v()],oe.prototype,"apiIntegrationAppVersion",void 0);ue([v()],oe.prototype,"uiLocale",void 0);ue([Fe(null)],oe.prototype,"availableUiLocales",void 0);ue([Fe(null)],oe.prototype,"metadataConfiguration",void 0);ue([v({type:Boolean})],oe.prototype,"editorMode",void 0);ue([v({type:Boolean})],oe.prototype,"noCustom",void 0);ue([v({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);ue([v({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);ue([v({type:Boolean})],oe.prototype,"withManualResources",void 0);ue([v({type:Boolean})],oe.prototype,"navigatorOnline",void 0);ue([v({type:Boolean})],oe.prototype,"forcedOffline",void 0);ue([v({type:Object})],oe.prototype,"apiProvider",void 0);ue([v({type:Boolean})],oe.prototype,"authenticationRequired",void 0);ue([Fe([])],oe.prototype,"messageContexts",void 0);ue([Fe(void 0)],oe.prototype,"session",void 0);ue([Y()],oe.prototype,"localesConfiguration",void 0);ue([Y()],oe.prototype,"availableContentLocales",void 0);var Fn=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},gw=xe(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(k)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>rr.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Fn([v({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Fn([v({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Fn([Cr({store:k.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Fn([Cr({store:k.name})],e.prototype,"uiLocale",void 0),e});var Un=class extends Me{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=k.getState().session;return!!e?.sessionAuthenticated}};var zn=class extends Me{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=k.getState().session;return!!e?.sessionAuthenticated}};var Tf="ft-user-assets",Lf={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(He).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;is(t,o,[...ns(t,o),i]),ud(t,o,1,n),fd(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;is(t,o,ns(t,o).map(i=>i.id===n.id?n:i)),fd(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;is(t,o,ns(t,o).filter(a=>a.id!==i)),ud(t,o,-1,n)}},hd={[He.SEARCHES]:"savedSearches",[He.BOOKMARKS]:"bookmarks",[He.BOOKS]:void 0,[He.COLLECTIONS]:void 0},ns=(t,e)=>{var o;let n=hd[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},is=(t,e,o)=>{let n=hd[e];n&&(t[n]=o)},ud=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===He.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},fd=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},$e=tr.get({name:Tf,reducers:Lf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(He).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),as=class{constructor(e=new Un,o=new zn){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=k.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new kn,this.savedSearchesService=new $n,k.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=k.getState();Le((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),$e.actions.clearAssetCount(),$e.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),$e.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),$e.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();$e.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();$e.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&$e.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&$e.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys($e.getState().assetCounts.bookmarkByMap).length!==0;e===He.BOOKMARKS&&o&&$e.actions.clearBookmarkCountByMap(),$e.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;$e.actions.bookmarks(o)}}},_f=new as;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=_f);Q("ft-app-context")(oe);var ss=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},yd=new ss;var Nf=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Pf=Symbol("i18nAttributes"),kf=Symbol("i18nListAttributes"),gd=Symbol("i18nProperties"),Hn=Symbol("i18nContexts"),wo=Symbol("i18nUnsubs"),Gn=xe(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Mn:Kr}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let y=h??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...y)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(yd.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,u=(h,f,y)=>y?.context&&y.key&&a(h,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...h})}:y;(s=this[Pf])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(l=this[kf])===null||l===void 0||l.forEach((h,f)=>{var y;return d[f]=(y=d[f])===null||y===void 0?void 0:y.map(x=>u(h,f,x))})}updateI18nProperties(a){var s;(s=this[gd])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[Hn].set(d,{isCustomContext:l}),this[wo].has(d)||this[wo].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Hn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Hn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[wo].forEach(a=>a()),this[wo].clear()}}return e=Hn,o=wo,Nf([v({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),md=class extends Gn(H){},Wn=class extends Gn(bo){};var Ao=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Qe=class extends Wn{constructor(){super(),this.editorMode=!1,this.addStore(k)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":V:F`
575
+ `}connectedCallback(){super.connectedCallback(),k.addEventListener(nr.eventName,this.reloadConfiguration)}disconnectedCallback(){k.addEventListener(nr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,i,a,s,l,d;super.update(e),e.has("baseUrl")&&(k.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&k.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&k.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&k.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&k.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&k.actions.noCustom(this.noCustom),e.has("editorMode")&&k.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&k.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&k.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>Kr.addContext(u)),e.has("openExternalDocumentInNewTab")&&k.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&k.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&k.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(k.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),k.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),k.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&k.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&k.actions.availableContentLocales((d=(l=this.availableContentLocales)===null||l===void 0?void 0:l.contentLocales)!==null&&d!==void 0?d:[]),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 e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}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",()=>pd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};oe.elementDefinitions={};oe.styles=sd;ue([v()],oe.prototype,"baseUrl",void 0);ue([v()],oe.prototype,"apiIntegrationIdentifier",void 0);ue([v()],oe.prototype,"apiIntegrationAppVersion",void 0);ue([v()],oe.prototype,"uiLocale",void 0);ue([Fe(null)],oe.prototype,"availableUiLocales",void 0);ue([Fe(null)],oe.prototype,"metadataConfiguration",void 0);ue([v({type:Boolean})],oe.prototype,"editorMode",void 0);ue([v({type:Boolean})],oe.prototype,"noCustom",void 0);ue([v({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);ue([v({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);ue([v({type:Boolean})],oe.prototype,"withManualResources",void 0);ue([v({type:Boolean})],oe.prototype,"navigatorOnline",void 0);ue([v({type:Boolean})],oe.prototype,"forcedOffline",void 0);ue([v({type:Object})],oe.prototype,"apiProvider",void 0);ue([v({type:Boolean})],oe.prototype,"authenticationRequired",void 0);ue([Fe([])],oe.prototype,"messageContexts",void 0);ue([Fe(void 0)],oe.prototype,"session",void 0);ue([Y()],oe.prototype,"localesConfiguration",void 0);ue([Y()],oe.prototype,"availableContentLocales",void 0);var Fn=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},gw=xe(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(k)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>rr.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Fn([v({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Fn([v({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Fn([Cr({store:k.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Fn([Cr({store:k.name})],e.prototype,"uiLocale",void 0),e});var Un=class extends Me{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=k.getState().session;return!!e?.sessionAuthenticated}};var zn=class extends Me{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=k.getState().session;return!!e?.sessionAuthenticated}};var Tf="ft-user-assets",Lf={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(He).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;is(t,o,[...ns(t,o),i]),ud(t,o,1,n),fd(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;is(t,o,ns(t,o).map(i=>i.id===n.id?n:i)),fd(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;is(t,o,ns(t,o).filter(a=>a.id!==i)),ud(t,o,-1,n)}},hd={[He.SEARCHES]:"savedSearches",[He.BOOKMARKS]:"bookmarks",[He.BOOKS]:void 0,[He.COLLECTIONS]:void 0},ns=(t,e)=>{var o;let n=hd[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},is=(t,e,o)=>{let n=hd[e];n&&(t[n]=o)},ud=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===He.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},fd=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},$e=tr.get({name:Tf,reducers:Lf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(He).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),as=class{constructor(e=new Un,o=new zn){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=k.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new kn,this.savedSearchesService=new $n,k.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=k.getState();Le((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),$e.actions.clearAssetCount(),$e.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),$e.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),$e.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();$e.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();$e.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&$e.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&$e.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys($e.getState().assetCounts.bookmarkByMap).length!==0;e===He.BOOKMARKS&&o&&$e.actions.clearBookmarkCountByMap(),$e.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;$e.actions.bookmarks(o)}}},_f=new as;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=_f);Q("ft-app-context")(oe);var ss=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},yd=new ss;var Nf=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Pf=Symbol("i18nAttributes"),kf=Symbol("i18nListAttributes"),gd=Symbol("i18nProperties"),Hn=Symbol("i18nContexts"),wo=Symbol("i18nUnsubs"),Gn=xe(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Mn:Kr}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let y=h??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...y)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(yd.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,u=(h,f,y)=>y?.context&&y.key&&a(h,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...h})}:y;(s=this[Pf])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(l=this[kf])===null||l===void 0||l.forEach((h,f)=>{var y;return d[f]=(y=d[f])===null||y===void 0?void 0:y.map(x=>u(h,f,x))})}updateI18nProperties(a){var s;(s=this[gd])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[Hn].set(d,{isCustomContext:l}),this[wo].has(d)||this[wo].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Hn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Hn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[wo].forEach(a=>a()),this[wo].clear()}}return e=Hn,o=wo,Nf([v({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),md=class extends Gn(H){},Wn=class extends Gn(bo){};var Ao=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Qe=class extends Wn{constructor(){super(),this.editorMode=!1,this.addStore(k)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":V:F`
576
576
  <span class="ft-i18n">
577
577
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
578
578
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-text-input",
3
- "version": "1.3.46",
3
+ "version": "1.3.47",
4
4
  "description": "Text Input",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,17 +19,17 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-base-input": "1.3.46",
23
- "@fluid-topics/ft-i18n": "1.3.46",
24
- "@fluid-topics/ft-icon": "1.3.46",
25
- "@fluid-topics/ft-input-helper-text": "1.3.46",
26
- "@fluid-topics/ft-input-label": "1.3.46",
27
- "@fluid-topics/ft-tooltip": "1.3.46",
28
- "@fluid-topics/ft-wc-utils": "1.3.46",
22
+ "@fluid-topics/ft-base-input": "1.3.47",
23
+ "@fluid-topics/ft-i18n": "1.3.47",
24
+ "@fluid-topics/ft-icon": "1.3.47",
25
+ "@fluid-topics/ft-input-helper-text": "1.3.47",
26
+ "@fluid-topics/ft-input-label": "1.3.47",
27
+ "@fluid-topics/ft-tooltip": "1.3.47",
28
+ "@fluid-topics/ft-wc-utils": "1.3.47",
29
29
  "lit": "3.1.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@fluid-topics/ft-wc-test-utils": "1.3.46"
32
+ "@fluid-topics/ft-wc-test-utils": "1.3.47"
33
33
  },
34
- "gitHead": "d6cf25d6ed0dead8c7aff4f94a493c35d12f1392"
34
+ "gitHead": "16ac56d62f3a88a3b03cbc92bcd04dd91951a015"
35
35
  }