@fluid-topics/ft-reader-attachments 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.
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
`;var st=C(_());var fi=C(_());var ga=C(Z()),K=C(X()),pe=C(_());var Nn=C(Z());var Tn=Nn.css`
|
|
231
231
|
`;var Kt=C(_()),Es="ft-app-info",Ue=class t extends CustomEvent{constructor(r){super(t.eventName,{detail:r})}};Ue.eventName="authentication-change";var As={session:(t,r)=>{(0,Kt.deepEqual)(t.session,r.payload)||(t.session=r.payload,setTimeout(()=>E.dispatchEvent(new Ue(r.payload)),0))}},E=Kt.FtReduxStore.get({name:Es,reducers:As,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 Dr=C(_());var Me=class t{static get(r){let{baseUrl:o,apiIntegrationIdentifier:n}=E.getState(),a=r??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(r){return new Promise(o=>{let n=t.get(r);if(n)o(n);else{let a=E.subscribe(()=>{n=t.get(r),n&&(a(),o(n))})}})}};var Vt=class{constructor(r){this.overrideApi=r}get api(){var r;return(r=this.overrideApi)!==null&&r!==void 0?r:Me.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Me.await()}};var Q=class extends Vt{constructor(r=!0,o){var n;super(o),this.sortObjectFields=(s,c)=>typeof c!="object"||c==null||Array.isArray(c)?c:Object.fromEntries(Object.entries(c).sort(([d],[u])=>d.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Dr.CacheRegistry,this.cache=r?a.commonCache:new Dr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(r){return String(Array.from(JSON.stringify(r,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var Zt=class extends Q{async listMyBookmarks(){let r=E.getState().session;return r?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(r.profile.userId),5*60*1e3):[]}};var Br=class{addCommand(r,o=!1){E.commands.add(r,o)}consumeCommand(r){return E.commands.consume(r)}};window.FluidTopicsAppInfoStoreService=new Br;var ae=C(_());var In,Xe=class extends CustomEvent{constructor(r){super("ft-i18n-context-loaded",{detail:r})}},ws=Symbol("clearAfterUnitTest"),qt=class extends(0,ae.withEventBus)(Q){constructor(r){super(),this.messageContextProvider=r,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[In]=()=>{this.defaultMessages={},this.cache=new ae.CacheRegistry,this.listeners={}},this.currentUiLocale=E.getState().uiLocale,E.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:r}=E.getState();this.currentUiLocale!==r&&(this.currentUiLocale=r,this.cache.clearAll(),this.notifyAll())}addContext(r){let o=r.name.toLowerCase();this.cache.setFinal(o,r),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(r,o){var n;if(r=r.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[r])!==null&&n!==void 0?n:{},...o};(0,ae.deepEqual)(this.defaultMessages[r],a)||(this.defaultMessages[r]=a,await this.notify(r))}return this.fetchContext(r)}resolveContext(r){var o,n;return this.fetchContext(r),(n=(o=this.cache.getNow(r))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(r,o){let n=r.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(r,o,...n){var a;let s=r.toLowerCase(),c=this.resolveContext(s);return new ae.ParametrizedLabelResolver((a=this.defaultMessages[s])!==null&&a!==void 0?a:{},c).resolve(o,...n)}async fetchContext(r){let o=!this.cache.has(r),n;try{n=await this.cache.get(r,()=>this.messageContextProvider(this.currentUiLocale,r)),o&&await this.notify(r)}catch(a){!(a instanceof ae.CanceledPromiseError)&&o&&console.error(a)}return n}subscribe(r,o){var n;return r=r.toLowerCase(),this.listeners[r]=(n=this.listeners[r])!==null&&n!==void 0?n:new Set,this.listeners[r].add(o),()=>{var a;return(a=this.listeners[r])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){let r=Object.keys(this.listeners);document.body.dispatchEvent(new Xe({loadedContexts:r})),this.dispatchEvent(new Xe({loadedContexts:r})),await Promise.all(r.map(o=>this.notify(o,!1)))}async notify(r,o=!0){o&&(document.body.dispatchEvent(new Xe({loadedContexts:[r]})),this.dispatchEvent(new Xe({loadedContexts:[r]}))),this.listeners[r]!=null&&await Promise.all([...this.listeners[r].values()].map(n=>(0,ae.delay)(0).then(()=>n()).catch(()=>null)))}};In=ws;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends qt{constructor(){super(async(t,r)=>(await this.awaitApi).getFluidTopicsMessageContext(t,r))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends qt{constructor(){super(async(t,r)=>(await this.awaitApi).getCustomMessageContext(t,r))}});var Je=window.FluidTopicsI18nService,Yt=window.FluidTopicsCustomI18nService;var _n=C(_()),Ur=class{highlightHtml(r,o,n){(0,_n.highlightHtml)(r,o,n)}};window.FluidTopicsHighlightHtmlService=new Ur;var Ns=C(Pn(),1);var kn;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(kn||(kn={}));var Dn;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Dn||(Dn={}));var Bn;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Bn||(Bn={}));var Un;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Un||(Un={}));var Mn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Mn||(Mn={}));var Hn;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Hn||(Hn={}));var Wn;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Wn||(Wn={}));var Fn;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(Fn||(Fn={}));var zn;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT"})(zn||(zn={}));var Gn;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Gn||(Gn={}));var $n;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})($n||($n={}));var jn;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(jn||(jn={}));var Kn;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Kn||(Kn={}));var Vn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Vn||(Vn={}));var Zn;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Zn||(Zn={}));var qn;(function(t){t.ASC="ASC",t.DESC="DESC"})(qn||(qn={}));var Yn;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Yn||(Yn={}));var Xn;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Xn||(Xn={}));var Jn;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Jn||(Jn={}));var Qn;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Qn||(Qn={}));var ea;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(ea||(ea={}));var ta;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ta||(ta={}));var ra;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(ra||(ra={}));var oa;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(oa||(oa={}));var na;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(na||(na={}));var F;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(F||(F={}));var ie;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(ie||(ie={}));var aa;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(aa||(aa={}));var ia;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(ia||(ia={}));var sa;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(sa||(sa={}));var ca;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(ca||(ca={}));var la;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(la||(la={}));var Rs={[F.PERSONAL_BOOK_SHARE_USER]:[F.PERSONAL_BOOK_USER],[F.HTML_EXPORT_USER]:[F.PERSONAL_BOOK_USER],[F.PDF_EXPORT_USER]:[F.PERSONAL_BOOK_USER],[F.KHUB_ADMIN]:[F.CONTENT_PUBLISHER],[F.ADMIN]:[F.KHUB_ADMIN,F.USERS_ADMIN,F.PORTAL_ADMIN],[F.GENERATIVE_AI_EXPORT_USER]:[F.GENERATIVE_AI_USER]};function da(t,r){return t===r||(Rs[t]??[]).some(o=>da(o,r))}function ua(t,r){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>da(n,r))}var Qt=class extends Q{async listMySearches(){let{session:r}=E.getState();return ua(r,F.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(r.profile.userId),5*60*1e3):[]}};var pa=C(_());var Mr=class{isDate(r){var o,n,a,s;return(s=(a=((n=(o=E.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===r))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1}format(r,o){var n,a,s;return pa.DateFormatter.format(r,(n=o?.locale)!==null&&n!==void 0?n:E.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(s=o?.withTime)!==null&&s!==void 0?s:!1)}};window.FluidTopicsDateService=new Mr;var fa=C(_());var Rt=class{static get(r,o){var n,a;let s=E.getState(),{lang:c,region:d}=(a=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new fa.SearchPlaceConverter(s.baseUrl,r??20,s.searchInAllLanguagesAllowed,o??`${c}-${d}`)}};var Hr=class{urlToSearchRequest(r){return Rt.get().parse(r)}searchRequestToUrl(r){return Rt.get().serialize(r)}};window.FluidTopicsUrlService=new Hr;var Ce=C(_());var He=class t extends CustomEvent{constructor(r){super(t.eventName,{detail:{currentItem:r}})}};He.eventName="change";var Wr=class{itemName(r){return`fluid-topics-history-item-${r}`}get(r){let o=sessionStorage.getItem(this.itemName(r));return o?JSON.parse(o):void 0}set(r,o){sessionStorage.setItem(this.itemName(r),JSON.stringify(o))}},ha=new Wr;var er=class t extends Ce.WithEventBus{static build(){return new t(window.history,ha,()=>window.location,!1)}constructor(r,o,n,a){var s,c;super(),this.history=r,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=r.pushState,this.realReplaceState=r.replaceState,this.initialIndex=(c=(s=r.state)===null||s===void 0?void 0:s.index)!==null&&c!==void 0?c:r.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(r,o=!1){let n=o&&this.currentIndex===r.index-1;this.currentState={...this.buildCurrentState(),...r},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,Ce.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new He(this.currentItem())),0)}installProxies(){let r=o=>(n,a,[s,c,d])=>{let u=o(),p={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[p,c,d]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:r(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:r(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",r=>this.setCurrentState(r.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(r){for(let o=this.history.length-1;o>=0;o--)r?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(r){var o;let n={...this.buildCurrentState(),...r,index:this.currentIndex,title:(o=r?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(r){this.addEventListener(He.eventName,r)}removeHistoryChangeListener(r){this.removeEventListener(He.eventName,r)}currentItem(){return(0,Ce.deepCopy)(this.currentState)}back(){let r=this.previousDifferentMajorPosition();r>=0?this.history.go(r-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Ce.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let r=this.currentIndex>0?this.currentIndex-1:0;for(;r>0&&!this.isDifferentMajorState(r);)r--;return r}forward(){let r=this.nextMajorPosition();r&&r<this.states.length?this.history.go(r-this.currentIndex):this.history.forward()}forwardItem(){let r=this.nextMajorPosition();if(r)return(0,Ce.deepCopy)(this.states[r])}nextMajorPosition(){let r=this.currentIndex;if(!(r>=this.states.length)){do r++;while(r<this.states.length&&!this.isDifferentMajorState(r));return this.getHigherPositionInTheSameState(r)}}getHigherPositionInTheSameState(r){var o;let n=(o=this.states[r])===null||o===void 0?void 0:o.majorStateId;if(!n)return r;let a=r,s=r+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(a=s),s++;return a}buildCurrentState(){var r,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(r=this.history.state)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:document.title}}hasState(r){return this.states[r]!=null}isDifferentMajorState(r,o){var n;if(!this.hasState(r))return!1;let a=o??this.currentState.majorStateId,s=(n=this.states[r])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=er.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 ya=E;function ma(t,r){var o;return ya.getState().authenticationRequired&&!(!((o=ya.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(r):t()}var z=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},D=class extends pe.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=()=>Me.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new pe.CacheRegistry,this.cleanSessionDebouncer=new pe.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return ga.html`
|
|
232
232
|
<slot></slot>
|
|
233
|
-
`}connectedCallback(){super.connectedCallback(),E.addEventListener(Ue.eventName,this.reloadConfiguration)}disconnectedCallback(){E.addEventListener(Ue.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(r){var o,n,a,s,c,d,u;super.update(r),r.has("baseUrl")&&(E.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&E.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("apiIntegrationAppVersion")&&E.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),r.has("uiLocale")&&E.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&E.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&E.actions.noCustom(this.noCustom),r.has("editorMode")&&E.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&E.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&E.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Je.addContext(p)),r.has("openExternalDocumentInNewTab")&&E.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&E.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&E.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(E.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),E.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),E.actions.searchInAllLanguagesAllowed((c=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),r.has("authenticationRequired")&&E.actions.authenticationRequired(this.authenticationRequired),r.has("availableContentLocales")&&E.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),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 r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},r.idleTimeoutInMillis),r})}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",()=>ma(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};D.elementDefinitions={};D.styles=Tn;z([(0,K.property)()],D.prototype,"baseUrl",void 0);z([(0,K.property)()],D.prototype,"apiIntegrationIdentifier",void 0);z([(0,K.property)()],D.prototype,"apiIntegrationAppVersion",void 0);z([(0,K.property)()],D.prototype,"uiLocale",void 0);z([(0,pe.jsonProperty)(null)],D.prototype,"availableUiLocales",void 0);z([(0,pe.jsonProperty)(null)],D.prototype,"metadataConfiguration",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"editorMode",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"noCustom",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"openExternalDocumentInNewTab",void 0);z([(0,K.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],D.prototype,"noCustomComponent",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"withManualResources",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"navigatorOnline",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"forcedOffline",void 0);z([(0,K.property)({type:Object})],D.prototype,"apiProvider",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"authenticationRequired",void 0);z([(0,pe.jsonProperty)([])],D.prototype,"messageContexts",void 0);z([(0,pe.jsonProperty)(void 0)],D.prototype,"session",void 0);z([(0,K.state)()],D.prototype,"localesConfiguration",void 0);z([(0,K.state)()],D.prototype,"availableContentLocales",void 0);var po=C(X());function Ts(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;let o,n,a;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!tr(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!tr(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();let s=c=>Object.keys(c).filter(d=>c[d]!=null);if(a=s(t),o=a.length,o!==s(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=o;n--!==0;){let c=a[n];if(!tr(t[c],r[c]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function tr(t,r){try{return Ts(t,r)}catch{return!1}}function Nt(t,r){return!tr(t,r)}function rr(t,r){let o=n=>n[t]===!0;return n=>{if(o(n))return n;let a=r(n);return a[t]=!0,a}}var ba=C(X(),1);var Fr=t=>{let r=t??{};return(o,n)=>{var a;let s={hasChanged:Nt,attribute:!1,...r};(0,ba.property)(s)(o,n);let c=o.constructor;c.reduxProperties=new Map(c.reduxProperties),c.reduxProperties.set(n,{selector:(a=r.selector)!==null&&a!==void 0?a:d=>d[n],store:r.store})}};var or=class{constructor(){this.queue=[]}add(r,o=!1){o&&this.clear(r.type),this.queue.push(r)}consume(r){let o=this.queue.find(n=>n.type===r);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(r){typeof r=="string"?this.queue=this.queue.filter(o=>o.type!==r):this.queue=this.queue.filter(o=>!r.test(o.type))}};var We=C(X(),1);var xa=C(X(),1);function va(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,xa.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:Nt,...r??{}})}var nr=class{constructor(r=0){this.timeout=r,this.callbacks=[]}run(r,o){return this.callbacks=[r],this.debounce(o)}queue(r,o){return this.callbacks.push(r),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(r){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),r??this.timeout),this.promise}async runCallbacks(){var r,o;let n=[...this.callbacks];this.callbacks=[];let a=(r=this.rejectPromise)!==null&&r!==void 0?r:()=>null,s=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){a(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Oa=C(Z(),1);var ar=globalThis,Is=ar.ShadowRoot&&(ar.ShadyCSS===void 0||ar.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,md=Symbol();var Sa=(t,r)=>{if(Is)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=ar.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var ir=class extends Oa.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([a,s])=>r.registry.define(a,s)));let o={...r.shadowRootOptions,customElements:r.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Sa(n,r.elementStyles),n}};function Ca(t,r,...o){var n;let a=t.querySelector(r);for(let s of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return a}var tt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Ra,Ea=Symbol("constructorPrototype"),Aa=Symbol("constructorName"),Na=Symbol("exportpartsDebouncer"),wa=Symbol("dynamicDependenciesLoaded"),et=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};et.eventName="exportparts-updated";var me=class extends ir{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ra]=new nr(5),this.scheduleExportpartsUpdate=()=>{var r,o,n;(!((r=this.exportpartsPrefix)===null||r===void 0)&&r.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[Na].run(()=>{var a,s;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Aa]=this.constructor.name,this[Ea]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Aa]&&Object.setPrototypeOf(this,this[Ea])}connectedCallback(){var r;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[wa]||(o[wa]=!0,this.importDynamicDependencies()),(r=this.shadowRoot)===null||r===void 0||r.addEventListener(et.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.shadowRoot)===null||r===void 0||r.removeEventListener(et.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(r){super.updated(r),this.updateComplete.then(()=>{this.contentAvailableCallback(r),this.focusElementToFocus(r),this.applyCustomStylesheet(r),this.scheduleExportpartsUpdate(),r.has("exportparts")&&this.dispatchEvent(new et)})}contentAvailableCallback(r){}focusElementToFocus(r){if(r.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let s=[...a??[],n];o=Ca(this.shadowRoot,...s)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(r){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(s=>s.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(r){var o,n,a,s,c,d;let u=m=>m!=null&&m.trim().length>0,p=r.filter(u).map(m=>m.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let m of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(s=(a=m.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],x=(d=(c=m.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(R=>R.split(":")[1]))!==null&&d!==void 0?d:[],O=[...S,...x].filter(u).map(R=>R.trim());for(let R of O)h.add(R)}if(h.size===0){this.exportparts=void 0;return}let y=[...h.values()].flatMap(m=>p.map(S=>`${m}:${S}--${m}`));this.exportparts=[...this.part,...y].join(", ")}};Ra=Na;tt([(0,We.property)()],me.prototype,"exportpartsPrefix",void 0);tt([va([])],me.prototype,"exportpartsPrefixes",void 0);tt([(0,We.property)({reflect:!0})],me.prototype,"exportparts",void 0);tt([(0,We.property)()],me.prototype,"customStylesheet",void 0);tt([(0,We.property)()],me.prototype,"elementToFocus",void 0);tt([(0,We.state)()],me.prototype,"useAdoptedStyleSheets",void 0);function sr(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Tt=Symbol("internalReduxEventsUnsubscribers"),Ee=Symbol("internalStoresUnsubscribers"),Fe=Symbol("internalStores"),_s=rr(Symbol("withRedux"),function(t){var r,o,n;class a extends t{constructor(){super(...arguments),this[r]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(c){super.willUpdate(c),[...this.reduxConstructor.reduxReactiveProperties].some(d=>c.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[Fe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Fe].values()][0]}getStore(c){return c==null?this.getUnnamedStore():this[Fe].get(c)}addStore(c,d){var u;d=(u=d??c.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[Fe].set(d,c),this.subscribeToStore(d,c),this.updateFromStores()}removeStore(c){let d=typeof c=="string"?c:c.name;this.unsubscribeFromStore(d),this[Fe].delete(d)}setupStores(){this.unsubscribeFromStores(),this[Fe].forEach((c,d)=>this.subscribeToStore(d,c)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((c,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(c.store);p&&(c.store?this[Ee].has(c.store):this[Ee].size>0)&&(this[d]=c.selector(p.getState(),this))}})}subscribeToStore(c,d){var u;this[Ee].set(c,d.subscribe(()=>this.updateFromStores())),this[Tt].set(c,[]),sr(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let y=m=>this[h](m);d.addEventListener(p.eventName,y),this[Tt].get(c).push(()=>d.removeEventListener(p.eventName,y))}})),this.onStoreAvailable(c)}unsubscribeFromStores(){this[Ee].forEach((c,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(c){var d;this[Ee].has(c)&&this[Ee].get(c)(),this[Ee].delete(c),(d=this[Tt].get(c))===null||d===void 0||d.forEach(u=>u()),this[Tt].delete(c)}onStoreAvailable(c){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return r=Ee,o=Fe,n=Tt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ta=class extends _s(me){};function se(t){for(var r=arguments.length,o=Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];if(0)var a,s;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function be(t){return!!t&&!!t[U]}function fe(t){var r;return!!t&&(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)===Hs}(t)||Array.isArray(t)||!!t[Ba]||!!(!((r=t.constructor)===null||r===void 0)&&r[Ba])||Yr(t)||Xr(t))}function ze(t,r,o){o===void 0&&(o=!1),nt(t)===0?(o?Object.keys:ot)(t).forEach(function(n){o&&typeof n=="symbol"||r(n,t[n],t)}):t.forEach(function(n,a){return r(a,n,t)})}function nt(t){var r=t[U];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:Yr(t)?2:Xr(t)?3:0}function rt(t,r){return nt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function Ls(t,r){return nt(t)===2?t.get(r):t[r]}function Ua(t,r,o){var n=nt(t);n===2?t.set(r,o):n===3?t.add(o):t[r]=o}function Ma(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function Yr(t){return Us&&t instanceof Map}function Xr(t){return Ms&&t instanceof Set}function Ae(t){return t.o||t.t}function Jr(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=Fa(t);delete r[U];for(var o=ot(r),n=0;n<o.length;n++){var a=o[n],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),r)}function Qr(t,r){return r===void 0&&(r=!1),eo(t)||be(t)||!fe(t)||(nt(t)>1&&(t.set=t.add=t.clear=t.delete=Ps),Object.freeze(t),r&&ze(t,function(o,n){return Qr(n,!0)},!0)),t}function Ps(){se(2)}function eo(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ge(t){var r=qr[t];return r||se(18,t),r}function ks(t,r){qr[t]||(qr[t]=r)}function Kr(){return _t}function zr(t,r){r&&(ge("Patches"),t.u=[],t.s=[],t.v=r)}function cr(t){Vr(t),t.p.forEach(Ds),t.p=null}function Vr(t){t===_t&&(_t=t.l)}function Ia(t){return _t={p:[],l:_t,h:t,m:!0,_:0}}function Ds(t){var r=t[U];r.i===0||r.i===1?r.j():r.g=!0}function Gr(t,r){r._=r.p.length;var o=r.p[0],n=t!==void 0&&t!==o;return r.h.O||ge("ES5").S(r,t,n),n?(o[U].P&&(cr(r),se(4)),fe(t)&&(t=lr(r,t),r.l||dr(r,t)),r.u&&ge("Patches").M(o[U].t,t,r.u,r.s)):t=lr(r,o,[]),cr(r),r.u&&r.v(r.u,r.s),t!==Wa?t:void 0}function lr(t,r,o){if(eo(r))return r;var n=r[U];if(!n)return ze(r,function(d,u){return _a(t,n,r,d,u,o)},!0),r;if(n.A!==t)return r;if(!n.P)return dr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=Jr(n.k):n.o,s=a,c=!1;n.i===3&&(s=new Set(a),a.clear(),c=!0),ze(s,function(d,u){return _a(t,n,a,d,u,o,c)}),dr(t,a,!1),o&&t.u&&ge("Patches").N(n,o,t.u,t.s)}return n.o}function _a(t,r,o,n,a,s,c){if(be(a)){var d=lr(t,a,s&&r&&r.i!==3&&!rt(r.R,n)?s.concat(n):void 0);if(Ua(o,n,d),!be(d))return;t.m=!1}else c&&o.add(a);if(fe(a)&&!eo(a)){if(!t.h.D&&t._<1)return;lr(t,a),r&&r.A.l||dr(t,a)}}function dr(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&Qr(r,o)}function $r(t,r){var o=t[U];return(o?Ae(o):t)[r]}function La(t,r){if(r in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,r);if(n)return n;o=Object.getPrototypeOf(o)}}function we(t){t.P||(t.P=!0,t.l&&we(t.l))}function jr(t){t.o||(t.o=Jr(t.t))}function Zr(t,r,o){var n=Yr(r)?ge("MapSet").F(r,o):Xr(r)?ge("MapSet").T(r,o):t.O?function(a,s){var c=Array.isArray(a),d={i:c?1:0,A:s?s.A:Kr(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},u=d,p=Lt;c&&(u=[d],p=It);var h=Proxy.revocable(u,p),y=h.revoke,m=h.proxy;return d.k=m,d.j=y,m}(r,o):ge("ES5").J(r,o);return(o?o.A:Kr()).p.push(n),n}function Bs(t){return be(t)||se(22,t),function r(o){if(!fe(o))return o;var n,a=o[U],s=nt(o);if(a){if(!a.P&&(a.i<4||!ge("ES5").K(a)))return a.t;a.I=!0,n=Pa(o,s),a.I=!1}else n=Pa(o,s);return ze(n,function(c,d){a&&Ls(a.t,c)===d||Ua(n,c,r(d))}),s===3?new Set(n):n}(t)}function Pa(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return Jr(t)}function Ha(){function t(c,d){var u=s[c];return u?u.enumerable=d:s[c]=u={configurable:!0,enumerable:d,get:function(){var p=this[U];return Lt.get(p,c)},set:function(p){var h=this[U];Lt.set(h,c,p)}},u}function r(c){for(var d=c.length-1;d>=0;d--){var u=c[d][U];if(!u.P)switch(u.i){case 5:n(u)&&we(u);break;case 4:o(u)&&we(u)}}}function o(c){for(var d=c.t,u=c.k,p=ot(u),h=p.length-1;h>=0;h--){var y=p[h];if(y!==U){var m=d[y];if(m===void 0&&!rt(d,y))return!0;var S=u[y],x=S&&S[U];if(x?x.t!==m:!Ma(S,m))return!0}}var O=!!d[U];return p.length!==ot(d).length+(O?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function a(c){c.g&&se(3,JSON.stringify(Ae(c)))}var s={};ks("ES5",{J:function(c,d){var u=Array.isArray(c),p=function(y,m){if(y){for(var S=Array(m.length),x=0;x<m.length;x++)Object.defineProperty(S,""+x,t(x,!0));return S}var O=Fa(m);delete O[U];for(var R=ot(O),N=0;N<R.length;N++){var T=R[N];O[T]=t(T,y||!!O[T].enumerable)}return Object.create(Object.getPrototypeOf(m),O)}(u,c),h={i:u?5:4,A:d?d.A:Kr(),P:!1,I:!1,R:{},l:d,t:c,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,U,{value:h,writable:!0}),p},S:function(c,d,u){u?be(d)&&d[U].A===c&&r(c.p):(c.u&&function p(h){if(h&&typeof h=="object"){var y=h[U];if(y){var m=y.t,S=y.k,x=y.R,O=y.i;if(O===4)ze(S,function(L){L!==U&&(m[L]!==void 0||rt(m,L)?x[L]||p(S[L]):(x[L]=!0,we(y)))}),ze(m,function(L){S[L]!==void 0||rt(S,L)||(x[L]=!1,we(y))});else if(O===5){if(n(y)&&(we(y),x.length=!0),S.length<m.length)for(var R=S.length;R<m.length;R++)x[R]=!1;else for(var N=m.length;N<S.length;N++)x[N]=!0;for(var T=Math.min(S.length,m.length),k=0;k<T;k++)S.hasOwnProperty(k)||(x[k]=!0),x[k]===void 0&&p(S[k])}}}}(c.p[0]),r(c.p))},K:function(c){return c.i===4?o(c):n(c)}})}var ka,_t,to=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Us=typeof Map<"u",Ms=typeof Set<"u",Da=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Wa=to?Symbol.for("immer-nothing"):((ka={})["immer-nothing"]=!0,ka),Ba=to?Symbol.for("immer-draftable"):"__$immer_draftable",U=to?Symbol.for("immer-state"):"__$immer_state";var Hs=""+Object.prototype.constructor,ot=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Fa=Object.getOwnPropertyDescriptors||function(t){var r={};return ot(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},qr={},Lt={get:function(t,r){if(r===U)return t;var o=Ae(t);if(!rt(o,r))return function(a,s,c){var d,u=La(s,c);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(a.k):void 0}(t,o,r);var n=o[r];return t.I||!fe(n)?n:n===$r(t.t,r)?(jr(t),t.o[r]=Zr(t.A.h,n,t)):n},has:function(t,r){return r in Ae(t)},ownKeys:function(t){return Reflect.ownKeys(Ae(t))},set:function(t,r,o){var n=La(Ae(t),r);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=$r(Ae(t),r),s=a?.[U];if(s&&s.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(Ma(o,a)&&(o!==void 0||rt(t.t,r)))return!0;jr(t),we(t)}return t.o[r]===o&&(o!==void 0||r in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[r])||(t.o[r]=o,t.R[r]=!0),!0},deleteProperty:function(t,r){return $r(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,jr(t),we(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=Ae(t),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){se(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){se(12)}},It={};ze(Lt,function(t,r){It[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),It.deleteProperty=function(t,r){return It.set.call(this,t,r,void 0)},It.set=function(t,r,o){return Lt.set.call(this,t[0],r,o,t[0])};var Ws=function(){function t(o){var n=this;this.O=Da,this.D=!0,this.produce=function(a,s,c){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var u=n;return function(O){var R=this;O===void 0&&(O=d);for(var N=arguments.length,T=Array(N>1?N-1:0),k=1;k<N;k++)T[k-1]=arguments[k];return u.produce(O,function(L){var $;return($=s).call.apply($,[R,L].concat(T))})}}var p;if(typeof s!="function"&&se(6),c!==void 0&&typeof c!="function"&&se(7),fe(a)){var h=Ia(n),y=Zr(n,a,void 0),m=!0;try{p=s(y),m=!1}finally{m?cr(h):Vr(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(O){return zr(h,c),Gr(O,h)},function(O){throw cr(h),O}):(zr(h,c),Gr(p,h))}if(!a||typeof a!="object"){if((p=s(a))===void 0&&(p=a),p===Wa&&(p=void 0),n.D&&Qr(p,!0),c){var S=[],x=[];ge("Patches").M(a,p,S,x),c(S,x)}return p}se(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(p){for(var h=arguments.length,y=Array(h>1?h-1:0),m=1;m<h;m++)y[m-1]=arguments[m];return n.produceWithPatches(p,function(S){return a.apply(void 0,[S].concat(y))})};var c,d,u=n.produce(a,s,function(p,h){c=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,c,d]}):[u,c,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var r=t.prototype;return r.createDraft=function(o){fe(o)||se(8),be(o)&&(o=Bs(o));var n=Ia(this),a=Zr(this,o,void 0);return a[U].C=!0,Vr(n),a},r.finishDraft=function(o,n){var a=o&&o[U],s=a.A;return zr(s,n),Gr(void 0,s)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!Da&&se(20),this.O=o},r.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var s=n[a];if(s.path.length===0&&s.op==="replace"){o=s.value;break}}a>-1&&(n=n.slice(a+1));var c=ge("Patches").$;return be(o)?c(o,n):this.produce(o,function(d){return c(d,n)})},t}(),ee=new Ws,Fs=ee.produce,_d=ee.produceWithPatches.bind(ee),Ld=ee.setAutoFreeze.bind(ee),Pd=ee.setUseProxies.bind(ee),kd=ee.applyPatches.bind(ee),Dd=ee.createDraft.bind(ee),Bd=ee.finishDraft.bind(ee),ur=Fs;function Ge(t){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ge(t)}function za(t,r){if(Ge(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,r||"default");if(Ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Ga(t){var r=za(t,"string");return Ge(r)=="symbol"?r:r+""}function $a(t,r,o){return(r=Ga(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ja(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function ro(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?ja(Object(o),!0).forEach(function(n){$a(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ja(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function q(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Ka=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),oo=function(){return Math.random().toString(36).substring(7).split("").join(".")},pr={INIT:"@@redux/INIT"+oo(),REPLACE:"@@redux/REPLACE"+oo(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+oo()}};function zs(t){if(typeof t!="object"||t===null)return!1;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}function no(t,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(q(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(q(1));return o(no)(t,r)}if(typeof t!="function")throw new Error(q(2));var a=t,s=r,c=[],d=c,u=!1;function p(){d===c&&(d=c.slice())}function h(){if(u)throw new Error(q(3));return s}function y(O){if(typeof O!="function")throw new Error(q(4));if(u)throw new Error(q(5));var R=!0;return p(),d.push(O),function(){if(R){if(u)throw new Error(q(6));R=!1,p();var T=d.indexOf(O);d.splice(T,1),c=null}}}function m(O){if(!zs(O))throw new Error(q(7));if(typeof O.type>"u")throw new Error(q(8));if(u)throw new Error(q(9));try{u=!0,s=a(s,O)}finally{u=!1}for(var R=c=d,N=0;N<R.length;N++){var T=R[N];T()}return O}function S(O){if(typeof O!="function")throw new Error(q(10));a=O,m({type:pr.REPLACE})}function x(){var O,R=y;return O={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(q(11));function k(){T.next&&T.next(h())}k();var L=R(k);return{unsubscribe:L}}},O[Ka]=function(){return this},O}return m({type:pr.INIT}),n={dispatch:m,subscribe:y,getState:h,replaceReducer:S},n[Ka]=x,n}function Gs(t){Object.keys(t).forEach(function(r){var o=t[r],n=o(void 0,{type:pr.INIT});if(typeof n>"u")throw new Error(q(12));if(typeof o(void 0,{type:pr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(q(13))})}function Va(t){for(var r=Object.keys(t),o={},n=0;n<r.length;n++){var a=r[n];typeof t[a]=="function"&&(o[a]=t[a])}var s=Object.keys(o),c,d;try{Gs(o)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var y;for(var m=!1,S={},x=0;x<s.length;x++){var O=s[x],R=o[O],N=p[O],T=R(N,h);if(typeof T>"u"){var k=h&&h.type;throw new Error(q(14))}S[O]=T,m=m||T!==N}return m=m||s.length!==Object.keys(p).length,m?S:p}}function at(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r.length===0?function(n){return n}:r.length===1?r[0]:r.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Za(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),s=function(){throw new Error(q(15))},c={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=r.map(function(u){return u(c)});return s=at.apply(void 0,d)(a.dispatch),ro(ro({},a),{},{dispatch:s})}}}function qa(t){var r=function(n){var a=n.dispatch,s=n.getState;return function(c){return function(d){return typeof d=="function"?d(a,s,t):c(d)}}};return r}var Ya=qa();Ya.withExtraArgument=qa;var ao=Ya;var ti=function(){var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])},t(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(r,o);function n(){this.constructor=r}r.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),$s=function(t,r){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){o.label=p[1];break}if(p[0]===6&&o.label<s[1]){o.label=s[1],s=p;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(p);break}s[2]&&o.ops.pop(),o.trys.pop();continue}p=r.call(t,o)}catch(h){p=[6,h],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},it=function(t,r){for(var o=0,n=r.length,a=t.length;o<n;o++,a++)t[a]=r[o];return t},js=Object.defineProperty,Ks=Object.defineProperties,Vs=Object.getOwnPropertyDescriptors,Xa=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable,Ja=function(t,r,o){return r in t?js(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},Re=function(t,r){for(var o in r||(r={}))Zs.call(r,o)&&Ja(t,o,r[o]);if(Xa)for(var n=0,a=Xa(r);n<a.length;n++){var o=a[n];qs.call(r,o)&&Ja(t,o,r[o])}return t},io=function(t,r){return Ks(t,Vs(r))},Ys=function(t,r,o){return new Promise(function(n,a){var s=function(u){try{d(o.next(u))}catch(p){a(p)}},c=function(u){try{d(o.throw(u))}catch(p){a(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,c)};d((o=o.apply(t,r)).next())})};var Xs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?at:at.apply(null,arguments)},eu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Js(t){if(typeof t!="object"||t===null)return!1;var r=Object.getPrototypeOf(t);if(r===null)return!0;for(var o=r;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return r===o}var Qs=function(t){ti(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},r.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(r.bind.apply(r,it([void 0],o[0].concat(this)))):new(r.bind.apply(r,it([void 0],o.concat(this))))},r}(Array),ec=function(t){ti(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},r.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(r.bind.apply(r,it([void 0],o[0].concat(this)))):new(r.bind.apply(r,it([void 0],o.concat(this))))},r}(Array);function lo(t){return fe(t)?ur(t,function(){}):t}function tc(t){return typeof t=="boolean"}function rc(){return function(r){return oc(r)}}function oc(t){t===void 0&&(t={});var r=t.thunk,o=r===void 0?!0:r,n=t.immutableCheck,a=n===void 0?!0:n,s=t.serializableCheck,c=s===void 0?!0:s,d=new Qs;if(o&&(tc(o)?d.push(ao):d.push(ao.withExtraArgument(o.extraArgument))),0){if(a)var u;if(c)var p}return d}var so=!0;function ri(t){var r=rc(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,s=o.middleware,c=s===void 0?r():s,d=o.devTools,u=d===void 0?!0:d,p=o.preloadedState,h=p===void 0?void 0:p,y=o.enhancers,m=y===void 0?void 0:y,S;if(typeof a=="function")S=a;else if(Js(a))S=Va(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 x=c;if(typeof x=="function"&&(x=x(r),!so&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!so&&x.some(function(L){return typeof L!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Za.apply(void 0,x),R=at;u&&(R=Xs(Re({trace:!so},typeof u=="object"&&u)));var N=new ec(O),T=N;Array.isArray(m)?T=it([O],m):typeof m=="function"&&(T=m(N));var k=R.apply(void 0,T);return no(S,h,k)}function Ne(t,r){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var s=r.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Re(Re({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function oi(t){var r={},o=[],n,a={addCase:function(s,c){var d=typeof s=="string"?s:s.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=c,a},addMatcher:function(s,c){return o.push({matcher:s,reducer:c}),a},addDefaultCase:function(s){return n=s,a}};return t(a),[r,o,n]}function nc(t){return typeof t=="function"}function ac(t,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?oi(r):[r,o,n],s=a[0],c=a[1],d=a[2],u;if(nc(t))u=function(){return lo(t())};else{var p=lo(t);u=function(){return p}}function h(y,m){y===void 0&&(y=u());var S=it([s[m.type]],c.filter(function(x){var O=x.matcher;return O(m)}).map(function(x){var O=x.reducer;return O}));return S.filter(function(x){return!!x}).length===0&&(S=[d]),S.reduce(function(x,O){if(O)if(be(x)){var R=x,N=O(R,m);return N===void 0?x:N}else{if(fe(x))return ur(x,function(T){return O(T,m)});var N=O(x,m);if(N===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return N}return x},y)}return h.getInitialState=u,h}function ic(t,r){return t+"/"+r}function ni(t){var r=t.name;if(!r)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:lo(t.initialState),n=t.reducers||{},a=Object.keys(n),s={},c={},d={};a.forEach(function(h){var y=n[h],m=ic(r,h),S,x;"reducer"in y?(S=y.reducer,x=y.prepare):S=y,s[h]=S,c[m]=S,d[h]=x?Ne(m,x):Ne(m)});function u(){var h=typeof t.extraReducers=="function"?oi(t.extraReducers):[t.extraReducers],y=h[0],m=y===void 0?{}:y,S=h[1],x=S===void 0?[]:S,O=h[2],R=O===void 0?void 0:O,N=Re(Re({},m),c);return ac(o,function(T){for(var k in N)T.addCase(k,N[k]);for(var L=0,$=x;L<$.length;L++){var de=$[L];T.addMatcher(de.matcher,de.reducer)}R&&T.addDefaultCase(R)})}var p;return{name:r,reducer:function(h,y){return p||(p=u()),p(h,y)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var sc="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",cc=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=sc[Math.random()*64|0];return r},lc=["name","message","stack","code"],co=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Qa=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),dc=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,n=lc;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(r[a]=t[a])}return r}return{message:String(t)}},nu=function(){function t(r,o,n){var a=Ne(r+"/fulfilled",function(h,y,m,S){return{payload:h,meta:io(Re({},S||{}),{arg:m,requestId:y,requestStatus:"fulfilled"})}}),s=Ne(r+"/pending",function(h,y,m){return{payload:void 0,meta:io(Re({},m||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),c=Ne(r+"/rejected",function(h,y,m,S,x){return{payload:S,error:(n&&n.serializeError||dc)(h||"Rejected"),meta:io(Re({},x||{}),{arg:m,requestId:y,rejectedWithValue:!!S,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(y,m,S){var x=n?.idGenerator?n.idGenerator(h):cc(),O=new u,R,N=!1;function T(L){R=L,O.abort()}var k=function(){return Ys(this,null,function(){var L,$,de,Pe,Y,ke,Ye;return $s(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),Pe=(L=n?.condition)==null?void 0:L.call(n,h,{getState:m,extra:S}),pc(Pe)?[4,Pe]:[3,2];case 1:Pe=f.sent(),f.label=2;case 2:if(Pe===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return N=!0,Y=new Promise(function(g,w){return O.signal.addEventListener("abort",function(){return w({name:"AbortError",message:R||"Aborted"})})}),y(s(x,h,($=n?.getPendingMeta)==null?void 0:$.call(n,{requestId:x,arg:h},{getState:m,extra:S}))),[4,Promise.race([Y,Promise.resolve(o(h,{dispatch:y,getState:m,extra:S,requestId:x,signal:O.signal,abort:T,rejectWithValue:function(g,w){return new co(g,w)},fulfillWithValue:function(g,w){return new Qa(g,w)}})).then(function(g){if(g instanceof co)throw g;return g instanceof Qa?a(g.payload,x,h,g.meta):a(g,x,h)})])];case 3:return de=f.sent(),[3,5];case 4:return ke=f.sent(),de=ke instanceof co?c(null,x,h,ke.payload,ke.meta):c(ke,x,h),[3,5];case 5:return Ye=n&&!n.dispatchConditionRejection&&c.match(de)&&de.meta.condition,Ye||y(de),[2,de]}})})}();return Object.assign(k,{abort:T,requestId:x,arg:h,unwrap:function(){return k.then(uc)}})}}return Object.assign(p,{pending:s,rejected:c,fulfilled:a,typePrefix:r})}return t.withTypes=function(){return t},t}();function uc(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function pc(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var ai="listener",ii="completed",si="cancelled",au="task-"+si,iu="task-"+ii,su=ai+"-"+si,cu=ai+"-"+ii;var uo="listenerMiddleware";var lu=Ne(uo+"/add"),du=Ne(uo+"/removeAll"),uu=Ne(uo+"/remove");var ei,pu=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ei||(ei=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},fc=function(t){return function(r){setTimeout(r,t)}},fu=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:fc(10);Ha();var hc=rr(Symbol("withEventBus"),function(t,r){return class extends t{constructor(){super(...arguments),this.eventBus=r??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)}}}),fr=class extends hc(Object){};window.ftReduxStores||(window.ftReduxStores={});var ci=class t extends fr{static get(r){var o;let n=typeof r=="string"?r:r.name,a=typeof r=="string"?void 0:r,s=window.ftReduxStores[n];if(sr(s))return s;if(a==null)return;let c=ni({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=ri({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?c.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:c.reducer(u,p)});return window.ftReduxStores[a.name]=new t(c,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new or;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,c,d)=>{let u=c,p=s[u];return p?(...h)=>{let y=p(...h.map(a));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[u]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(r){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(r).join("_"),overwrites:r})}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(r){throw new Error("Not implemented yet.")}subscribe(r){return this.reduxStore.subscribe(r)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var hr=class{static format(r,o,n,a){return window.moment?window.moment(r).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(r,o,n,a)}static getMomentDateFormat(r,o){return r?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(r,o,n,a){let s=typeof r=="string"?new Date(r):r,c=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!a)return c;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${c} ${d}`}static getTimezoneAsString(){let r=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${r(Math.abs(o)/60)}:${r(Math.abs(o)%60)}`}};var li=C(_()),yr=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Uu=(0,li.applyMixinOnce)(Symbol("withDateFormat"),function(t){class r extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(E)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,s;return((s=(a=this.metadataDescriptors.find(d=>d.key===n))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1)?d=>hr.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return yr([(0,po.property)({type:Boolean})],r.prototype,"useLongDateFormat",void 0),yr([(0,po.property)({type:Boolean})],r.prototype,"useDateTimeFormat",void 0),yr([Fr({store:E.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],r.prototype,"metadataDescriptors",void 0),yr([Fr({store:E.name})],r.prototype,"uiLocale",void 0),r});var br=C(_());var mr=class extends Q{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(r){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${r}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(r){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${r}`),this.CACHE_DURATION)}isAuthenticated(){let r=E.getState().session;return!!r?.sessionAuthenticated}};var gr=class extends Q{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 r=E.getState().session;return!!r?.sessionAuthenticated}};var yc="ft-user-assets",mc={setAssetCount:(t,r)=>{let{userAssetType:o,count:n}=r.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(ie).forEach(r=>{t.assetCounts.allAsset[r]=void 0})},setBookmarkCountByMap:(t,r)=>{let o=r.payload.mapId;t.assetCounts.bookmarkByMap[o]=r.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,r)=>{let{assetType:o,mapId:n,asset:a}=r.payload;ho(t,o,[...fo(t,o),a]),di(t,o,1,n),ui(t,a)},editAsset:(t,r)=>{let{assetType:o,asset:n}=r.payload;ho(t,o,fo(t,o).map(a=>a.id===n.id?n:a)),ui(t,n)},removeAsset:(t,r)=>{let{assetType:o,mapId:n,assetId:a}=r.payload;ho(t,o,fo(t,o).filter(s=>s.id!==a)),di(t,o,-1,n)}},pi={[ie.SEARCHES]:"savedSearches",[ie.BOOKMARKS]:"bookmarks",[ie.BOOKS]:void 0,[ie.COLLECTIONS]:void 0},fo=(t,r)=>{var o;let n=pi[r];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},ho=(t,r,o)=>{let n=pi[r];n&&(t[n]=o)},di=(t,r,o,n)=>{let a=t.assetCounts.allAsset[r];if(a!==void 0&&(t.assetCounts.allAsset[r]=Math.max(0,a+o),r===ie.BOOKMARKS&&n)){let s=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,s+o)}},ui=(t,r)=>{let o=t.assetLabels.map(a=>a.title),n=r.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},te=br.FtReduxStore.get({name:yc,reducers:mc,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ie).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),yo=class{constructor(r=new mr,o=new gr){this.assetCountsService=r,this.assetLabelsService=o,this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Zt,this.savedSearchesService=new Qt,E.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=E.getState();(0,br.deepEqual)((r=this.currentSession)===null||r===void 0?void 0:r.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),te.actions.clearAssetCount(),te.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),te.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),te.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();te.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let r=await this.assetLabelsService.getUserAssetLabels();te.actions.assetLabels(r)}async loadAssetCount(r){let o=await this.assetCountsService.getUserAssetCount(r);o&&te.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(r){let o=await this.assetCountsService.getUserBookmarkCountByMap(r);o&&te.actions.setBookmarkCountByMap({count:o.count,mapId:r})}async reloadAssetCount(r){this.assetCountsService.clearCache();let o=Object.keys(te.getState().assetCounts.bookmarkByMap).length!==0;r===ie.BOOKMARKS&&o&&te.actions.clearBookmarkCountByMap(),te.getState().assetCounts.allAsset[r]!==void 0&&await this.loadAssetCount(r)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var r;if(this.bookmarksAreUsed){let o=!((r=this.currentSession)===null||r===void 0)&&r.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;te.actions.bookmarks(o)}}},gc=new yo;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gc);(0,fi.customElement)("ft-app-context")(D);var mi=C(X());var mo=class{fromLocalizableLabel(r){return r.type=="PLAIN_TEXT"?{message:r.text}:{key:r.key,custom:r.type=="LOCALIZED_CUSTOM",context:r.context,message:r.key}}fromAttribute(r){if(r!=null)try{return JSON.parse(r)}catch{if(this.isI18nKey(r)){let[n,a]=r.split(".");return{context:n,key:a,message:""}}return{message:r}}}toAttribute(r){if(r!=null)return JSON.stringify(r)}isI18nKey(r){return r.match(/^[\w-]+\.[\w-]+$/)}},hi=new mo;var bc=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},xc=Symbol("i18nAttributes"),vc=Symbol("i18nListAttributes"),gi=Symbol("i18nProperties"),xr=Symbol("i18nContexts"),Pt=Symbol("i18nUnsubs"),Sr=(0,st.applyMixinOnce)(Symbol("withI18n"),function(t){var r,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[r]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Yt:Je}i18n(s){let{context:c,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(c&&d){this.hasI18nContext(c)||this.addI18nContext(c,void 0,p);let m=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(c,d,...m)}return u}async awaitI18n(s){let{context:c,custom:d}=s;return c&&await this.getI18nService(d).prepareContext(c),this.i18n(s)}customI18n(s,c){if(hi.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...c})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((c,d,u)=>s.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((c,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(c=>c.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var c,d;let u=this,p=(h,y,m)=>m?.context&&m.key&&s(h,y,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(c=this[xc])===null||c===void 0||c.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[vc])===null||d===void 0||d.forEach((h,y)=>{var m;return u[y]=(m=u[y])===null||m===void 0?void 0:m.map(S=>p(h,y,S))})}updateI18nProperties(s){var c;(c=this[gi])===null||c===void 0||c.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,c,d)}addI18nContext(s,c,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[xr].set(u,{isCustomContext:d}),this[Pt].has(u)||this[Pt].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,c)}hasI18nContext(s){return this[xr].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[xr].forEach((s,c)=>this.addI18nContext(c,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Pt].forEach(s=>s()),this[Pt].clear()}}return r=xr,o=Pt,bc([(0,mi.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),yi=class extends Sr(st.FtLitElement){},vr=class extends Sr(st.FtLitElementRedux){};var kt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},he=class extends vr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Or.nothing:Or.html`
|
|
233
|
+
`}connectedCallback(){super.connectedCallback(),E.addEventListener(Ue.eventName,this.reloadConfiguration)}disconnectedCallback(){E.addEventListener(Ue.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(r){var o,n,a,s,c,d,u;super.update(r),r.has("baseUrl")&&(E.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&E.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("apiIntegrationAppVersion")&&E.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),r.has("uiLocale")&&E.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&E.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&E.actions.noCustom(this.noCustom),r.has("editorMode")&&E.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&E.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&E.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Je.addContext(p)),r.has("openExternalDocumentInNewTab")&&E.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&E.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&E.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(E.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),E.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),E.actions.searchInAllLanguagesAllowed((c=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),r.has("authenticationRequired")&&E.actions.authenticationRequired(this.authenticationRequired),r.has("availableContentLocales")&&E.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),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 r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},r.idleTimeoutInMillis),r})}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",()=>ma(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};D.elementDefinitions={};D.styles=Tn;z([(0,K.property)()],D.prototype,"baseUrl",void 0);z([(0,K.property)()],D.prototype,"apiIntegrationIdentifier",void 0);z([(0,K.property)()],D.prototype,"apiIntegrationAppVersion",void 0);z([(0,K.property)()],D.prototype,"uiLocale",void 0);z([(0,pe.jsonProperty)(null)],D.prototype,"availableUiLocales",void 0);z([(0,pe.jsonProperty)(null)],D.prototype,"metadataConfiguration",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"editorMode",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"noCustom",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"openExternalDocumentInNewTab",void 0);z([(0,K.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],D.prototype,"noCustomComponent",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"withManualResources",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"navigatorOnline",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"forcedOffline",void 0);z([(0,K.property)({type:Object})],D.prototype,"apiProvider",void 0);z([(0,K.property)({type:Boolean})],D.prototype,"authenticationRequired",void 0);z([(0,pe.jsonProperty)([])],D.prototype,"messageContexts",void 0);z([(0,pe.jsonProperty)(void 0)],D.prototype,"session",void 0);z([(0,K.state)()],D.prototype,"localesConfiguration",void 0);z([(0,K.state)()],D.prototype,"availableContentLocales",void 0);var po=C(X());function Ts(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;let o,n,a;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!tr(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!tr(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();let s=c=>Object.keys(c).filter(d=>c[d]!=null);if(a=s(t),o=a.length,o!==s(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=o;n--!==0;){let c=a[n];if(!tr(t[c],r[c]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function tr(t,r){try{return Ts(t,r)}catch{return!1}}function Nt(t,r){return!tr(t,r)}function rr(t,r){let o=n=>n[t]===!0;return n=>{if(o(n))return n;let a=r(n);return a[t]=!0,a}}var ba=C(X(),1);var Fr=t=>{let r=t??{};return(o,n)=>{var a;let s={hasChanged:Nt,attribute:!1,...r};(0,ba.property)(s)(o,n);let c=o.constructor;c.reduxProperties=new Map(c.reduxProperties),c.reduxProperties.set(n,{selector:(a=r.selector)!==null&&a!==void 0?a:d=>d[n],store:r.store})}};var or=class{constructor(){this.queue=[]}add(r,o=!1){o&&this.clear(r.type),this.queue.push(r)}consume(r){let o=this.queue.find(n=>n.type===r);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(r){typeof r=="string"?this.queue=this.queue.filter(o=>o.type!==r):this.queue=this.queue.filter(o=>!r.test(o.type))}};var We=C(X(),1);var xa=C(X(),1);function va(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,xa.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:Nt,...r??{}})}var nr=class{constructor(r=0){this.timeout=r,this.callbacks=[]}run(r,o){return this.callbacks=[r],this.debounce(o)}queue(r,o){return this.callbacks.push(r),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(r){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),r??this.timeout),this.promise}async runCallbacks(){var r,o;let n=[...this.callbacks];this.callbacks=[];let a=(r=this.rejectPromise)!==null&&r!==void 0?r:()=>null,s=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){a(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Oa=C(Z(),1);var ar=globalThis,Is=ar.ShadowRoot&&(ar.ShadyCSS===void 0||ar.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,md=Symbol();var Sa=(t,r)=>{if(Is)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=ar.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var ir=class extends Oa.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([a,s])=>r.registry.define(a,s)));let o={...r.shadowRootOptions,customElements:r.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Sa(n,r.elementStyles),n}};function Ca(t,r,...o){var n;let a=t.querySelector(r);for(let s of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return a}var tt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Ra,Ea=Symbol("constructorPrototype"),Aa=Symbol("constructorName"),Na=Symbol("exportpartsDebouncer"),wa=Symbol("dynamicDependenciesLoaded"),et=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};et.eventName="exportparts-updated";var me=class extends ir{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ra]=new nr(5),this.scheduleExportpartsUpdate=()=>{var r,o,n;(!((r=this.exportpartsPrefix)===null||r===void 0)&&r.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[Na].run(()=>{var a,s;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Aa]=this.constructor.name,this[Ea]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Aa]&&Object.setPrototypeOf(this,this[Ea])}connectedCallback(){var r;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[wa]||(o[wa]=!0,this.importDynamicDependencies()),(r=this.shadowRoot)===null||r===void 0||r.addEventListener(et.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.shadowRoot)===null||r===void 0||r.removeEventListener(et.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(r){super.updated(r),this.updateComplete.then(()=>{this.contentAvailableCallback(r),this.focusElementToFocus(r),this.applyCustomStylesheet(r),this.scheduleExportpartsUpdate(),r.has("exportparts")&&this.dispatchEvent(new et)})}contentAvailableCallback(r){}focusElementToFocus(r){if(r.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let s=[...a??[],n];o=Ca(this.shadowRoot,...s)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(r){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(s=>s.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(r){var o,n,a,s,c,d;let u=m=>m!=null&&m.trim().length>0,p=r.filter(u).map(m=>m.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let m of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(s=(a=m.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],x=(d=(c=m.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(R=>R.split(":")[1]))!==null&&d!==void 0?d:[],O=[...S,...x].filter(u).map(R=>R.trim());for(let R of O)h.add(R)}if(h.size===0){this.exportparts=void 0;return}let y=[...h.values()].flatMap(m=>p.map(S=>`${m}:${S}--${m}`));this.exportparts=[...this.part,...y].join(", ")}};Ra=Na;tt([(0,We.property)()],me.prototype,"exportpartsPrefix",void 0);tt([va([])],me.prototype,"exportpartsPrefixes",void 0);tt([(0,We.property)({reflect:!0})],me.prototype,"exportparts",void 0);tt([(0,We.property)()],me.prototype,"customStylesheet",void 0);tt([(0,We.property)()],me.prototype,"elementToFocus",void 0);tt([(0,We.state)()],me.prototype,"useAdoptedStyleSheets",void 0);function sr(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Tt=Symbol("internalReduxEventsUnsubscribers"),Ee=Symbol("internalStoresUnsubscribers"),Fe=Symbol("internalStores"),_s=rr(Symbol("withRedux"),function(t){var r,o,n;class a extends t{constructor(){super(...arguments),this[r]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(c){super.willUpdate(c),[...this.reduxConstructor.reduxReactiveProperties].some(d=>c.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[Fe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Fe].values()][0]}getStore(c){return c==null?this.getUnnamedStore():this[Fe].get(c)}addStore(c,d){var u;d=(u=d??c.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[Fe].set(d,c),this.subscribeToStore(d,c),this.updateFromStores()}removeStore(c){let d=typeof c=="string"?c:c.name;this.unsubscribeFromStore(d),this[Fe].delete(d)}setupStores(){this.unsubscribeFromStores(),this[Fe].forEach((c,d)=>this.subscribeToStore(d,c)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((c,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(c.store);p&&(c.store?this[Ee].has(c.store):this[Ee].size>0)&&(this[d]=c.selector(p.getState(),this))}})}subscribeToStore(c,d){var u;this[Ee].set(c,d.subscribe(()=>this.updateFromStores())),this[Tt].set(c,[]),sr(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let y=m=>this[h](m);d.addEventListener(p.eventName,y),this[Tt].get(c).push(()=>d.removeEventListener(p.eventName,y))}})),this.onStoreAvailable(c)}unsubscribeFromStores(){this[Ee].forEach((c,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(c){var d;this[Ee].has(c)&&this[Ee].get(c)(),this[Ee].delete(c),(d=this[Tt].get(c))===null||d===void 0||d.forEach(u=>u()),this[Tt].delete(c)}onStoreAvailable(c){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return r=Ee,o=Fe,n=Tt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ta=class extends _s(me){};function se(t){for(var r=arguments.length,o=Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];if(0)var a,s;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function be(t){return!!t&&!!t[U]}function fe(t){var r;return!!t&&(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)===Hs}(t)||Array.isArray(t)||!!t[Ba]||!!(!((r=t.constructor)===null||r===void 0)&&r[Ba])||Yr(t)||Xr(t))}function ze(t,r,o){o===void 0&&(o=!1),nt(t)===0?(o?Object.keys:ot)(t).forEach(function(n){o&&typeof n=="symbol"||r(n,t[n],t)}):t.forEach(function(n,a){return r(a,n,t)})}function nt(t){var r=t[U];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:Yr(t)?2:Xr(t)?3:0}function rt(t,r){return nt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function Ls(t,r){return nt(t)===2?t.get(r):t[r]}function Ua(t,r,o){var n=nt(t);n===2?t.set(r,o):n===3?t.add(o):t[r]=o}function Ma(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function Yr(t){return Us&&t instanceof Map}function Xr(t){return Ms&&t instanceof Set}function Ae(t){return t.o||t.t}function Jr(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=Fa(t);delete r[U];for(var o=ot(r),n=0;n<o.length;n++){var a=o[n],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),r)}function Qr(t,r){return r===void 0&&(r=!1),eo(t)||be(t)||!fe(t)||(nt(t)>1&&(t.set=t.add=t.clear=t.delete=Ps),Object.freeze(t),r&&ze(t,function(o,n){return Qr(n,!0)},!0)),t}function Ps(){se(2)}function eo(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ge(t){var r=qr[t];return r||se(18,t),r}function ks(t,r){qr[t]||(qr[t]=r)}function Kr(){return _t}function zr(t,r){r&&(ge("Patches"),t.u=[],t.s=[],t.v=r)}function cr(t){Vr(t),t.p.forEach(Ds),t.p=null}function Vr(t){t===_t&&(_t=t.l)}function Ia(t){return _t={p:[],l:_t,h:t,m:!0,_:0}}function Ds(t){var r=t[U];r.i===0||r.i===1?r.j():r.g=!0}function Gr(t,r){r._=r.p.length;var o=r.p[0],n=t!==void 0&&t!==o;return r.h.O||ge("ES5").S(r,t,n),n?(o[U].P&&(cr(r),se(4)),fe(t)&&(t=lr(r,t),r.l||dr(r,t)),r.u&&ge("Patches").M(o[U].t,t,r.u,r.s)):t=lr(r,o,[]),cr(r),r.u&&r.v(r.u,r.s),t!==Wa?t:void 0}function lr(t,r,o){if(eo(r))return r;var n=r[U];if(!n)return ze(r,function(d,u){return _a(t,n,r,d,u,o)},!0),r;if(n.A!==t)return r;if(!n.P)return dr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=Jr(n.k):n.o,s=a,c=!1;n.i===3&&(s=new Set(a),a.clear(),c=!0),ze(s,function(d,u){return _a(t,n,a,d,u,o,c)}),dr(t,a,!1),o&&t.u&&ge("Patches").N(n,o,t.u,t.s)}return n.o}function _a(t,r,o,n,a,s,c){if(be(a)){var d=lr(t,a,s&&r&&r.i!==3&&!rt(r.R,n)?s.concat(n):void 0);if(Ua(o,n,d),!be(d))return;t.m=!1}else c&&o.add(a);if(fe(a)&&!eo(a)){if(!t.h.D&&t._<1)return;lr(t,a),r&&r.A.l||dr(t,a)}}function dr(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&Qr(r,o)}function $r(t,r){var o=t[U];return(o?Ae(o):t)[r]}function La(t,r){if(r in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,r);if(n)return n;o=Object.getPrototypeOf(o)}}function we(t){t.P||(t.P=!0,t.l&&we(t.l))}function jr(t){t.o||(t.o=Jr(t.t))}function Zr(t,r,o){var n=Yr(r)?ge("MapSet").F(r,o):Xr(r)?ge("MapSet").T(r,o):t.O?function(a,s){var c=Array.isArray(a),d={i:c?1:0,A:s?s.A:Kr(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},u=d,p=Lt;c&&(u=[d],p=It);var h=Proxy.revocable(u,p),y=h.revoke,m=h.proxy;return d.k=m,d.j=y,m}(r,o):ge("ES5").J(r,o);return(o?o.A:Kr()).p.push(n),n}function Bs(t){return be(t)||se(22,t),function r(o){if(!fe(o))return o;var n,a=o[U],s=nt(o);if(a){if(!a.P&&(a.i<4||!ge("ES5").K(a)))return a.t;a.I=!0,n=Pa(o,s),a.I=!1}else n=Pa(o,s);return ze(n,function(c,d){a&&Ls(a.t,c)===d||Ua(n,c,r(d))}),s===3?new Set(n):n}(t)}function Pa(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return Jr(t)}function Ha(){function t(c,d){var u=s[c];return u?u.enumerable=d:s[c]=u={configurable:!0,enumerable:d,get:function(){var p=this[U];return Lt.get(p,c)},set:function(p){var h=this[U];Lt.set(h,c,p)}},u}function r(c){for(var d=c.length-1;d>=0;d--){var u=c[d][U];if(!u.P)switch(u.i){case 5:n(u)&&we(u);break;case 4:o(u)&&we(u)}}}function o(c){for(var d=c.t,u=c.k,p=ot(u),h=p.length-1;h>=0;h--){var y=p[h];if(y!==U){var m=d[y];if(m===void 0&&!rt(d,y))return!0;var S=u[y],x=S&&S[U];if(x?x.t!==m:!Ma(S,m))return!0}}var O=!!d[U];return p.length!==ot(d).length+(O?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function a(c){c.g&&se(3,JSON.stringify(Ae(c)))}var s={};ks("ES5",{J:function(c,d){var u=Array.isArray(c),p=function(y,m){if(y){for(var S=Array(m.length),x=0;x<m.length;x++)Object.defineProperty(S,""+x,t(x,!0));return S}var O=Fa(m);delete O[U];for(var R=ot(O),N=0;N<R.length;N++){var T=R[N];O[T]=t(T,y||!!O[T].enumerable)}return Object.create(Object.getPrototypeOf(m),O)}(u,c),h={i:u?5:4,A:d?d.A:Kr(),P:!1,I:!1,R:{},l:d,t:c,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,U,{value:h,writable:!0}),p},S:function(c,d,u){u?be(d)&&d[U].A===c&&r(c.p):(c.u&&function p(h){if(h&&typeof h=="object"){var y=h[U];if(y){var m=y.t,S=y.k,x=y.R,O=y.i;if(O===4)ze(S,function(L){L!==U&&(m[L]!==void 0||rt(m,L)?x[L]||p(S[L]):(x[L]=!0,we(y)))}),ze(m,function(L){S[L]!==void 0||rt(S,L)||(x[L]=!1,we(y))});else if(O===5){if(n(y)&&(we(y),x.length=!0),S.length<m.length)for(var R=S.length;R<m.length;R++)x[R]=!1;else for(var N=m.length;N<S.length;N++)x[N]=!0;for(var T=Math.min(S.length,m.length),k=0;k<T;k++)S.hasOwnProperty(k)||(x[k]=!0),x[k]===void 0&&p(S[k])}}}}(c.p[0]),r(c.p))},K:function(c){return c.i===4?o(c):n(c)}})}var ka,_t,to=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Us=typeof Map<"u",Ms=typeof Set<"u",Da=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Wa=to?Symbol.for("immer-nothing"):((ka={})["immer-nothing"]=!0,ka),Ba=to?Symbol.for("immer-draftable"):"__$immer_draftable",U=to?Symbol.for("immer-state"):"__$immer_state";var Hs=""+Object.prototype.constructor,ot=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Fa=Object.getOwnPropertyDescriptors||function(t){var r={};return ot(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},qr={},Lt={get:function(t,r){if(r===U)return t;var o=Ae(t);if(!rt(o,r))return function(a,s,c){var d,u=La(s,c);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(a.k):void 0}(t,o,r);var n=o[r];return t.I||!fe(n)?n:n===$r(t.t,r)?(jr(t),t.o[r]=Zr(t.A.h,n,t)):n},has:function(t,r){return r in Ae(t)},ownKeys:function(t){return Reflect.ownKeys(Ae(t))},set:function(t,r,o){var n=La(Ae(t),r);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=$r(Ae(t),r),s=a?.[U];if(s&&s.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(Ma(o,a)&&(o!==void 0||rt(t.t,r)))return!0;jr(t),we(t)}return t.o[r]===o&&(o!==void 0||r in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[r])||(t.o[r]=o,t.R[r]=!0),!0},deleteProperty:function(t,r){return $r(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,jr(t),we(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=Ae(t),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){se(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){se(12)}},It={};ze(Lt,function(t,r){It[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),It.deleteProperty=function(t,r){return It.set.call(this,t,r,void 0)},It.set=function(t,r,o){return Lt.set.call(this,t[0],r,o,t[0])};var Ws=function(){function t(o){var n=this;this.O=Da,this.D=!0,this.produce=function(a,s,c){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var u=n;return function(O){var R=this;O===void 0&&(O=d);for(var N=arguments.length,T=Array(N>1?N-1:0),k=1;k<N;k++)T[k-1]=arguments[k];return u.produce(O,function(L){var $;return($=s).call.apply($,[R,L].concat(T))})}}var p;if(typeof s!="function"&&se(6),c!==void 0&&typeof c!="function"&&se(7),fe(a)){var h=Ia(n),y=Zr(n,a,void 0),m=!0;try{p=s(y),m=!1}finally{m?cr(h):Vr(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(O){return zr(h,c),Gr(O,h)},function(O){throw cr(h),O}):(zr(h,c),Gr(p,h))}if(!a||typeof a!="object"){if((p=s(a))===void 0&&(p=a),p===Wa&&(p=void 0),n.D&&Qr(p,!0),c){var S=[],x=[];ge("Patches").M(a,p,S,x),c(S,x)}return p}se(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(p){for(var h=arguments.length,y=Array(h>1?h-1:0),m=1;m<h;m++)y[m-1]=arguments[m];return n.produceWithPatches(p,function(S){return a.apply(void 0,[S].concat(y))})};var c,d,u=n.produce(a,s,function(p,h){c=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,c,d]}):[u,c,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var r=t.prototype;return r.createDraft=function(o){fe(o)||se(8),be(o)&&(o=Bs(o));var n=Ia(this),a=Zr(this,o,void 0);return a[U].C=!0,Vr(n),a},r.finishDraft=function(o,n){var a=o&&o[U],s=a.A;return zr(s,n),Gr(void 0,s)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!Da&&se(20),this.O=o},r.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var s=n[a];if(s.path.length===0&&s.op==="replace"){o=s.value;break}}a>-1&&(n=n.slice(a+1));var c=ge("Patches").$;return be(o)?c(o,n):this.produce(o,function(d){return c(d,n)})},t}(),ee=new Ws,Fs=ee.produce,_d=ee.produceWithPatches.bind(ee),Ld=ee.setAutoFreeze.bind(ee),Pd=ee.setUseProxies.bind(ee),kd=ee.applyPatches.bind(ee),Dd=ee.createDraft.bind(ee),Bd=ee.finishDraft.bind(ee),ur=Fs;function Ge(t){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ge(t)}function za(t,r){if(Ge(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,r||"default");if(Ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Ga(t){var r=za(t,"string");return Ge(r)=="symbol"?r:r+""}function $a(t,r,o){return(r=Ga(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ja(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function ro(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?ja(Object(o),!0).forEach(function(n){$a(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ja(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function q(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Ka=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),oo=function(){return Math.random().toString(36).substring(7).split("").join(".")},pr={INIT:"@@redux/INIT"+oo(),REPLACE:"@@redux/REPLACE"+oo(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+oo()}};function zs(t){if(typeof t!="object"||t===null)return!1;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}function no(t,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(q(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(q(1));return o(no)(t,r)}if(typeof t!="function")throw new Error(q(2));var a=t,s=r,c=[],d=c,u=!1;function p(){d===c&&(d=c.slice())}function h(){if(u)throw new Error(q(3));return s}function y(O){if(typeof O!="function")throw new Error(q(4));if(u)throw new Error(q(5));var R=!0;return p(),d.push(O),function(){if(R){if(u)throw new Error(q(6));R=!1,p();var T=d.indexOf(O);d.splice(T,1),c=null}}}function m(O){if(!zs(O))throw new Error(q(7));if(typeof O.type>"u")throw new Error(q(8));if(u)throw new Error(q(9));try{u=!0,s=a(s,O)}finally{u=!1}for(var R=c=d,N=0;N<R.length;N++){var T=R[N];T()}return O}function S(O){if(typeof O!="function")throw new Error(q(10));a=O,m({type:pr.REPLACE})}function x(){var O,R=y;return O={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(q(11));function k(){T.next&&T.next(h())}k();var L=R(k);return{unsubscribe:L}}},O[Ka]=function(){return this},O}return m({type:pr.INIT}),n={dispatch:m,subscribe:y,getState:h,replaceReducer:S},n[Ka]=x,n}function Gs(t){Object.keys(t).forEach(function(r){var o=t[r],n=o(void 0,{type:pr.INIT});if(typeof n>"u")throw new Error(q(12));if(typeof o(void 0,{type:pr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(q(13))})}function Va(t){for(var r=Object.keys(t),o={},n=0;n<r.length;n++){var a=r[n];typeof t[a]=="function"&&(o[a]=t[a])}var s=Object.keys(o),c,d;try{Gs(o)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var y;for(var m=!1,S={},x=0;x<s.length;x++){var O=s[x],R=o[O],N=p[O],T=R(N,h);if(typeof T>"u"){var k=h&&h.type;throw new Error(q(14))}S[O]=T,m=m||T!==N}return m=m||s.length!==Object.keys(p).length,m?S:p}}function at(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r.length===0?function(n){return n}:r.length===1?r[0]:r.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Za(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),s=function(){throw new Error(q(15))},c={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=r.map(function(u){return u(c)});return s=at.apply(void 0,d)(a.dispatch),ro(ro({},a),{},{dispatch:s})}}}function qa(t){var r=function(n){var a=n.dispatch,s=n.getState;return function(c){return function(d){return typeof d=="function"?d(a,s,t):c(d)}}};return r}var Ya=qa();Ya.withExtraArgument=qa;var ao=Ya;var ti=function(){var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])},t(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(r,o);function n(){this.constructor=r}r.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),$s=function(t,r){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){o.label=p[1];break}if(p[0]===6&&o.label<s[1]){o.label=s[1],s=p;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(p);break}s[2]&&o.ops.pop(),o.trys.pop();continue}p=r.call(t,o)}catch(h){p=[6,h],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},it=function(t,r){for(var o=0,n=r.length,a=t.length;o<n;o++,a++)t[a]=r[o];return t},js=Object.defineProperty,Ks=Object.defineProperties,Vs=Object.getOwnPropertyDescriptors,Xa=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable,Ja=function(t,r,o){return r in t?js(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},Re=function(t,r){for(var o in r||(r={}))Zs.call(r,o)&&Ja(t,o,r[o]);if(Xa)for(var n=0,a=Xa(r);n<a.length;n++){var o=a[n];qs.call(r,o)&&Ja(t,o,r[o])}return t},io=function(t,r){return Ks(t,Vs(r))},Ys=function(t,r,o){return new Promise(function(n,a){var s=function(u){try{d(o.next(u))}catch(p){a(p)}},c=function(u){try{d(o.throw(u))}catch(p){a(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,c)};d((o=o.apply(t,r)).next())})};var Xs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?at:at.apply(null,arguments)},eu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Js(t){if(typeof t!="object"||t===null)return!1;var r=Object.getPrototypeOf(t);if(r===null)return!0;for(var o=r;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return r===o}var Qs=function(t){ti(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},r.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(r.bind.apply(r,it([void 0],o[0].concat(this)))):new(r.bind.apply(r,it([void 0],o.concat(this))))},r}(Array),ec=function(t){ti(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},r.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(r.bind.apply(r,it([void 0],o[0].concat(this)))):new(r.bind.apply(r,it([void 0],o.concat(this))))},r}(Array);function lo(t){return fe(t)?ur(t,function(){}):t}function tc(t){return typeof t=="boolean"}function rc(){return function(r){return oc(r)}}function oc(t){t===void 0&&(t={});var r=t.thunk,o=r===void 0?!0:r,n=t.immutableCheck,a=n===void 0?!0:n,s=t.serializableCheck,c=s===void 0?!0:s,d=new Qs;if(o&&(tc(o)?d.push(ao):d.push(ao.withExtraArgument(o.extraArgument))),0){if(a)var u;if(c)var p}return d}var so=!0;function ri(t){var r=rc(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,s=o.middleware,c=s===void 0?r():s,d=o.devTools,u=d===void 0?!0:d,p=o.preloadedState,h=p===void 0?void 0:p,y=o.enhancers,m=y===void 0?void 0:y,S;if(typeof a=="function")S=a;else if(Js(a))S=Va(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 x=c;if(typeof x=="function"&&(x=x(r),!so&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!so&&x.some(function(L){return typeof L!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Za.apply(void 0,x),R=at;u&&(R=Xs(Re({trace:!so},typeof u=="object"&&u)));var N=new ec(O),T=N;Array.isArray(m)?T=it([O],m):typeof m=="function"&&(T=m(N));var k=R.apply(void 0,T);return no(S,h,k)}function Ne(t,r){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var s=r.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Re(Re({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function oi(t){var r={},o=[],n,a={addCase:function(s,c){var d=typeof s=="string"?s:s.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=c,a},addMatcher:function(s,c){return o.push({matcher:s,reducer:c}),a},addDefaultCase:function(s){return n=s,a}};return t(a),[r,o,n]}function nc(t){return typeof t=="function"}function ac(t,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?oi(r):[r,o,n],s=a[0],c=a[1],d=a[2],u;if(nc(t))u=function(){return lo(t())};else{var p=lo(t);u=function(){return p}}function h(y,m){y===void 0&&(y=u());var S=it([s[m.type]],c.filter(function(x){var O=x.matcher;return O(m)}).map(function(x){var O=x.reducer;return O}));return S.filter(function(x){return!!x}).length===0&&(S=[d]),S.reduce(function(x,O){if(O)if(be(x)){var R=x,N=O(R,m);return N===void 0?x:N}else{if(fe(x))return ur(x,function(T){return O(T,m)});var N=O(x,m);if(N===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return N}return x},y)}return h.getInitialState=u,h}function ic(t,r){return t+"/"+r}function ni(t){var r=t.name;if(!r)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:lo(t.initialState),n=t.reducers||{},a=Object.keys(n),s={},c={},d={};a.forEach(function(h){var y=n[h],m=ic(r,h),S,x;"reducer"in y?(S=y.reducer,x=y.prepare):S=y,s[h]=S,c[m]=S,d[h]=x?Ne(m,x):Ne(m)});function u(){var h=typeof t.extraReducers=="function"?oi(t.extraReducers):[t.extraReducers],y=h[0],m=y===void 0?{}:y,S=h[1],x=S===void 0?[]:S,O=h[2],R=O===void 0?void 0:O,N=Re(Re({},m),c);return ac(o,function(T){for(var k in N)T.addCase(k,N[k]);for(var L=0,$=x;L<$.length;L++){var de=$[L];T.addMatcher(de.matcher,de.reducer)}R&&T.addDefaultCase(R)})}var p;return{name:r,reducer:function(h,y){return p||(p=u()),p(h,y)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var sc="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",cc=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=sc[Math.random()*64|0];return r},lc=["name","message","stack","code"],co=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Qa=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),dc=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,n=lc;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(r[a]=t[a])}return r}return{message:String(t)}},nu=function(){function t(r,o,n){var a=Ne(r+"/fulfilled",function(h,y,m,S){return{payload:h,meta:io(Re({},S||{}),{arg:m,requestId:y,requestStatus:"fulfilled"})}}),s=Ne(r+"/pending",function(h,y,m){return{payload:void 0,meta:io(Re({},m||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),c=Ne(r+"/rejected",function(h,y,m,S,x){return{payload:S,error:(n&&n.serializeError||dc)(h||"Rejected"),meta:io(Re({},x||{}),{arg:m,requestId:y,rejectedWithValue:!!S,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(y,m,S){var x=n?.idGenerator?n.idGenerator(h):cc(),O=new u,R,N=!1;function T(L){R=L,O.abort()}var k=function(){return Ys(this,null,function(){var L,$,de,Pe,Y,ke,Ye;return $s(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),Pe=(L=n?.condition)==null?void 0:L.call(n,h,{getState:m,extra:S}),pc(Pe)?[4,Pe]:[3,2];case 1:Pe=f.sent(),f.label=2;case 2:if(Pe===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return N=!0,Y=new Promise(function(g,w){return O.signal.addEventListener("abort",function(){return w({name:"AbortError",message:R||"Aborted"})})}),y(s(x,h,($=n?.getPendingMeta)==null?void 0:$.call(n,{requestId:x,arg:h},{getState:m,extra:S}))),[4,Promise.race([Y,Promise.resolve(o(h,{dispatch:y,getState:m,extra:S,requestId:x,signal:O.signal,abort:T,rejectWithValue:function(g,w){return new co(g,w)},fulfillWithValue:function(g,w){return new Qa(g,w)}})).then(function(g){if(g instanceof co)throw g;return g instanceof Qa?a(g.payload,x,h,g.meta):a(g,x,h)})])];case 3:return de=f.sent(),[3,5];case 4:return ke=f.sent(),de=ke instanceof co?c(null,x,h,ke.payload,ke.meta):c(ke,x,h),[3,5];case 5:return Ye=n&&!n.dispatchConditionRejection&&c.match(de)&&de.meta.condition,Ye||y(de),[2,de]}})})}();return Object.assign(k,{abort:T,requestId:x,arg:h,unwrap:function(){return k.then(uc)}})}}return Object.assign(p,{pending:s,rejected:c,fulfilled:a,typePrefix:r})}return t.withTypes=function(){return t},t}();function uc(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function pc(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var ai="listener",ii="completed",si="cancelled",au="task-"+si,iu="task-"+ii,su=ai+"-"+si,cu=ai+"-"+ii;var uo="listenerMiddleware";var lu=Ne(uo+"/add"),du=Ne(uo+"/removeAll"),uu=Ne(uo+"/remove");var ei,pu=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ei||(ei=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},fc=function(t){return function(r){setTimeout(r,t)}},fu=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:fc(10);Ha();var hc=rr(Symbol("withEventBus"),function(t,r){return class extends t{constructor(){super(...arguments),this.eventBus=r??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)}}}),fr=class extends hc(Object){};window.ftReduxStores||(window.ftReduxStores={});var ci=class t extends fr{static get(r){var o;let n=typeof r=="string"?r:r.name,a=typeof r=="string"?void 0:r,s=window.ftReduxStores[n];if(sr(s))return s;if(a==null)return;let c=ni({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=ri({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?c.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:c.reducer(u,p)});return window.ftReduxStores[a.name]=new t(c,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new or;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,c,d)=>{let u=c,p=s[u];return p?(...h)=>{let y=p(...h.map(a));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[u]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(r){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(r).join("_"),overwrites:r})}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(r){throw new Error("Not implemented yet.")}subscribe(r){return this.reduxStore.subscribe(r)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var hr=class{static format(r,o,n,a){return window.moment?window.moment(r).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(r,o,n,a)}static getMomentDateFormat(r,o){return r?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(r,o,n,a){let s=typeof r=="string"?new Date(r):r,c=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!a)return c;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${c} ${d}`}static getTimezoneAsString(){let r=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${r(Math.abs(o)/60)}:${r(Math.abs(o)%60)}`}};var li=C(_()),yr=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Uu=(0,li.applyMixinOnce)(Symbol("withDateFormat"),function(t){class r extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(E)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,s;return((s=(a=this.metadataDescriptors.find(d=>d.key===n))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1)?d=>hr.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return yr([(0,po.property)({type:Boolean})],r.prototype,"useLongDateFormat",void 0),yr([(0,po.property)({type:Boolean})],r.prototype,"useDateTimeFormat",void 0),yr([Fr({store:E.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],r.prototype,"metadataDescriptors",void 0),yr([Fr({store:E.name})],r.prototype,"uiLocale",void 0),r});var br=C(_());var mr=class extends Q{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(r){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${r}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(r){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${r}`),this.CACHE_DURATION)}isAuthenticated(){let r=E.getState().session;return!!r?.sessionAuthenticated}};var gr=class extends Q{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 r=E.getState().session;return!!r?.sessionAuthenticated}};var yc="ft-user-assets",mc={setAssetCount:(t,r)=>{let{userAssetType:o,count:n}=r.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(ie).forEach(r=>{t.assetCounts.allAsset[r]=void 0})},setBookmarkCountByMap:(t,r)=>{let o=r.payload.mapId;t.assetCounts.bookmarkByMap[o]=r.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,r)=>{let{assetType:o,mapId:n,asset:a}=r.payload;ho(t,o,[...fo(t,o),a]),di(t,o,1,n),ui(t,a)},editAsset:(t,r)=>{let{assetType:o,asset:n}=r.payload;ho(t,o,fo(t,o).map(a=>a.id===n.id?n:a)),ui(t,n)},removeAsset:(t,r)=>{let{assetType:o,mapId:n,assetId:a}=r.payload;ho(t,o,fo(t,o).filter(s=>s.id!==a)),di(t,o,-1,n)}},pi={[ie.SEARCHES]:"savedSearches",[ie.BOOKMARKS]:"bookmarks",[ie.BOOKS]:void 0,[ie.COLLECTIONS]:void 0},fo=(t,r)=>{var o;let n=pi[r];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},ho=(t,r,o)=>{let n=pi[r];n&&(t[n]=o)},di=(t,r,o,n)=>{let a=t.assetCounts.allAsset[r];if(a!==void 0&&(t.assetCounts.allAsset[r]=Math.max(0,a+o),r===ie.BOOKMARKS&&n)){let s=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,s+o)}},ui=(t,r)=>{let o=t.assetLabels.map(a=>a.title),n=r.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},te=br.FtReduxStore.get({name:yc,reducers:mc,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ie).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),yo=class{constructor(r=new mr,o=new gr){this.assetCountsService=r,this.assetLabelsService=o,this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Zt,this.savedSearchesService=new Qt,E.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=E.getState();(0,br.deepEqual)((r=this.currentSession)===null||r===void 0?void 0:r.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),te.actions.clearAssetCount(),te.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),te.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),te.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();te.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let r=await this.assetLabelsService.getUserAssetLabels();te.actions.assetLabels(r)}async loadAssetCount(r){let o=await this.assetCountsService.getUserAssetCount(r);o&&te.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(r){let o=await this.assetCountsService.getUserBookmarkCountByMap(r);o&&te.actions.setBookmarkCountByMap({count:o.count,mapId:r})}async reloadAssetCount(r){this.assetCountsService.clearCache();let o=Object.keys(te.getState().assetCounts.bookmarkByMap).length!==0;r===ie.BOOKMARKS&&o&&te.actions.clearBookmarkCountByMap(),te.getState().assetCounts.allAsset[r]!==void 0&&await this.loadAssetCount(r)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var r;if(this.bookmarksAreUsed){let o=!((r=this.currentSession)===null||r===void 0)&&r.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;te.actions.bookmarks(o)}}},gc=new yo;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gc);(0,fi.customElement)("ft-app-context")(D);var mi=C(X());var mo=class{fromLocalizableLabel(r){return r.type=="PLAIN_TEXT"?{message:r.text}:{key:r.key,custom:r.type=="LOCALIZED_CUSTOM",context:r.context,message:r.key}}fromAttribute(r){if(r!=null)try{return JSON.parse(r)}catch{if(this.isI18nKey(r)){let[n,a]=r.split(".");return{context:n,key:a,custom:!0,message:""}}return{message:r}}}toAttribute(r){if(r!=null)return JSON.stringify(r)}isI18nKey(r){return r.match(/^[\w-]+\.[\w-]+$/)}},hi=new mo;var bc=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},xc=Symbol("i18nAttributes"),vc=Symbol("i18nListAttributes"),gi=Symbol("i18nProperties"),xr=Symbol("i18nContexts"),Pt=Symbol("i18nUnsubs"),Sr=(0,st.applyMixinOnce)(Symbol("withI18n"),function(t){var r,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[r]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Yt:Je}i18n(s){let{context:c,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(c&&d){this.hasI18nContext(c)||this.addI18nContext(c,void 0,p);let m=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(c,d,...m)}return u}async awaitI18n(s){let{context:c,custom:d}=s;return c&&await this.getI18nService(d).prepareContext(c),this.i18n(s)}customI18n(s,c){if(hi.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...c})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((c,d,u)=>s.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((c,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(c=>c.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var c,d;let u=this,p=(h,y,m)=>m?.context&&m.key&&s(h,y,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(c=this[xc])===null||c===void 0||c.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[vc])===null||d===void 0||d.forEach((h,y)=>{var m;return u[y]=(m=u[y])===null||m===void 0?void 0:m.map(S=>p(h,y,S))})}updateI18nProperties(s){var c;(c=this[gi])===null||c===void 0||c.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,c,d)}addI18nContext(s,c,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[xr].set(u,{isCustomContext:d}),this[Pt].has(u)||this[Pt].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,c)}hasI18nContext(s){return this[xr].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[xr].forEach((s,c)=>this.addI18nContext(c,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Pt].forEach(s=>s()),this[Pt].clear()}}return r=xr,o=Pt,bc([(0,mi.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),yi=class extends Sr(st.FtLitElement){},vr=class extends Sr(st.FtLitElementRedux){};var kt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(c=t[d])&&(s=(a<3?c(s):a>3?c(r,o,s):c(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},he=class extends vr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Or.nothing:Or.html`
|
|
234
234
|
<span class="ft-i18n">
|
|
235
235
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
236
236
|
</span>
|
|
@@ -313,7 +313,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
313
313
|
`;var ul=k`
|
|
314
314
|
`;var Hp="ft-app-info",Et=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Et.eventName="authentication-change";var $p={session:(t,e)=>{se(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>_.dispatchEvent(new Et(e.payload)),0))}},_=xt.get({name:Hp,reducers:$p,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 Ct=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=_.getState(),a=e??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let a=_.subscribe(()=>{n=t.get(e),n&&(a(),o(n))})}})}};var Xo=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ct.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ct.await()}};var de=class extends Xo{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Te,this.cache=e?a.commonCache:new Te}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 Jo=class extends de{async listMyBookmarks(){let e=_.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var gi=class{addCommand(e,o=!1){_.commands.add(e,o)}consumeCommand(e){return _.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new gi;var pl,Jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Wp=Symbol("clearAfterUnitTest"),Qo=class extends no(de){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[pl]=()=>{this.defaultMessages={},this.cache=new Te,this.listeners={}},this.currentUiLocale=_.getState().uiLocale,_.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=_.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 a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};se(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,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 a;let i=e.toLowerCase(),s=this.resolveContext(i);return new kr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},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(a){!(a instanceof lt)&&o&&console.error(a)}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 a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Jt({loadedContexts:e})),this.dispatchEvent(new Jt({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new Jt({loadedContexts:[e]})),this.dispatchEvent(new Jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>oo(0).then(()=>n()).catch(()=>null)))}};pl=Wp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Qo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Qo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Qt=window.FluidTopicsI18nService,en=window.FluidTopicsCustomI18nService;var bi=class{highlightHtml(e,o,n){Sa(e,o,n)}};window.FluidTopicsHighlightHtmlService=new bi;var tn=class extends de{async listMySearches(){let{session:e}=_.getState();return Vc(e,J.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var xi=class{isDate(e){var o,n,a,i;return(i=(a=((n=(o=_.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,o){var n,a,i;return vt.format(e,(n=o?.locale)!==null&&n!==void 0?n:_.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new xi;var $r=class{static get(e,o){var n,a;let i=_.getState(),{lang:s,region:l}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Yt(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,o??`${s}-${l}`)}};var vi=class{urlToSearchRequest(e){return $r.get().parse(e)}searchRequestToUrl(e){return $r.get().serialize(e)}};window.FluidTopicsUrlService=new vi;var At=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};At.eventName="change";var Si=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))}},fl=new Si;var rn=class t extends Ue{static build(){return new t(window.history,fl,()=>window.location,!1)}constructor(e,o,n,a){var i,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}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),se(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new At(this.currentItem())),0)}installProxies(){let e=o=>(n,a,[i,s,l])=>{let d=o(),p={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[p,s,l]),this.setCurrentState(p,!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(At.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(At.eventName,e)}currentItem(){return Er(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 Er(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 Er(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 a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}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 a=o??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=rn.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 hl=_;function ml(t,e){var o;return hl.getState().authenticationRequired&&!(!((o=hl.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var Q=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},K=class extends j{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=()=>Ct.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Te,this.cleanSessionDebouncer=new Ne,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return q`
|
|
315
315
|
<slot></slot>
|
|
316
|
-
`}connectedCallback(){super.connectedCallback(),_.addEventListener(Et.eventName,this.reloadConfiguration)}disconnectedCallback(){_.addEventListener(Et.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(_.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&_.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&_.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&_.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&_.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&_.actions.noCustom(this.noCustom),e.has("editorMode")&&_.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&_.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&_.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Qt.addContext(p)),e.has("openExternalDocumentInNewTab")&&_.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&_.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&_.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(_.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),_.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),_.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&_.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&_.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",()=>ml(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};K.elementDefinitions={};K.styles=ul;Q([R()],K.prototype,"baseUrl",void 0);Q([R()],K.prototype,"apiIntegrationIdentifier",void 0);Q([R()],K.prototype,"apiIntegrationAppVersion",void 0);Q([R()],K.prototype,"uiLocale",void 0);Q([_e(null)],K.prototype,"availableUiLocales",void 0);Q([_e(null)],K.prototype,"metadataConfiguration",void 0);Q([R({type:Boolean})],K.prototype,"editorMode",void 0);Q([R({type:Boolean})],K.prototype,"noCustom",void 0);Q([R({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);Q([R({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],K.prototype,"noCustomComponent",void 0);Q([R({type:Boolean})],K.prototype,"withManualResources",void 0);Q([R({type:Boolean})],K.prototype,"navigatorOnline",void 0);Q([R({type:Boolean})],K.prototype,"forcedOffline",void 0);Q([R({type:Object})],K.prototype,"apiProvider",void 0);Q([R({type:Boolean})],K.prototype,"authenticationRequired",void 0);Q([_e([])],K.prototype,"messageContexts",void 0);Q([_e(void 0)],K.prototype,"session",void 0);Q([G()],K.prototype,"localesConfiguration",void 0);Q([G()],K.prototype,"availableContentLocales",void 0);var on=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},YS=Y(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(_)}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(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>vt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return on([R({type:Boolean})],e.prototype,"useLongDateFormat",void 0),on([R({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),on([qe({store:_.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),on([qe({store:_.name})],e.prototype,"uiLocale",void 0),e});var nn=class extends de{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=_.getState().session;return!!e?.sessionAuthenticated}};var an=class extends de{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=_.getState().session;return!!e?.sessionAuthenticated}};var zp="ft-user-assets",Gp={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(me).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:a}=e.payload;Ei(t,o,[...Oi(t,o),a]),yl(t,o,1,n),gl(t,a)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Ei(t,o,Oi(t,o).map(a=>a.id===n.id?n:a)),gl(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:a}=e.payload;Ei(t,o,Oi(t,o).filter(i=>i.id!==a)),yl(t,o,-1,n)}},bl={[me.SEARCHES]:"savedSearches",[me.BOOKMARKS]:"bookmarks",[me.BOOKS]:void 0,[me.COLLECTIONS]:void 0},Oi=(t,e)=>{var o;let n=bl[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Ei=(t,e,o)=>{let n=bl[e];n&&(t[n]=o)},yl=(t,e,o,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+o),e===me.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},gl=(t,e)=>{let o=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},ue=xt.get({name:zp,reducers:Gp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(me).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ci=class{constructor(e=new nn,o=new an){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=_.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Jo,this.savedSearchesService=new tn,_.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=_.getState();se((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(),ue.actions.clearAssetCount(),ue.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ue.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ue.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ue.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ue.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ue.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ue.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ue.getState().assetCounts.bookmarkByMap).length!==0;e===me.BOOKMARKS&&o&&ue.actions.clearBookmarkCountByMap(),ue.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;ue.actions.bookmarks(o)}}},jp=new Ci;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=jp);ne("ft-app-context")(K);var Ai=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,a]=e.split(".");return{context:n,key:a,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},xl=new Ai;var Kp=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Vp=Symbol("i18nAttributes"),Zp=Symbol("i18nListAttributes"),Sl=Symbol("i18nProperties"),sn=Symbol("i18nContexts"),Wr=Symbol("i18nUnsubs"),ln=Y(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(i){return i??this.useCustomMessageContexts?en:Qt}i18n(i){let{context:s,key:l,message:d}=i,{custom:p,args:h,argsProvider:f}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let m=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,l,...m)}return d}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(xl.isI18nKey(i)){let[l,d]=i.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,d)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let d=this,p=(h,f,m)=>m?.context&&m.key&&i(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Vp])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(l=this[Zp])===null||l===void 0||l.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(b=>p(h,f,b))})}updateI18nProperties(i){var s;(s=this[Sl])===null||s===void 0||s.forEach((l,d)=>{i(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let d=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[sn].set(d,{isCustomContext:l}),this[Wr].has(d)||this[Wr].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(i){return this[sn].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[sn].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Wr].forEach(i=>i()),this[Wr].clear()}}return e=sn,o=Wr,Kp([R({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),vl=class extends ln(j){},cn=class extends ln(yt){};var zr=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Ae=class extends cn{constructor(){super(),this.editorMode=!1,this.addStore(_)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":F:q`
|
|
316
|
+
`}connectedCallback(){super.connectedCallback(),_.addEventListener(Et.eventName,this.reloadConfiguration)}disconnectedCallback(){_.addEventListener(Et.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(_.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&_.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&_.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&_.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&_.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&_.actions.noCustom(this.noCustom),e.has("editorMode")&&_.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&_.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&_.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Qt.addContext(p)),e.has("openExternalDocumentInNewTab")&&_.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&_.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&_.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(_.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),_.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),_.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&_.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&_.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",()=>ml(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};K.elementDefinitions={};K.styles=ul;Q([R()],K.prototype,"baseUrl",void 0);Q([R()],K.prototype,"apiIntegrationIdentifier",void 0);Q([R()],K.prototype,"apiIntegrationAppVersion",void 0);Q([R()],K.prototype,"uiLocale",void 0);Q([_e(null)],K.prototype,"availableUiLocales",void 0);Q([_e(null)],K.prototype,"metadataConfiguration",void 0);Q([R({type:Boolean})],K.prototype,"editorMode",void 0);Q([R({type:Boolean})],K.prototype,"noCustom",void 0);Q([R({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);Q([R({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],K.prototype,"noCustomComponent",void 0);Q([R({type:Boolean})],K.prototype,"withManualResources",void 0);Q([R({type:Boolean})],K.prototype,"navigatorOnline",void 0);Q([R({type:Boolean})],K.prototype,"forcedOffline",void 0);Q([R({type:Object})],K.prototype,"apiProvider",void 0);Q([R({type:Boolean})],K.prototype,"authenticationRequired",void 0);Q([_e([])],K.prototype,"messageContexts",void 0);Q([_e(void 0)],K.prototype,"session",void 0);Q([G()],K.prototype,"localesConfiguration",void 0);Q([G()],K.prototype,"availableContentLocales",void 0);var on=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},YS=Y(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(_)}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(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>vt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return on([R({type:Boolean})],e.prototype,"useLongDateFormat",void 0),on([R({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),on([qe({store:_.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),on([qe({store:_.name})],e.prototype,"uiLocale",void 0),e});var nn=class extends de{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=_.getState().session;return!!e?.sessionAuthenticated}};var an=class extends de{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=_.getState().session;return!!e?.sessionAuthenticated}};var zp="ft-user-assets",Gp={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(me).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:a}=e.payload;Ei(t,o,[...Oi(t,o),a]),yl(t,o,1,n),gl(t,a)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Ei(t,o,Oi(t,o).map(a=>a.id===n.id?n:a)),gl(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:a}=e.payload;Ei(t,o,Oi(t,o).filter(i=>i.id!==a)),yl(t,o,-1,n)}},bl={[me.SEARCHES]:"savedSearches",[me.BOOKMARKS]:"bookmarks",[me.BOOKS]:void 0,[me.COLLECTIONS]:void 0},Oi=(t,e)=>{var o;let n=bl[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Ei=(t,e,o)=>{let n=bl[e];n&&(t[n]=o)},yl=(t,e,o,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+o),e===me.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},gl=(t,e)=>{let o=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},ue=xt.get({name:zp,reducers:Gp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(me).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ci=class{constructor(e=new nn,o=new an){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=_.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Jo,this.savedSearchesService=new tn,_.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=_.getState();se((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(),ue.actions.clearAssetCount(),ue.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ue.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ue.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ue.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ue.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ue.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ue.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ue.getState().assetCounts.bookmarkByMap).length!==0;e===me.BOOKMARKS&&o&&ue.actions.clearBookmarkCountByMap(),ue.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;ue.actions.bookmarks(o)}}},jp=new Ci;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=jp);ne("ft-app-context")(K);var Ai=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,a]=e.split(".");return{context:n,key:a,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},xl=new Ai;var Kp=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Vp=Symbol("i18nAttributes"),Zp=Symbol("i18nListAttributes"),Sl=Symbol("i18nProperties"),sn=Symbol("i18nContexts"),Wr=Symbol("i18nUnsubs"),ln=Y(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(i){return i??this.useCustomMessageContexts?en:Qt}i18n(i){let{context:s,key:l,message:d}=i,{custom:p,args:h,argsProvider:f}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let m=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,l,...m)}return d}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(xl.isI18nKey(i)){let[l,d]=i.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,d)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let d=this,p=(h,f,m)=>m?.context&&m.key&&i(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Vp])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(l=this[Zp])===null||l===void 0||l.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(b=>p(h,f,b))})}updateI18nProperties(i){var s;(s=this[Sl])===null||s===void 0||s.forEach((l,d)=>{i(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let d=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[sn].set(d,{isCustomContext:l}),this[Wr].has(d)||this[Wr].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(i){return this[sn].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[sn].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Wr].forEach(i=>i()),this[Wr].clear()}}return e=sn,o=Wr,Kp([R({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),vl=class extends ln(j){},cn=class extends ln(yt){};var zr=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Ae=class extends cn{constructor(){super(),this.editorMode=!1,this.addStore(_)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":F:q`
|
|
317
317
|
<span class="ft-i18n">
|
|
318
318
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
319
319
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-attachments",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.47",
|
|
4
4
|
"description": "Reader component to list map attachments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-app-context": "1.3.
|
|
23
|
-
"@fluid-topics/ft-i18n": "1.3.
|
|
24
|
-
"@fluid-topics/ft-icon": "1.3.
|
|
25
|
-
"@fluid-topics/ft-reader-context": "1.3.
|
|
26
|
-
"@fluid-topics/ft-ripple": "1.3.
|
|
27
|
-
"@fluid-topics/ft-typography": "1.3.
|
|
28
|
-
"@fluid-topics/ft-wc-utils": "1.3.
|
|
22
|
+
"@fluid-topics/ft-app-context": "1.3.47",
|
|
23
|
+
"@fluid-topics/ft-i18n": "1.3.47",
|
|
24
|
+
"@fluid-topics/ft-icon": "1.3.47",
|
|
25
|
+
"@fluid-topics/ft-reader-context": "1.3.47",
|
|
26
|
+
"@fluid-topics/ft-ripple": "1.3.47",
|
|
27
|
+
"@fluid-topics/ft-typography": "1.3.47",
|
|
28
|
+
"@fluid-topics/ft-wc-utils": "1.3.47",
|
|
29
29
|
"@fluid-topics/public-api": "1.0.110",
|
|
30
30
|
"lit": "3.1.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "16ac56d62f3a88a3b03cbc92bcd04dd91951a015"
|
|
33
33
|
}
|