@fluid-topics/ft-search-sort-selector 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.
@@ -717,23 +717,23 @@ Also for action icons.`,i.colorGray200),contentGlobalSubtle:e.extend("--ftds-con
717
717
  <slot @slotchange=${this.updateOptionsFromSlot}
718
718
  @option-change=${this.updateOptionsFromSlot}
719
719
  ></slot>
720
- `}renderOption(r,o){var n;let a=this.selectedOption===r;return it.html`
721
- <div class="${(0,Go.classMap)({"ft-select--option":!0,"ft-select--option-selected":a,"ft-typography--body2":!0})}"
722
- part="option option-${(n=r.value)===null||n===void 0?void 0:n.replace(/[^\w-]/g,"")}"
720
+ `}renderOption(r,o){var n,a;let s=this.selectedOption===r;return it.html`
721
+ <div class="${(0,Go.classMap)({"ft-select--option":!0,"ft-select--option-selected":s,"ft-typography--body2":!0})}"
722
+ part="option option-${(a=(n=r.value)===null||n===void 0?void 0:n.toString())===null||a===void 0?void 0:a.replace(/[^\w-]/g,"")}"
723
723
  tabindex="0"
724
724
  aria-label="${r.label}"
725
725
  data-value="${r.value}"
726
726
  id="${"option-"+o}"
727
- @keydown=${l=>this.onOptionKeyDown(l,r)}
727
+ @keydown=${d=>this.onOptionKeyDown(d,r)}
728
728
  @click=${()=>this.selectOption(r)}>
729
- <ft-ripple ?primary=${a} ?activated=${a}></ft-ripple>
729
+ <ft-ripple ?primary=${s} ?activated=${s}></ft-ripple>
730
730
  <span>${r.label}</span>
731
731
  </div>
732
732
  `}willUpdate(r){super.willUpdate(r),r.has("options")&&(this.selectedOption=this.options.filter(o=>o.selected)[0]),r.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(r){var o,n;if(super.contentAvailableCallback(r),r.has("focusOptions")&&this.focusOptions&&((n=(o=this.selectedOptionElement)!==null&&o!==void 0?o:this.firstOption)===null||n===void 0||n.focus(),this.focusOptions=!1),r.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px";let a=["bottom","top"];(0,He.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",a,"fixed",P.optionsHeight,0).then(({x:s,y:l})=>{this.optionsMenu.style.left=`${s}px`,this.optionsMenu.style.top=`${l}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(r){var o;r.stopPropagation();let n=(o=this.optionsSlot)===null||o===void 0?void 0:o.assignedElements().map(a=>a);n&&n.length>0&&(this.options=n)}onMainPanelKeyDown(r){switch(r.key){case" ":r.preventDefault(),r.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":r.preventDefault(),r.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(r){var o,n,a,s,l;let d;switch(r.key){case"Escape":this.optionsDisplayed=!1,(o=this.mainPanel)===null||o===void 0||o.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),d=(a=(n=this.focusedOption)===null||n===void 0?void 0:n.previousElementSibling)!==null&&a!==void 0?a:this.lastOption;break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),d=(l=(s=this.focusedOption)===null||s===void 0?void 0:s.nextElementSibling)!==null&&l!==void 0?l:this.firstOption;break;default:if(r.key.length!=1)break;this.isKeyAlphanumeric(r.key)&&(d=this.handleAlphanumericPress(r.key));break}d?.focus()}isKeyAlphanumeric(r){let o=r.charCodeAt(0);return o>47&&o<58||o>64&&o<91||o>96&&o<123}handleAlphanumericPress(r){var o,n;let a=new Date;a.getTime()-this.lastSearchInputDate.getTime()>t.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=r.toLowerCase();let s=this.options.find(d=>{var p;return((p=d.label)===null||p===void 0?void 0:p.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});if(s===void 0){this.lastSearchInputDate=a;return}let l=(n=(o=this.optionsMenu)===null||o===void 0?void 0:o.querySelector(`[data-value="${s.value}"]`))!==null&&n!==void 0?n:void 0;return this.lastSearchInputDate=a,l}onOptionKeyDown(r,o){var n;(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),this.selectOption(o),this.optionsDisplayed=!1,(n=this.mainPanel)===null||n===void 0||n.focus())}getOptionId(r){if(!r)return;let o=this.options.findIndex(n=>(0,He.deepEqual)(n.value,r.value));if(o!==-1)return`option-${o}`}selectOption(r){var o,n;if(!(0,He.deepEqual)((o=this.selectedOption)===null||o===void 0?void 0:o.value,r.value)){this.selectedOption=r;for(let a of this.options)a.selected=a===r;this.dispatchEvent(new CustomEvent("change",{detail:(n=this.selectedOption)===null||n===void 0?void 0:n.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};D.elementDefinitions={"ft-input-label":me,"ft-typography":_e,"ft-ripple":j,"ft-icon":ce};D.searchTimeoutMilliseconds=2e3;D.styles=[fr,Ue,Xa];W([(0,B.property)({type:String})],D.prototype,"label",void 0);W([(0,B.property)({type:String})],D.prototype,"ariaLabel",void 0);W([(0,B.property)({type:String})],D.prototype,"helper",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"outlined",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"disabled",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"error",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"fixedMenuPosition",void 0);W([(0,B.property)({type:Array})],D.prototype,"options",void 0);W([(0,B.state)()],D.prototype,"selectedOption",void 0);W([(0,B.state)()],D.prototype,"optionsDisplayed",void 0);W([(0,B.state)()],D.prototype,"focusOptions",void 0);W([(0,B.state)()],D.prototype,"currentSearch",void 0);W([(0,B.state)()],D.prototype,"lastSearchInputDate",void 0);W([(0,B.query)(".ft-select")],D.prototype,"container",void 0);W([(0,B.query)(".ft-select--options")],D.prototype,"optionsMenu",void 0);W([(0,B.query)(".ft-select--input-panel")],D.prototype,"mainPanel",void 0);W([(0,B.query)(".ft-select--option:first-child")],D.prototype,"firstOption",void 0);W([(0,B.query)(".ft-select--option:focus")],D.prototype,"focusedOption",void 0);W([(0,B.query)(".ft-select--option.ft-select--option-selected")],D.prototype,"selectedOptionElement",void 0);W([(0,B.query)(".ft-select--option:last-child")],D.prototype,"lastOption",void 0);W([(0,B.query)("slot:not([name])")],D.prototype,"optionsSlot",void 0);(0,jo.customElement)("ft-select")(D);(0,jo.customElement)("ft-select-option")(Ae);var Xs=b(to());var Ws=b(N());var Kr=b(K()),Vr=b(te()),Zr=b(N());var Ja=b(K());var ei=Ja.css`
733
733
  `;var Ht=b(N());var Us=b(N());var zi=b(K()),oe=b(te()),Se=b(N());var ti=b(K());var ri=ti.css`
734
734
  `;var gr=b(N()),ul="ft-app-info",st=class t extends CustomEvent{constructor(r){super(t.eventName,{detail:r})}};st.eventName="authentication-change";var fl={session:(t,r)=>{(0,gr.deepEqual)(t.session,r.payload)||(t.session=r.payload,setTimeout(()=>E.dispatchEvent(new st(r.payload)),0))}},E=gr.FtReduxStore.get({name:ul,reducers:fl,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 Ko=b(N());var lt=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 mr=class{constructor(r){this.overrideApi=r}get api(){var r;return(r=this.overrideApi)!==null&&r!==void 0?r:lt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):lt.await()}};var le=class extends mr{constructor(r=!0,o){var n;super(o),this.sortObjectFields=(s,l)=>typeof l!="object"||l==null||Array.isArray(l)?l:Object.fromEntries(Object.entries(l).sort(([d],[p])=>d.localeCompare(p)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Ko.CacheRegistry,this.cache=r?a.commonCache:new Ko.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 br=class extends le{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 Vo=class{addCommand(r,o=!1){E.commands.add(r,o)}consumeCommand(r){return E.commands.consume(r)}};window.FluidTopicsAppInfoStoreService=new Vo;var fe=b(N());var oi,It=class extends CustomEvent{constructor(r){super("ft-i18n-context-loaded",{detail:r})}},hl=Symbol("clearAfterUnitTest"),xr=class extends(0,fe.withEventBus)(le){constructor(r){super(),this.messageContextProvider=r,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[oi]=()=>{this.defaultMessages={},this.cache=new fe.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,fe.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(),l=this.resolveContext(s);return new fe.ParametrizedLabelResolver((a=this.defaultMessages[s])!==null&&a!==void 0?a:{},l).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 fe.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 It({loadedContexts:r})),this.dispatchEvent(new It({loadedContexts:r})),await Promise.all(r.map(o=>this.notify(o,!1)))}async notify(r,o=!0){o&&(document.body.dispatchEvent(new It({loadedContexts:[r]})),this.dispatchEvent(new It({loadedContexts:[r]}))),this.listeners[r]!=null&&await Promise.all([...this.listeners[r].values()].map(n=>(0,fe.delay)(0).then(()=>n()).catch(()=>null)))}};oi=hl;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends xr{constructor(){super(async(t,r)=>(await this.awaitApi).getFluidTopicsMessageContext(t,r))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends xr{constructor(){super(async(t,r)=>(await this.awaitApi).getCustomMessageContext(t,r))}});var _t=window.FluidTopicsI18nService,vr=window.FluidTopicsCustomI18nService;var ni=b(N()),Zo=class{highlightHtml(r,o,n){(0,ni.highlightHtml)(r,o,n)}};window.FluidTopicsHighlightHtmlService=new Zo;var gl=b(ii(),1);var si;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(si||(si={}));var li;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(li||(li={}));var ci;(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"})(ci||(ci={}));var di;(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"})(di||(di={}));var pi;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(pi||(pi={}));var ui;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(ui||(ui={}));var fi;(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"})(fi||(fi={}));var hi;(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"})(hi||(hi={}));var yi;(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"})(yi||(yi={}));var gi;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(gi||(gi={}));var mi;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(mi||(mi={}));var bi;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(bi||(bi={}));var xi;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(xi||(xi={}));var vi;(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"})(vi||(vi={}));var qo;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(qo||(qo={}));var Si;(function(t){t.ASC="ASC",t.DESC="DESC"})(Si||(Si={}));var Oi;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Oi||(Oi={}));var Yo;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Yo||(Yo={}));var Ci;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Ci||(Ci={}));var Ei;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Ei||(Ei={}));var Ai;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Ai||(Ai={}));var wi;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(wi||(wi={}));var Ri;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(Ri||(Ri={}));var Xo;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Xo||(Xo={}));var Ni;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ni||(Ni={}));var Y;(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"})(Y||(Y={}));var he;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(he||(he={}));var Ti;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Ti||(Ti={}));var Ii;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Ii||(Ii={}));var _i;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(_i||(_i={}));var Li;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Li||(Li={}));var Pi;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Pi||(Pi={}));var yl={[Y.PERSONAL_BOOK_SHARE_USER]:[Y.PERSONAL_BOOK_USER],[Y.HTML_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.PDF_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.KHUB_ADMIN]:[Y.CONTENT_PUBLISHER],[Y.ADMIN]:[Y.KHUB_ADMIN,Y.USERS_ADMIN,Y.PORTAL_ADMIN],[Y.GENERATIVE_AI_EXPORT_USER]:[Y.GENERATIVE_AI_USER]};function ki(t,r){return t===r||(yl[t]??[]).some(o=>ki(o,r))}function Di(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=>ki(n,r))}var Cr=class extends le{async listMySearches(){let{session:r}=E.getState();return Di(r,Y.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(r.profile.userId),5*60*1e3):[]}};var Mi=b(N());var Qo=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 Mi.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 Qo;var Ui=b(N());var qt=class{static get(r,o){var n,a;let s=E.getState(),{lang:l,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 Ui.SearchPlaceConverter(s.baseUrl,r??20,s.searchInAllLanguagesAllowed,o??`${l}-${d}`)}};var Jo=class{urlToSearchRequest(r){return qt.get().parse(r)}searchRequestToUrl(r){return qt.get().serialize(r)}};window.FluidTopicsUrlService=new Jo;var We=b(N());var ct=class t extends CustomEvent{constructor(r){super(t.eventName,{detail:{currentItem:r}})}};ct.eventName="change";var en=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))}},Bi=new en;var Er=class t extends We.WithEventBus{static build(){return new t(window.history,Bi,()=>window.location,!1)}constructor(r,o,n,a){var s,l;super(),this.history=r,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=r.pushState,this.realReplaceState=r.replaceState,this.initialIndex=(l=(s=r.state)===null||s===void 0?void 0:s.index)!==null&&l!==void 0?l: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,We.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ct(this.currentItem())),0)}installProxies(){let r=o=>(n,a,[s,l,d])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...s,index:p,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[u,l,d]),this.setCurrentState(u,!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(ct.eventName,r)}removeHistoryChangeListener(r){this.removeEventListener(ct.eventName,r)}currentItem(){return(0,We.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,We.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,We.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 Fi=E;function Hi(t,r){var o;return Fi.getState().authenticationRequired&&!(!((o=Fi.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(r):t()}var X=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},z=class extends Se.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=()=>lt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Se.CacheRegistry,this.cleanSessionDebouncer=new Se.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return zi.html`
735
735
  <slot></slot>
736
- `}connectedCallback(){super.connectedCallback(),E.addEventListener(st.eventName,this.reloadConfiguration)}disconnectedCallback(){E.addEventListener(st.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(r){var o,n,a,s,l,d,p;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(u=>_t.addContext(u)),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((l=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),r.has("authenticationRequired")&&E.actions.authenticationRequired(this.authenticationRequired),r.has("availableContentLocales")&&E.actions.availableContentLocales((p=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&p!==void 0?p:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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",()=>Hi(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=ri;X([(0,oe.property)()],z.prototype,"baseUrl",void 0);X([(0,oe.property)()],z.prototype,"apiIntegrationIdentifier",void 0);X([(0,oe.property)()],z.prototype,"apiIntegrationAppVersion",void 0);X([(0,oe.property)()],z.prototype,"uiLocale",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"availableUiLocales",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"metadataConfiguration",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"editorMode",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"noCustom",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);X([(0,oe.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"withManualResources",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"navigatorOnline",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"forcedOffline",void 0);X([(0,oe.property)({type:Object})],z.prototype,"apiProvider",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"authenticationRequired",void 0);X([(0,Se.jsonProperty)([])],z.prototype,"messageContexts",void 0);X([(0,Se.jsonProperty)(void 0)],z.prototype,"session",void 0);X([(0,oe.state)()],z.prototype,"localesConfiguration",void 0);X([(0,oe.state)()],z.prototype,"availableContentLocales",void 0);var wn=b(te());function ml(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(!Ar(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(!Ar(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=l=>Object.keys(l).filter(d=>l[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 l=a[n];if(!Ar(t[l],r[l]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function Ar(t,r){try{return ml(t,r)}catch{return!1}}function Yt(t,r){return!Ar(t,r)}function wr(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 Wi=b(te(),1);var tn=t=>{let r=t??{};return(o,n)=>{var a;let s={hasChanged:Yt,attribute:!1,...r};(0,Wi.property)(s)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=r.selector)!==null&&a!==void 0?a:d=>d[n],store:r.store})}};var Rr=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 dt=b(te(),1);var $i=b(te(),1);function Gi(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,$i.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:Yt,...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 l of n)try{await l()}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 Ki=b(K(),1);var Tr=globalThis,bl=Tr.ShadowRoot&&(Tr.ShadyCSS===void 0||Tr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,km=Symbol();var ji=(t,r)=>{if(bl)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=Tr.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var Ir=class extends Ki.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 ji(n,r.elementStyles),n}};function Vi(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 kt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Xi,Zi=Symbol("constructorPrototype"),qi=Symbol("constructorName"),Qi=Symbol("exportpartsDebouncer"),Yi=Symbol("dynamicDependenciesLoaded"),Pt=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Pt.eventName="exportparts-updated";var we=class extends Ir{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Xi]=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[Qi].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[qi]=this.constructor.name,this[Zi]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[qi]&&Object.setPrototypeOf(this,this[Zi])}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[Yi]||(o[Yi]=!0,this.importDynamicDependencies()),(r=this.shadowRoot)===null||r===void 0||r.addEventListener(Pt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.shadowRoot)===null||r===void 0||r.removeEventListener(Pt.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 Pt)})}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=Vi(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,l,d;let p=g=>g!=null&&g.trim().length>0,u=r.filter(p).map(g=>g.trim());if(u.length===0){this.exportparts=void 0;return}let h=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let O=(s=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],x=(d=(l=g.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(I=>I.split(":")[1]))!==null&&d!==void 0?d:[],C=[...O,...x].filter(p).map(I=>I.trim());for(let I of C)h.add(I)}if(h.size===0){this.exportparts=void 0;return}let y=[...h.values()].flatMap(g=>u.map(O=>`${g}:${O}--${g}`));this.exportparts=[...this.part,...y].join(", ")}};Xi=Qi;kt([(0,dt.property)()],we.prototype,"exportpartsPrefix",void 0);kt([Gi([])],we.prototype,"exportpartsPrefixes",void 0);kt([(0,dt.property)({reflect:!0})],we.prototype,"exportparts",void 0);kt([(0,dt.property)()],we.prototype,"customStylesheet",void 0);kt([(0,dt.property)()],we.prototype,"elementToFocus",void 0);kt([(0,dt.state)()],we.prototype,"useAdoptedStyleSheets",void 0);function _r(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Xt=Symbol("internalReduxEventsUnsubscribers"),$e=Symbol("internalStoresUnsubscribers"),pt=Symbol("internalStores"),xl=wr(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(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(d=>l.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[pt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[pt].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[pt].get(l)}addStore(l,d){var p;d=(p=d??l.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(d),this[pt].set(d,l),this.subscribeToStore(d,l),this.updateFromStores()}removeStore(l){let d=typeof l=="string"?l:l.name;this.unsubscribeFromStore(d),this[pt].delete(d)}setupStores(){this.unsubscribeFromStores(),this[pt].forEach((l,d)=>this.subscribeToStore(d,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,d)=>{let p=this.constructor.getPropertyOptions(d);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:d)){let u=this.getStore(l.store);u&&(l.store?this[$e].has(l.store):this[$e].size>0)&&(this[d]=l.selector(u.getState(),this))}})}subscribeToStore(l,d){var p;this[$e].set(l,d.subscribe(()=>this.updateFromStores())),this[Xt].set(l,[]),_r(d)&&d.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,h)=>{if(typeof this[h]=="function"&&(!u.store||d.name===u.store)){let y=g=>this[h](g);d.addEventListener(u.eventName,y),this[Xt].get(l).push(()=>d.removeEventListener(u.eventName,y))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[$e].forEach((l,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(l){var d;this[$e].has(l)&&this[$e].get(l)(),this[$e].delete(l),(d=this[Xt].get(l))===null||d===void 0||d.forEach(p=>p()),this[Xt].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return r=$e,o=pt,n=Xt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ji=class extends xl(we){};function ye(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(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Pe(t){return!!t&&!!t[$]}function Oe(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)===Rl}(t)||Array.isArray(t)||!!t[is]||!!(!((r=t.constructor)===null||r===void 0)&&r[is])||pn(t)||un(t))}function ut(t,r,o){o===void 0&&(o=!1),Ut(t)===0?(o?Object.keys:Mt)(t).forEach(function(n){o&&typeof n=="symbol"||r(n,t[n],t)}):t.forEach(function(n,a){return r(a,n,t)})}function Ut(t){var r=t[$];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:pn(t)?2:un(t)?3:0}function Dt(t,r){return Ut(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function vl(t,r){return Ut(t)===2?t.get(r):t[r]}function ss(t,r,o){var n=Ut(t);n===2?t.set(r,o):n===3?t.add(o):t[r]=o}function ls(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function pn(t){return Al&&t instanceof Map}function un(t){return wl&&t instanceof Set}function Ge(t){return t.o||t.t}function fn(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=ps(t);delete r[$];for(var o=Mt(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 hn(t,r){return r===void 0&&(r=!1),yn(t)||Pe(t)||!Oe(t)||(Ut(t)>1&&(t.set=t.add=t.clear=t.delete=Sl),Object.freeze(t),r&&ut(t,function(o,n){return hn(n,!0)},!0)),t}function Sl(){ye(2)}function yn(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Re(t){var r=dn[t];return r||ye(18,t),r}function Ol(t,r){dn[t]||(dn[t]=r)}function sn(){return Jt}function rn(t,r){r&&(Re("Patches"),t.u=[],t.s=[],t.v=r)}function Lr(t){ln(t),t.p.forEach(Cl),t.p=null}function ln(t){t===Jt&&(Jt=t.l)}function es(t){return Jt={p:[],l:Jt,h:t,m:!0,_:0}}function Cl(t){var r=t[$];r.i===0||r.i===1?r.j():r.g=!0}function on(t,r){r._=r.p.length;var o=r.p[0],n=t!==void 0&&t!==o;return r.h.O||Re("ES5").S(r,t,n),n?(o[$].P&&(Lr(r),ye(4)),Oe(t)&&(t=Pr(r,t),r.l||kr(r,t)),r.u&&Re("Patches").M(o[$].t,t,r.u,r.s)):t=Pr(r,o,[]),Lr(r),r.u&&r.v(r.u,r.s),t!==ds?t:void 0}function Pr(t,r,o){if(yn(r))return r;var n=r[$];if(!n)return ut(r,function(d,p){return ts(t,n,r,d,p,o)},!0),r;if(n.A!==t)return r;if(!n.P)return kr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=fn(n.k):n.o,s=a,l=!1;n.i===3&&(s=new Set(a),a.clear(),l=!0),ut(s,function(d,p){return ts(t,n,a,d,p,o,l)}),kr(t,a,!1),o&&t.u&&Re("Patches").N(n,o,t.u,t.s)}return n.o}function ts(t,r,o,n,a,s,l){if(Pe(a)){var d=Pr(t,a,s&&r&&r.i!==3&&!Dt(r.R,n)?s.concat(n):void 0);if(ss(o,n,d),!Pe(d))return;t.m=!1}else l&&o.add(a);if(Oe(a)&&!yn(a)){if(!t.h.D&&t._<1)return;Pr(t,a),r&&r.A.l||kr(t,a)}}function kr(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&hn(r,o)}function nn(t,r){var o=t[$];return(o?Ge(o):t)[r]}function rs(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 je(t){t.P||(t.P=!0,t.l&&je(t.l))}function an(t){t.o||(t.o=fn(t.t))}function cn(t,r,o){var n=pn(r)?Re("MapSet").F(r,o):un(r)?Re("MapSet").T(r,o):t.O?function(a,s){var l=Array.isArray(a),d={i:l?1:0,A:s?s.A:sn(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},p=d,u=er;l&&(p=[d],u=Qt);var h=Proxy.revocable(p,u),y=h.revoke,g=h.proxy;return d.k=g,d.j=y,g}(r,o):Re("ES5").J(r,o);return(o?o.A:sn()).p.push(n),n}function El(t){return Pe(t)||ye(22,t),function r(o){if(!Oe(o))return o;var n,a=o[$],s=Ut(o);if(a){if(!a.P&&(a.i<4||!Re("ES5").K(a)))return a.t;a.I=!0,n=os(o,s),a.I=!1}else n=os(o,s);return ut(n,function(l,d){a&&vl(a.t,l)===d||ss(n,l,r(d))}),s===3?new Set(n):n}(t)}function os(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return fn(t)}function cs(){function t(l,d){var p=s[l];return p?p.enumerable=d:s[l]=p={configurable:!0,enumerable:d,get:function(){var u=this[$];return er.get(u,l)},set:function(u){var h=this[$];er.set(h,l,u)}},p}function r(l){for(var d=l.length-1;d>=0;d--){var p=l[d][$];if(!p.P)switch(p.i){case 5:n(p)&&je(p);break;case 4:o(p)&&je(p)}}}function o(l){for(var d=l.t,p=l.k,u=Mt(p),h=u.length-1;h>=0;h--){var y=u[h];if(y!==$){var g=d[y];if(g===void 0&&!Dt(d,y))return!0;var O=p[y],x=O&&O[$];if(x?x.t!==g:!ls(O,g))return!0}}var C=!!d[$];return u.length!==Mt(d).length+(C?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(d,d.length-1);if(p&&!p.get)return!0;for(var u=0;u<d.length;u++)if(!d.hasOwnProperty(u))return!0;return!1}function a(l){l.g&&ye(3,JSON.stringify(Ge(l)))}var s={};Ol("ES5",{J:function(l,d){var p=Array.isArray(l),u=function(y,g){if(y){for(var O=Array(g.length),x=0;x<g.length;x++)Object.defineProperty(O,""+x,t(x,!0));return O}var C=ps(g);delete C[$];for(var I=Mt(C),_=0;_<I.length;_++){var L=I[_];C[L]=t(L,y||!!C[L].enumerable)}return Object.create(Object.getPrototypeOf(g),C)}(p,l),h={i:p?5:4,A:d?d.A:sn(),P:!1,I:!1,R:{},l:d,t:l,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,$,{value:h,writable:!0}),u},S:function(l,d,p){p?Pe(d)&&d[$].A===l&&r(l.p):(l.u&&function u(h){if(h&&typeof h=="object"){var y=h[$];if(y){var g=y.t,O=y.k,x=y.R,C=y.i;if(C===4)ut(O,function(M){M!==$&&(g[M]!==void 0||Dt(g,M)?x[M]||u(O[M]):(x[M]=!0,je(y)))}),ut(g,function(M){O[M]!==void 0||Dt(O,M)||(x[M]=!1,je(y))});else if(C===5){if(n(y)&&(je(y),x.length=!0),O.length<g.length)for(var I=O.length;I<g.length;I++)x[I]=!1;else for(var _=g.length;_<O.length;_++)x[_]=!0;for(var L=Math.min(O.length,g.length),F=0;F<L;F++)O.hasOwnProperty(F)||(x[F]=!0),x[F]===void 0&&u(O[F])}}}}(l.p[0]),r(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var ns,Jt,gn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Al=typeof Map<"u",wl=typeof Set<"u",as=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ds=gn?Symbol.for("immer-nothing"):((ns={})["immer-nothing"]=!0,ns),is=gn?Symbol.for("immer-draftable"):"__$immer_draftable",$=gn?Symbol.for("immer-state"):"__$immer_state";var Rl=""+Object.prototype.constructor,Mt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ps=Object.getOwnPropertyDescriptors||function(t){var r={};return Mt(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},dn={},er={get:function(t,r){if(r===$)return t;var o=Ge(t);if(!Dt(o,r))return function(a,s,l){var d,p=rs(s,l);return p?"value"in p?p.value:(d=p.get)===null||d===void 0?void 0:d.call(a.k):void 0}(t,o,r);var n=o[r];return t.I||!Oe(n)?n:n===nn(t.t,r)?(an(t),t.o[r]=cn(t.A.h,n,t)):n},has:function(t,r){return r in Ge(t)},ownKeys:function(t){return Reflect.ownKeys(Ge(t))},set:function(t,r,o){var n=rs(Ge(t),r);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=nn(Ge(t),r),s=a?.[$];if(s&&s.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(ls(o,a)&&(o!==void 0||Dt(t.t,r)))return!0;an(t),je(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 nn(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,an(t),je(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=Ge(t),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){ye(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ye(12)}},Qt={};ut(er,function(t,r){Qt[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Qt.deleteProperty=function(t,r){return Qt.set.call(this,t,r,void 0)},Qt.set=function(t,r,o){return er.set.call(this,t[0],r,o,t[0])};var Nl=function(){function t(o){var n=this;this.O=as,this.D=!0,this.produce=function(a,s,l){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var p=n;return function(C){var I=this;C===void 0&&(C=d);for(var _=arguments.length,L=Array(_>1?_-1:0),F=1;F<_;F++)L[F-1]=arguments[F];return p.produce(C,function(M){var J;return(J=s).call.apply(J,[I,M].concat(L))})}}var u;if(typeof s!="function"&&ye(6),l!==void 0&&typeof l!="function"&&ye(7),Oe(a)){var h=es(n),y=cn(n,a,void 0),g=!0;try{u=s(y),g=!1}finally{g?Lr(h):ln(h)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(C){return rn(h,l),on(C,h)},function(C){throw Lr(h),C}):(rn(h,l),on(u,h))}if(!a||typeof a!="object"){if((u=s(a))===void 0&&(u=a),u===ds&&(u=void 0),n.D&&hn(u,!0),l){var O=[],x=[];Re("Patches").M(a,u,O,x),l(O,x)}return u}ye(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(u){for(var h=arguments.length,y=Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return n.produceWithPatches(u,function(O){return a.apply(void 0,[O].concat(y))})};var l,d,p=n.produce(a,s,function(u,h){l=u,d=h});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,l,d]}):[p,l,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){Oe(o)||ye(8),Pe(o)&&(o=El(o));var n=es(this),a=cn(this,o,void 0);return a[$].C=!0,ln(n),a},r.finishDraft=function(o,n){var a=o&&o[$],s=a.A;return rn(s,n),on(void 0,s)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!as&&ye(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 l=Re("Patches").$;return Pe(o)?l(o,n):this.produce(o,function(d){return l(d,n)})},t}(),de=new Nl,Tl=de.produce,qm=de.produceWithPatches.bind(de),Ym=de.setAutoFreeze.bind(de),Xm=de.setUseProxies.bind(de),Qm=de.applyPatches.bind(de),Jm=de.createDraft.bind(de),eb=de.finishDraft.bind(de),Dr=Tl;function ft(t){"@babel/helpers - typeof";return ft=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},ft(t)}function us(t,r){if(ft(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,r||"default");if(ft(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function fs(t){var r=us(t,"string");return ft(r)=="symbol"?r:r+""}function hs(t,r,o){return(r=fs(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ys(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 mn(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?ys(Object(o),!0).forEach(function(n){hs(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ys(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ae(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 gs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),bn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mr={INIT:"@@redux/INIT"+bn(),REPLACE:"@@redux/REPLACE"+bn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bn()}};function Il(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 xn(t,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(ae(1));return o(xn)(t,r)}if(typeof t!="function")throw new Error(ae(2));var a=t,s=r,l=[],d=l,p=!1;function u(){d===l&&(d=l.slice())}function h(){if(p)throw new Error(ae(3));return s}function y(C){if(typeof C!="function")throw new Error(ae(4));if(p)throw new Error(ae(5));var I=!0;return u(),d.push(C),function(){if(I){if(p)throw new Error(ae(6));I=!1,u();var L=d.indexOf(C);d.splice(L,1),l=null}}}function g(C){if(!Il(C))throw new Error(ae(7));if(typeof C.type>"u")throw new Error(ae(8));if(p)throw new Error(ae(9));try{p=!0,s=a(s,C)}finally{p=!1}for(var I=l=d,_=0;_<I.length;_++){var L=I[_];L()}return C}function O(C){if(typeof C!="function")throw new Error(ae(10));a=C,g({type:Mr.REPLACE})}function x(){var C,I=y;return C={subscribe:function(L){if(typeof L!="object"||L===null)throw new Error(ae(11));function F(){L.next&&L.next(h())}F();var M=I(F);return{unsubscribe:M}}},C[gs]=function(){return this},C}return g({type:Mr.INIT}),n={dispatch:g,subscribe:y,getState:h,replaceReducer:O},n[gs]=x,n}function _l(t){Object.keys(t).forEach(function(r){var o=t[r],n=o(void 0,{type:Mr.INIT});if(typeof n>"u")throw new Error(ae(12));if(typeof o(void 0,{type:Mr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ae(13))})}function ms(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),l,d;try{_l(o)}catch(p){d=p}return function(u,h){if(u===void 0&&(u={}),d)throw d;if(0)var y;for(var g=!1,O={},x=0;x<s.length;x++){var C=s[x],I=o[C],_=u[C],L=I(_,h);if(typeof L>"u"){var F=h&&h.type;throw new Error(ae(14))}O[C]=L,g=g||L!==_}return g=g||s.length!==Object.keys(u).length,g?O:u}}function Bt(){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 bs(){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(ae(15))},l={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=r.map(function(p){return p(l)});return s=Bt.apply(void 0,d)(a.dispatch),mn(mn({},a),{},{dispatch:s})}}}function xs(t){var r=function(n){var a=n.dispatch,s=n.getState;return function(l){return function(d){return typeof d=="function"?d(a,s,t):l(d)}}};return r}var vs=xs();vs.withExtraArgument=xs;var vn=vs;var As=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)}}(),Ll=function(t,r){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,l;return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(u){return function(h){return p([u,h])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(s=u[0]&2?a.return:u[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,u[1])).done)return s;switch(a=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,a=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(u[0]===6&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=r.call(t,o)}catch(h){u=[6,h],a=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ft=function(t,r){for(var o=0,n=r.length,a=t.length;o<n;o++,a++)t[a]=r[o];return t},Pl=Object.defineProperty,kl=Object.defineProperties,Dl=Object.getOwnPropertyDescriptors,Ss=Object.getOwnPropertySymbols,Ml=Object.prototype.hasOwnProperty,Ul=Object.prototype.propertyIsEnumerable,Os=function(t,r,o){return r in t?Pl(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},Ke=function(t,r){for(var o in r||(r={}))Ml.call(r,o)&&Os(t,o,r[o]);if(Ss)for(var n=0,a=Ss(r);n<a.length;n++){var o=a[n];Ul.call(r,o)&&Os(t,o,r[o])}return t},Sn=function(t,r){return kl(t,Dl(r))},Bl=function(t,r,o){return new Promise(function(n,a){var s=function(p){try{d(o.next(p))}catch(u){a(u)}},l=function(p){try{d(o.throw(p))}catch(u){a(u)}},d=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(s,l)};d((o=o.apply(t,r)).next())})};var Fl=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bt:Bt.apply(null,arguments)},bb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Hl(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 zl=function(t){As(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,Ft([void 0],o[0].concat(this)))):new(r.bind.apply(r,Ft([void 0],o.concat(this))))},r}(Array),Wl=function(t){As(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,Ft([void 0],o[0].concat(this)))):new(r.bind.apply(r,Ft([void 0],o.concat(this))))},r}(Array);function En(t){return Oe(t)?Dr(t,function(){}):t}function $l(t){return typeof t=="boolean"}function Gl(){return function(r){return jl(r)}}function jl(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,l=s===void 0?!0:s,d=new zl;if(o&&($l(o)?d.push(vn):d.push(vn.withExtraArgument(o.extraArgument))),0){if(a)var p;if(l)var u}return d}var On=!0;function ws(t){var r=Gl(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,s=o.middleware,l=s===void 0?r():s,d=o.devTools,p=d===void 0?!0:d,u=o.preloadedState,h=u===void 0?void 0:u,y=o.enhancers,g=y===void 0?void 0:y,O;if(typeof a=="function")O=a;else if(Hl(a))O=ms(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=l;if(typeof x=="function"&&(x=x(r),!On&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!On&&x.some(function(M){return typeof M!="function"}))throw new Error("each middleware provided to configureStore must be a function");var C=bs.apply(void 0,x),I=Bt;p&&(I=Fl(Ke({trace:!On},typeof p=="object"&&p)));var _=new Wl(C),L=_;Array.isArray(g)?L=Ft([C],g):typeof g=="function"&&(L=g(_));var F=I.apply(void 0,L);return xn(O,h,F)}function Ve(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 Ke(Ke({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 Rs(t){var r={},o=[],n,a={addCase:function(s,l){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]=l,a},addMatcher:function(s,l){return o.push({matcher:s,reducer:l}),a},addDefaultCase:function(s){return n=s,a}};return t(a),[r,o,n]}function Kl(t){return typeof t=="function"}function Vl(t,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?Rs(r):[r,o,n],s=a[0],l=a[1],d=a[2],p;if(Kl(t))p=function(){return En(t())};else{var u=En(t);p=function(){return u}}function h(y,g){y===void 0&&(y=p());var O=Ft([s[g.type]],l.filter(function(x){var C=x.matcher;return C(g)}).map(function(x){var C=x.reducer;return C}));return O.filter(function(x){return!!x}).length===0&&(O=[d]),O.reduce(function(x,C){if(C)if(Pe(x)){var I=x,_=C(I,g);return _===void 0?x:_}else{if(Oe(x))return Dr(x,function(L){return C(L,g)});var _=C(x,g);if(_===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return x},y)}return h.getInitialState=p,h}function Zl(t,r){return t+"/"+r}function Ns(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:En(t.initialState),n=t.reducers||{},a=Object.keys(n),s={},l={},d={};a.forEach(function(h){var y=n[h],g=Zl(r,h),O,x;"reducer"in y?(O=y.reducer,x=y.prepare):O=y,s[h]=O,l[g]=O,d[h]=x?Ve(g,x):Ve(g)});function p(){var h=typeof t.extraReducers=="function"?Rs(t.extraReducers):[t.extraReducers],y=h[0],g=y===void 0?{}:y,O=h[1],x=O===void 0?[]:O,C=h[2],I=C===void 0?void 0:C,_=Ke(Ke({},g),l);return Vl(o,function(L){for(var F in _)L.addCase(F,_[F]);for(var M=0,J=x;M<J.length;M++){var ge=J[M];L.addMatcher(ge.matcher,ge.reducer)}I&&L.addDefaultCase(I)})}var u;return{name:r,reducer:function(h,y){return u||(u=p()),u(h,y)},actions:d,caseReducers:s,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var ql="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Yl=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=ql[Math.random()*64|0];return r},Xl=["name","message","stack","code"],Cn=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Cs=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Ql=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,n=Xl;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(r[a]=t[a])}return r}return{message:String(t)}},Ob=function(){function t(r,o,n){var a=Ve(r+"/fulfilled",function(h,y,g,O){return{payload:h,meta:Sn(Ke({},O||{}),{arg:g,requestId:y,requestStatus:"fulfilled"})}}),s=Ve(r+"/pending",function(h,y,g){return{payload:void 0,meta:Sn(Ke({},g||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),l=Ve(r+"/rejected",function(h,y,g,O,x){return{payload:O,error:(n&&n.serializeError||Ql)(h||"Rejected"),meta:Sn(Ke({},x||{}),{arg:g,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,p=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 u(h){return function(y,g,O){var x=n?.idGenerator?n.idGenerator(h):Yl(),C=new p,I,_=!1;function L(M){I=M,C.abort()}var F=function(){return Bl(this,null,function(){var M,J,ge,Ze,ie,qe,yt;return Ll(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),Ze=(M=n?.condition)==null?void 0:M.call(n,h,{getState:g,extra:O}),ec(Ze)?[4,Ze]:[3,2];case 1:Ze=f.sent(),f.label=2;case 2:if(Ze===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=!0,ie=new Promise(function(m,w){return C.signal.addEventListener("abort",function(){return w({name:"AbortError",message:I||"Aborted"})})}),y(s(x,h,(J=n?.getPendingMeta)==null?void 0:J.call(n,{requestId:x,arg:h},{getState:g,extra:O}))),[4,Promise.race([ie,Promise.resolve(o(h,{dispatch:y,getState:g,extra:O,requestId:x,signal:C.signal,abort:L,rejectWithValue:function(m,w){return new Cn(m,w)},fulfillWithValue:function(m,w){return new Cs(m,w)}})).then(function(m){if(m instanceof Cn)throw m;return m instanceof Cs?a(m.payload,x,h,m.meta):a(m,x,h)})])];case 3:return ge=f.sent(),[3,5];case 4:return qe=f.sent(),ge=qe instanceof Cn?l(null,x,h,qe.payload,qe.meta):l(qe,x,h),[3,5];case 5:return yt=n&&!n.dispatchConditionRejection&&l.match(ge)&&ge.meta.condition,yt||y(ge),[2,ge]}})})}();return Object.assign(F,{abort:L,requestId:x,arg:h,unwrap:function(){return F.then(Jl)}})}}return Object.assign(u,{pending:s,rejected:l,fulfilled:a,typePrefix:r})}return t.withTypes=function(){return t},t}();function Jl(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ec(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Ts="listener",Is="completed",_s="cancelled",Cb="task-"+_s,Eb="task-"+Is,Ab=Ts+"-"+_s,wb=Ts+"-"+Is;var An="listenerMiddleware";var Rb=Ve(An+"/add"),Nb=Ve(An+"/removeAll"),Tb=Ve(An+"/remove");var Es,Ib=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Es||(Es=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},tc=function(t){return function(r){setTimeout(r,t)}},_b=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tc(10);cs();var rc=wr(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)}}}),Ur=class extends rc(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ls=class t extends Ur{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(_r(s))return s;if(a==null)return;let l=Ns({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=ws({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:l.reducer(p,u)});return window.ftReduxStores[a.name]=new t(l,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Rr;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,d)=>{let p=l,u=s[p];return u?(...h)=>{let y=u(...h.map(a));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[p]: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 Br=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,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!a)return l;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${l} ${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 Ps=b(N()),Fr=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},tx=(0,Ps.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=>Br.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Fr([(0,wn.property)({type:Boolean})],r.prototype,"useLongDateFormat",void 0),Fr([(0,wn.property)({type:Boolean})],r.prototype,"useDateTimeFormat",void 0),Fr([tn({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),Fr([tn({store:E.name})],r.prototype,"uiLocale",void 0),r});var Wr=b(N());var Hr=class extends le{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 zr=class extends le{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 oc="ft-user-assets",nc={setAssetCount:(t,r)=>{let{userAssetType:o,count:n}=r.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(he).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;Nn(t,o,[...Rn(t,o),a]),ks(t,o,1,n),Ds(t,a)},editAsset:(t,r)=>{let{assetType:o,asset:n}=r.payload;Nn(t,o,Rn(t,o).map(a=>a.id===n.id?n:a)),Ds(t,n)},removeAsset:(t,r)=>{let{assetType:o,mapId:n,assetId:a}=r.payload;Nn(t,o,Rn(t,o).filter(s=>s.id!==a)),ks(t,o,-1,n)}},Ms={[he.SEARCHES]:"savedSearches",[he.BOOKMARKS]:"bookmarks",[he.BOOKS]:void 0,[he.COLLECTIONS]:void 0},Rn=(t,r)=>{var o;let n=Ms[r];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Nn=(t,r,o)=>{let n=Ms[r];n&&(t[n]=o)},ks=(t,r,o,n)=>{let a=t.assetCounts.allAsset[r];if(a!==void 0&&(t.assetCounts.allAsset[r]=Math.max(0,a+o),r===he.BOOKMARKS&&n)){let s=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,s+o)}},Ds=(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)},pe=Wr.FtReduxStore.get({name:oc,reducers:nc,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(he).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Tn=class{constructor(r=new Hr,o=new zr){this.assetCountsService=r,this.assetLabelsService=o,this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new br,this.savedSearchesService=new Cr,E.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=E.getState();(0,Wr.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(),pe.actions.clearAssetCount(),pe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();pe.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let r=await this.assetLabelsService.getUserAssetLabels();pe.actions.assetLabels(r)}async loadAssetCount(r){let o=await this.assetCountsService.getUserAssetCount(r);o&&pe.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(r){let o=await this.assetCountsService.getUserBookmarkCountByMap(r);o&&pe.actions.setBookmarkCountByMap({count:o.count,mapId:r})}async reloadAssetCount(r){this.assetCountsService.clearCache();let o=Object.keys(pe.getState().assetCounts.bookmarkByMap).length!==0;r===he.BOOKMARKS&&o&&pe.actions.clearBookmarkCountByMap(),pe.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;pe.actions.bookmarks(o)}}},ac=new Tn;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ac);(0,Us.customElement)("ft-app-context")(z);var Fs=b(te());var In=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-]+$/)}},ht=new In;var ic=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Hs=Symbol("i18nAttributes"),rr=Symbol("i18nListAttributes"),zs=Symbol("i18nProperties"),$r=Symbol("i18nContexts"),tr=Symbol("i18nUnsubs"),jr=(0,Ht.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?vr:_t}i18n(s){let{context:l,key:d,message:p}=s,{custom:u,args:h,argsProvider:y}=s;if(l&&d){this.hasI18nContext(l)||this.addI18nContext(l,void 0,u);let g=h??(y?y(this):[]);return this.getI18nService(u).resolveMessage(l,d,...g)}return p}async awaitI18n(s){let{context:l,custom:d}=s;return l&&await this.getI18nService(d).prepareContext(l),this.i18n(s)}customI18n(s,l){if(ht.isI18nKey(s)){let[d,p]=s.split(".");return this.i18n({custom:!0,context:d,key:p,...l})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((l,d,p)=>s.has(d)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((l,d,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===s}),this.updateI18nProperties(l=>l.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var l,d;let p=this,u=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(l=this[Hs])===null||l===void 0||l.forEach((h,y)=>p[y]=u(h,y,p[y])),(d=this[rr])===null||d===void 0||d.forEach((h,y)=>{var g;return p[y]=(g=p[y])===null||g===void 0?void 0:g.map(O=>u(h,y,O))})}updateI18nProperties(s){var l;(l=this[zs])===null||l===void 0||l.forEach((d,p)=>{s(d,p)&&(this[p]=this.i18n(d))})}addI18nMessages(s,l,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,l,d)}addI18nContext(s,l,d){let p=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[$r].set(p,{isCustomContext:d}),this[tr].has(p)||this[tr].set(p,this.getI18nService(d).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(d).prepareContext(p,l)}hasI18nContext(s){return this[$r].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[$r].forEach((s,l)=>this.addI18nContext(l,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[tr].forEach(s=>s()),this[tr].clear()}}return r=$r,o=tr,ic([(0,Fs.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Bs=class extends jr(Ht.FtLitElement){},Gr=class extends jr(Ht.FtLitElementRedux){};var or=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Ce=class extends Gr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Kr.nothing:Kr.html`
736
+ `}connectedCallback(){super.connectedCallback(),E.addEventListener(st.eventName,this.reloadConfiguration)}disconnectedCallback(){E.addEventListener(st.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(r){var o,n,a,s,l,d,p;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(u=>_t.addContext(u)),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((l=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),r.has("authenticationRequired")&&E.actions.authenticationRequired(this.authenticationRequired),r.has("availableContentLocales")&&E.actions.availableContentLocales((p=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&p!==void 0?p:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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",()=>Hi(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=ri;X([(0,oe.property)()],z.prototype,"baseUrl",void 0);X([(0,oe.property)()],z.prototype,"apiIntegrationIdentifier",void 0);X([(0,oe.property)()],z.prototype,"apiIntegrationAppVersion",void 0);X([(0,oe.property)()],z.prototype,"uiLocale",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"availableUiLocales",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"metadataConfiguration",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"editorMode",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"noCustom",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);X([(0,oe.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"withManualResources",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"navigatorOnline",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"forcedOffline",void 0);X([(0,oe.property)({type:Object})],z.prototype,"apiProvider",void 0);X([(0,oe.property)({type:Boolean})],z.prototype,"authenticationRequired",void 0);X([(0,Se.jsonProperty)([])],z.prototype,"messageContexts",void 0);X([(0,Se.jsonProperty)(void 0)],z.prototype,"session",void 0);X([(0,oe.state)()],z.prototype,"localesConfiguration",void 0);X([(0,oe.state)()],z.prototype,"availableContentLocales",void 0);var wn=b(te());function ml(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(!Ar(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(!Ar(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=l=>Object.keys(l).filter(d=>l[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 l=a[n];if(!Ar(t[l],r[l]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function Ar(t,r){try{return ml(t,r)}catch{return!1}}function Yt(t,r){return!Ar(t,r)}function wr(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 Wi=b(te(),1);var tn=t=>{let r=t??{};return(o,n)=>{var a;let s={hasChanged:Yt,attribute:!1,...r};(0,Wi.property)(s)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=r.selector)!==null&&a!==void 0?a:d=>d[n],store:r.store})}};var Rr=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 dt=b(te(),1);var $i=b(te(),1);function Gi(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,$i.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:Yt,...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 l of n)try{await l()}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 Ki=b(K(),1);var Tr=globalThis,bl=Tr.ShadowRoot&&(Tr.ShadyCSS===void 0||Tr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,km=Symbol();var ji=(t,r)=>{if(bl)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=Tr.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var Ir=class extends Ki.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 ji(n,r.elementStyles),n}};function Vi(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 kt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Xi,Zi=Symbol("constructorPrototype"),qi=Symbol("constructorName"),Qi=Symbol("exportpartsDebouncer"),Yi=Symbol("dynamicDependenciesLoaded"),Pt=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Pt.eventName="exportparts-updated";var we=class extends Ir{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Xi]=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[Qi].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[qi]=this.constructor.name,this[Zi]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[qi]&&Object.setPrototypeOf(this,this[Zi])}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[Yi]||(o[Yi]=!0,this.importDynamicDependencies()),(r=this.shadowRoot)===null||r===void 0||r.addEventListener(Pt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.shadowRoot)===null||r===void 0||r.removeEventListener(Pt.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 Pt)})}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=Vi(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,l,d;let p=g=>g!=null&&g.trim().length>0,u=r.filter(p).map(g=>g.trim());if(u.length===0){this.exportparts=void 0;return}let h=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let O=(s=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],x=(d=(l=g.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(I=>I.split(":")[1]))!==null&&d!==void 0?d:[],C=[...O,...x].filter(p).map(I=>I.trim());for(let I of C)h.add(I)}if(h.size===0){this.exportparts=void 0;return}let y=[...h.values()].flatMap(g=>u.map(O=>`${g}:${O}--${g}`));this.exportparts=[...this.part,...y].join(", ")}};Xi=Qi;kt([(0,dt.property)()],we.prototype,"exportpartsPrefix",void 0);kt([Gi([])],we.prototype,"exportpartsPrefixes",void 0);kt([(0,dt.property)({reflect:!0})],we.prototype,"exportparts",void 0);kt([(0,dt.property)()],we.prototype,"customStylesheet",void 0);kt([(0,dt.property)()],we.prototype,"elementToFocus",void 0);kt([(0,dt.state)()],we.prototype,"useAdoptedStyleSheets",void 0);function _r(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Xt=Symbol("internalReduxEventsUnsubscribers"),$e=Symbol("internalStoresUnsubscribers"),pt=Symbol("internalStores"),xl=wr(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(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(d=>l.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[pt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[pt].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[pt].get(l)}addStore(l,d){var p;d=(p=d??l.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(d),this[pt].set(d,l),this.subscribeToStore(d,l),this.updateFromStores()}removeStore(l){let d=typeof l=="string"?l:l.name;this.unsubscribeFromStore(d),this[pt].delete(d)}setupStores(){this.unsubscribeFromStores(),this[pt].forEach((l,d)=>this.subscribeToStore(d,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,d)=>{let p=this.constructor.getPropertyOptions(d);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:d)){let u=this.getStore(l.store);u&&(l.store?this[$e].has(l.store):this[$e].size>0)&&(this[d]=l.selector(u.getState(),this))}})}subscribeToStore(l,d){var p;this[$e].set(l,d.subscribe(()=>this.updateFromStores())),this[Xt].set(l,[]),_r(d)&&d.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,h)=>{if(typeof this[h]=="function"&&(!u.store||d.name===u.store)){let y=g=>this[h](g);d.addEventListener(u.eventName,y),this[Xt].get(l).push(()=>d.removeEventListener(u.eventName,y))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[$e].forEach((l,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(l){var d;this[$e].has(l)&&this[$e].get(l)(),this[$e].delete(l),(d=this[Xt].get(l))===null||d===void 0||d.forEach(p=>p()),this[Xt].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return r=$e,o=pt,n=Xt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ji=class extends xl(we){};function ye(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(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Pe(t){return!!t&&!!t[$]}function Oe(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)===Rl}(t)||Array.isArray(t)||!!t[is]||!!(!((r=t.constructor)===null||r===void 0)&&r[is])||pn(t)||un(t))}function ut(t,r,o){o===void 0&&(o=!1),Ut(t)===0?(o?Object.keys:Mt)(t).forEach(function(n){o&&typeof n=="symbol"||r(n,t[n],t)}):t.forEach(function(n,a){return r(a,n,t)})}function Ut(t){var r=t[$];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:pn(t)?2:un(t)?3:0}function Dt(t,r){return Ut(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function vl(t,r){return Ut(t)===2?t.get(r):t[r]}function ss(t,r,o){var n=Ut(t);n===2?t.set(r,o):n===3?t.add(o):t[r]=o}function ls(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function pn(t){return Al&&t instanceof Map}function un(t){return wl&&t instanceof Set}function Ge(t){return t.o||t.t}function fn(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=ps(t);delete r[$];for(var o=Mt(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 hn(t,r){return r===void 0&&(r=!1),yn(t)||Pe(t)||!Oe(t)||(Ut(t)>1&&(t.set=t.add=t.clear=t.delete=Sl),Object.freeze(t),r&&ut(t,function(o,n){return hn(n,!0)},!0)),t}function Sl(){ye(2)}function yn(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Re(t){var r=dn[t];return r||ye(18,t),r}function Ol(t,r){dn[t]||(dn[t]=r)}function sn(){return Jt}function rn(t,r){r&&(Re("Patches"),t.u=[],t.s=[],t.v=r)}function Lr(t){ln(t),t.p.forEach(Cl),t.p=null}function ln(t){t===Jt&&(Jt=t.l)}function es(t){return Jt={p:[],l:Jt,h:t,m:!0,_:0}}function Cl(t){var r=t[$];r.i===0||r.i===1?r.j():r.g=!0}function on(t,r){r._=r.p.length;var o=r.p[0],n=t!==void 0&&t!==o;return r.h.O||Re("ES5").S(r,t,n),n?(o[$].P&&(Lr(r),ye(4)),Oe(t)&&(t=Pr(r,t),r.l||kr(r,t)),r.u&&Re("Patches").M(o[$].t,t,r.u,r.s)):t=Pr(r,o,[]),Lr(r),r.u&&r.v(r.u,r.s),t!==ds?t:void 0}function Pr(t,r,o){if(yn(r))return r;var n=r[$];if(!n)return ut(r,function(d,p){return ts(t,n,r,d,p,o)},!0),r;if(n.A!==t)return r;if(!n.P)return kr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=fn(n.k):n.o,s=a,l=!1;n.i===3&&(s=new Set(a),a.clear(),l=!0),ut(s,function(d,p){return ts(t,n,a,d,p,o,l)}),kr(t,a,!1),o&&t.u&&Re("Patches").N(n,o,t.u,t.s)}return n.o}function ts(t,r,o,n,a,s,l){if(Pe(a)){var d=Pr(t,a,s&&r&&r.i!==3&&!Dt(r.R,n)?s.concat(n):void 0);if(ss(o,n,d),!Pe(d))return;t.m=!1}else l&&o.add(a);if(Oe(a)&&!yn(a)){if(!t.h.D&&t._<1)return;Pr(t,a),r&&r.A.l||kr(t,a)}}function kr(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&hn(r,o)}function nn(t,r){var o=t[$];return(o?Ge(o):t)[r]}function rs(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 je(t){t.P||(t.P=!0,t.l&&je(t.l))}function an(t){t.o||(t.o=fn(t.t))}function cn(t,r,o){var n=pn(r)?Re("MapSet").F(r,o):un(r)?Re("MapSet").T(r,o):t.O?function(a,s){var l=Array.isArray(a),d={i:l?1:0,A:s?s.A:sn(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},p=d,u=er;l&&(p=[d],u=Qt);var h=Proxy.revocable(p,u),y=h.revoke,g=h.proxy;return d.k=g,d.j=y,g}(r,o):Re("ES5").J(r,o);return(o?o.A:sn()).p.push(n),n}function El(t){return Pe(t)||ye(22,t),function r(o){if(!Oe(o))return o;var n,a=o[$],s=Ut(o);if(a){if(!a.P&&(a.i<4||!Re("ES5").K(a)))return a.t;a.I=!0,n=os(o,s),a.I=!1}else n=os(o,s);return ut(n,function(l,d){a&&vl(a.t,l)===d||ss(n,l,r(d))}),s===3?new Set(n):n}(t)}function os(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return fn(t)}function cs(){function t(l,d){var p=s[l];return p?p.enumerable=d:s[l]=p={configurable:!0,enumerable:d,get:function(){var u=this[$];return er.get(u,l)},set:function(u){var h=this[$];er.set(h,l,u)}},p}function r(l){for(var d=l.length-1;d>=0;d--){var p=l[d][$];if(!p.P)switch(p.i){case 5:n(p)&&je(p);break;case 4:o(p)&&je(p)}}}function o(l){for(var d=l.t,p=l.k,u=Mt(p),h=u.length-1;h>=0;h--){var y=u[h];if(y!==$){var g=d[y];if(g===void 0&&!Dt(d,y))return!0;var O=p[y],x=O&&O[$];if(x?x.t!==g:!ls(O,g))return!0}}var C=!!d[$];return u.length!==Mt(d).length+(C?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(d,d.length-1);if(p&&!p.get)return!0;for(var u=0;u<d.length;u++)if(!d.hasOwnProperty(u))return!0;return!1}function a(l){l.g&&ye(3,JSON.stringify(Ge(l)))}var s={};Ol("ES5",{J:function(l,d){var p=Array.isArray(l),u=function(y,g){if(y){for(var O=Array(g.length),x=0;x<g.length;x++)Object.defineProperty(O,""+x,t(x,!0));return O}var C=ps(g);delete C[$];for(var I=Mt(C),_=0;_<I.length;_++){var L=I[_];C[L]=t(L,y||!!C[L].enumerable)}return Object.create(Object.getPrototypeOf(g),C)}(p,l),h={i:p?5:4,A:d?d.A:sn(),P:!1,I:!1,R:{},l:d,t:l,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,$,{value:h,writable:!0}),u},S:function(l,d,p){p?Pe(d)&&d[$].A===l&&r(l.p):(l.u&&function u(h){if(h&&typeof h=="object"){var y=h[$];if(y){var g=y.t,O=y.k,x=y.R,C=y.i;if(C===4)ut(O,function(M){M!==$&&(g[M]!==void 0||Dt(g,M)?x[M]||u(O[M]):(x[M]=!0,je(y)))}),ut(g,function(M){O[M]!==void 0||Dt(O,M)||(x[M]=!1,je(y))});else if(C===5){if(n(y)&&(je(y),x.length=!0),O.length<g.length)for(var I=O.length;I<g.length;I++)x[I]=!1;else for(var _=g.length;_<O.length;_++)x[_]=!0;for(var L=Math.min(O.length,g.length),F=0;F<L;F++)O.hasOwnProperty(F)||(x[F]=!0),x[F]===void 0&&u(O[F])}}}}(l.p[0]),r(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var ns,Jt,gn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Al=typeof Map<"u",wl=typeof Set<"u",as=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ds=gn?Symbol.for("immer-nothing"):((ns={})["immer-nothing"]=!0,ns),is=gn?Symbol.for("immer-draftable"):"__$immer_draftable",$=gn?Symbol.for("immer-state"):"__$immer_state";var Rl=""+Object.prototype.constructor,Mt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ps=Object.getOwnPropertyDescriptors||function(t){var r={};return Mt(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},dn={},er={get:function(t,r){if(r===$)return t;var o=Ge(t);if(!Dt(o,r))return function(a,s,l){var d,p=rs(s,l);return p?"value"in p?p.value:(d=p.get)===null||d===void 0?void 0:d.call(a.k):void 0}(t,o,r);var n=o[r];return t.I||!Oe(n)?n:n===nn(t.t,r)?(an(t),t.o[r]=cn(t.A.h,n,t)):n},has:function(t,r){return r in Ge(t)},ownKeys:function(t){return Reflect.ownKeys(Ge(t))},set:function(t,r,o){var n=rs(Ge(t),r);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=nn(Ge(t),r),s=a?.[$];if(s&&s.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(ls(o,a)&&(o!==void 0||Dt(t.t,r)))return!0;an(t),je(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 nn(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,an(t),je(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=Ge(t),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){ye(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ye(12)}},Qt={};ut(er,function(t,r){Qt[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Qt.deleteProperty=function(t,r){return Qt.set.call(this,t,r,void 0)},Qt.set=function(t,r,o){return er.set.call(this,t[0],r,o,t[0])};var Nl=function(){function t(o){var n=this;this.O=as,this.D=!0,this.produce=function(a,s,l){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var p=n;return function(C){var I=this;C===void 0&&(C=d);for(var _=arguments.length,L=Array(_>1?_-1:0),F=1;F<_;F++)L[F-1]=arguments[F];return p.produce(C,function(M){var J;return(J=s).call.apply(J,[I,M].concat(L))})}}var u;if(typeof s!="function"&&ye(6),l!==void 0&&typeof l!="function"&&ye(7),Oe(a)){var h=es(n),y=cn(n,a,void 0),g=!0;try{u=s(y),g=!1}finally{g?Lr(h):ln(h)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(C){return rn(h,l),on(C,h)},function(C){throw Lr(h),C}):(rn(h,l),on(u,h))}if(!a||typeof a!="object"){if((u=s(a))===void 0&&(u=a),u===ds&&(u=void 0),n.D&&hn(u,!0),l){var O=[],x=[];Re("Patches").M(a,u,O,x),l(O,x)}return u}ye(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(u){for(var h=arguments.length,y=Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return n.produceWithPatches(u,function(O){return a.apply(void 0,[O].concat(y))})};var l,d,p=n.produce(a,s,function(u,h){l=u,d=h});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,l,d]}):[p,l,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){Oe(o)||ye(8),Pe(o)&&(o=El(o));var n=es(this),a=cn(this,o,void 0);return a[$].C=!0,ln(n),a},r.finishDraft=function(o,n){var a=o&&o[$],s=a.A;return rn(s,n),on(void 0,s)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!as&&ye(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 l=Re("Patches").$;return Pe(o)?l(o,n):this.produce(o,function(d){return l(d,n)})},t}(),de=new Nl,Tl=de.produce,qm=de.produceWithPatches.bind(de),Ym=de.setAutoFreeze.bind(de),Xm=de.setUseProxies.bind(de),Qm=de.applyPatches.bind(de),Jm=de.createDraft.bind(de),eb=de.finishDraft.bind(de),Dr=Tl;function ft(t){"@babel/helpers - typeof";return ft=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},ft(t)}function us(t,r){if(ft(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,r||"default");if(ft(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function fs(t){var r=us(t,"string");return ft(r)=="symbol"?r:r+""}function hs(t,r,o){return(r=fs(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ys(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 mn(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?ys(Object(o),!0).forEach(function(n){hs(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ys(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ae(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 gs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),bn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mr={INIT:"@@redux/INIT"+bn(),REPLACE:"@@redux/REPLACE"+bn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bn()}};function Il(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 xn(t,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(ae(1));return o(xn)(t,r)}if(typeof t!="function")throw new Error(ae(2));var a=t,s=r,l=[],d=l,p=!1;function u(){d===l&&(d=l.slice())}function h(){if(p)throw new Error(ae(3));return s}function y(C){if(typeof C!="function")throw new Error(ae(4));if(p)throw new Error(ae(5));var I=!0;return u(),d.push(C),function(){if(I){if(p)throw new Error(ae(6));I=!1,u();var L=d.indexOf(C);d.splice(L,1),l=null}}}function g(C){if(!Il(C))throw new Error(ae(7));if(typeof C.type>"u")throw new Error(ae(8));if(p)throw new Error(ae(9));try{p=!0,s=a(s,C)}finally{p=!1}for(var I=l=d,_=0;_<I.length;_++){var L=I[_];L()}return C}function O(C){if(typeof C!="function")throw new Error(ae(10));a=C,g({type:Mr.REPLACE})}function x(){var C,I=y;return C={subscribe:function(L){if(typeof L!="object"||L===null)throw new Error(ae(11));function F(){L.next&&L.next(h())}F();var M=I(F);return{unsubscribe:M}}},C[gs]=function(){return this},C}return g({type:Mr.INIT}),n={dispatch:g,subscribe:y,getState:h,replaceReducer:O},n[gs]=x,n}function _l(t){Object.keys(t).forEach(function(r){var o=t[r],n=o(void 0,{type:Mr.INIT});if(typeof n>"u")throw new Error(ae(12));if(typeof o(void 0,{type:Mr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ae(13))})}function ms(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),l,d;try{_l(o)}catch(p){d=p}return function(u,h){if(u===void 0&&(u={}),d)throw d;if(0)var y;for(var g=!1,O={},x=0;x<s.length;x++){var C=s[x],I=o[C],_=u[C],L=I(_,h);if(typeof L>"u"){var F=h&&h.type;throw new Error(ae(14))}O[C]=L,g=g||L!==_}return g=g||s.length!==Object.keys(u).length,g?O:u}}function Bt(){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 bs(){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(ae(15))},l={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=r.map(function(p){return p(l)});return s=Bt.apply(void 0,d)(a.dispatch),mn(mn({},a),{},{dispatch:s})}}}function xs(t){var r=function(n){var a=n.dispatch,s=n.getState;return function(l){return function(d){return typeof d=="function"?d(a,s,t):l(d)}}};return r}var vs=xs();vs.withExtraArgument=xs;var vn=vs;var As=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)}}(),Ll=function(t,r){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,l;return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(u){return function(h){return p([u,h])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(s=u[0]&2?a.return:u[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,u[1])).done)return s;switch(a=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,a=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(u[0]===6&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=r.call(t,o)}catch(h){u=[6,h],a=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ft=function(t,r){for(var o=0,n=r.length,a=t.length;o<n;o++,a++)t[a]=r[o];return t},Pl=Object.defineProperty,kl=Object.defineProperties,Dl=Object.getOwnPropertyDescriptors,Ss=Object.getOwnPropertySymbols,Ml=Object.prototype.hasOwnProperty,Ul=Object.prototype.propertyIsEnumerable,Os=function(t,r,o){return r in t?Pl(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},Ke=function(t,r){for(var o in r||(r={}))Ml.call(r,o)&&Os(t,o,r[o]);if(Ss)for(var n=0,a=Ss(r);n<a.length;n++){var o=a[n];Ul.call(r,o)&&Os(t,o,r[o])}return t},Sn=function(t,r){return kl(t,Dl(r))},Bl=function(t,r,o){return new Promise(function(n,a){var s=function(p){try{d(o.next(p))}catch(u){a(u)}},l=function(p){try{d(o.throw(p))}catch(u){a(u)}},d=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(s,l)};d((o=o.apply(t,r)).next())})};var Fl=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bt:Bt.apply(null,arguments)},bb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Hl(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 zl=function(t){As(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,Ft([void 0],o[0].concat(this)))):new(r.bind.apply(r,Ft([void 0],o.concat(this))))},r}(Array),Wl=function(t){As(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,Ft([void 0],o[0].concat(this)))):new(r.bind.apply(r,Ft([void 0],o.concat(this))))},r}(Array);function En(t){return Oe(t)?Dr(t,function(){}):t}function $l(t){return typeof t=="boolean"}function Gl(){return function(r){return jl(r)}}function jl(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,l=s===void 0?!0:s,d=new zl;if(o&&($l(o)?d.push(vn):d.push(vn.withExtraArgument(o.extraArgument))),0){if(a)var p;if(l)var u}return d}var On=!0;function ws(t){var r=Gl(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,s=o.middleware,l=s===void 0?r():s,d=o.devTools,p=d===void 0?!0:d,u=o.preloadedState,h=u===void 0?void 0:u,y=o.enhancers,g=y===void 0?void 0:y,O;if(typeof a=="function")O=a;else if(Hl(a))O=ms(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=l;if(typeof x=="function"&&(x=x(r),!On&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!On&&x.some(function(M){return typeof M!="function"}))throw new Error("each middleware provided to configureStore must be a function");var C=bs.apply(void 0,x),I=Bt;p&&(I=Fl(Ke({trace:!On},typeof p=="object"&&p)));var _=new Wl(C),L=_;Array.isArray(g)?L=Ft([C],g):typeof g=="function"&&(L=g(_));var F=I.apply(void 0,L);return xn(O,h,F)}function Ve(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 Ke(Ke({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 Rs(t){var r={},o=[],n,a={addCase:function(s,l){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]=l,a},addMatcher:function(s,l){return o.push({matcher:s,reducer:l}),a},addDefaultCase:function(s){return n=s,a}};return t(a),[r,o,n]}function Kl(t){return typeof t=="function"}function Vl(t,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?Rs(r):[r,o,n],s=a[0],l=a[1],d=a[2],p;if(Kl(t))p=function(){return En(t())};else{var u=En(t);p=function(){return u}}function h(y,g){y===void 0&&(y=p());var O=Ft([s[g.type]],l.filter(function(x){var C=x.matcher;return C(g)}).map(function(x){var C=x.reducer;return C}));return O.filter(function(x){return!!x}).length===0&&(O=[d]),O.reduce(function(x,C){if(C)if(Pe(x)){var I=x,_=C(I,g);return _===void 0?x:_}else{if(Oe(x))return Dr(x,function(L){return C(L,g)});var _=C(x,g);if(_===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return x},y)}return h.getInitialState=p,h}function Zl(t,r){return t+"/"+r}function Ns(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:En(t.initialState),n=t.reducers||{},a=Object.keys(n),s={},l={},d={};a.forEach(function(h){var y=n[h],g=Zl(r,h),O,x;"reducer"in y?(O=y.reducer,x=y.prepare):O=y,s[h]=O,l[g]=O,d[h]=x?Ve(g,x):Ve(g)});function p(){var h=typeof t.extraReducers=="function"?Rs(t.extraReducers):[t.extraReducers],y=h[0],g=y===void 0?{}:y,O=h[1],x=O===void 0?[]:O,C=h[2],I=C===void 0?void 0:C,_=Ke(Ke({},g),l);return Vl(o,function(L){for(var F in _)L.addCase(F,_[F]);for(var M=0,J=x;M<J.length;M++){var ge=J[M];L.addMatcher(ge.matcher,ge.reducer)}I&&L.addDefaultCase(I)})}var u;return{name:r,reducer:function(h,y){return u||(u=p()),u(h,y)},actions:d,caseReducers:s,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var ql="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Yl=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=ql[Math.random()*64|0];return r},Xl=["name","message","stack","code"],Cn=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Cs=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Ql=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,n=Xl;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(r[a]=t[a])}return r}return{message:String(t)}},Ob=function(){function t(r,o,n){var a=Ve(r+"/fulfilled",function(h,y,g,O){return{payload:h,meta:Sn(Ke({},O||{}),{arg:g,requestId:y,requestStatus:"fulfilled"})}}),s=Ve(r+"/pending",function(h,y,g){return{payload:void 0,meta:Sn(Ke({},g||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),l=Ve(r+"/rejected",function(h,y,g,O,x){return{payload:O,error:(n&&n.serializeError||Ql)(h||"Rejected"),meta:Sn(Ke({},x||{}),{arg:g,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,p=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 u(h){return function(y,g,O){var x=n?.idGenerator?n.idGenerator(h):Yl(),C=new p,I,_=!1;function L(M){I=M,C.abort()}var F=function(){return Bl(this,null,function(){var M,J,ge,Ze,ie,qe,yt;return Ll(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),Ze=(M=n?.condition)==null?void 0:M.call(n,h,{getState:g,extra:O}),ec(Ze)?[4,Ze]:[3,2];case 1:Ze=f.sent(),f.label=2;case 2:if(Ze===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=!0,ie=new Promise(function(m,w){return C.signal.addEventListener("abort",function(){return w({name:"AbortError",message:I||"Aborted"})})}),y(s(x,h,(J=n?.getPendingMeta)==null?void 0:J.call(n,{requestId:x,arg:h},{getState:g,extra:O}))),[4,Promise.race([ie,Promise.resolve(o(h,{dispatch:y,getState:g,extra:O,requestId:x,signal:C.signal,abort:L,rejectWithValue:function(m,w){return new Cn(m,w)},fulfillWithValue:function(m,w){return new Cs(m,w)}})).then(function(m){if(m instanceof Cn)throw m;return m instanceof Cs?a(m.payload,x,h,m.meta):a(m,x,h)})])];case 3:return ge=f.sent(),[3,5];case 4:return qe=f.sent(),ge=qe instanceof Cn?l(null,x,h,qe.payload,qe.meta):l(qe,x,h),[3,5];case 5:return yt=n&&!n.dispatchConditionRejection&&l.match(ge)&&ge.meta.condition,yt||y(ge),[2,ge]}})})}();return Object.assign(F,{abort:L,requestId:x,arg:h,unwrap:function(){return F.then(Jl)}})}}return Object.assign(u,{pending:s,rejected:l,fulfilled:a,typePrefix:r})}return t.withTypes=function(){return t},t}();function Jl(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ec(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Ts="listener",Is="completed",_s="cancelled",Cb="task-"+_s,Eb="task-"+Is,Ab=Ts+"-"+_s,wb=Ts+"-"+Is;var An="listenerMiddleware";var Rb=Ve(An+"/add"),Nb=Ve(An+"/removeAll"),Tb=Ve(An+"/remove");var Es,Ib=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Es||(Es=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},tc=function(t){return function(r){setTimeout(r,t)}},_b=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tc(10);cs();var rc=wr(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)}}}),Ur=class extends rc(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ls=class t extends Ur{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(_r(s))return s;if(a==null)return;let l=Ns({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=ws({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:l.reducer(p,u)});return window.ftReduxStores[a.name]=new t(l,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Rr;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,d)=>{let p=l,u=s[p];return u?(...h)=>{let y=u(...h.map(a));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[p]: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 Br=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,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!a)return l;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${l} ${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 Ps=b(N()),Fr=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},tx=(0,Ps.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=>Br.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Fr([(0,wn.property)({type:Boolean})],r.prototype,"useLongDateFormat",void 0),Fr([(0,wn.property)({type:Boolean})],r.prototype,"useDateTimeFormat",void 0),Fr([tn({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),Fr([tn({store:E.name})],r.prototype,"uiLocale",void 0),r});var Wr=b(N());var Hr=class extends le{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 zr=class extends le{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 oc="ft-user-assets",nc={setAssetCount:(t,r)=>{let{userAssetType:o,count:n}=r.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(he).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;Nn(t,o,[...Rn(t,o),a]),ks(t,o,1,n),Ds(t,a)},editAsset:(t,r)=>{let{assetType:o,asset:n}=r.payload;Nn(t,o,Rn(t,o).map(a=>a.id===n.id?n:a)),Ds(t,n)},removeAsset:(t,r)=>{let{assetType:o,mapId:n,assetId:a}=r.payload;Nn(t,o,Rn(t,o).filter(s=>s.id!==a)),ks(t,o,-1,n)}},Ms={[he.SEARCHES]:"savedSearches",[he.BOOKMARKS]:"bookmarks",[he.BOOKS]:void 0,[he.COLLECTIONS]:void 0},Rn=(t,r)=>{var o;let n=Ms[r];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Nn=(t,r,o)=>{let n=Ms[r];n&&(t[n]=o)},ks=(t,r,o,n)=>{let a=t.assetCounts.allAsset[r];if(a!==void 0&&(t.assetCounts.allAsset[r]=Math.max(0,a+o),r===he.BOOKMARKS&&n)){let s=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,s+o)}},Ds=(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)},pe=Wr.FtReduxStore.get({name:oc,reducers:nc,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(he).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Tn=class{constructor(r=new Hr,o=new zr){this.assetCountsService=r,this.assetLabelsService=o,this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new br,this.savedSearchesService=new Cr,E.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=E.getState();(0,Wr.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(),pe.actions.clearAssetCount(),pe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();pe.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let r=await this.assetLabelsService.getUserAssetLabels();pe.actions.assetLabels(r)}async loadAssetCount(r){let o=await this.assetCountsService.getUserAssetCount(r);o&&pe.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(r){let o=await this.assetCountsService.getUserBookmarkCountByMap(r);o&&pe.actions.setBookmarkCountByMap({count:o.count,mapId:r})}async reloadAssetCount(r){this.assetCountsService.clearCache();let o=Object.keys(pe.getState().assetCounts.bookmarkByMap).length!==0;r===he.BOOKMARKS&&o&&pe.actions.clearBookmarkCountByMap(),pe.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;pe.actions.bookmarks(o)}}},ac=new Tn;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ac);(0,Us.customElement)("ft-app-context")(z);var Fs=b(te());var In=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-]+$/)}},ht=new In;var ic=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Hs=Symbol("i18nAttributes"),rr=Symbol("i18nListAttributes"),zs=Symbol("i18nProperties"),$r=Symbol("i18nContexts"),tr=Symbol("i18nUnsubs"),jr=(0,Ht.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?vr:_t}i18n(s){let{context:l,key:d,message:p}=s,{custom:u,args:h,argsProvider:y}=s;if(l&&d){this.hasI18nContext(l)||this.addI18nContext(l,void 0,u);let g=h??(y?y(this):[]);return this.getI18nService(u).resolveMessage(l,d,...g)}return p}async awaitI18n(s){let{context:l,custom:d}=s;return l&&await this.getI18nService(d).prepareContext(l),this.i18n(s)}customI18n(s,l){if(ht.isI18nKey(s)){let[d,p]=s.split(".");return this.i18n({custom:!0,context:d,key:p,...l})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((l,d,p)=>s.has(d)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((l,d,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===s}),this.updateI18nProperties(l=>l.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var l,d;let p=this,u=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(l=this[Hs])===null||l===void 0||l.forEach((h,y)=>p[y]=u(h,y,p[y])),(d=this[rr])===null||d===void 0||d.forEach((h,y)=>{var g;return p[y]=(g=p[y])===null||g===void 0?void 0:g.map(O=>u(h,y,O))})}updateI18nProperties(s){var l;(l=this[zs])===null||l===void 0||l.forEach((d,p)=>{s(d,p)&&(this[p]=this.i18n(d))})}addI18nMessages(s,l,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,l,d)}addI18nContext(s,l,d){let p=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[$r].set(p,{isCustomContext:d}),this[tr].has(p)||this[tr].set(p,this.getI18nService(d).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(d).prepareContext(p,l)}hasI18nContext(s){return this[$r].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[$r].forEach((s,l)=>this.addI18nContext(l,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[tr].forEach(s=>s()),this[tr].clear()}}return r=$r,o=tr,ic([(0,Fs.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Bs=class extends jr(Ht.FtLitElement){},Gr=class extends jr(Ht.FtLitElementRedux){};var or=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;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--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Ce=class extends Gr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Kr.nothing:Kr.html`
737
737
  <span class="ft-i18n">
738
738
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
739
739
  </span>
@@ -797,23 +797,23 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
797
797
  <slot @slotchange=${this.updateOptionsFromSlot}
798
798
  @option-change=${this.updateOptionsFromSlot}
799
799
  ></slot>
800
- `}renderOption(e,o){var n;let i=this.selectedOption===e;return Y`
801
- <div class="${it({"ft-select--option":!0,"ft-select--option-selected":i,"ft-typography--body2":!0})}"
802
- part="option option-${(n=e.value)===null||n===void 0?void 0:n.replace(/[^\w-]/g,"")}"
800
+ `}renderOption(e,o){var n,i;let a=this.selectedOption===e;return Y`
801
+ <div class="${it({"ft-select--option":!0,"ft-select--option-selected":a,"ft-typography--body2":!0})}"
802
+ part="option option-${(i=(n=e.value)===null||n===void 0?void 0:n.toString())===null||i===void 0?void 0:i.replace(/[^\w-]/g,"")}"
803
803
  tabindex="0"
804
804
  aria-label="${e.label}"
805
805
  data-value="${e.value}"
806
806
  id="${"option-"+o}"
807
- @keydown=${s=>this.onOptionKeyDown(s,e)}
807
+ @keydown=${l=>this.onOptionKeyDown(l,e)}
808
808
  @click=${()=>this.selectOption(e)}>
809
- <ft-ripple ?primary=${i} ?activated=${i}></ft-ripple>
809
+ <ft-ripple ?primary=${a} ?activated=${a}></ft-ripple>
810
810
  <span>${e.label}</span>
811
811
  </div>
812
812
  `}willUpdate(e){super.willUpdate(e),e.has("options")&&(this.selectedOption=this.options.filter(o=>o.selected)[0]),e.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(e){var o,n;if(super.contentAvailableCallback(e),e.has("focusOptions")&&this.focusOptions&&((n=(o=this.selectedOptionElement)!==null&&o!==void 0?o:this.firstOption)===null||n===void 0||n.focus(),this.focusOptions=!1),e.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px";let i=["bottom","top"];Ri(this.mainPanel,this.optionsMenu,"bottom",i,"fixed",U.optionsHeight,0).then(({x:a,y:s})=>{this.optionsMenu.style.left=`${a}px`,this.optionsMenu.style.top=`${s}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(e){var o;e.stopPropagation();let n=(o=this.optionsSlot)===null||o===void 0?void 0:o.assignedElements().map(i=>i);n&&n.length>0&&(this.options=n)}onMainPanelKeyDown(e){switch(e.key){case" ":e.preventDefault(),e.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":e.preventDefault(),e.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(e){var o,n,i,a,s;let l;switch(e.key){case"Escape":this.optionsDisplayed=!1,(o=this.mainPanel)===null||o===void 0||o.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),l=(i=(n=this.focusedOption)===null||n===void 0?void 0:n.previousElementSibling)!==null&&i!==void 0?i:this.lastOption;break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),l=(s=(a=this.focusedOption)===null||a===void 0?void 0:a.nextElementSibling)!==null&&s!==void 0?s:this.firstOption;break;default:if(e.key.length!=1)break;this.isKeyAlphanumeric(e.key)&&(l=this.handleAlphanumericPress(e.key));break}l?.focus()}isKeyAlphanumeric(e){let o=e.charCodeAt(0);return o>47&&o<58||o>64&&o<91||o>96&&o<123}handleAlphanumericPress(e){var o,n;let i=new Date;i.getTime()-this.lastSearchInputDate.getTime()>t.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=e.toLowerCase();let a=this.options.find(l=>{var d;return((d=l.label)===null||d===void 0?void 0:d.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});if(a===void 0){this.lastSearchInputDate=i;return}let s=(n=(o=this.optionsMenu)===null||o===void 0?void 0:o.querySelector(`[data-value="${a.value}"]`))!==null&&n!==void 0?n:void 0;return this.lastSearchInputDate=i,s}onOptionKeyDown(e,o){var n;(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this.selectOption(o),this.optionsDisplayed=!1,(n=this.mainPanel)===null||n===void 0||n.focus())}getOptionId(e){if(!e)return;let o=this.options.findIndex(n=>de(n.value,e.value));if(o!==-1)return`option-${o}`}selectOption(e){var o,n;if(!de((o=this.selectedOption)===null||o===void 0?void 0:o.value,e.value)){this.selectedOption=e;for(let i of this.options)i.selected=i===e;this.dispatchEvent(new CustomEvent("change",{detail:(n=this.selectedOption)===null||n===void 0?void 0:n.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};Z.elementDefinitions={"ft-input-label":Le,"ft-typography":tt,"ft-ripple":te,"ft-icon":xe};Z.searchTimeoutMilliseconds=2e3;Z.styles=[fn,xt,zc];ee([C({type:String})],Z.prototype,"label",void 0);ee([C({type:String})],Z.prototype,"ariaLabel",void 0);ee([C({type:String})],Z.prototype,"helper",void 0);ee([C({type:Boolean})],Z.prototype,"outlined",void 0);ee([C({type:Boolean})],Z.prototype,"disabled",void 0);ee([C({type:Boolean})],Z.prototype,"error",void 0);ee([C({type:Boolean})],Z.prototype,"fixedMenuPosition",void 0);ee([C({type:Array})],Z.prototype,"options",void 0);ee([z()],Z.prototype,"selectedOption",void 0);ee([z()],Z.prototype,"optionsDisplayed",void 0);ee([z()],Z.prototype,"focusOptions",void 0);ee([z()],Z.prototype,"currentSearch",void 0);ee([z()],Z.prototype,"lastSearchInputDate",void 0);ee([fe(".ft-select")],Z.prototype,"container",void 0);ee([fe(".ft-select--options")],Z.prototype,"optionsMenu",void 0);ee([fe(".ft-select--input-panel")],Z.prototype,"mainPanel",void 0);ee([fe(".ft-select--option:first-child")],Z.prototype,"firstOption",void 0);ee([fe(".ft-select--option:focus")],Z.prototype,"focusedOption",void 0);ee([fe(".ft-select--option.ft-select--option-selected")],Z.prototype,"selectedOptionElement",void 0);ee([fe(".ft-select--option:last-child")],Z.prototype,"lastOption",void 0);ee([fe("slot:not([name])")],Z.prototype,"optionsSlot",void 0);re("ft-select")(Z);re("ft-select-option")(ze);var Wc=P`
813
813
  `;var Gc=P`
814
814
  `;var rf="ft-app-info",zt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};zt.eventName="authentication-change";var of={session:(t,e)=>{de(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>N.dispatchEvent(new zt(e.payload)),0))}},N=gt.get({name:rf,reducers:of,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 Wt=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=N.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=N.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var mn=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Wt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Wt.await()}};var ye=class extends mn{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Be,this.cache=e?i.commonCache:new Be}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 yn=class extends ye{async listMyBookmarks(){let e=N.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Ia=class{addCommand(e,o=!1){N.commands.add(e,o)}consumeCommand(e){return N.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ia;var jc,Ar=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},nf=Symbol("clearAfterUnitTest"),gn=class extends Oo(ye){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[jc]=()=>{this.defaultMessages={},this.cache=new Be,this.listeners={}},this.currentUiLocale=N.getState().uiLocale,N.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=N.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};de(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new Kr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(i){!(i instanceof at)&&o&&console.error(i)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ar({loadedContexts:e})),this.dispatchEvent(new Ar({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new Ar({loadedContexts:[e]})),this.dispatchEvent(new Ar({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>So(0).then(()=>n()).catch(()=>null)))}};jc=nf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends gn{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends gn{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Rr=window.FluidTopicsI18nService,bn=window.FluidTopicsCustomI18nService;var Pa=class{highlightHtml(e,o,n){Mi(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Pa;var xn=class extends ye{async listMySearches(){let{session:e}=N.getState();return sc(e,ne.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ka=class{isDate(e){var o,n,i,a;return(a=(i=((n=(o=N.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a;return Mt.format(e,(n=o?.locale)!==null&&n!==void 0?n:N.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new ka;var ro=class{static get(e,o){var n,i;let a=N.getState(),{lang:s,region:l}=(i=(n=a.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new fr(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,o??`${s}-${l}`)}};var Da=class{urlToSearchRequest(e){return ro.get().parse(e)}searchRequestToUrl(e){return ro.get().serialize(e)}};window.FluidTopicsUrlService=new Da;var Gt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Gt.eventName="change";var Ma=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))}},Vc=new Ma;var vn=class t extends Ve{static build(){return new t(window.history,Vc,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),de(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Gt(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,l])=>{let d=o(),u={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(i,[u,s,l]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Gt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Gt.eventName,e)}currentItem(){return Mr(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 Mr(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 Mr(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=vn.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 Kc=N;function Zc(t,e){var o;return Kc.getState().authenticationRequired&&!(!((o=Kc.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var ie=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},J=class extends V{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>Wt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Be,this.cleanSessionDebouncer=new _e,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Y`
815
815
  <slot></slot>
816
- `}connectedCallback(){super.connectedCallback(),N.addEventListener(zt.eventName,this.reloadConfiguration)}disconnectedCallback(){N.addEventListener(zt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,i,a,s,l,d;super.update(e),e.has("baseUrl")&&(N.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&N.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&N.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&N.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&N.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&N.actions.noCustom(this.noCustom),e.has("editorMode")&&N.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&N.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&N.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>Rr.addContext(u)),e.has("openExternalDocumentInNewTab")&&N.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&N.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&N.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(N.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),N.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),N.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&N.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&N.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",()=>Zc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};J.elementDefinitions={};J.styles=Gc;ie([C()],J.prototype,"baseUrl",void 0);ie([C()],J.prototype,"apiIntegrationIdentifier",void 0);ie([C()],J.prototype,"apiIntegrationAppVersion",void 0);ie([C()],J.prototype,"uiLocale",void 0);ie([Oe(null)],J.prototype,"availableUiLocales",void 0);ie([Oe(null)],J.prototype,"metadataConfiguration",void 0);ie([C({type:Boolean})],J.prototype,"editorMode",void 0);ie([C({type:Boolean})],J.prototype,"noCustom",void 0);ie([C({type:Boolean})],J.prototype,"openExternalDocumentInNewTab",void 0);ie([C({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],J.prototype,"noCustomComponent",void 0);ie([C({type:Boolean})],J.prototype,"withManualResources",void 0);ie([C({type:Boolean})],J.prototype,"navigatorOnline",void 0);ie([C({type:Boolean})],J.prototype,"forcedOffline",void 0);ie([C({type:Object})],J.prototype,"apiProvider",void 0);ie([C({type:Boolean})],J.prototype,"authenticationRequired",void 0);ie([Oe([])],J.prototype,"messageContexts",void 0);ie([Oe(void 0)],J.prototype,"session",void 0);ie([z()],J.prototype,"localesConfiguration",void 0);ie([z()],J.prototype,"availableContentLocales",void 0);var Sn=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Tw=oe(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(N)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>Mt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Sn([C({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Sn([C({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Sn([Xe({store:N.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Sn([Xe({store:N.name})],e.prototype,"uiLocale",void 0),e});var On=class extends ye{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=N.getState().session;return!!e?.sessionAuthenticated}};var En=class extends ye{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=N.getState().session;return!!e?.sessionAuthenticated}};var af="ft-user-assets",sf={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(Ce).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;Ba(t,o,[...Ua(t,o),i]),qc(t,o,1,n),Yc(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Ba(t,o,Ua(t,o).map(i=>i.id===n.id?n:i)),Yc(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;Ba(t,o,Ua(t,o).filter(a=>a.id!==i)),qc(t,o,-1,n)}},Xc={[Ce.SEARCHES]:"savedSearches",[Ce.BOOKMARKS]:"bookmarks",[Ce.BOOKS]:void 0,[Ce.COLLECTIONS]:void 0},Ua=(t,e)=>{var o;let n=Xc[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Ba=(t,e,o)=>{let n=Xc[e];n&&(t[n]=o)},qc=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===Ce.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},Yc=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},ve=gt.get({name:af,reducers:sf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Ce).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Fa=class{constructor(e=new On,o=new En){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=N.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new yn,this.savedSearchesService=new xn,N.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=N.getState();de((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(),ve.actions.clearAssetCount(),ve.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ve.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ve.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ve.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ve.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ve.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ve.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ve.getState().assetCounts.bookmarkByMap).length!==0;e===Ce.BOOKMARKS&&o&&ve.actions.clearBookmarkCountByMap(),ve.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;ve.actions.bookmarks(o)}}},lf=new Fa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=lf);re("ft-app-context")(J);var $a=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},jt=new $a;var cf=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Qc=Symbol("i18nAttributes"),no=Symbol("i18nListAttributes"),ed=Symbol("i18nProperties"),Cn=Symbol("i18nContexts"),oo=Symbol("i18nUnsubs"),An=oe(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?bn:Rr}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let m=h??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...m)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(jt.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,u=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Qc])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(l=this[no])===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=>u(h,f,b))})}updateI18nProperties(a){var s;(s=this[ed])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[Cn].set(d,{isCustomContext:l}),this[oo].has(d)||this[oo].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Cn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Cn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[oo].forEach(a=>a()),this[oo].clear()}}return e=Cn,o=oo,cf([C({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Jc=class extends An(V){},wn=class extends An(It){};var io=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},ke=class extends wn{constructor(){super(),this.editorMode=!1,this.addStore(N)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":F:Y`
816
+ `}connectedCallback(){super.connectedCallback(),N.addEventListener(zt.eventName,this.reloadConfiguration)}disconnectedCallback(){N.addEventListener(zt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,i,a,s,l,d;super.update(e),e.has("baseUrl")&&(N.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&N.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&N.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&N.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&N.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&N.actions.noCustom(this.noCustom),e.has("editorMode")&&N.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&N.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&N.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>Rr.addContext(u)),e.has("openExternalDocumentInNewTab")&&N.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&N.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&N.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(N.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),N.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),N.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&N.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&N.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",()=>Zc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};J.elementDefinitions={};J.styles=Gc;ie([C()],J.prototype,"baseUrl",void 0);ie([C()],J.prototype,"apiIntegrationIdentifier",void 0);ie([C()],J.prototype,"apiIntegrationAppVersion",void 0);ie([C()],J.prototype,"uiLocale",void 0);ie([Oe(null)],J.prototype,"availableUiLocales",void 0);ie([Oe(null)],J.prototype,"metadataConfiguration",void 0);ie([C({type:Boolean})],J.prototype,"editorMode",void 0);ie([C({type:Boolean})],J.prototype,"noCustom",void 0);ie([C({type:Boolean})],J.prototype,"openExternalDocumentInNewTab",void 0);ie([C({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],J.prototype,"noCustomComponent",void 0);ie([C({type:Boolean})],J.prototype,"withManualResources",void 0);ie([C({type:Boolean})],J.prototype,"navigatorOnline",void 0);ie([C({type:Boolean})],J.prototype,"forcedOffline",void 0);ie([C({type:Object})],J.prototype,"apiProvider",void 0);ie([C({type:Boolean})],J.prototype,"authenticationRequired",void 0);ie([Oe([])],J.prototype,"messageContexts",void 0);ie([Oe(void 0)],J.prototype,"session",void 0);ie([z()],J.prototype,"localesConfiguration",void 0);ie([z()],J.prototype,"availableContentLocales",void 0);var Sn=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Tw=oe(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(N)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>Mt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Sn([C({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Sn([C({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Sn([Xe({store:N.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Sn([Xe({store:N.name})],e.prototype,"uiLocale",void 0),e});var On=class extends ye{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=N.getState().session;return!!e?.sessionAuthenticated}};var En=class extends ye{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=N.getState().session;return!!e?.sessionAuthenticated}};var af="ft-user-assets",sf={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(Ce).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;Ba(t,o,[...Ua(t,o),i]),qc(t,o,1,n),Yc(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Ba(t,o,Ua(t,o).map(i=>i.id===n.id?n:i)),Yc(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;Ba(t,o,Ua(t,o).filter(a=>a.id!==i)),qc(t,o,-1,n)}},Xc={[Ce.SEARCHES]:"savedSearches",[Ce.BOOKMARKS]:"bookmarks",[Ce.BOOKS]:void 0,[Ce.COLLECTIONS]:void 0},Ua=(t,e)=>{var o;let n=Xc[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Ba=(t,e,o)=>{let n=Xc[e];n&&(t[n]=o)},qc=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===Ce.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},Yc=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},ve=gt.get({name:af,reducers:sf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Ce).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Fa=class{constructor(e=new On,o=new En){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=N.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new yn,this.savedSearchesService=new xn,N.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=N.getState();de((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(),ve.actions.clearAssetCount(),ve.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ve.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ve.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ve.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ve.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ve.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ve.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ve.getState().assetCounts.bookmarkByMap).length!==0;e===Ce.BOOKMARKS&&o&&ve.actions.clearBookmarkCountByMap(),ve.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;ve.actions.bookmarks(o)}}},lf=new Fa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=lf);re("ft-app-context")(J);var $a=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},jt=new $a;var cf=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Qc=Symbol("i18nAttributes"),no=Symbol("i18nListAttributes"),ed=Symbol("i18nProperties"),Cn=Symbol("i18nContexts"),oo=Symbol("i18nUnsubs"),An=oe(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?bn:Rr}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let m=h??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...m)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(jt.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,u=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Qc])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(l=this[no])===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=>u(h,f,b))})}updateI18nProperties(a){var s;(s=this[ed])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[Cn].set(d,{isCustomContext:l}),this[oo].has(d)||this[oo].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Cn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Cn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[oo].forEach(a=>a()),this[oo].clear()}}return e=Cn,o=oo,cf([C({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Jc=class extends An(V){},wn=class extends An(It){};var io=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},ke=class extends wn{constructor(){super(),this.editorMode=!1,this.addStore(N)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":F:Y`
817
817
  <span class="ft-i18n">
818
818
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
819
819
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-sort-selector",
3
- "version": "1.3.46",
3
+ "version": "1.3.47",
4
4
  "description": "Sort selector component for fluid-topics search pages",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-search-context": "1.3.46",
23
- "@fluid-topics/ft-wc-utils": "1.3.46",
22
+ "@fluid-topics/ft-search-context": "1.3.47",
23
+ "@fluid-topics/ft-wc-utils": "1.3.47",
24
24
  "@fluid-topics/public-api": "1.0.110",
25
25
  "lit": "3.1.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@fluid-topics/ft-wc-test-utils": "1.3.46"
28
+ "@fluid-topics/ft-wc-test-utils": "1.3.47"
29
29
  },
30
- "gitHead": "d6cf25d6ed0dead8c7aff4f94a493c35d12f1392"
30
+ "gitHead": "16ac56d62f3a88a3b03cbc92bcd04dd91951a015"
31
31
  }