@fluid-topics/ft-search-bar 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.
|
@@ -1200,7 +1200,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
1200
1200
|
unbounded>
|
|
1201
1201
|
</ft-ripple>
|
|
1202
1202
|
<div class="ft-checkbox--box" part="checkbox-box">
|
|
1203
|
-
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24" part="checkbox-check">
|
|
1203
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24" part="checkbox-check" aria-hidden="true">
|
|
1204
1204
|
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
1205
1205
|
d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
1206
1206
|
</svg>
|
|
@@ -1538,7 +1538,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
1538
1538
|
`;var Mo=f(w());var Wp=f(w());var Kd=f(k()),Ue=f(ee()),Bt=f(w());var id=f(k());var nd=id.css`
|
|
1539
1539
|
`;var Vi=f(w()),wf="ft-app-info",Qr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Qr.eventName="authentication-change";var Ef={session:(t,e)=>{(0,Vi.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>I.dispatchEvent(new Qr(e.payload)),0))}},I=Vi.FtReduxStore.get({name:wf,reducers:Ef,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 Pa=f(w());var Jr=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:i}=I.getState(),n=e??i;if(o&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,n,!0)}static await(e){return new Promise(o=>{let i=t.get(e);if(i)o(i);else{let n=I.subscribe(()=>{i=t.get(e),i&&(n(),o(i))})}})}};var Gi=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Jr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Jr.await()}};var ht=class extends Gi{constructor(e=!0,o){var i;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[p])=>c.localeCompare(p)));let n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new Pa.CacheRegistry,this.cache=e?n.commonCache:new Pa.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,i)=>0|31*o+i.charCodeAt(0),0))}};var ji=class extends ht{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Ba=class{addCommand(e,o=!1){I.commands.add(e,o)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ba;var Et=f(w());var ad,ko=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Af=Symbol("clearAfterUnitTest"),Ki=class extends(0,Et.withEventBus)(ht){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ad]=()=>{this.defaultMessages={},this.cache=new Et.CacheRegistry,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.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 i;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let n={...(i=this.defaultMessages[e])!==null&&i!==void 0?i:{},...o};(0,Et.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,i;return this.fetchContext(e),(i=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&i!==void 0?i:{}}resolveRawMessage(e,o){let i=e.toLowerCase();return this.resolveContext(i)[o]}resolveMessage(e,o,...i){var n;let a=e.toLowerCase(),s=this.resolveContext(a);return new Et.ParametrizedLabelResolver((n=this.defaultMessages[a])!==null&&n!==void 0?n:{},s).resolve(o,...i)}async fetchContext(e){let o=!this.cache.has(e),i;try{i=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(n){!(n instanceof Et.CanceledPromiseError)&&o&&console.error(n)}return i}subscribe(e,o){var i;return e=e.toLowerCase(),this.listeners[e]=(i=this.listeners[e])!==null&&i!==void 0?i:new Set,this.listeners[e].add(o),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new ko({loadedContexts:e})),this.dispatchEvent(new ko({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new ko({loadedContexts:[e]})),this.dispatchEvent(new ko({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,Et.delay)(0).then(()=>i()).catch(()=>null)))}};ad=Af;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ki{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ki{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var di=window.FluidTopicsI18nService,Da=window.FluidTopicsCustomI18nService;var sd=f(w()),Fa=class{highlightHtml(e,o,i){(0,sd.highlightHtml)(e,o,i)}};window.FluidTopicsHighlightHtmlService=new Fa;var Lf=f(cd(),1);var dd;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(dd||(dd={}));var pd;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(pd||(pd={}));var ud;(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"})(ud||(ud={}));var fd;(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"})(fd||(fd={}));var hd;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(hd||(hd={}));var yd;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(yd||(yd={}));var md;(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"})(md||(md={}));var gd;(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"})(gd||(gd={}));var bd;(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"})(bd||(bd={}));var xd;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(xd||(xd={}));var vd;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(vd||(vd={}));var Sd;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Sd||(Sd={}));var Od;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Od||(Od={}));var Cd;(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"})(Cd||(Cd={}));var wd;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(wd||(wd={}));var Ed;(function(t){t.ASC="ASC",t.DESC="DESC"})(Ed||(Ed={}));var Ad;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Ad||(Ad={}));var Rd;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Rd||(Rd={}));var Ld;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Ld||(Ld={}));var Id;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Id||(Id={}));var kd;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(kd||(kd={}));var Td;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Td||(Td={}));var $d;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})($d||($d={}));var Nd;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Nd||(Nd={}));var _d;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(_d||(_d={}));var ke;(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"})(ke||(ke={}));var At;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(At||(At={}));var Pd;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Pd||(Pd={}));var Bd;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Bd||(Bd={}));var Dd;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(Dd||(Dd={}));var Fd;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Fd||(Fd={}));var Md;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Md||(Md={}));var Rf={[ke.PERSONAL_BOOK_SHARE_USER]:[ke.PERSONAL_BOOK_USER],[ke.HTML_EXPORT_USER]:[ke.PERSONAL_BOOK_USER],[ke.PDF_EXPORT_USER]:[ke.PERSONAL_BOOK_USER],[ke.KHUB_ADMIN]:[ke.CONTENT_PUBLISHER],[ke.ADMIN]:[ke.KHUB_ADMIN,ke.USERS_ADMIN,ke.PORTAL_ADMIN],[ke.GENERATIVE_AI_EXPORT_USER]:[ke.GENERATIVE_AI_USER]};function zd(t,e){return t===e||(Rf[t]??[]).some(o=>zd(o,e))}function Ud(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(i=>zd(i,e))}var Yi=class extends ht{async listMySearches(){let{session:e}=I.getState();return Ud(e,ke.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Hd=f(w());var Ma=class{isDate(e){var o,i,n,a;return(a=(n=((i=(o=I.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&i!==void 0?i:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,o){var i,n,a;return Hd.DateFormatter.format(e,(i=o?.locale)!==null&&i!==void 0?i:I.getState().uiLocale,(n=o?.longFormat)!==null&&n!==void 0?n:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Ma;var Wd=f(w());var pi=class{static get(e,o){var i,n;let a=I.getState(),{lang:s,region:c}=(n=(i=a.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&n!==void 0?n:{lang:"en",region:"US"};return new Wd.SearchPlaceConverter(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,o??`${s}-${c}`)}};var za=class{urlToSearchRequest(e){return pi.get().parse(e)}searchRequestToUrl(e){return pi.get().serialize(e)}};window.FluidTopicsUrlService=new za;var Ir=f(w());var eo=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};eo.eventName="change";var Ua=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))}},Vd=new Ua;var Xi=class t extends Ir.WithEventBus{static build(){return new t(window.history,Vd,()=>window.location,!1)}constructor(e,o,i,n){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=i,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(n)}setCurrentState(e,o=!1){let i=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,i&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Ir.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new eo(this.currentItem())),0)}installProxies(){let e=o=>(i,n,[a,s,c])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};i.apply(n,[u,s,c]),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 i={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(i)}addHistoryChangeListener(e){this.addEventListener(eo.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(eo.eventName,e)}currentItem(){return(0,Ir.deepCopy)(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(0,Ir.deepCopy)(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(0,Ir.deepCopy)(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 i=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!i)return e;let n=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,i);)this.hasState(a)&&(n=a),a++;return n}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 i;if(!this.hasState(e))return!1;let n=o??this.currentState.majorStateId,a=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return a==null||a!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Xi.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 Gd=I;function jd(t,e){var o;return Gd.getState().authenticationRequired&&!(!((o=Gd.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var Te=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},pe=class extends Bt.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=()=>Jr.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Bt.CacheRegistry,this.cleanSessionDebouncer=new Bt.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Kd.html`
|
|
1540
1540
|
<slot></slot>
|
|
1541
|
-
`}connectedCallback(){super.connectedCallback(),I.addEventListener(Qr.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(Qr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,i,n,a,s,c,p;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>di.addContext(u)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),I.actions.availableUiLocales((n=(i=this.localesConfiguration)===null||i===void 0?void 0:i.availableUiLocales)!==null&&n!==void 0?n:[]),I.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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",()=>jd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};pe.elementDefinitions={};pe.styles=nd;Te([(0,Ue.property)()],pe.prototype,"baseUrl",void 0);Te([(0,Ue.property)()],pe.prototype,"apiIntegrationIdentifier",void 0);Te([(0,Ue.property)()],pe.prototype,"apiIntegrationAppVersion",void 0);Te([(0,Ue.property)()],pe.prototype,"uiLocale",void 0);Te([(0,Bt.jsonProperty)(null)],pe.prototype,"availableUiLocales",void 0);Te([(0,Bt.jsonProperty)(null)],pe.prototype,"metadataConfiguration",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"editorMode",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"noCustom",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"openExternalDocumentInNewTab",void 0);Te([(0,Ue.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],pe.prototype,"noCustomComponent",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"withManualResources",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"navigatorOnline",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"forcedOffline",void 0);Te([(0,Ue.property)({type:Object})],pe.prototype,"apiProvider",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"authenticationRequired",void 0);Te([(0,Bt.jsonProperty)([])],pe.prototype,"messageContexts",void 0);Te([(0,Bt.jsonProperty)(void 0)],pe.prototype,"session",void 0);Te([(0,Ue.state)()],pe.prototype,"localesConfiguration",void 0);Te([(0,Ue.state)()],pe.prototype,"availableContentLocales",void 0);var us=f(ee());function If(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let o,i,n;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(i=o;i--!==0;)if(!Qi(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!Qi(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let a=s=>Object.keys(s).filter(c=>s[c]!=null);if(n=a(t),o=n.length,o!==a(e).length)return!1;for(i=o;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[i]))return!1;for(i=o;i--!==0;){let s=n[i];if(!Qi(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Qi(t,e){try{return If(t,e)}catch{return!1}}function ui(t,e){return!Qi(t,e)}function Ji(t,e){let o=i=>i[t]===!0;return i=>{if(o(i))return i;let n=e(i);return n[t]=!0,n}}var Zd=f(ee(),1);var Ha=t=>{let e=t??{};return(o,i)=>{var n;let a={hasChanged:ui,attribute:!1,...e};(0,Zd.property)(a)(o,i);let s=o.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(i,{selector:(n=e.selector)!==null&&n!==void 0?n:c=>c[i],store:e.store})}};var en=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(i=>i.type===e);return o&&(this.queue=this.queue.filter(i=>i!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};var to=f(ee(),1);var qd=f(ee(),1);function Yd(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,qd.property)({type:Object,converter:{fromAttribute:i=>{if(i==null)return o();try{return JSON.parse(i)}catch{return o()}},toAttribute:i=>JSON.stringify(i)},hasChanged:ui,...e??{}})}var tn=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,o){return this.callbacks=[e],this.debounce(o)}queue(e,o){return this.callbacks.push(e),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((o,i)=>{this.resolvePromise=o,this.rejectPromise=i})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,o;let i=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let s of i)try{await s()}catch(c){n(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Qd=f(k(),1);var rn=globalThis,kf=rn.ShadowRoot&&(rn.ShadyCSS===void 0||rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,IC=Symbol();var Xd=(t,e)=>{if(kf)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let i=document.createElement("style"),n=rn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=o.cssText,t.appendChild(i)}};var on=class extends Qd.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([n,a])=>e.registry.define(n,a)));let o={...e.shadowRootOptions,customElements:e.registry},i=this.renderOptions.creationScope=this.attachShadow(o);return Xd(i,e.elementStyles),i}};function Jd(t,e,...o){var i;let n=t.querySelector(e);for(let a of o)n=(i=n?.shadowRoot)===null||i===void 0?void 0:i.querySelector(a);return n}var No=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},op,ep=Symbol("constructorPrototype"),tp=Symbol("constructorName"),ip=Symbol("exportpartsDebouncer"),rp=Symbol("dynamicDependenciesLoaded"),$o=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};$o.eventName="exportparts-updated";var Qt=class extends on{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[op]=new tn(5),this.scheduleExportpartsUpdate=()=>{var e,o,i;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(i=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&i!==void 0&&i)&&this[ip].run(()=>{var n,a;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[tp]=this.constructor.name,this[ep]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[tp]&&Object.setPrototypeOf(this,this[ep])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(i){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",i)}let o=this.constructor;o[rp]||(o[rp]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener($o.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener($o.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new $o)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:i,shadowPath:n}=this.elementToFocus;if(i!=null){let a=[...n??[],i];o=Jd(this.shadowRoot,...a)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,i,n;if(((i=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&i!==void 0?i:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}setExportpartsAttribute(e){var o,i,n,a,s,c;let p=b=>b!=null&&b.trim().length>0,u=e.filter(p).map(b=>b.trim());if(u.length===0){this.exportparts=void 0;return}let m=new Set;for(let b of(i=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let O=(a=(n=b.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],v=(c=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map($=>$.split(":")[1]))!==null&&c!==void 0?c:[],E=[...O,...v].filter(p).map($=>$.trim());for(let $ of E)m.add($)}if(m.size===0){this.exportparts=void 0;return}let y=[...m.values()].flatMap(b=>u.map(O=>`${b}:${O}--${b}`));this.exportparts=[...this.part,...y].join(", ")}};op=ip;No([(0,to.property)()],Qt.prototype,"exportpartsPrefix",void 0);No([Yd([])],Qt.prototype,"exportpartsPrefixes",void 0);No([(0,to.property)({reflect:!0})],Qt.prototype,"exportparts",void 0);No([(0,to.property)()],Qt.prototype,"customStylesheet",void 0);No([(0,to.property)()],Qt.prototype,"elementToFocus",void 0);No([(0,to.state)()],Qt.prototype,"useAdoptedStyleSheets",void 0);function nn(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var fi=Symbol("internalReduxEventsUnsubscribers"),kr=Symbol("internalStoresUnsubscribers"),ro=Symbol("internalStores"),Tf=Ji(Symbol("withRedux"),function(t){var e,o,i;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[i]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[ro].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ro].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[ro].get(s)}addStore(s,c){var p;c=(p=c??s.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[ro].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[ro].delete(c)}setupStores(){this.unsubscribeFromStores(),this[ro].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(s.store);u&&(s.store?this[kr].has(s.store):this[kr].size>0)&&(this[c]=s.selector(u.getState(),this))}})}subscribeToStore(s,c){var p;this[kr].set(s,c.subscribe(()=>this.updateFromStores())),this[fi].set(s,[]),nn(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,m)=>{if(typeof this[m]=="function"&&(!u.store||c.name===u.store)){let y=b=>this[m](b);c.addEventListener(u.eventName,y),this[fi].get(s).push(()=>c.removeEventListener(u.eventName,y))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[kr].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[kr].has(s)&&this[kr].get(s)(),this[kr].delete(s),(c=this[fi].get(s))===null||c===void 0||c.forEach(p=>p()),this[fi].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=kr,o=ro,i=fi,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),np=class extends Tf(Qt){};function Rt(t){for(var e=arguments.length,o=Array(e>1?e-1:0),i=1;i<e;i++)o[i-1]=arguments[i];if(0)var n,a;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function fr(t){return!!t&&!!t[me]}function Dt(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var i=Object.getPrototypeOf(o);if(i===null)return!0;var n=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===Mf}(t)||Array.isArray(t)||!!t[up]||!!(!((e=t.constructor)===null||e===void 0)&&e[up])||Xa(t)||Qa(t))}function oo(t,e,o){o===void 0&&(o=!1),Bo(t)===0?(o?Object.keys:Po)(t).forEach(function(i){o&&typeof i=="symbol"||e(i,t[i],t)}):t.forEach(function(i,n){return e(n,i,t)})}function Bo(t){var e=t[me];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Xa(t)?2:Qa(t)?3:0}function _o(t,e){return Bo(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function $f(t,e){return Bo(t)===2?t.get(e):t[e]}function fp(t,e,o){var i=Bo(t);i===2?t.set(e,o):i===3?t.add(o):t[e]=o}function hp(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Xa(t){return Df&&t instanceof Map}function Qa(t){return Ff&&t instanceof Set}function Tr(t){return t.o||t.t}function Ja(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=gp(t);delete e[me];for(var o=Po(e),i=0;i<o.length;i++){var n=o[i],a=e[n];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[n]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function es(t,e){return e===void 0&&(e=!1),ts(t)||fr(t)||!Dt(t)||(Bo(t)>1&&(t.set=t.add=t.clear=t.delete=Nf),Object.freeze(t),e&&oo(t,function(o,i){return es(i,!0)},!0)),t}function Nf(){Rt(2)}function ts(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Jt(t){var e=Ya[t];return e||Rt(18,t),e}function _f(t,e){Ya[t]||(Ya[t]=e)}function Ka(){return yi}function Wa(t,e){e&&(Jt("Patches"),t.u=[],t.s=[],t.v=e)}function an(t){Za(t),t.p.forEach(Pf),t.p=null}function Za(t){t===yi&&(yi=t.l)}function ap(t){return yi={p:[],l:yi,h:t,m:!0,_:0}}function Pf(t){var e=t[me];e.i===0||e.i===1?e.j():e.g=!0}function Va(t,e){e._=e.p.length;var o=e.p[0],i=t!==void 0&&t!==o;return e.h.O||Jt("ES5").S(e,t,i),i?(o[me].P&&(an(e),Rt(4)),Dt(t)&&(t=sn(e,t),e.l||ln(e,t)),e.u&&Jt("Patches").M(o[me].t,t,e.u,e.s)):t=sn(e,o,[]),an(e),e.u&&e.v(e.u,e.s),t!==mp?t:void 0}function sn(t,e,o){if(ts(e))return e;var i=e[me];if(!i)return oo(e,function(c,p){return sp(t,i,e,c,p,o)},!0),e;if(i.A!==t)return e;if(!i.P)return ln(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=Ja(i.k):i.o,a=n,s=!1;i.i===3&&(a=new Set(n),n.clear(),s=!0),oo(a,function(c,p){return sp(t,i,n,c,p,o,s)}),ln(t,n,!1),o&&t.u&&Jt("Patches").N(i,o,t.u,t.s)}return i.o}function sp(t,e,o,i,n,a,s){if(fr(n)){var c=sn(t,n,a&&e&&e.i!==3&&!_o(e.R,i)?a.concat(i):void 0);if(fp(o,i,c),!fr(c))return;t.m=!1}else s&&o.add(n);if(Dt(n)&&!ts(n)){if(!t.h.D&&t._<1)return;sn(t,n),e&&e.A.l||ln(t,n)}}function ln(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&es(e,o)}function Ga(t,e){var o=t[me];return(o?Tr(o):t)[e]}function lp(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var i=Object.getOwnPropertyDescriptor(o,e);if(i)return i;o=Object.getPrototypeOf(o)}}function $r(t){t.P||(t.P=!0,t.l&&$r(t.l))}function ja(t){t.o||(t.o=Ja(t.t))}function qa(t,e,o){var i=Xa(e)?Jt("MapSet").F(e,o):Qa(e)?Jt("MapSet").T(e,o):t.O?function(n,a){var s=Array.isArray(n),c={i:s?1:0,A:a?a.A:Ka(),P:!1,I:!1,R:{},l:a,t:n,k:null,o:null,j:null,C:!1},p=c,u=mi;s&&(p=[c],u=hi);var m=Proxy.revocable(p,u),y=m.revoke,b=m.proxy;return c.k=b,c.j=y,b}(e,o):Jt("ES5").J(e,o);return(o?o.A:Ka()).p.push(i),i}function Bf(t){return fr(t)||Rt(22,t),function e(o){if(!Dt(o))return o;var i,n=o[me],a=Bo(o);if(n){if(!n.P&&(n.i<4||!Jt("ES5").K(n)))return n.t;n.I=!0,i=cp(o,a),n.I=!1}else i=cp(o,a);return oo(i,function(s,c){n&&$f(n.t,s)===c||fp(i,s,e(c))}),a===3?new Set(i):i}(t)}function cp(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ja(t)}function yp(){function t(s,c){var p=a[s];return p?p.enumerable=c:a[s]=p={configurable:!0,enumerable:c,get:function(){var u=this[me];return mi.get(u,s)},set:function(u){var m=this[me];mi.set(m,s,u)}},p}function e(s){for(var c=s.length-1;c>=0;c--){var p=s[c][me];if(!p.P)switch(p.i){case 5:i(p)&&$r(p);break;case 4:o(p)&&$r(p)}}}function o(s){for(var c=s.t,p=s.k,u=Po(p),m=u.length-1;m>=0;m--){var y=u[m];if(y!==me){var b=c[y];if(b===void 0&&!_o(c,y))return!0;var O=p[y],v=O&&O[me];if(v?v.t!==b:!hp(O,b))return!0}}var E=!!c[me];return u.length!==Po(c).length+(E?0:1)}function i(s){var c=s.k;if(c.length!==s.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function n(s){s.g&&Rt(3,JSON.stringify(Tr(s)))}var a={};_f("ES5",{J:function(s,c){var p=Array.isArray(s),u=function(y,b){if(y){for(var O=Array(b.length),v=0;v<b.length;v++)Object.defineProperty(O,""+v,t(v,!0));return O}var E=gp(b);delete E[me];for(var $=Po(E),T=0;T<$.length;T++){var N=$[T];E[N]=t(N,y||!!E[N].enumerable)}return Object.create(Object.getPrototypeOf(b),E)}(p,s),m={i:p?5:4,A:c?c.A:Ka(),P:!1,I:!1,R:{},l:c,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,me,{value:m,writable:!0}),u},S:function(s,c,p){p?fr(c)&&c[me].A===s&&e(s.p):(s.u&&function u(m){if(m&&typeof m=="object"){var y=m[me];if(y){var b=y.t,O=y.k,v=y.R,E=y.i;if(E===4)oo(O,function(Z){Z!==me&&(b[Z]!==void 0||_o(b,Z)?v[Z]||u(O[Z]):(v[Z]=!0,$r(y)))}),oo(b,function(Z){O[Z]!==void 0||_o(O,Z)||(v[Z]=!1,$r(y))});else if(E===5){if(i(y)&&($r(y),v.length=!0),O.length<b.length)for(var $=O.length;$<b.length;$++)v[$]=!1;else for(var T=b.length;T<O.length;T++)v[T]=!0;for(var N=Math.min(O.length,b.length),z=0;z<N;z++)O.hasOwnProperty(z)||(v[z]=!0),v[z]===void 0&&u(O[z])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):i(s)}})}var dp,yi,rs=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Df=typeof Map<"u",Ff=typeof Set<"u",pp=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",mp=rs?Symbol.for("immer-nothing"):((dp={})["immer-nothing"]=!0,dp),up=rs?Symbol.for("immer-draftable"):"__$immer_draftable",me=rs?Symbol.for("immer-state"):"__$immer_state";var Mf=""+Object.prototype.constructor,Po=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,gp=Object.getOwnPropertyDescriptors||function(t){var e={};return Po(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},Ya={},mi={get:function(t,e){if(e===me)return t;var o=Tr(t);if(!_o(o,e))return function(n,a,s){var c,p=lp(a,s);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(n.k):void 0}(t,o,e);var i=o[e];return t.I||!Dt(i)?i:i===Ga(t.t,e)?(ja(t),t.o[e]=qa(t.A.h,i,t)):i},has:function(t,e){return e in Tr(t)},ownKeys:function(t){return Reflect.ownKeys(Tr(t))},set:function(t,e,o){var i=lp(Tr(t),e);if(i?.set)return i.set.call(t.k,o),!0;if(!t.P){var n=Ga(Tr(t),e),a=n?.[me];if(a&&a.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(hp(o,n)&&(o!==void 0||_o(t.t,e)))return!0;ja(t),$r(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return Ga(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,ja(t),$r(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=Tr(t),i=Reflect.getOwnPropertyDescriptor(o,e);return i&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:i.enumerable,value:o[e]}},defineProperty:function(){Rt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Rt(12)}},hi={};oo(mi,function(t,e){hi[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),hi.deleteProperty=function(t,e){return hi.set.call(this,t,e,void 0)},hi.set=function(t,e,o){return mi.set.call(this,t[0],e,o,t[0])};var zf=function(){function t(o){var i=this;this.O=pp,this.D=!0,this.produce=function(n,a,s){if(typeof n=="function"&&typeof a!="function"){var c=a;a=n;var p=i;return function(E){var $=this;E===void 0&&(E=c);for(var T=arguments.length,N=Array(T>1?T-1:0),z=1;z<T;z++)N[z-1]=arguments[z];return p.produce(E,function(Z){var X;return(X=a).call.apply(X,[$,Z].concat(N))})}}var u;if(typeof a!="function"&&Rt(6),s!==void 0&&typeof s!="function"&&Rt(7),Dt(n)){var m=ap(i),y=qa(i,n,void 0),b=!0;try{u=a(y),b=!1}finally{b?an(m):Za(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(E){return Wa(m,s),Va(E,m)},function(E){throw an(m),E}):(Wa(m,s),Va(u,m))}if(!n||typeof n!="object"){if((u=a(n))===void 0&&(u=n),u===mp&&(u=void 0),i.D&&es(u,!0),s){var O=[],v=[];Jt("Patches").M(n,u,O,v),s(O,v)}return u}Rt(21,n)},this.produceWithPatches=function(n,a){if(typeof n=="function")return function(u){for(var m=arguments.length,y=Array(m>1?m-1:0),b=1;b<m;b++)y[b-1]=arguments[b];return i.produceWithPatches(u,function(O){return n.apply(void 0,[O].concat(y))})};var s,c,p=i.produce(n,a,function(u,m){s=u,c=m});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,s,c]}):[p,s,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){Dt(o)||Rt(8),fr(o)&&(o=Bf(o));var i=ap(this),n=qa(this,o,void 0);return n[me].C=!0,Za(i),n},e.finishDraft=function(o,i){var n=o&&o[me],a=n.A;return Wa(a,i),Va(void 0,a)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!pp&&Rt(20),this.O=o},e.applyPatches=function(o,i){var n;for(n=i.length-1;n>=0;n--){var a=i[n];if(a.path.length===0&&a.op==="replace"){o=a.value;break}}n>-1&&(i=i.slice(n+1));var s=Jt("Patches").$;return fr(o)?s(o,i):this.produce(o,function(c){return s(c,i)})},t}(),yt=new zf,Uf=yt.produce,VC=yt.produceWithPatches.bind(yt),GC=yt.setAutoFreeze.bind(yt),jC=yt.setUseProxies.bind(yt),KC=yt.applyPatches.bind(yt),ZC=yt.createDraft.bind(yt),qC=yt.finishDraft.bind(yt),cn=Uf;function io(t){"@babel/helpers - typeof";return io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},io(t)}function bp(t,e){if(io(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var i=o.call(t,e||"default");if(io(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xp(t){var e=bp(t,"string");return io(e)=="symbol"?e:e+""}function vp(t,e,o){return(e=xp(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Sp(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),o.push.apply(o,i)}return o}function os(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Sp(Object(o),!0).forEach(function(i){vp(t,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Sp(Object(o)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(o,i))})}return t}function Ke(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 Op=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),is=function(){return Math.random().toString(36).substring(7).split("").join(".")},dn={INIT:"@@redux/INIT"+is(),REPLACE:"@@redux/REPLACE"+is(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+is()}};function Hf(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ns(t,e,o){var i;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(Ke(1));return o(ns)(t,e)}if(typeof t!="function")throw new Error(Ke(2));var n=t,a=e,s=[],c=s,p=!1;function u(){c===s&&(c=s.slice())}function m(){if(p)throw new Error(Ke(3));return a}function y(E){if(typeof E!="function")throw new Error(Ke(4));if(p)throw new Error(Ke(5));var $=!0;return u(),c.push(E),function(){if($){if(p)throw new Error(Ke(6));$=!1,u();var N=c.indexOf(E);c.splice(N,1),s=null}}}function b(E){if(!Hf(E))throw new Error(Ke(7));if(typeof E.type>"u")throw new Error(Ke(8));if(p)throw new Error(Ke(9));try{p=!0,a=n(a,E)}finally{p=!1}for(var $=s=c,T=0;T<$.length;T++){var N=$[T];N()}return E}function O(E){if(typeof E!="function")throw new Error(Ke(10));n=E,b({type:dn.REPLACE})}function v(){var E,$=y;return E={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(Ke(11));function z(){N.next&&N.next(m())}z();var Z=$(z);return{unsubscribe:Z}}},E[Op]=function(){return this},E}return b({type:dn.INIT}),i={dispatch:b,subscribe:y,getState:m,replaceReducer:O},i[Op]=v,i}function Wf(t){Object.keys(t).forEach(function(e){var o=t[e],i=o(void 0,{type:dn.INIT});if(typeof i>"u")throw new Error(Ke(12));if(typeof o(void 0,{type:dn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function Cp(t){for(var e=Object.keys(t),o={},i=0;i<e.length;i++){var n=e[i];typeof t[n]=="function"&&(o[n]=t[n])}var a=Object.keys(o),s,c;try{Wf(o)}catch(p){c=p}return function(u,m){if(u===void 0&&(u={}),c)throw c;if(0)var y;for(var b=!1,O={},v=0;v<a.length;v++){var E=a[v],$=o[E],T=u[E],N=$(T,m);if(typeof N>"u"){var z=m&&m.type;throw new Error(Ke(14))}O[E]=N,b=b||N!==T}return b=b||a.length!==Object.keys(u).length,b?O:u}}function Do(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(i){return i}:e.length===1?e[0]:e.reduce(function(i,n){return function(){return i(n.apply(void 0,arguments))}})}function wp(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(i){return function(){var n=i.apply(void 0,arguments),a=function(){throw new Error(Ke(15))},s={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(s)});return a=Do.apply(void 0,c)(n.dispatch),os(os({},n),{},{dispatch:a})}}}function Ep(t){var e=function(i){var n=i.dispatch,a=i.getState;return function(s){return function(c){return typeof c=="function"?c(n,a,t):s(c)}}};return e}var Ap=Ep();Ap.withExtraArgument=Ep;var as=Ap;var Tp=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function i(){this.constructor=e}e.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}}(),Vf=function(t,e){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(m){return p([u,m])}}function p(u){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(m){u=[6,m],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Fo=function(t,e){for(var o=0,i=e.length,n=t.length;o<i;o++,n++)t[n]=e[o];return t},Gf=Object.defineProperty,jf=Object.defineProperties,Kf=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,Zf=Object.prototype.hasOwnProperty,qf=Object.prototype.propertyIsEnumerable,Lp=function(t,e,o){return e in t?Gf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Nr=function(t,e){for(var o in e||(e={}))Zf.call(e,o)&&Lp(t,o,e[o]);if(Rp)for(var i=0,n=Rp(e);i<n.length;i++){var o=n[i];qf.call(e,o)&&Lp(t,o,e[o])}return t},ss=function(t,e){return jf(t,Kf(e))},Yf=function(t,e,o){return new Promise(function(i,n){var a=function(p){try{c(o.next(p))}catch(u){n(u)}},s=function(p){try{c(o.throw(p))}catch(u){n(u)}},c=function(p){return p.done?i(p.value):Promise.resolve(p.value).then(a,s)};c((o=o.apply(t,e)).next())})};var Xf=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Do:Do.apply(null,arguments)},fw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Qf(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var Jf=function(t){Tp(e,t);function e(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var n=t.apply(this,o)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Fo([void 0],o[0].concat(this)))):new(e.bind.apply(e,Fo([void 0],o.concat(this))))},e}(Array),eh=function(t){Tp(e,t);function e(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var n=t.apply(this,o)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Fo([void 0],o[0].concat(this)))):new(e.bind.apply(e,Fo([void 0],o.concat(this))))},e}(Array);function ds(t){return Dt(t)?cn(t,function(){}):t}function th(t){return typeof t=="boolean"}function rh(){return function(e){return oh(e)}}function oh(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,i=t.immutableCheck,n=i===void 0?!0:i,a=t.serializableCheck,s=a===void 0?!0:a,c=new Jf;if(o&&(th(o)?c.push(as):c.push(as.withExtraArgument(o.extraArgument))),0){if(n)var p;if(s)var u}return c}var ls=!0;function $p(t){var e=rh(),o=t||{},i=o.reducer,n=i===void 0?void 0:i,a=o.middleware,s=a===void 0?e():a,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,m=u===void 0?void 0:u,y=o.enhancers,b=y===void 0?void 0:y,O;if(typeof n=="function")O=n;else if(Qf(n))O=Cp(n);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=s;if(typeof v=="function"&&(v=v(e),!ls&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ls&&v.some(function(Z){return typeof Z!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=wp.apply(void 0,v),$=Do;p&&($=Xf(Nr({trace:!ls},typeof p=="object"&&p)));var T=new eh(E),N=T;Array.isArray(b)?N=Fo([E],b):typeof b=="function"&&(N=b(T));var z=$.apply(void 0,N);return ns(O,m,z)}function _r(t,e){function o(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(e){var a=e.apply(void 0,i);if(!a)throw new Error("prepareAction did not return an object");return Nr(Nr({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:i[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(i){return i.type===t},o}function Np(t){var e={},o=[],i,n={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,n},addMatcher:function(a,s){return o.push({matcher:a,reducer:s}),n},addDefaultCase:function(a){return i=a,n}};return t(n),[e,o,i]}function ih(t){return typeof t=="function"}function nh(t,e,o,i){o===void 0&&(o=[]);var n=typeof e=="function"?Np(e):[e,o,i],a=n[0],s=n[1],c=n[2],p;if(ih(t))p=function(){return ds(t())};else{var u=ds(t);p=function(){return u}}function m(y,b){y===void 0&&(y=p());var O=Fo([a[b.type]],s.filter(function(v){var E=v.matcher;return E(b)}).map(function(v){var E=v.reducer;return E}));return O.filter(function(v){return!!v}).length===0&&(O=[c]),O.reduce(function(v,E){if(E)if(fr(v)){var $=v,T=E($,b);return T===void 0?v:T}else{if(Dt(v))return cn(v,function(N){return E(N,b)});var T=E(v,b);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},y)}return m.getInitialState=p,m}function ah(t,e){return t+"/"+e}function _p(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:ds(t.initialState),i=t.reducers||{},n=Object.keys(i),a={},s={},c={};n.forEach(function(m){var y=i[m],b=ah(e,m),O,v;"reducer"in y?(O=y.reducer,v=y.prepare):O=y,a[m]=O,s[b]=O,c[m]=v?_r(b,v):_r(b)});function p(){var m=typeof t.extraReducers=="function"?Np(t.extraReducers):[t.extraReducers],y=m[0],b=y===void 0?{}:y,O=m[1],v=O===void 0?[]:O,E=m[2],$=E===void 0?void 0:E,T=Nr(Nr({},b),s);return nh(o,function(N){for(var z in T)N.addCase(z,T[z]);for(var Z=0,X=v;Z<X.length;Z++){var tt=X[Z];N.addMatcher(tt.matcher,tt.reducer)}$&&N.addDefaultCase($)})}var u;return{name:e,reducer:function(m,y){return u||(u=p()),u(m,y)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var sh="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lh=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=sh[Math.random()*64|0];return e},ch=["name","message","stack","code"],cs=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Ip=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),dh=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,i=ch;o<i.length;o++){var n=i[o];typeof t[n]=="string"&&(e[n]=t[n])}return e}return{message:String(t)}},gw=function(){function t(e,o,i){var n=_r(e+"/fulfilled",function(m,y,b,O){return{payload:m,meta:ss(Nr({},O||{}),{arg:b,requestId:y,requestStatus:"fulfilled"})}}),a=_r(e+"/pending",function(m,y,b){return{payload:void 0,meta:ss(Nr({},b||{}),{arg:y,requestId:m,requestStatus:"pending"})}}),s=_r(e+"/rejected",function(m,y,b,O,v){return{payload:O,error:(i&&i.serializeError||dh)(m||"Rejected"),meta:ss(Nr({},v||{}),{arg:b,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(y,b,O){var v=i?.idGenerator?i.idGenerator(m):lh(),E=new p,$,T=!1;function N(Z){$=Z,E.abort()}var z=function(){return Yf(this,null,function(){var Z,X,tt,Wt,Ye,Vt,Be;return Vf(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),Wt=(Z=i?.condition)==null?void 0:Z.call(i,m,{getState:b,extra:O}),uh(Wt)?[4,Wt]:[3,2];case 1:Wt=g.sent(),g.label=2;case 2:if(Wt===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=!0,Ye=new Promise(function(x,_){return E.signal.addEventListener("abort",function(){return _({name:"AbortError",message:$||"Aborted"})})}),y(a(v,m,(X=i?.getPendingMeta)==null?void 0:X.call(i,{requestId:v,arg:m},{getState:b,extra:O}))),[4,Promise.race([Ye,Promise.resolve(o(m,{dispatch:y,getState:b,extra:O,requestId:v,signal:E.signal,abort:N,rejectWithValue:function(x,_){return new cs(x,_)},fulfillWithValue:function(x,_){return new Ip(x,_)}})).then(function(x){if(x instanceof cs)throw x;return x instanceof Ip?n(x.payload,v,m,x.meta):n(x,v,m)})])];case 3:return tt=g.sent(),[3,5];case 4:return Vt=g.sent(),tt=Vt instanceof cs?s(null,v,m,Vt.payload,Vt.meta):s(Vt,v,m),[3,5];case 5:return Be=i&&!i.dispatchConditionRejection&&s.match(tt)&&tt.meta.condition,Be||y(tt),[2,tt]}})})}();return Object.assign(z,{abort:N,requestId:v,arg:m,unwrap:function(){return z.then(ph)}})}}return Object.assign(u,{pending:a,rejected:s,fulfilled:n,typePrefix:e})}return t.withTypes=function(){return t},t}();function ph(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function uh(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Pp="listener",Bp="completed",Dp="cancelled",bw="task-"+Dp,xw="task-"+Bp,vw=Pp+"-"+Dp,Sw=Pp+"-"+Bp;var ps="listenerMiddleware";var Ow=_r(ps+"/add"),Cw=_r(ps+"/removeAll"),ww=_r(ps+"/remove");var kp,Ew=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(kp||(kp=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},fh=function(t){return function(e){setTimeout(e,t)}},Aw=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:fh(10);yp();var hh=Ji(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,i,n){this.eventBus.addEventListener(o,i,n)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,i,n){this.eventBus.removeEventListener(o,i,n)}}}),pn=class extends hh(Object){};window.ftReduxStores||(window.ftReduxStores={});var Fp=class t extends pn{static get(e){var o;let i=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,a=window.ftReduxStores[i];if(nn(a))return a;if(n==null)return;let s=_p({...n,reducers:(o=n.reducers)!==null&&o!==void 0?o:{}}),c=$p({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:s.reducer(p,u)});return window.ftReduxStores[n.name]=new t(s,c,n.eventBus)}constructor(e,o,i){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new en;let n=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let p=s,u=a[p];return u?(...m)=>{let y=u(...m.map(n));return this.reduxStore.dispatch(y),y}:m=>{this.setState({[p]:n(m)})}}}),this.eventBus=i??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}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(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var un=class{static format(e,o,i,n){return window.moment?window.moment(e).locale(o).format(this.getMomentDateFormat(i,n)):this.getIntlDateTime(e,o,i,n)}static getMomentDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(e,o,i,n){let a=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(o,{dateStyle:i?"medium":"short"}).format(a);if(!n)return s;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(a);return`${s} ${c}`}static getTimezoneAsString(){let e=i=>String(Math.floor(i)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${e(Math.abs(o)/60)}:${e(Math.abs(o)%60)}`}};var Mp=f(w()),fn=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Yw=(0,Mp.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,a;return((a=(n=this.metadataDescriptors.find(c=>c.key===i))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1)?c=>un.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return fn([(0,us.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),fn([(0,us.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),fn([Ha({store:I.name,selector:o=>{var i,n;return(n=(i=o.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),fn([Ha({store:I.name})],e.prototype,"uiLocale",void 0),e});var mn=f(w());var hn=class extends ht{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=I.getState().session;return!!e?.sessionAuthenticated}};var yn=class extends ht{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=I.getState().session;return!!e?.sessionAuthenticated}};var yh="ft-user-assets",mh={setAssetCount:(t,e)=>{let{userAssetType:o,count:i}=e.payload.assetCount;t.assetCounts.allAsset[o]=i},clearAssetCount:t=>{Object.values(At).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:i,asset:n}=e.payload;hs(t,o,[...fs(t,o),n]),zp(t,o,1,i),Up(t,n)},editAsset:(t,e)=>{let{assetType:o,asset:i}=e.payload;hs(t,o,fs(t,o).map(n=>n.id===i.id?i:n)),Up(t,i)},removeAsset:(t,e)=>{let{assetType:o,mapId:i,assetId:n}=e.payload;hs(t,o,fs(t,o).filter(a=>a.id!==n)),zp(t,o,-1,i)}},Hp={[At.SEARCHES]:"savedSearches",[At.BOOKMARKS]:"bookmarks",[At.BOOKS]:void 0,[At.COLLECTIONS]:void 0},fs=(t,e)=>{var o;let i=Hp[e];return i?(o=t[i])!==null&&o!==void 0?o:[]:[]},hs=(t,e,o)=>{let i=Hp[e];i&&(t[i]=o)},zp=(t,e,o,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+o),e===At.BOOKMARKS&&i)){let a=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,a+o)}},Up=(t,e)=>{let o=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!o.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},mt=mn.FtReduxStore.get({name:yh,reducers:mh,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(At).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ys=class{constructor(e=new hn,o=new yn){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ji,this.savedSearchesService=new Yi,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,mn.deepEqual)((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(),mt.actions.clearAssetCount(),mt.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),mt.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),mt.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();mt.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();mt.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&mt.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&mt.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(mt.getState().assetCounts.bookmarkByMap).length!==0;e===At.BOOKMARKS&&o&&mt.actions.clearBookmarkCountByMap(),mt.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;mt.actions.bookmarks(o)}}},gh=new ys;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gh);(0,Wp.customElement)("ft-app-context")(pe);var jp=f(ee());var ms=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[i,n]=e.split(".");return{context:i,key:n,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Vp=new ms;var bh=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},xh=Symbol("i18nAttributes"),vh=Symbol("i18nListAttributes"),Kp=Symbol("i18nProperties"),gn=Symbol("i18nContexts"),gi=Symbol("i18nUnsubs"),xn=(0,Mo.applyMixinOnce)(Symbol("withI18n"),function(t){var e,o;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Da:di}i18n(a){let{context:s,key:c,message:p}=a,{custom:u,args:m,argsProvider:y}=a;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let b=m??(y?y(this):[]);return this.getI18nService(u).resolveMessage(s,c,...b)}return p}async awaitI18n(a){let{context:s,custom:c}=a;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Vp.isI18nKey(a)){let[c,p]=a.split(".");return this.i18n({custom:!0,context:c,key:p,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,c,p)=>a.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,c;let p=this,u=(m,y,b)=>b?.context&&b.key&&a(m,y,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...m})}:b;(s=this[xh])===null||s===void 0||s.forEach((m,y)=>p[y]=u(m,y,p[y])),(c=this[vh])===null||c===void 0||c.forEach((m,y)=>{var b;return p[y]=(b=p[y])===null||b===void 0?void 0:b.map(O=>u(m,y,O))})}updateI18nProperties(a){var s;(s=this[Kp])===null||s===void 0||s.forEach((c,p)=>{a(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(a,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,c)}addI18nContext(a,s,c){let p=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[gn].set(p,{isCustomContext:c}),this[gi].has(p)||this[gi].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,s)}hasI18nContext(a){return this[gn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[gn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[gi].forEach(a=>a()),this[gi].clear()}}return e=gn,o=gi,bh([(0,jp.property)({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),Gp=class extends xn(Mo.FtLitElement){},bn=class extends xn(Mo.FtLitElementRedux){};var bi=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Ft=class extends bn{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":vn.nothing:vn.html`
|
|
1541
|
+
`}connectedCallback(){super.connectedCallback(),I.addEventListener(Qr.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(Qr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,i,n,a,s,c,p;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>di.addContext(u)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),I.actions.availableUiLocales((n=(i=this.localesConfiguration)===null||i===void 0?void 0:i.availableUiLocales)!==null&&n!==void 0?n:[]),I.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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",()=>jd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};pe.elementDefinitions={};pe.styles=nd;Te([(0,Ue.property)()],pe.prototype,"baseUrl",void 0);Te([(0,Ue.property)()],pe.prototype,"apiIntegrationIdentifier",void 0);Te([(0,Ue.property)()],pe.prototype,"apiIntegrationAppVersion",void 0);Te([(0,Ue.property)()],pe.prototype,"uiLocale",void 0);Te([(0,Bt.jsonProperty)(null)],pe.prototype,"availableUiLocales",void 0);Te([(0,Bt.jsonProperty)(null)],pe.prototype,"metadataConfiguration",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"editorMode",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"noCustom",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"openExternalDocumentInNewTab",void 0);Te([(0,Ue.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],pe.prototype,"noCustomComponent",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"withManualResources",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"navigatorOnline",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"forcedOffline",void 0);Te([(0,Ue.property)({type:Object})],pe.prototype,"apiProvider",void 0);Te([(0,Ue.property)({type:Boolean})],pe.prototype,"authenticationRequired",void 0);Te([(0,Bt.jsonProperty)([])],pe.prototype,"messageContexts",void 0);Te([(0,Bt.jsonProperty)(void 0)],pe.prototype,"session",void 0);Te([(0,Ue.state)()],pe.prototype,"localesConfiguration",void 0);Te([(0,Ue.state)()],pe.prototype,"availableContentLocales",void 0);var us=f(ee());function If(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let o,i,n;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(i=o;i--!==0;)if(!Qi(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!Qi(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let a=s=>Object.keys(s).filter(c=>s[c]!=null);if(n=a(t),o=n.length,o!==a(e).length)return!1;for(i=o;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[i]))return!1;for(i=o;i--!==0;){let s=n[i];if(!Qi(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Qi(t,e){try{return If(t,e)}catch{return!1}}function ui(t,e){return!Qi(t,e)}function Ji(t,e){let o=i=>i[t]===!0;return i=>{if(o(i))return i;let n=e(i);return n[t]=!0,n}}var Zd=f(ee(),1);var Ha=t=>{let e=t??{};return(o,i)=>{var n;let a={hasChanged:ui,attribute:!1,...e};(0,Zd.property)(a)(o,i);let s=o.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(i,{selector:(n=e.selector)!==null&&n!==void 0?n:c=>c[i],store:e.store})}};var en=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(i=>i.type===e);return o&&(this.queue=this.queue.filter(i=>i!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};var to=f(ee(),1);var qd=f(ee(),1);function Yd(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,qd.property)({type:Object,converter:{fromAttribute:i=>{if(i==null)return o();try{return JSON.parse(i)}catch{return o()}},toAttribute:i=>JSON.stringify(i)},hasChanged:ui,...e??{}})}var tn=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,o){return this.callbacks=[e],this.debounce(o)}queue(e,o){return this.callbacks.push(e),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((o,i)=>{this.resolvePromise=o,this.rejectPromise=i})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,o;let i=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let s of i)try{await s()}catch(c){n(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Qd=f(k(),1);var rn=globalThis,kf=rn.ShadowRoot&&(rn.ShadyCSS===void 0||rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,IC=Symbol();var Xd=(t,e)=>{if(kf)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let i=document.createElement("style"),n=rn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=o.cssText,t.appendChild(i)}};var on=class extends Qd.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([n,a])=>e.registry.define(n,a)));let o={...e.shadowRootOptions,customElements:e.registry},i=this.renderOptions.creationScope=this.attachShadow(o);return Xd(i,e.elementStyles),i}};function Jd(t,e,...o){var i;let n=t.querySelector(e);for(let a of o)n=(i=n?.shadowRoot)===null||i===void 0?void 0:i.querySelector(a);return n}var No=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},op,ep=Symbol("constructorPrototype"),tp=Symbol("constructorName"),ip=Symbol("exportpartsDebouncer"),rp=Symbol("dynamicDependenciesLoaded"),$o=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};$o.eventName="exportparts-updated";var Qt=class extends on{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[op]=new tn(5),this.scheduleExportpartsUpdate=()=>{var e,o,i;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(i=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&i!==void 0&&i)&&this[ip].run(()=>{var n,a;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[tp]=this.constructor.name,this[ep]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[tp]&&Object.setPrototypeOf(this,this[ep])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(i){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",i)}let o=this.constructor;o[rp]||(o[rp]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener($o.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener($o.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new $o)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:i,shadowPath:n}=this.elementToFocus;if(i!=null){let a=[...n??[],i];o=Jd(this.shadowRoot,...a)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,i,n;if(((i=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&i!==void 0?i:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}setExportpartsAttribute(e){var o,i,n,a,s,c;let p=b=>b!=null&&b.trim().length>0,u=e.filter(p).map(b=>b.trim());if(u.length===0){this.exportparts=void 0;return}let m=new Set;for(let b of(i=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let O=(a=(n=b.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],v=(c=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map($=>$.split(":")[1]))!==null&&c!==void 0?c:[],E=[...O,...v].filter(p).map($=>$.trim());for(let $ of E)m.add($)}if(m.size===0){this.exportparts=void 0;return}let y=[...m.values()].flatMap(b=>u.map(O=>`${b}:${O}--${b}`));this.exportparts=[...this.part,...y].join(", ")}};op=ip;No([(0,to.property)()],Qt.prototype,"exportpartsPrefix",void 0);No([Yd([])],Qt.prototype,"exportpartsPrefixes",void 0);No([(0,to.property)({reflect:!0})],Qt.prototype,"exportparts",void 0);No([(0,to.property)()],Qt.prototype,"customStylesheet",void 0);No([(0,to.property)()],Qt.prototype,"elementToFocus",void 0);No([(0,to.state)()],Qt.prototype,"useAdoptedStyleSheets",void 0);function nn(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var fi=Symbol("internalReduxEventsUnsubscribers"),kr=Symbol("internalStoresUnsubscribers"),ro=Symbol("internalStores"),Tf=Ji(Symbol("withRedux"),function(t){var e,o,i;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[i]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[ro].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ro].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[ro].get(s)}addStore(s,c){var p;c=(p=c??s.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[ro].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[ro].delete(c)}setupStores(){this.unsubscribeFromStores(),this[ro].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(s.store);u&&(s.store?this[kr].has(s.store):this[kr].size>0)&&(this[c]=s.selector(u.getState(),this))}})}subscribeToStore(s,c){var p;this[kr].set(s,c.subscribe(()=>this.updateFromStores())),this[fi].set(s,[]),nn(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,m)=>{if(typeof this[m]=="function"&&(!u.store||c.name===u.store)){let y=b=>this[m](b);c.addEventListener(u.eventName,y),this[fi].get(s).push(()=>c.removeEventListener(u.eventName,y))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[kr].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[kr].has(s)&&this[kr].get(s)(),this[kr].delete(s),(c=this[fi].get(s))===null||c===void 0||c.forEach(p=>p()),this[fi].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=kr,o=ro,i=fi,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),np=class extends Tf(Qt){};function Rt(t){for(var e=arguments.length,o=Array(e>1?e-1:0),i=1;i<e;i++)o[i-1]=arguments[i];if(0)var n,a;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function fr(t){return!!t&&!!t[me]}function Dt(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var i=Object.getPrototypeOf(o);if(i===null)return!0;var n=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===Mf}(t)||Array.isArray(t)||!!t[up]||!!(!((e=t.constructor)===null||e===void 0)&&e[up])||Xa(t)||Qa(t))}function oo(t,e,o){o===void 0&&(o=!1),Bo(t)===0?(o?Object.keys:Po)(t).forEach(function(i){o&&typeof i=="symbol"||e(i,t[i],t)}):t.forEach(function(i,n){return e(n,i,t)})}function Bo(t){var e=t[me];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Xa(t)?2:Qa(t)?3:0}function _o(t,e){return Bo(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function $f(t,e){return Bo(t)===2?t.get(e):t[e]}function fp(t,e,o){var i=Bo(t);i===2?t.set(e,o):i===3?t.add(o):t[e]=o}function hp(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Xa(t){return Df&&t instanceof Map}function Qa(t){return Ff&&t instanceof Set}function Tr(t){return t.o||t.t}function Ja(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=gp(t);delete e[me];for(var o=Po(e),i=0;i<o.length;i++){var n=o[i],a=e[n];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[n]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function es(t,e){return e===void 0&&(e=!1),ts(t)||fr(t)||!Dt(t)||(Bo(t)>1&&(t.set=t.add=t.clear=t.delete=Nf),Object.freeze(t),e&&oo(t,function(o,i){return es(i,!0)},!0)),t}function Nf(){Rt(2)}function ts(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Jt(t){var e=Ya[t];return e||Rt(18,t),e}function _f(t,e){Ya[t]||(Ya[t]=e)}function Ka(){return yi}function Wa(t,e){e&&(Jt("Patches"),t.u=[],t.s=[],t.v=e)}function an(t){Za(t),t.p.forEach(Pf),t.p=null}function Za(t){t===yi&&(yi=t.l)}function ap(t){return yi={p:[],l:yi,h:t,m:!0,_:0}}function Pf(t){var e=t[me];e.i===0||e.i===1?e.j():e.g=!0}function Va(t,e){e._=e.p.length;var o=e.p[0],i=t!==void 0&&t!==o;return e.h.O||Jt("ES5").S(e,t,i),i?(o[me].P&&(an(e),Rt(4)),Dt(t)&&(t=sn(e,t),e.l||ln(e,t)),e.u&&Jt("Patches").M(o[me].t,t,e.u,e.s)):t=sn(e,o,[]),an(e),e.u&&e.v(e.u,e.s),t!==mp?t:void 0}function sn(t,e,o){if(ts(e))return e;var i=e[me];if(!i)return oo(e,function(c,p){return sp(t,i,e,c,p,o)},!0),e;if(i.A!==t)return e;if(!i.P)return ln(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=Ja(i.k):i.o,a=n,s=!1;i.i===3&&(a=new Set(n),n.clear(),s=!0),oo(a,function(c,p){return sp(t,i,n,c,p,o,s)}),ln(t,n,!1),o&&t.u&&Jt("Patches").N(i,o,t.u,t.s)}return i.o}function sp(t,e,o,i,n,a,s){if(fr(n)){var c=sn(t,n,a&&e&&e.i!==3&&!_o(e.R,i)?a.concat(i):void 0);if(fp(o,i,c),!fr(c))return;t.m=!1}else s&&o.add(n);if(Dt(n)&&!ts(n)){if(!t.h.D&&t._<1)return;sn(t,n),e&&e.A.l||ln(t,n)}}function ln(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&es(e,o)}function Ga(t,e){var o=t[me];return(o?Tr(o):t)[e]}function lp(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var i=Object.getOwnPropertyDescriptor(o,e);if(i)return i;o=Object.getPrototypeOf(o)}}function $r(t){t.P||(t.P=!0,t.l&&$r(t.l))}function ja(t){t.o||(t.o=Ja(t.t))}function qa(t,e,o){var i=Xa(e)?Jt("MapSet").F(e,o):Qa(e)?Jt("MapSet").T(e,o):t.O?function(n,a){var s=Array.isArray(n),c={i:s?1:0,A:a?a.A:Ka(),P:!1,I:!1,R:{},l:a,t:n,k:null,o:null,j:null,C:!1},p=c,u=mi;s&&(p=[c],u=hi);var m=Proxy.revocable(p,u),y=m.revoke,b=m.proxy;return c.k=b,c.j=y,b}(e,o):Jt("ES5").J(e,o);return(o?o.A:Ka()).p.push(i),i}function Bf(t){return fr(t)||Rt(22,t),function e(o){if(!Dt(o))return o;var i,n=o[me],a=Bo(o);if(n){if(!n.P&&(n.i<4||!Jt("ES5").K(n)))return n.t;n.I=!0,i=cp(o,a),n.I=!1}else i=cp(o,a);return oo(i,function(s,c){n&&$f(n.t,s)===c||fp(i,s,e(c))}),a===3?new Set(i):i}(t)}function cp(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ja(t)}function yp(){function t(s,c){var p=a[s];return p?p.enumerable=c:a[s]=p={configurable:!0,enumerable:c,get:function(){var u=this[me];return mi.get(u,s)},set:function(u){var m=this[me];mi.set(m,s,u)}},p}function e(s){for(var c=s.length-1;c>=0;c--){var p=s[c][me];if(!p.P)switch(p.i){case 5:i(p)&&$r(p);break;case 4:o(p)&&$r(p)}}}function o(s){for(var c=s.t,p=s.k,u=Po(p),m=u.length-1;m>=0;m--){var y=u[m];if(y!==me){var b=c[y];if(b===void 0&&!_o(c,y))return!0;var O=p[y],v=O&&O[me];if(v?v.t!==b:!hp(O,b))return!0}}var E=!!c[me];return u.length!==Po(c).length+(E?0:1)}function i(s){var c=s.k;if(c.length!==s.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function n(s){s.g&&Rt(3,JSON.stringify(Tr(s)))}var a={};_f("ES5",{J:function(s,c){var p=Array.isArray(s),u=function(y,b){if(y){for(var O=Array(b.length),v=0;v<b.length;v++)Object.defineProperty(O,""+v,t(v,!0));return O}var E=gp(b);delete E[me];for(var $=Po(E),T=0;T<$.length;T++){var N=$[T];E[N]=t(N,y||!!E[N].enumerable)}return Object.create(Object.getPrototypeOf(b),E)}(p,s),m={i:p?5:4,A:c?c.A:Ka(),P:!1,I:!1,R:{},l:c,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,me,{value:m,writable:!0}),u},S:function(s,c,p){p?fr(c)&&c[me].A===s&&e(s.p):(s.u&&function u(m){if(m&&typeof m=="object"){var y=m[me];if(y){var b=y.t,O=y.k,v=y.R,E=y.i;if(E===4)oo(O,function(Z){Z!==me&&(b[Z]!==void 0||_o(b,Z)?v[Z]||u(O[Z]):(v[Z]=!0,$r(y)))}),oo(b,function(Z){O[Z]!==void 0||_o(O,Z)||(v[Z]=!1,$r(y))});else if(E===5){if(i(y)&&($r(y),v.length=!0),O.length<b.length)for(var $=O.length;$<b.length;$++)v[$]=!1;else for(var T=b.length;T<O.length;T++)v[T]=!0;for(var N=Math.min(O.length,b.length),z=0;z<N;z++)O.hasOwnProperty(z)||(v[z]=!0),v[z]===void 0&&u(O[z])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):i(s)}})}var dp,yi,rs=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Df=typeof Map<"u",Ff=typeof Set<"u",pp=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",mp=rs?Symbol.for("immer-nothing"):((dp={})["immer-nothing"]=!0,dp),up=rs?Symbol.for("immer-draftable"):"__$immer_draftable",me=rs?Symbol.for("immer-state"):"__$immer_state";var Mf=""+Object.prototype.constructor,Po=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,gp=Object.getOwnPropertyDescriptors||function(t){var e={};return Po(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},Ya={},mi={get:function(t,e){if(e===me)return t;var o=Tr(t);if(!_o(o,e))return function(n,a,s){var c,p=lp(a,s);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(n.k):void 0}(t,o,e);var i=o[e];return t.I||!Dt(i)?i:i===Ga(t.t,e)?(ja(t),t.o[e]=qa(t.A.h,i,t)):i},has:function(t,e){return e in Tr(t)},ownKeys:function(t){return Reflect.ownKeys(Tr(t))},set:function(t,e,o){var i=lp(Tr(t),e);if(i?.set)return i.set.call(t.k,o),!0;if(!t.P){var n=Ga(Tr(t),e),a=n?.[me];if(a&&a.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(hp(o,n)&&(o!==void 0||_o(t.t,e)))return!0;ja(t),$r(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return Ga(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,ja(t),$r(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=Tr(t),i=Reflect.getOwnPropertyDescriptor(o,e);return i&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:i.enumerable,value:o[e]}},defineProperty:function(){Rt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Rt(12)}},hi={};oo(mi,function(t,e){hi[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),hi.deleteProperty=function(t,e){return hi.set.call(this,t,e,void 0)},hi.set=function(t,e,o){return mi.set.call(this,t[0],e,o,t[0])};var zf=function(){function t(o){var i=this;this.O=pp,this.D=!0,this.produce=function(n,a,s){if(typeof n=="function"&&typeof a!="function"){var c=a;a=n;var p=i;return function(E){var $=this;E===void 0&&(E=c);for(var T=arguments.length,N=Array(T>1?T-1:0),z=1;z<T;z++)N[z-1]=arguments[z];return p.produce(E,function(Z){var X;return(X=a).call.apply(X,[$,Z].concat(N))})}}var u;if(typeof a!="function"&&Rt(6),s!==void 0&&typeof s!="function"&&Rt(7),Dt(n)){var m=ap(i),y=qa(i,n,void 0),b=!0;try{u=a(y),b=!1}finally{b?an(m):Za(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(E){return Wa(m,s),Va(E,m)},function(E){throw an(m),E}):(Wa(m,s),Va(u,m))}if(!n||typeof n!="object"){if((u=a(n))===void 0&&(u=n),u===mp&&(u=void 0),i.D&&es(u,!0),s){var O=[],v=[];Jt("Patches").M(n,u,O,v),s(O,v)}return u}Rt(21,n)},this.produceWithPatches=function(n,a){if(typeof n=="function")return function(u){for(var m=arguments.length,y=Array(m>1?m-1:0),b=1;b<m;b++)y[b-1]=arguments[b];return i.produceWithPatches(u,function(O){return n.apply(void 0,[O].concat(y))})};var s,c,p=i.produce(n,a,function(u,m){s=u,c=m});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,s,c]}):[p,s,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){Dt(o)||Rt(8),fr(o)&&(o=Bf(o));var i=ap(this),n=qa(this,o,void 0);return n[me].C=!0,Za(i),n},e.finishDraft=function(o,i){var n=o&&o[me],a=n.A;return Wa(a,i),Va(void 0,a)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!pp&&Rt(20),this.O=o},e.applyPatches=function(o,i){var n;for(n=i.length-1;n>=0;n--){var a=i[n];if(a.path.length===0&&a.op==="replace"){o=a.value;break}}n>-1&&(i=i.slice(n+1));var s=Jt("Patches").$;return fr(o)?s(o,i):this.produce(o,function(c){return s(c,i)})},t}(),yt=new zf,Uf=yt.produce,VC=yt.produceWithPatches.bind(yt),GC=yt.setAutoFreeze.bind(yt),jC=yt.setUseProxies.bind(yt),KC=yt.applyPatches.bind(yt),ZC=yt.createDraft.bind(yt),qC=yt.finishDraft.bind(yt),cn=Uf;function io(t){"@babel/helpers - typeof";return io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},io(t)}function bp(t,e){if(io(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var i=o.call(t,e||"default");if(io(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xp(t){var e=bp(t,"string");return io(e)=="symbol"?e:e+""}function vp(t,e,o){return(e=xp(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Sp(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),o.push.apply(o,i)}return o}function os(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Sp(Object(o),!0).forEach(function(i){vp(t,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Sp(Object(o)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(o,i))})}return t}function Ke(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 Op=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),is=function(){return Math.random().toString(36).substring(7).split("").join(".")},dn={INIT:"@@redux/INIT"+is(),REPLACE:"@@redux/REPLACE"+is(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+is()}};function Hf(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ns(t,e,o){var i;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(Ke(1));return o(ns)(t,e)}if(typeof t!="function")throw new Error(Ke(2));var n=t,a=e,s=[],c=s,p=!1;function u(){c===s&&(c=s.slice())}function m(){if(p)throw new Error(Ke(3));return a}function y(E){if(typeof E!="function")throw new Error(Ke(4));if(p)throw new Error(Ke(5));var $=!0;return u(),c.push(E),function(){if($){if(p)throw new Error(Ke(6));$=!1,u();var N=c.indexOf(E);c.splice(N,1),s=null}}}function b(E){if(!Hf(E))throw new Error(Ke(7));if(typeof E.type>"u")throw new Error(Ke(8));if(p)throw new Error(Ke(9));try{p=!0,a=n(a,E)}finally{p=!1}for(var $=s=c,T=0;T<$.length;T++){var N=$[T];N()}return E}function O(E){if(typeof E!="function")throw new Error(Ke(10));n=E,b({type:dn.REPLACE})}function v(){var E,$=y;return E={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(Ke(11));function z(){N.next&&N.next(m())}z();var Z=$(z);return{unsubscribe:Z}}},E[Op]=function(){return this},E}return b({type:dn.INIT}),i={dispatch:b,subscribe:y,getState:m,replaceReducer:O},i[Op]=v,i}function Wf(t){Object.keys(t).forEach(function(e){var o=t[e],i=o(void 0,{type:dn.INIT});if(typeof i>"u")throw new Error(Ke(12));if(typeof o(void 0,{type:dn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function Cp(t){for(var e=Object.keys(t),o={},i=0;i<e.length;i++){var n=e[i];typeof t[n]=="function"&&(o[n]=t[n])}var a=Object.keys(o),s,c;try{Wf(o)}catch(p){c=p}return function(u,m){if(u===void 0&&(u={}),c)throw c;if(0)var y;for(var b=!1,O={},v=0;v<a.length;v++){var E=a[v],$=o[E],T=u[E],N=$(T,m);if(typeof N>"u"){var z=m&&m.type;throw new Error(Ke(14))}O[E]=N,b=b||N!==T}return b=b||a.length!==Object.keys(u).length,b?O:u}}function Do(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(i){return i}:e.length===1?e[0]:e.reduce(function(i,n){return function(){return i(n.apply(void 0,arguments))}})}function wp(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(i){return function(){var n=i.apply(void 0,arguments),a=function(){throw new Error(Ke(15))},s={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(s)});return a=Do.apply(void 0,c)(n.dispatch),os(os({},n),{},{dispatch:a})}}}function Ep(t){var e=function(i){var n=i.dispatch,a=i.getState;return function(s){return function(c){return typeof c=="function"?c(n,a,t):s(c)}}};return e}var Ap=Ep();Ap.withExtraArgument=Ep;var as=Ap;var Tp=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function i(){this.constructor=e}e.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}}(),Vf=function(t,e){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(m){return p([u,m])}}function p(u){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(m){u=[6,m],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Fo=function(t,e){for(var o=0,i=e.length,n=t.length;o<i;o++,n++)t[n]=e[o];return t},Gf=Object.defineProperty,jf=Object.defineProperties,Kf=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,Zf=Object.prototype.hasOwnProperty,qf=Object.prototype.propertyIsEnumerable,Lp=function(t,e,o){return e in t?Gf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Nr=function(t,e){for(var o in e||(e={}))Zf.call(e,o)&&Lp(t,o,e[o]);if(Rp)for(var i=0,n=Rp(e);i<n.length;i++){var o=n[i];qf.call(e,o)&&Lp(t,o,e[o])}return t},ss=function(t,e){return jf(t,Kf(e))},Yf=function(t,e,o){return new Promise(function(i,n){var a=function(p){try{c(o.next(p))}catch(u){n(u)}},s=function(p){try{c(o.throw(p))}catch(u){n(u)}},c=function(p){return p.done?i(p.value):Promise.resolve(p.value).then(a,s)};c((o=o.apply(t,e)).next())})};var Xf=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Do:Do.apply(null,arguments)},fw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Qf(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var Jf=function(t){Tp(e,t);function e(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var n=t.apply(this,o)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Fo([void 0],o[0].concat(this)))):new(e.bind.apply(e,Fo([void 0],o.concat(this))))},e}(Array),eh=function(t){Tp(e,t);function e(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var n=t.apply(this,o)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Fo([void 0],o[0].concat(this)))):new(e.bind.apply(e,Fo([void 0],o.concat(this))))},e}(Array);function ds(t){return Dt(t)?cn(t,function(){}):t}function th(t){return typeof t=="boolean"}function rh(){return function(e){return oh(e)}}function oh(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,i=t.immutableCheck,n=i===void 0?!0:i,a=t.serializableCheck,s=a===void 0?!0:a,c=new Jf;if(o&&(th(o)?c.push(as):c.push(as.withExtraArgument(o.extraArgument))),0){if(n)var p;if(s)var u}return c}var ls=!0;function $p(t){var e=rh(),o=t||{},i=o.reducer,n=i===void 0?void 0:i,a=o.middleware,s=a===void 0?e():a,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,m=u===void 0?void 0:u,y=o.enhancers,b=y===void 0?void 0:y,O;if(typeof n=="function")O=n;else if(Qf(n))O=Cp(n);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=s;if(typeof v=="function"&&(v=v(e),!ls&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ls&&v.some(function(Z){return typeof Z!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=wp.apply(void 0,v),$=Do;p&&($=Xf(Nr({trace:!ls},typeof p=="object"&&p)));var T=new eh(E),N=T;Array.isArray(b)?N=Fo([E],b):typeof b=="function"&&(N=b(T));var z=$.apply(void 0,N);return ns(O,m,z)}function _r(t,e){function o(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(e){var a=e.apply(void 0,i);if(!a)throw new Error("prepareAction did not return an object");return Nr(Nr({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:i[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(i){return i.type===t},o}function Np(t){var e={},o=[],i,n={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,n},addMatcher:function(a,s){return o.push({matcher:a,reducer:s}),n},addDefaultCase:function(a){return i=a,n}};return t(n),[e,o,i]}function ih(t){return typeof t=="function"}function nh(t,e,o,i){o===void 0&&(o=[]);var n=typeof e=="function"?Np(e):[e,o,i],a=n[0],s=n[1],c=n[2],p;if(ih(t))p=function(){return ds(t())};else{var u=ds(t);p=function(){return u}}function m(y,b){y===void 0&&(y=p());var O=Fo([a[b.type]],s.filter(function(v){var E=v.matcher;return E(b)}).map(function(v){var E=v.reducer;return E}));return O.filter(function(v){return!!v}).length===0&&(O=[c]),O.reduce(function(v,E){if(E)if(fr(v)){var $=v,T=E($,b);return T===void 0?v:T}else{if(Dt(v))return cn(v,function(N){return E(N,b)});var T=E(v,b);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},y)}return m.getInitialState=p,m}function ah(t,e){return t+"/"+e}function _p(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:ds(t.initialState),i=t.reducers||{},n=Object.keys(i),a={},s={},c={};n.forEach(function(m){var y=i[m],b=ah(e,m),O,v;"reducer"in y?(O=y.reducer,v=y.prepare):O=y,a[m]=O,s[b]=O,c[m]=v?_r(b,v):_r(b)});function p(){var m=typeof t.extraReducers=="function"?Np(t.extraReducers):[t.extraReducers],y=m[0],b=y===void 0?{}:y,O=m[1],v=O===void 0?[]:O,E=m[2],$=E===void 0?void 0:E,T=Nr(Nr({},b),s);return nh(o,function(N){for(var z in T)N.addCase(z,T[z]);for(var Z=0,X=v;Z<X.length;Z++){var tt=X[Z];N.addMatcher(tt.matcher,tt.reducer)}$&&N.addDefaultCase($)})}var u;return{name:e,reducer:function(m,y){return u||(u=p()),u(m,y)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var sh="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lh=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=sh[Math.random()*64|0];return e},ch=["name","message","stack","code"],cs=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Ip=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),dh=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,i=ch;o<i.length;o++){var n=i[o];typeof t[n]=="string"&&(e[n]=t[n])}return e}return{message:String(t)}},gw=function(){function t(e,o,i){var n=_r(e+"/fulfilled",function(m,y,b,O){return{payload:m,meta:ss(Nr({},O||{}),{arg:b,requestId:y,requestStatus:"fulfilled"})}}),a=_r(e+"/pending",function(m,y,b){return{payload:void 0,meta:ss(Nr({},b||{}),{arg:y,requestId:m,requestStatus:"pending"})}}),s=_r(e+"/rejected",function(m,y,b,O,v){return{payload:O,error:(i&&i.serializeError||dh)(m||"Rejected"),meta:ss(Nr({},v||{}),{arg:b,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(y,b,O){var v=i?.idGenerator?i.idGenerator(m):lh(),E=new p,$,T=!1;function N(Z){$=Z,E.abort()}var z=function(){return Yf(this,null,function(){var Z,X,tt,Wt,Ye,Vt,Be;return Vf(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),Wt=(Z=i?.condition)==null?void 0:Z.call(i,m,{getState:b,extra:O}),uh(Wt)?[4,Wt]:[3,2];case 1:Wt=g.sent(),g.label=2;case 2:if(Wt===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=!0,Ye=new Promise(function(x,_){return E.signal.addEventListener("abort",function(){return _({name:"AbortError",message:$||"Aborted"})})}),y(a(v,m,(X=i?.getPendingMeta)==null?void 0:X.call(i,{requestId:v,arg:m},{getState:b,extra:O}))),[4,Promise.race([Ye,Promise.resolve(o(m,{dispatch:y,getState:b,extra:O,requestId:v,signal:E.signal,abort:N,rejectWithValue:function(x,_){return new cs(x,_)},fulfillWithValue:function(x,_){return new Ip(x,_)}})).then(function(x){if(x instanceof cs)throw x;return x instanceof Ip?n(x.payload,v,m,x.meta):n(x,v,m)})])];case 3:return tt=g.sent(),[3,5];case 4:return Vt=g.sent(),tt=Vt instanceof cs?s(null,v,m,Vt.payload,Vt.meta):s(Vt,v,m),[3,5];case 5:return Be=i&&!i.dispatchConditionRejection&&s.match(tt)&&tt.meta.condition,Be||y(tt),[2,tt]}})})}();return Object.assign(z,{abort:N,requestId:v,arg:m,unwrap:function(){return z.then(ph)}})}}return Object.assign(u,{pending:a,rejected:s,fulfilled:n,typePrefix:e})}return t.withTypes=function(){return t},t}();function ph(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function uh(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Pp="listener",Bp="completed",Dp="cancelled",bw="task-"+Dp,xw="task-"+Bp,vw=Pp+"-"+Dp,Sw=Pp+"-"+Bp;var ps="listenerMiddleware";var Ow=_r(ps+"/add"),Cw=_r(ps+"/removeAll"),ww=_r(ps+"/remove");var kp,Ew=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(kp||(kp=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},fh=function(t){return function(e){setTimeout(e,t)}},Aw=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:fh(10);yp();var hh=Ji(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,i,n){this.eventBus.addEventListener(o,i,n)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,i,n){this.eventBus.removeEventListener(o,i,n)}}}),pn=class extends hh(Object){};window.ftReduxStores||(window.ftReduxStores={});var Fp=class t extends pn{static get(e){var o;let i=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,a=window.ftReduxStores[i];if(nn(a))return a;if(n==null)return;let s=_p({...n,reducers:(o=n.reducers)!==null&&o!==void 0?o:{}}),c=$p({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:s.reducer(p,u)});return window.ftReduxStores[n.name]=new t(s,c,n.eventBus)}constructor(e,o,i){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new en;let n=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let p=s,u=a[p];return u?(...m)=>{let y=u(...m.map(n));return this.reduxStore.dispatch(y),y}:m=>{this.setState({[p]:n(m)})}}}),this.eventBus=i??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}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(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var un=class{static format(e,o,i,n){return window.moment?window.moment(e).locale(o).format(this.getMomentDateFormat(i,n)):this.getIntlDateTime(e,o,i,n)}static getMomentDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(e,o,i,n){let a=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(o,{dateStyle:i?"medium":"short"}).format(a);if(!n)return s;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(a);return`${s} ${c}`}static getTimezoneAsString(){let e=i=>String(Math.floor(i)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${e(Math.abs(o)/60)}:${e(Math.abs(o)%60)}`}};var Mp=f(w()),fn=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Yw=(0,Mp.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,a;return((a=(n=this.metadataDescriptors.find(c=>c.key===i))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1)?c=>un.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return fn([(0,us.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),fn([(0,us.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),fn([Ha({store:I.name,selector:o=>{var i,n;return(n=(i=o.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),fn([Ha({store:I.name})],e.prototype,"uiLocale",void 0),e});var mn=f(w());var hn=class extends ht{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=I.getState().session;return!!e?.sessionAuthenticated}};var yn=class extends ht{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=I.getState().session;return!!e?.sessionAuthenticated}};var yh="ft-user-assets",mh={setAssetCount:(t,e)=>{let{userAssetType:o,count:i}=e.payload.assetCount;t.assetCounts.allAsset[o]=i},clearAssetCount:t=>{Object.values(At).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:i,asset:n}=e.payload;hs(t,o,[...fs(t,o),n]),zp(t,o,1,i),Up(t,n)},editAsset:(t,e)=>{let{assetType:o,asset:i}=e.payload;hs(t,o,fs(t,o).map(n=>n.id===i.id?i:n)),Up(t,i)},removeAsset:(t,e)=>{let{assetType:o,mapId:i,assetId:n}=e.payload;hs(t,o,fs(t,o).filter(a=>a.id!==n)),zp(t,o,-1,i)}},Hp={[At.SEARCHES]:"savedSearches",[At.BOOKMARKS]:"bookmarks",[At.BOOKS]:void 0,[At.COLLECTIONS]:void 0},fs=(t,e)=>{var o;let i=Hp[e];return i?(o=t[i])!==null&&o!==void 0?o:[]:[]},hs=(t,e,o)=>{let i=Hp[e];i&&(t[i]=o)},zp=(t,e,o,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+o),e===At.BOOKMARKS&&i)){let a=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,a+o)}},Up=(t,e)=>{let o=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!o.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},mt=mn.FtReduxStore.get({name:yh,reducers:mh,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(At).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ys=class{constructor(e=new hn,o=new yn){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ji,this.savedSearchesService=new Yi,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,mn.deepEqual)((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(),mt.actions.clearAssetCount(),mt.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),mt.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),mt.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();mt.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();mt.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&mt.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&mt.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(mt.getState().assetCounts.bookmarkByMap).length!==0;e===At.BOOKMARKS&&o&&mt.actions.clearBookmarkCountByMap(),mt.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;mt.actions.bookmarks(o)}}},gh=new ys;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gh);(0,Wp.customElement)("ft-app-context")(pe);var jp=f(ee());var ms=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[i,n]=e.split(".");return{context:i,key:n,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Vp=new ms;var bh=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},xh=Symbol("i18nAttributes"),vh=Symbol("i18nListAttributes"),Kp=Symbol("i18nProperties"),gn=Symbol("i18nContexts"),gi=Symbol("i18nUnsubs"),xn=(0,Mo.applyMixinOnce)(Symbol("withI18n"),function(t){var e,o;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Da:di}i18n(a){let{context:s,key:c,message:p}=a,{custom:u,args:m,argsProvider:y}=a;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let b=m??(y?y(this):[]);return this.getI18nService(u).resolveMessage(s,c,...b)}return p}async awaitI18n(a){let{context:s,custom:c}=a;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Vp.isI18nKey(a)){let[c,p]=a.split(".");return this.i18n({custom:!0,context:c,key:p,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,c,p)=>a.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,c;let p=this,u=(m,y,b)=>b?.context&&b.key&&a(m,y,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...m})}:b;(s=this[xh])===null||s===void 0||s.forEach((m,y)=>p[y]=u(m,y,p[y])),(c=this[vh])===null||c===void 0||c.forEach((m,y)=>{var b;return p[y]=(b=p[y])===null||b===void 0?void 0:b.map(O=>u(m,y,O))})}updateI18nProperties(a){var s;(s=this[Kp])===null||s===void 0||s.forEach((c,p)=>{a(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(a,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,c)}addI18nContext(a,s,c){let p=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[gn].set(p,{isCustomContext:c}),this[gi].has(p)||this[gi].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,s)}hasI18nContext(a){return this[gn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[gn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[gi].forEach(a=>a()),this[gi].clear()}}return e=gn,o=gi,bh([(0,jp.property)({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),Gp=class extends xn(Mo.FtLitElement){},bn=class extends xn(Mo.FtLitElementRedux){};var bi=function(t,e,o,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,o,a):s(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Ft=class extends bn{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":vn.nothing:vn.html`
|
|
1542
1542
|
<span class="ft-i18n">
|
|
1543
1543
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
1544
1544
|
</span>
|
|
@@ -2811,16 +2811,16 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
2811
2811
|
<slot @slotchange=${this.updateOptionsFromSlot}
|
|
2812
2812
|
@option-change=${this.updateOptionsFromSlot}
|
|
2813
2813
|
></slot>
|
|
2814
|
-
`}renderOption(e,o){var i;let
|
|
2815
|
-
<div class="${(0,Ls.classMap)({"ft-select--option":!0,"ft-select--option-selected":
|
|
2816
|
-
part="option option-${(i=e.value)===null||i===void 0?void 0:i.replace(/[^\w-]/g,"")}"
|
|
2814
|
+
`}renderOption(e,o){var i,n;let a=this.selectedOption===e;return po.html`
|
|
2815
|
+
<div class="${(0,Ls.classMap)({"ft-select--option":!0,"ft-select--option-selected":a,"ft-typography--body2":!0})}"
|
|
2816
|
+
part="option option-${(n=(i=e.value)===null||i===void 0?void 0:i.toString())===null||n===void 0?void 0:n.replace(/[^\w-]/g,"")}"
|
|
2817
2817
|
tabindex="0"
|
|
2818
2818
|
aria-label="${e.label}"
|
|
2819
2819
|
data-value="${e.value}"
|
|
2820
2820
|
id="${"option-"+o}"
|
|
2821
|
-
@keydown=${
|
|
2821
|
+
@keydown=${c=>this.onOptionKeyDown(c,e)}
|
|
2822
2822
|
@click=${()=>this.selectOption(e)}>
|
|
2823
|
-
<ft-ripple ?primary=${
|
|
2823
|
+
<ft-ripple ?primary=${a} ?activated=${a}></ft-ripple>
|
|
2824
2824
|
<span>${e.label}</span>
|
|
2825
2825
|
</div>
|
|
2826
2826
|
`}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,i;if(super.contentAvailableCallback(e),e.has("focusOptions")&&this.focusOptions&&((i=(o=this.selectedOptionElement)!==null&&o!==void 0?o:this.firstOption)===null||i===void 0||i.focus(),this.focusOptions=!1),e.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px";let n=["bottom","top"];(0,Dr.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",n,"fixed",G.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 i=(o=this.optionsSlot)===null||o===void 0?void 0:o.assignedElements().map(n=>n);i&&i.length>0&&(this.options=i)}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,i,n,a,s;let c;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(),c=(n=(i=this.focusedOption)===null||i===void 0?void 0:i.previousElementSibling)!==null&&n!==void 0?n:this.lastOption;break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),c=(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)&&(c=this.handleAlphanumericPress(e.key));break}c?.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,i;let n=new Date;n.getTime()-this.lastSearchInputDate.getTime()>t.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=e.toLowerCase();let a=this.options.find(c=>{var p;return((p=c.label)===null||p===void 0?void 0:p.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});if(a===void 0){this.lastSearchInputDate=n;return}let s=(i=(o=this.optionsMenu)===null||o===void 0?void 0:o.querySelector(`[data-value="${a.value}"]`))!==null&&i!==void 0?i:void 0;return this.lastSearchInputDate=n,s}onOptionKeyDown(e,o){var i;(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this.selectOption(o),this.optionsDisplayed=!1,(i=this.mainPanel)===null||i===void 0||i.focus())}getOptionId(e){if(!e)return;let o=this.options.findIndex(i=>(0,Dr.deepEqual)(i.value,e.value));if(o!==-1)return`option-${o}`}selectOption(e){var o,i;if(!(0,Dr.deepEqual)((o=this.selectedOption)===null||o===void 0?void 0:o.value,e.value)){this.selectedOption=e;for(let n of this.options)n.selected=n===e;this.dispatchEvent(new CustomEvent("change",{detail:(i=this.selectedOption)===null||i===void 0?void 0:i.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};re.elementDefinitions={"ft-input-label":zt,"ft-typography":oe,"ft-ripple":Y,"ft-icon":de};re.searchTimeoutMilliseconds=2e3;re.styles=[Co,jt,Iu];ge([(0,se.property)({type:String})],re.prototype,"label",void 0);ge([(0,se.property)({type:String})],re.prototype,"ariaLabel",void 0);ge([(0,se.property)({type:String})],re.prototype,"helper",void 0);ge([(0,se.property)({type:Boolean})],re.prototype,"outlined",void 0);ge([(0,se.property)({type:Boolean})],re.prototype,"disabled",void 0);ge([(0,se.property)({type:Boolean})],re.prototype,"error",void 0);ge([(0,se.property)({type:Boolean})],re.prototype,"fixedMenuPosition",void 0);ge([(0,se.property)({type:Array})],re.prototype,"options",void 0);ge([(0,se.state)()],re.prototype,"selectedOption",void 0);ge([(0,se.state)()],re.prototype,"optionsDisplayed",void 0);ge([(0,se.state)()],re.prototype,"focusOptions",void 0);ge([(0,se.state)()],re.prototype,"currentSearch",void 0);ge([(0,se.state)()],re.prototype,"lastSearchInputDate",void 0);ge([(0,se.query)(".ft-select")],re.prototype,"container",void 0);ge([(0,se.query)(".ft-select--options")],re.prototype,"optionsMenu",void 0);ge([(0,se.query)(".ft-select--input-panel")],re.prototype,"mainPanel",void 0);ge([(0,se.query)(".ft-select--option:first-child")],re.prototype,"firstOption",void 0);ge([(0,se.query)(".ft-select--option:focus")],re.prototype,"focusedOption",void 0);ge([(0,se.query)(".ft-select--option.ft-select--option-selected")],re.prototype,"selectedOptionElement",void 0);ge([(0,se.query)(".ft-select--option:last-child")],re.prototype,"lastOption",void 0);ge([(0,se.query)("slot:not([name])")],re.prototype,"optionsSlot",void 0);(0,Is.customElement)("ft-select")(re);(0,Is.customElement)("ft-select-option")(rr);var F=f(w()),ks=f(k());var Tu=f(k()),Ut=f(w()),Ve={display:Ut.FtCssVariableFactory.create("--ft-skeleton--display","","DISPLAY","block"),width:Ut.FtCssVariableFactory.create("--ft-skeleton--width","","SIZE","100%"),height:Ut.FtCssVariableFactory.create("--ft-skeleton--height","","SIZE","20px"),backgroundColor:Ut.FtCssVariableFactory.create("--ft-skeleton--background-color","","COLOR","#f1f1f1"),glareWidth:Ut.FtCssVariableFactory.create("--ft-skeleton--glare-width","","SIZE","200px"),glareColor:Ut.FtCssVariableFactory.create("--ft-skeleton--glare-color","","COLOR","rgba(255, 255, 255, .6)"),animationDuration:Ut.FtCssVariableFactory.create("--ft-skeleton--animation-duration","","UNKNOWN","2s"),borderRadiusM:Ut.FtCssVariableFactory.external(Ut.designSystemVariables.borderRadiusM,"Design system")},$u=Tu.css`
|
|
@@ -1280,7 +1280,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
1280
1280
|
unbounded>
|
|
1281
1281
|
</ft-ripple>
|
|
1282
1282
|
<div class="ft-checkbox--box" part="checkbox-box">
|
|
1283
|
-
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24" part="checkbox-check">
|
|
1283
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24" part="checkbox-check" aria-hidden="true">
|
|
1284
1284
|
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
1285
1285
|
d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
1286
1286
|
</svg>
|
|
@@ -1618,7 +1618,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
1618
1618
|
`;var Ep=T`
|
|
1619
1619
|
`;var Fh="ft-app-info",Vr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Vr.eventName="authentication-change";var Mh={session:(t,e)=>{ke(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>M.dispatchEvent(new Vr(e.payload)),0))}},M=Dr.get({name:Fh,reducers:Mh,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 jr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=M.getState(),n=e??i;if(r&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,n,!0)}static await(e){return new Promise(r=>{let i=t.get(e);if(i)r(i);else{let n=M.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var Ln=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:jr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):jr.await()}};var lt=class extends Ln{constructor(e=!0,r){var i;super(r),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 n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new It,this.cache=e?n.commonCache:new It}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,i)=>0|31*r+i.charCodeAt(0),0))}};var In=class extends lt{async listMyBookmarks(){let e=M.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Qs=class{addCommand(e,r=!1){M.commands.add(e,r)}consumeCommand(e){return M.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Qs;var wp,To=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Uh=Symbol("clearAfterUnitTest"),Tn=class extends Ni(lt){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[wp]=()=>{this.defaultMessages={},this.cache=new It,this.listeners={}},this.currentUiLocale=M.getState().uiLocale,M.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=M.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var i;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let n={...(i=this.defaultMessages[e])!==null&&i!==void 0?i:{},...r};ke(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,i;return this.fetchContext(e),(i=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&i!==void 0?i:{}}resolveRawMessage(e,r){let i=e.toLowerCase();return this.resolveContext(i)[r]}resolveMessage(e,r,...i){var n;let a=e.toLowerCase(),s=this.resolveContext(a);return new dr((n=this.defaultMessages[a])!==null&&n!==void 0?n:{},s).resolve(r,...i)}async fetchContext(e){let r=!this.cache.has(e),i;try{i=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(n){!(n instanceof Ir)&&r&&console.error(n)}return i}subscribe(e,r){var i;return e=e.toLowerCase(),this.listeners[e]=(i=this.listeners[e])!==null&&i!==void 0?i:new Set,this.listeners[e].add(r),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new To({loadedContexts:e})),this.dispatchEvent(new To({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new To({loadedContexts:[e]})),this.dispatchEvent(new To({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>_i(0).then(()=>i()).catch(()=>null)))}};wp=Uh;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Tn{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Tn{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var fi=window.FluidTopicsI18nService,el=window.FluidTopicsCustomI18nService;var tl=class{highlightHtml(e,r,i){Ja(e,r,i)}};window.FluidTopicsHighlightHtmlService=new tl;var kn=class extends lt{async listMySearches(){let{session:e}=M.getState();return Rd(e,Le.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var rl=class{isDate(e){var r,i,n,a;return(a=(n=((i=(r=M.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&i!==void 0?i:[]).find(l=>l.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,r){var i,n,a;return Fr.format(e,(i=r?.locale)!==null&&i!==void 0?i:M.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new rl;var hi=class{static get(e,r){var i,n;let a=M.getState(),{lang:s,region:l}=(n=(i=a.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&n!==void 0?n:{lang:"en",region:"US"};return new gr(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,r??`${s}-${l}`)}};var ol=class{urlToSearchRequest(e){return hi.get().parse(e)}searchRequestToUrl(e){return hi.get().serialize(e)}};window.FluidTopicsUrlService=new ol;var Gr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Gr.eventName="change";var il=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Ap=new il;var _n=class t extends Gt{static build(){return new t(window.history,Ap,()=>window.location,!1)}constructor(e,r,i,n){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=i,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(n)}setCurrentState(e,r=!1){let i=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,i&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),ke(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Gr(this.currentItem())),0)}installProxies(){let e=r=>(i,n,[a,s,l])=>{let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};i.apply(n,[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 r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let i={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(i)}addHistoryChangeListener(e){this.addEventListener(Gr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Gr.eventName,e)}currentItem(){return Wo(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 Wo(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 Wo(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 r;let i=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!i)return e;let n=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,i);)this.hasState(a)&&(n=a),a++;return n}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var i;if(!this.hasState(e))return!1;let n=r??this.currentState.majorStateId,a=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return a==null||a!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=_n.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 Rp=M;function Lp(t,e){var r;return Rp.getState().authenticationRequired&&!(!((r=Rp.getState().session)===null||r===void 0)&&r.sessionAuthenticated)?Promise.resolve(e):t()}var Te=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},me=class extends D{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=()=>jr.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new It,this.cleanSessionDebouncer=new ce,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return C`
|
|
1620
1620
|
<slot></slot>
|
|
1621
|
-
`}connectedCallback(){super.connectedCallback(),M.addEventListener(Vr.eventName,this.reloadConfiguration)}disconnectedCallback(){M.addEventListener(Vr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,i,n,a,s,l,d;super.update(e),e.has("baseUrl")&&(M.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&M.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&M.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&M.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&M.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&M.actions.noCustom(this.noCustom),e.has("editorMode")&&M.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&M.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&M.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>fi.addContext(u)),e.has("openExternalDocumentInNewTab")&&M.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&M.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&M.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(M.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),M.actions.availableUiLocales((n=(i=this.localesConfiguration)===null||i===void 0?void 0:i.availableUiLocales)!==null&&n!==void 0?n:[]),M.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&M.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&M.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",()=>Lp(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};me.elementDefinitions={};me.styles=Ep;Te([h()],me.prototype,"baseUrl",void 0);Te([h()],me.prototype,"apiIntegrationIdentifier",void 0);Te([h()],me.prototype,"apiIntegrationAppVersion",void 0);Te([h()],me.prototype,"uiLocale",void 0);Te([Oe(null)],me.prototype,"availableUiLocales",void 0);Te([Oe(null)],me.prototype,"metadataConfiguration",void 0);Te([h({type:Boolean})],me.prototype,"editorMode",void 0);Te([h({type:Boolean})],me.prototype,"noCustom",void 0);Te([h({type:Boolean})],me.prototype,"openExternalDocumentInNewTab",void 0);Te([h({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],me.prototype,"noCustomComponent",void 0);Te([h({type:Boolean})],me.prototype,"withManualResources",void 0);Te([h({type:Boolean})],me.prototype,"navigatorOnline",void 0);Te([h({type:Boolean})],me.prototype,"forcedOffline",void 0);Te([h({type:Object})],me.prototype,"apiProvider",void 0);Te([h({type:Boolean})],me.prototype,"authenticationRequired",void 0);Te([Oe([])],me.prototype,"messageContexts",void 0);Te([Oe(void 0)],me.prototype,"session",void 0);Te([B()],me.prototype,"localesConfiguration",void 0);Te([B()],me.prototype,"availableContentLocales",void 0);var $n=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},pI=Pe(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(M)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,a;return((a=(n=this.metadataDescriptors.find(l=>l.key===i))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1)?l=>Fr.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return $n([h({type:Boolean})],e.prototype,"useLongDateFormat",void 0),$n([h({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),$n([so({store:M.name,selector:r=>{var i,n;return(n=(i=r.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),$n([so({store:M.name})],e.prototype,"uiLocale",void 0),e});var Nn=class extends lt{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=M.getState().session;return!!e?.sessionAuthenticated}};var Pn=class extends lt{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=M.getState().session;return!!e?.sessionAuthenticated}};var zh="ft-user-assets",Hh={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(ft).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:i,asset:n}=e.payload;al(t,r,[...nl(t,r),n]),Ip(t,r,1,i),Tp(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;al(t,r,nl(t,r).map(n=>n.id===i.id?i:n)),Tp(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;al(t,r,nl(t,r).filter(a=>a.id!==n)),Ip(t,r,-1,i)}},kp={[ft.SEARCHES]:"savedSearches",[ft.BOOKMARKS]:"bookmarks",[ft.BOOKS]:void 0,[ft.COLLECTIONS]:void 0},nl=(t,e)=>{var r;let i=kp[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},al=(t,e,r)=>{let i=kp[e];i&&(t[i]=r)},Ip=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===ft.BOOKMARKS&&i)){let a=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,a+r)}},Tp=(t,e)=>{let r=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!r.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},ct=Dr.get({name:zh,reducers:Hh,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ft).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),sl=class{constructor(e=new Nn,r=new Pn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=M.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new In,this.savedSearchesService=new kn,M.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=M.getState();ke((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ct.actions.clearAssetCount(),ct.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ct.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ct.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ct.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ct.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ct.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ct.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ct.getState().assetCounts.bookmarkByMap).length!==0;e===ft.BOOKMARKS&&r&&ct.actions.clearBookmarkCountByMap(),ct.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 r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ct.actions.bookmarks(r)}}},Wh=new sl;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Wh);V("ft-app-context")(me);var ll=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[i,n]=e.split(".");return{context:i,key:n,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},_p=new ll;var Vh=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},jh=Symbol("i18nAttributes"),Gh=Symbol("i18nListAttributes"),Np=Symbol("i18nProperties"),Bn=Symbol("i18nContexts"),mi=Symbol("i18nUnsubs"),Fn=Pe(Symbol("withI18n"),function(t){var e,r;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?el:fi}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:m,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let y=m??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...y)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(_p.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=(m,f,y)=>y?.context&&y.key&&a(m,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...m})}:y;(s=this[jh])===null||s===void 0||s.forEach((m,f)=>d[f]=u(m,f,d[f])),(l=this[Gh])===null||l===void 0||l.forEach((m,f)=>{var y;return d[f]=(y=d[f])===null||y===void 0?void 0:y.map(S=>u(m,f,S))})}updateI18nProperties(a){var s;(s=this[Np])===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[Bn].set(d,{isCustomContext:l}),this[mi].has(d)||this[mi].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Bn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Bn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[mi].forEach(a=>a()),this[mi].clear()}}return e=Bn,r=mi,Vh([h({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),$p=class extends Fn(D){},Dn=class extends Fn(ri){};var yi=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},wt=class extends Dn{constructor(){super(),this.editorMode=!1,this.addStore(M)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":N:C`
|
|
1621
|
+
`}connectedCallback(){super.connectedCallback(),M.addEventListener(Vr.eventName,this.reloadConfiguration)}disconnectedCallback(){M.addEventListener(Vr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,i,n,a,s,l,d;super.update(e),e.has("baseUrl")&&(M.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&M.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&M.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&M.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&M.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&M.actions.noCustom(this.noCustom),e.has("editorMode")&&M.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&M.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&M.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>fi.addContext(u)),e.has("openExternalDocumentInNewTab")&&M.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&M.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&M.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(M.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),M.actions.availableUiLocales((n=(i=this.localesConfiguration)===null||i===void 0?void 0:i.availableUiLocales)!==null&&n!==void 0?n:[]),M.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&M.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&M.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",()=>Lp(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};me.elementDefinitions={};me.styles=Ep;Te([h()],me.prototype,"baseUrl",void 0);Te([h()],me.prototype,"apiIntegrationIdentifier",void 0);Te([h()],me.prototype,"apiIntegrationAppVersion",void 0);Te([h()],me.prototype,"uiLocale",void 0);Te([Oe(null)],me.prototype,"availableUiLocales",void 0);Te([Oe(null)],me.prototype,"metadataConfiguration",void 0);Te([h({type:Boolean})],me.prototype,"editorMode",void 0);Te([h({type:Boolean})],me.prototype,"noCustom",void 0);Te([h({type:Boolean})],me.prototype,"openExternalDocumentInNewTab",void 0);Te([h({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],me.prototype,"noCustomComponent",void 0);Te([h({type:Boolean})],me.prototype,"withManualResources",void 0);Te([h({type:Boolean})],me.prototype,"navigatorOnline",void 0);Te([h({type:Boolean})],me.prototype,"forcedOffline",void 0);Te([h({type:Object})],me.prototype,"apiProvider",void 0);Te([h({type:Boolean})],me.prototype,"authenticationRequired",void 0);Te([Oe([])],me.prototype,"messageContexts",void 0);Te([Oe(void 0)],me.prototype,"session",void 0);Te([B()],me.prototype,"localesConfiguration",void 0);Te([B()],me.prototype,"availableContentLocales",void 0);var $n=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},pI=Pe(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(M)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,a;return((a=(n=this.metadataDescriptors.find(l=>l.key===i))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1)?l=>Fr.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return $n([h({type:Boolean})],e.prototype,"useLongDateFormat",void 0),$n([h({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),$n([so({store:M.name,selector:r=>{var i,n;return(n=(i=r.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),$n([so({store:M.name})],e.prototype,"uiLocale",void 0),e});var Nn=class extends lt{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=M.getState().session;return!!e?.sessionAuthenticated}};var Pn=class extends lt{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=M.getState().session;return!!e?.sessionAuthenticated}};var zh="ft-user-assets",Hh={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(ft).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:i,asset:n}=e.payload;al(t,r,[...nl(t,r),n]),Ip(t,r,1,i),Tp(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;al(t,r,nl(t,r).map(n=>n.id===i.id?i:n)),Tp(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;al(t,r,nl(t,r).filter(a=>a.id!==n)),Ip(t,r,-1,i)}},kp={[ft.SEARCHES]:"savedSearches",[ft.BOOKMARKS]:"bookmarks",[ft.BOOKS]:void 0,[ft.COLLECTIONS]:void 0},nl=(t,e)=>{var r;let i=kp[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},al=(t,e,r)=>{let i=kp[e];i&&(t[i]=r)},Ip=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===ft.BOOKMARKS&&i)){let a=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,a+r)}},Tp=(t,e)=>{let r=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!r.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},ct=Dr.get({name:zh,reducers:Hh,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ft).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),sl=class{constructor(e=new Nn,r=new Pn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=M.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new In,this.savedSearchesService=new kn,M.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=M.getState();ke((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ct.actions.clearAssetCount(),ct.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ct.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ct.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ct.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ct.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ct.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ct.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ct.getState().assetCounts.bookmarkByMap).length!==0;e===ft.BOOKMARKS&&r&&ct.actions.clearBookmarkCountByMap(),ct.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 r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ct.actions.bookmarks(r)}}},Wh=new sl;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Wh);V("ft-app-context")(me);var ll=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[i,n]=e.split(".");return{context:i,key:n,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},_p=new ll;var Vh=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},jh=Symbol("i18nAttributes"),Gh=Symbol("i18nListAttributes"),Np=Symbol("i18nProperties"),Bn=Symbol("i18nContexts"),mi=Symbol("i18nUnsubs"),Fn=Pe(Symbol("withI18n"),function(t){var e,r;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?el:fi}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:m,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let y=m??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...y)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(_p.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=(m,f,y)=>y?.context&&y.key&&a(m,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...m})}:y;(s=this[jh])===null||s===void 0||s.forEach((m,f)=>d[f]=u(m,f,d[f])),(l=this[Gh])===null||l===void 0||l.forEach((m,f)=>{var y;return d[f]=(y=d[f])===null||y===void 0?void 0:y.map(S=>u(m,f,S))})}updateI18nProperties(a){var s;(s=this[Np])===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[Bn].set(d,{isCustomContext:l}),this[mi].has(d)||this[mi].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Bn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Bn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[mi].forEach(a=>a()),this[mi].clear()}}return e=Bn,r=mi,Vh([h({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),$p=class extends Fn(D){},Dn=class extends Fn(ri){};var yi=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},wt=class extends Dn{constructor(){super(),this.editorMode=!1,this.addStore(M)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":N:C`
|
|
1622
1622
|
<span class="ft-i18n">
|
|
1623
1623
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
1624
1624
|
</span>
|
|
@@ -2891,16 +2891,16 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
2891
2891
|
<slot @slotchange=${this.updateOptionsFromSlot}
|
|
2892
2892
|
@option-change=${this.updateOptionsFromSlot}
|
|
2893
2893
|
></slot>
|
|
2894
|
-
`}renderOption(e,r){var i;let
|
|
2895
|
-
<div class="${fe({"ft-select--option":!0,"ft-select--option-selected":
|
|
2896
|
-
part="option option-${(i=e.value)===null||i===void 0?void 0:i.replace(/[^\w-]/g,"")}"
|
|
2894
|
+
`}renderOption(e,r){var i,n;let a=this.selectedOption===e;return C`
|
|
2895
|
+
<div class="${fe({"ft-select--option":!0,"ft-select--option-selected":a,"ft-typography--body2":!0})}"
|
|
2896
|
+
part="option option-${(n=(i=e.value)===null||i===void 0?void 0:i.toString())===null||n===void 0?void 0:n.replace(/[^\w-]/g,"")}"
|
|
2897
2897
|
tabindex="0"
|
|
2898
2898
|
aria-label="${e.label}"
|
|
2899
2899
|
data-value="${e.value}"
|
|
2900
2900
|
id="${"option-"+r}"
|
|
2901
|
-
@keydown=${
|
|
2901
|
+
@keydown=${l=>this.onOptionKeyDown(l,e)}
|
|
2902
2902
|
@click=${()=>this.selectOption(e)}>
|
|
2903
|
-
<ft-ripple ?primary=${
|
|
2903
|
+
<ft-ripple ?primary=${a} ?activated=${a}></ft-ripple>
|
|
2904
2904
|
<span>${e.label}</span>
|
|
2905
2905
|
</div>
|
|
2906
2906
|
`}willUpdate(e){super.willUpdate(e),e.has("options")&&(this.selectedOption=this.options.filter(r=>r.selected)[0]),e.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(e){var r,i;if(super.contentAvailableCallback(e),e.has("focusOptions")&&this.focusOptions&&((i=(r=this.selectedOptionElement)!==null&&r!==void 0?r:this.firstOption)===null||i===void 0||i.focus(),this.focusOptions=!1),e.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px";let n=["bottom","top"];Va(this.mainPanel,this.optionsMenu,"bottom",n,"fixed",Y.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 r;e.stopPropagation();let i=(r=this.optionsSlot)===null||r===void 0?void 0:r.assignedElements().map(n=>n);i&&i.length>0&&(this.options=i)}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 r,i,n,a,s;let l;switch(e.key){case"Escape":this.optionsDisplayed=!1,(r=this.mainPanel)===null||r===void 0||r.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),l=(n=(i=this.focusedOption)===null||i===void 0?void 0:i.previousElementSibling)!==null&&n!==void 0?n: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 r=e.charCodeAt(0);return r>47&&r<58||r>64&&r<91||r>96&&r<123}handleAlphanumericPress(e){var r,i;let n=new Date;n.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=n;return}let s=(i=(r=this.optionsMenu)===null||r===void 0?void 0:r.querySelector(`[data-value="${a.value}"]`))!==null&&i!==void 0?i:void 0;return this.lastSearchInputDate=n,s}onOptionKeyDown(e,r){var i;(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this.selectOption(r),this.optionsDisplayed=!1,(i=this.mainPanel)===null||i===void 0||i.focus())}getOptionId(e){if(!e)return;let r=this.options.findIndex(i=>ke(i.value,e.value));if(r!==-1)return`option-${r}`}selectOption(e){var r,i;if(!ke((r=this.selectedOption)===null||r===void 0?void 0:r.value,e.value)){this.selectedOption=e;for(let n of this.options)n.selected=n===e;this.dispatchEvent(new CustomEvent("change",{detail:(i=this.selectedOption)===null||i===void 0?void 0:i.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};le.elementDefinitions={"ft-input-label":At,"ft-typography":de,"ft-ripple":Q,"ft-icon":he};le.searchTimeoutMilliseconds=2e3;le.styles=[Lo,Pt,Zp];xe([h({type:String})],le.prototype,"label",void 0);xe([h({type:String})],le.prototype,"ariaLabel",void 0);xe([h({type:String})],le.prototype,"helper",void 0);xe([h({type:Boolean})],le.prototype,"outlined",void 0);xe([h({type:Boolean})],le.prototype,"disabled",void 0);xe([h({type:Boolean})],le.prototype,"error",void 0);xe([h({type:Boolean})],le.prototype,"fixedMenuPosition",void 0);xe([h({type:Array})],le.prototype,"options",void 0);xe([B()],le.prototype,"selectedOption",void 0);xe([B()],le.prototype,"optionsDisplayed",void 0);xe([B()],le.prototype,"focusOptions",void 0);xe([B()],le.prototype,"currentSearch",void 0);xe([B()],le.prototype,"lastSearchInputDate",void 0);xe([z(".ft-select")],le.prototype,"container",void 0);xe([z(".ft-select--options")],le.prototype,"optionsMenu",void 0);xe([z(".ft-select--input-panel")],le.prototype,"mainPanel",void 0);xe([z(".ft-select--option:first-child")],le.prototype,"firstOption",void 0);xe([z(".ft-select--option:focus")],le.prototype,"focusedOption",void 0);xe([z(".ft-select--option.ft-select--option-selected")],le.prototype,"selectedOptionElement",void 0);xe([z(".ft-select--option:last-child")],le.prototype,"lastOption",void 0);xe([z("slot:not([name])")],le.prototype,"optionsSlot",void 0);V("ft-select")(le);V("ft-select-option")(Ut);var Ue={display:o.create("--ft-skeleton--display","","DISPLAY","block"),width:o.create("--ft-skeleton--width","","SIZE","100%"),height:o.create("--ft-skeleton--height","","SIZE","20px"),backgroundColor:o.create("--ft-skeleton--background-color","","COLOR","#f1f1f1"),glareWidth:o.create("--ft-skeleton--glare-width","","SIZE","200px"),glareColor:o.create("--ft-skeleton--glare-color","","COLOR","rgba(255, 255, 255, .6)"),animationDuration:o.create("--ft-skeleton--animation-duration","","UNKNOWN","2s"),borderRadiusM:o.external(L.borderRadiusM,"Design system")},qp=T`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-bar",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.47",
|
|
4
4
|
"description": "Search bar component using Fluid Topics public API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-accordion": "1.3.
|
|
23
|
-
"@fluid-topics/ft-app-context": "1.3.
|
|
24
|
-
"@fluid-topics/ft-button": "1.3.
|
|
25
|
-
"@fluid-topics/ft-chip": "1.3.
|
|
26
|
-
"@fluid-topics/ft-filter": "1.3.
|
|
27
|
-
"@fluid-topics/ft-icon": "1.3.
|
|
28
|
-
"@fluid-topics/ft-select": "1.3.
|
|
29
|
-
"@fluid-topics/ft-size-watcher": "1.3.
|
|
30
|
-
"@fluid-topics/ft-skeleton": "1.3.
|
|
31
|
-
"@fluid-topics/ft-snap-scroll": "1.3.
|
|
32
|
-
"@fluid-topics/ft-tooltip": "1.3.
|
|
33
|
-
"@fluid-topics/ft-typography": "1.3.
|
|
34
|
-
"@fluid-topics/ft-wc-utils": "1.3.
|
|
22
|
+
"@fluid-topics/ft-accordion": "1.3.47",
|
|
23
|
+
"@fluid-topics/ft-app-context": "1.3.47",
|
|
24
|
+
"@fluid-topics/ft-button": "1.3.47",
|
|
25
|
+
"@fluid-topics/ft-chip": "1.3.47",
|
|
26
|
+
"@fluid-topics/ft-filter": "1.3.47",
|
|
27
|
+
"@fluid-topics/ft-icon": "1.3.47",
|
|
28
|
+
"@fluid-topics/ft-select": "1.3.47",
|
|
29
|
+
"@fluid-topics/ft-size-watcher": "1.3.47",
|
|
30
|
+
"@fluid-topics/ft-skeleton": "1.3.47",
|
|
31
|
+
"@fluid-topics/ft-snap-scroll": "1.3.47",
|
|
32
|
+
"@fluid-topics/ft-tooltip": "1.3.47",
|
|
33
|
+
"@fluid-topics/ft-typography": "1.3.47",
|
|
34
|
+
"@fluid-topics/ft-wc-utils": "1.3.47",
|
|
35
35
|
"lit": "3.1.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@fluid-topics/public-api": "1.0.110"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "16ac56d62f3a88a3b03cbc92bcd04dd91951a015"
|
|
41
41
|
}
|