@fluid-topics/ft-search-context 2.2.52 → 2.2.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,13 @@
1
- "use strict";(()=>{var Cs=Object.create;var Er=Object.defineProperty;var xs=Object.getOwnPropertyDescriptor;var ws=Object.getOwnPropertyNames;var Ts=Object.getPrototypeOf,Rs=Object.prototype.hasOwnProperty;var Ft=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var Os=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ws(e))!Rs.call(t,s)&&s!==r&&Er(t,s,{get:()=>e[s],enumerable:!(n=xs(e,s))||n.enumerable});return t};var f=(t,e,r)=>(r=t!=null?Cs(Ts(t)):{},Os(e||!t||!t.__esModule?Er(r,"default",{value:t,enumerable:!0}):r,t));var C=Ft((Ni,Sr)=>{Sr.exports=ftGlobals.wcUtils});var fe=Ft((Li,vr)=>{vr.exports=ftGlobals.lit});var ee=Ft((Pi,Ar)=>{Ar.exports=ftGlobals.litDecorators});var As=f(C());var Ss=f(fe()),F=f(ee()),N=f(C());var br=f(fe());var _r=br.css`
2
- `;var ne=f(C()),qe=f(ee());var Ce;(function(t){t.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(Ce||(Ce={}));var A=f(C());var Cr=f(C()),Is={setRequest:(t,e)=>{t.request=e.payload}},xr=t=>Cr.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],sortId:void 0,paging:{page:1,perPage:20},keywordMatch:void 0},liveQuery:"",recentQueries:[],paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,announcements:void 0,suggestResults:void 0,configuration:void 0,propagatedFacets:[]},reducers:Is,deprecatedKeys:["locales"]});var wr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(wr||(wr={}));var Tr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Tr||(Tr={}));var Rr;(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"})(Rr||(Rr={}));var te;(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"})(te||(te={}));var Or;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Or||(Or={}));var Ir;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ir||(Ir={}));var kr;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(kr||(kr={}));var se;(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__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",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__AI_TRANSLATE="TOPIC__AI_TRANSLATE",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"})(se||(se={}));var Mr;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Mr||(Mr={}));var Dr;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(Dr||(Dr={}));var Nr;(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",t.DOC_DIFF="DOC_DIFF"})(Nr||(Nr={}));var Lr;(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",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(Lr||(Lr={}));var Pr;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Pr||(Pr={}));var Fr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Fr||(Fr={}));var Ur;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Ur||(Ur={}));var Vr;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Vr||(Vr={}));var Br;(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"})(Br||(Br={}));var He;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(He||(He={}));var jr;(function(t){t.ASC="ASC",t.DESC="DESC"})(jr||(jr={}));var qr;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(qr||(qr={}));var me;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(me||(me={}));var Hr;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Hr||(Hr={}));var $r;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})($r||($r={}));var Kr;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Kr||(Kr={}));var zr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(zr||(zr={}));var K;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(K||(K={}));var ye;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ye||(ye={}));var Gr;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Gr||(Gr={}));var v;(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.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.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(v||(v={}));var B;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(B||(B={}));var Wr;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Wr||(Wr={}));var Qr;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Qr||(Qr={}));var Yr;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Yr||(Yr={}));var Xr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Xr||(Xr={}));var Jr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Jr||(Jr={}));var Zr;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Zr||(Zr={}));var en;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(en||(en={}));var tn;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(tn||(tn={}));var rn;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(rn||(rn={}));var nn;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(nn||(nn={}));var sn;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(sn||(sn={}));var an;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(an||(an={}));var on;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(on||(on={}));var ks={[v.PERSONAL_BOOK_SHARE_USER]:[v.PERSONAL_BOOK_USER],[v.HTML_EXPORT_USER]:[v.PERSONAL_BOOK_USER],[v.PDF_EXPORT_USER]:[v.PERSONAL_BOOK_USER],[v.KHUB_ADMIN]:[v.CONTENT_PUBLISHER],[v.ADMIN]:[v.KHUB_ADMIN,v.USERS_ADMIN,v.PORTAL_ADMIN,v.BEHAVIOR_DATA_USER],[v.GENERATIVE_AI_EXPORT_USER]:[v.GENERATIVE_AI_USER]};function cn(t,e){return t===e||(ks[t]??[]).some(r=>cn(r,e))}function xe(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(n=>cn(n,e))}function un(t,...e){return t==null?!1:e.some(r=>xe(t,r))}var sr=f(ee());var ln=f(ee(),1);var Ut=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},Ms=t=>({fromAttribute:e=>{if(e==null)return we(t);try{return JSON.parse(e)}catch{return we(t)}},toAttribute:e=>JSON.stringify(e)});function dn(t,e){return(0,ln.property)({type:Object,converter:Ms(t),hasChanged:Te,...e??{}})}function Ds(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!ge(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!ge(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[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 s=a=>Object.keys(a).filter(o=>a[o]!=null),i=s(t);if(r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!ge(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function ge(t,e){try{return Ds(t,e)}catch{return!1}}function Te(t,e){return!ge(t,e)}function we(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function $e(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let s=e(n);return s[t]=!0,s}}var pn=f(ee(),1);var Vt=t=>{let e=t??{};return(r,n)=>{var s;let i={hasChanged:Te,attribute:!1,...e};(0,pn.property)(i)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(s=e.selector)!==null&&s!==void 0?s:(o=>o[n]),store:e.store})}};var Ke=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var ie=f(ee(),1);var ze=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let s=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let a of n)try{await a()}catch(o){s(o);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var We=f(fe(),1);var Ge=class extends We.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return(0,We.adoptStyles)(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){Ut(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function hn(t,e,...r){var n;let s=t.querySelector(e);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Se=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},gn,fn=Symbol("constructorPrototype"),mn=Symbol("constructorName"),En=Symbol("exportpartsDebouncer"),yn=Symbol("dynamicDependenciesLoaded"),Ee=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Ee.eventName="exportparts-updated";var z=class extends Ge{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[gn]=new ze(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[En].run(()=>{var s,i;!((s=this.exportpartsPrefix)===null||s===void 0)&&s.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[mn]=this.constructor.name,this[fn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[mn]&&Object.setPrototypeOf(this,this[fn])}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(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[yn]||(r[yn]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Ee.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Ee.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 Ee)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=hn(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,s;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((s=this.customStylesheet)!==null&&s!==void 0?s:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(e){var r,n,s,i,a,o;let c=h=>h!=null&&h.trim().length>0,u=e.filter(c).map(h=>h.trim());if(u.length===0){this.exportparts=void 0;return}let d=new Set;for(let h of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let _=(a=(n=h.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],O=(o=(s=h.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(y=>y.split(":")[1]))!==null&&o!==void 0?o:[],U=[..._,...O].filter(c).map(y=>y.trim());for(let y of U)d.add(y)}if(d.size===0){this.exportparts=void 0;return}let p=[...d.values()].flatMap(h=>u.map(_=>`${h}:${_}--${h}`));this.exportparts=[...this.part,...p].join(", ")}};gn=En;Se([(0,ie.property)()],z.prototype,"exportpartsPrefix",void 0);Se([dn([])],z.prototype,"exportpartsPrefixes",void 0);Se([(0,ie.property)({reflect:!0})],z.prototype,"exportparts",void 0);Se([(0,ie.property)()],z.prototype,"customStylesheet",void 0);Se([(0,ie.property)()],z.prototype,"elementToFocus",void 0);Se([(0,ie.state)()],z.prototype,"useAdoptedStyleSheets",void 0);function Qe(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Re=Symbol("internalReduxEventsUnsubscribers"),re=Symbol("internalStoresUnsubscribers"),ae=Symbol("internalStores"),Ns=$e(Symbol("withRedux"),function(t){var e,r,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ae].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ae].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ae].get(a)}addStore(a,o){var c;o=(c=o??a.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(o),this[ae].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ae].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ae].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let c=this.constructor.getPropertyOptions(o);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:o)){let u=this.getStore(a.store);u&&(a.store?this[re].has(a.store):this[re].size>0)&&(this[o]=a.selector(u.getState(),this))}})}subscribeToStore(a,o){var c,u;this[re].set(a,o.subscribe(()=>this.updateFromStores())),this[Re].set(a,[]),Qe(o)&&(!((c=o.deprecatedKeys)===null||c===void 0)&&c.length&&this.reduxConstructor.reduxProperties.forEach((d,p)=>{this.getStore(d.store)===o&&o.deprecatedKeys.includes(p)&&console.warn("Element",this,"is subscribed to deprecated key",p,"in store",o.name)}),o.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((d,p)=>{if(typeof this[p]=="function"&&(!d.store||o.name===d.store)){let h=_=>this[p](_);o.addEventListener(d.eventName,h),this[Re].get(a).push(()=>o.removeEventListener(d.eventName,h))}}))),this.onStoreAvailable(a)}unsubscribeFromStores(){this[re].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[re].has(a)&&this[re].get(a)(),this[re].delete(a),(o=this[Re].get(a))===null||o===void 0||o.forEach(c=>c()),this[Re].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=re,r=ae,n=Re,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),Sn=class extends Ns(z){};function w(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 Ls=typeof Symbol=="function"&&Symbol.observable||"@@observable",vn=Ls,Bt=()=>Math.random().toString(36).substring(7).split("").join("."),Ps={INIT:`@@redux/INIT${Bt()}`,REPLACE:`@@redux/REPLACE${Bt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bt()}`},Ye=Ps;function Xe(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function jt(t,e,r){if(typeof t!="function")throw new Error(w(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(w(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(w(1));return r(jt)(t,e)}let n=t,s=e,i=new Map,a=i,o=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((y,V)=>{a.set(V,y)}))}function d(){if(c)throw new Error(w(3));return s}function p(y){if(typeof y!="function")throw new Error(w(4));if(c)throw new Error(w(5));let V=!0;u();let H=o++;return a.set(H,y),function(){if(V){if(c)throw new Error(w(6));V=!1,u(),a.delete(H),i=null}}}function h(y){if(!Xe(y))throw new Error(w(7));if(typeof y.type>"u")throw new Error(w(8));if(typeof y.type!="string")throw new Error(w(17));if(c)throw new Error(w(9));try{c=!0,s=n(s,y)}finally{c=!1}return(i=a).forEach(H=>{H()}),y}function _(y){if(typeof y!="function")throw new Error(w(10));n=y,h({type:Ye.REPLACE})}function O(){let y=p;return{subscribe(V){if(typeof V!="object"||V===null)throw new Error(w(11));function H(){let E=V;E.next&&E.next(d())}return H(),{unsubscribe:y(H)}},[vn](){return this}}}return h({type:Ye.INIT}),{dispatch:h,subscribe:p,getState:d,replaceReducer:_,[vn]:O}}function Fs(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:Ye.INIT})>"u")throw new Error(w(12));if(typeof r(void 0,{type:Ye.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(w(13))})}function qt(t){let e=Object.keys(t),r={};for(let a=0;a<e.length;a++){let o=e[a];typeof t[o]=="function"&&(r[o]=t[o])}let n=Object.keys(r),s,i;try{Fs(r)}catch(a){i=a}return function(o={},c){if(i)throw i;let u=!1,d={};for(let p=0;p<n.length;p++){let h=n[p],_=r[h],O=o[h],U=_(O,c);if(typeof U>"u"){let y=c&&c.type;throw new Error(w(14))}d[h]=U,u=u||U!==O}return u=u||n.length!==Object.keys(o).length,u?d:o}}function Oe(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...n)=>e(r(...n)))}function An(...t){return e=>(r,n)=>{let s=e(r,n),i=()=>{throw new Error(w(15))},a={getState:s.getState,dispatch:(c,...u)=>i(c,...u)},o=t.map(c=>c(a));return i=Oe(...o)(s.dispatch),{...s,dispatch:i}}}function bn(t){return Xe(t)&&"type"in t&&typeof t.type=="string"}var kn=Symbol.for("immer-nothing"),_n=Symbol.for("immer-draftable"),T=Symbol.for("immer-state");function q(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var L=Object,Ae=L.getPrototypeOf,tt="constructor",ot="prototype",zt="configurable",rt="enumerable",Ze="writable",Ie="value",G=t=>!!t&&!!t[T];function P(t){return t?Mn(t)||ut(t)||!!t[_n]||!!t[tt]?.[_n]||lt(t)||Ne(t):!1}var Us=L[ot][tt].toString(),Cn=new WeakMap;function Mn(t){if(!t||!er(t))return!1;let e=Ae(t);if(e===null||e===L[ot])return!0;let r=L.hasOwnProperty.call(e,tt)&&e[tt];if(r===Object)return!0;if(!ve(r))return!1;let n=Cn.get(r);return n===void 0&&(n=Function.toString.call(r),Cn.set(r,n)),n===Us}function ct(t,e,r=!0){De(t)===0?(r?Reflect.ownKeys(t):L.keys(t)).forEach(s=>{e(s,t[s],t)}):t.forEach((n,s)=>e(s,n,t))}function De(t){let e=t[T];return e?e.type_:ut(t)?1:lt(t)?2:Ne(t)?3:0}var Ht=(t,e,r=De(t))=>r===2?t.has(e):L[ot].hasOwnProperty.call(t,e),Gt=(t,e,r=De(t))=>r===2?t.get(e):t[e],nt=(t,e,r,n=De(t))=>{n===2?t.set(e,r):n===3?t.add(r):t[e]=r};function Vs(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var ut=Array.isArray,lt=t=>t instanceof Map,Ne=t=>t instanceof Set,er=t=>typeof t=="object",ve=t=>typeof t=="function",$t=t=>typeof t=="boolean";function Bs(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var X=t=>t.copy_||t.base_;var tr=t=>t.modified_?t.copy_:t.base_;function Wt(t,e){if(lt(t))return new Map(t);if(Ne(t))return new Set(t);if(ut(t))return Array[ot].slice.call(t);let r=Mn(t);if(e===!0||e==="class_only"&&!r){let n=L.getOwnPropertyDescriptors(t);delete n[T];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let a=s[i],o=n[a];o[Ze]===!1&&(o[Ze]=!0,o[zt]=!0),(o.get||o.set)&&(n[a]={[zt]:!0,[Ze]:!0,[rt]:o[rt],[Ie]:t[a]})}return L.create(Ae(t),n)}else{let n=Ae(t);if(n!==null&&r)return{...t};let s=L.create(n);return L.assign(s,t)}}function dt(t,e=!1){return pt(t)||G(t)||!P(t)||(De(t)>1&&L.defineProperties(t,{set:Je,add:Je,clear:Je,delete:Je}),L.freeze(t),e&&ct(t,(r,n)=>{dt(n,!0)},!1)),t}function js(){q(2)}var Je={[Ie]:js};function pt(t){return t===null||!er(t)?!0:L.isFrozen(t)}var st="MapSet",Qt="Patches",xn="ArrayMethods",Dn={};function oe(t){let e=Dn[t];return e||q(0,t),e}var wn=t=>!!Dn[t];var ke,Nn=()=>ke,qs=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:wn(st)?oe(st):void 0,arrayMethodsPlugin_:wn(xn)?oe(xn):void 0});function Tn(t,e){e&&(t.patchPlugin_=oe(Qt),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Yt(t){Xt(t),t.drafts_.forEach(Hs),t.drafts_=null}function Xt(t){t===ke&&(ke=t.parent_)}var Rn=t=>ke=qs(ke,t);function Hs(t){let e=t[T];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function On(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[T].modified_&&(Yt(e),q(4)),P(t)&&(t=In(e,t));let{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(r[T].base_,t,e)}else t=In(e,r);return $s(e,t,!0),Yt(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==kn?t:void 0}function In(t,e){if(pt(e))return e;let r=e[T];if(!r)return it(e,t.handledSet_,t);if(!ht(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(t);Fn(r,t)}return r.copy_}function $s(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&dt(e,r)}function Ln(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var ht=(t,e)=>t.scope_===e,Ks=[];function Pn(t,e,r,n){let s=X(t),i=t.type_;if(n!==void 0&&Gt(s,n,i)===e){nt(s,n,r,i);return}if(!t.draftLocations_){let o=t.draftLocations_=new Map;ct(s,(c,u)=>{if(G(u)){let d=o.get(u)||[];d.push(c),o.set(u,d)}})}let a=t.draftLocations_.get(e)??Ks;for(let o of a)nt(s,o,r,i)}function zs(t,e,r){t.callbacks_.push(function(s){let i=e;if(!i||!ht(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let a=tr(i);Pn(t,i.draft_??i,a,r),Fn(i,s)})}function Fn(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:n}=e;if(n){let s=n.getPath(t);s&&n.generatePatches_(t,s,e)}Ln(t)}}function Gs(t,e,r){let{scope_:n}=t;if(G(r)){let s=r[T];ht(s,n)&&s.callbacks_.push(function(){et(t);let a=tr(s);Pn(t,r,a,e)})}else P(r)&&t.callbacks_.push(function(){let i=X(t);t.type_===3?i.has(r)&&it(r,n.handledSet_,n):Gt(i,e,t.type_)===r&&n.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&it(Gt(t.copy_,e,t.type_),n.handledSet_,n)})}function it(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||G(t)||e.has(t)||!P(t)||pt(t)||(e.add(t),ct(t,(n,s)=>{if(G(s)){let i=s[T];if(ht(i,r)){let a=tr(i);nt(t,n,a,t.type_),Ln(i)}}else P(s)&&it(s,e,r)})),t}function Ws(t,e){let r=ut(t),n={type_:r?1:0,scope_:e?e.scope_:Nn(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=at;r&&(s=[n],i=Me);let{revoke:a,proxy:o}=Proxy.revocable(s,i);return n.draft_=o,n.revoke_=a,[o,n]}var at={get(t,e){if(e===T)return t;let r=t.scope_.arrayMethodsPlugin_,n=t.type_===1&&typeof e=="string";if(n&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let s=X(t);if(!Ht(s,e,t.type_))return Ys(t,s,e);let i=s[e];if(t.finalized_||!P(i)||n&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&Bs(e))return i;if(i===Kt(t.base_,e)||Qs(t,e,i)){et(t);let a=t.type_===1?+e:e,o=Zt(t.scope_,i,t,a);return t.copy_[a]=o}return i},has(t,e){return e in X(t)},ownKeys(t){return Reflect.ownKeys(X(t))},set(t,e,r){let n=Un(X(t),e);if(n?.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){let s=Kt(X(t),e),i=s?.[T];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_.delete(e),!0;if(Vs(r,s)&&(r!==void 0||Ht(t.base_,e,t.type_)))return!0;et(t),Jt(t)}return t.copy_[e]===r&&(r!==void 0||Ht(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Gs(t,e,r)),!0},deleteProperty(t,e){return et(t),Kt(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),Jt(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=X(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{[Ze]:!0,[zt]:t.type_!==1||e!=="length",[rt]:n[rt],[Ie]:r[e]}},defineProperty(){q(11)},getPrototypeOf(t){return Ae(t.base_)},setPrototypeOf(){q(12)}},Me={};for(let t in at){let e=at[t];Me[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}Me.deleteProperty=function(t,e){return Me.set.call(this,t,e,void 0)};Me.set=function(t,e,r){return at.set.call(this,t[0],e,r,t[0])};function Kt(t,e){let r=t[T];return(r?X(r):t)[e]}function Qs(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||!P(r)||r[T]?!1:t.baseRefs_.has(r)}function Ys(t,e,r){let n=Un(e,r);return n?Ie in n?n[Ie]:n.get?.call(t.draft_):void 0}function Un(t,e){if(!(e in t))return;let r=Ae(t);for(;r;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Ae(r)}}function Jt(t){t.modified_||(t.modified_=!0,t.parent_&&Jt(t.parent_))}function et(t){t.copy_||(t.assigned_=new Map,t.copy_=Wt(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Xs=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,n)=>{if(ve(e)&&!ve(r)){let i=r;r=e;let a=this;return function(c=i,...u){return a.produce(c,d=>r.call(this,d,...u))}}ve(r)||q(6),n!==void 0&&!ve(n)&&q(7);let s;if(P(e)){let i=Rn(this),a=Zt(i,e,void 0),o=!0;try{s=r(a),o=!1}finally{o?Yt(i):Xt(i)}return Tn(i,n),On(s,i)}else if(!e||!er(e)){if(s=r(e),s===void 0&&(s=e),s===kn&&(s=void 0),this.autoFreeze_&&dt(s,!0),n){let i=[],a=[];oe(Qt).generateReplacementPatches_(e,s,{patches_:i,inversePatches_:a}),n(i,a)}return s}else q(1,e)},this.produceWithPatches=(e,r)=>{if(ve(e))return(a,...o)=>this.produceWithPatches(a,c=>e(c,...o));let n,s;return[this.produce(e,r,(a,o)=>{n=a,s=o}),n,s]},$t(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),$t(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),$t(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){P(t)||q(8),G(t)&&(t=Vn(t));let e=Rn(this),r=Zt(e,t,void 0);return r[T].isManual_=!0,Xt(e),r}finishDraft(t,e){let r=t&&t[T];(!r||!r.isManual_)&&q(9);let{scope_:n}=r;return Tn(n,e),On(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let s=e[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(e=e.slice(r+1));let n=oe(Qt).applyPatches_;return G(t)?n(t,e):this.produce(t,s=>n(s,e))}};function Zt(t,e,r,n){let[s,i]=lt(e)?oe(st).proxyMap_(e,r):Ne(e)?oe(st).proxySet_(e,r):Ws(e,r);return(r?.scope_??Nn()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?zs(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),s}function Vn(t){return G(t)||q(10,t),Bn(t)}function Bn(t){if(!P(t)||pt(t))return t;let e=t[T],r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=Wt(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=Wt(t,!0);let s=r;return Ne(r)&&(r=new Set),ct(s,(i,a)=>{nt(r,i,Bn(a))},n),e&&(e.finalized_=!1),r}var Js=globalThis.Iterator,xa=typeof Js?.from=="function";var Zs=new Xs,rr=Zs.produce;function jn(t){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,t):s(i)}var qn=jn(),Hn=jn;var ei=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Oe:Oe.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Pe(t,e){function r(...n){if(e){let s=e(...n);if(!s)throw new Error(W(0));return{type:t,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:t,payload:n[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=n=>n!=null&&n.type===t&&bn(n),r}var zn=class Le extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Le.prototype)}static get[Symbol.species](){return Le}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Le(...e[0].concat(this)):new Le(...e.concat(this))}};function $n(t){return P(t)?rr(t,()=>{}):t}function ft(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function ti(t){return typeof t=="boolean"}var ri=()=>function(e){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=e??{},a=new zn;return r&&(ti(r)?a.push(qn):a.push(Hn(r.extraArgument))),a},ni="RTK_autoBatch";var Kn=t=>e=>{setTimeout(e,t)},si=(t,e,r)=>n=>{let s=!1,i,a,o=()=>{s||(s=!0,e?.(i),clearTimeout(a),n())};i=t(o),a=setTimeout(o,r)},ii=(t={type:"raf"})=>e=>(...r)=>{let n=e(...r),s=!0,i=!1,a=!1,o=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?si(window.requestAnimationFrame,window.cancelAnimationFrame,100):Kn(10):t.type==="callback"?t.queueNotification:Kn(t.timeout),u=()=>{a=!1,i&&(i=!1,o.forEach(d=>d()))};return Object.assign({},n,{subscribe(d){let p=()=>s&&d(),h=n.subscribe(p);return o.add(d),()=>{h(),o.delete(d)}},dispatch(d){try{return s=!d?.meta?.[ni],i=!s,i&&(a||(a=!0,c(u))),n.dispatch(d)}finally{s=!0}}})},ai=t=>function(r){let{autoBatch:n=!0}=r??{},s=new zn(t);return n&&s.push(ii(typeof n=="object"?n:void 0)),s};function Gn(t){let e=ri(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=t||{},c;if(typeof r=="function")c=r;else if(Xe(r))c=qt(r);else throw new Error(W(1));let u;typeof n=="function"?u=n(e):u=e();let d=Oe;s&&(d=ei({trace:!1,...typeof s=="object"&&s}));let p=An(...u),h=ai(p),_=typeof o=="function"?o(h):h(),O=d(..._);return jt(c,a,O)}function Wn(t){let e={},r=[],n,s={addCase(i,a){let o=typeof i=="string"?i:i.type;if(!o)throw new Error(W(28));if(o in e)throw new Error(W(29));return e[o]=a,s},addAsyncThunk(i,a){return a.pending&&(e[i.pending.type]=a.pending),a.rejected&&(e[i.rejected.type]=a.rejected),a.fulfilled&&(e[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){return n=i,s}};return t(s),[e,r,n]}function oi(t){return typeof t=="function"}function ci(t,e){let[r,n,s]=Wn(e),i;if(oi(t))i=()=>$n(t());else{let c=$n(t);i=()=>c}function a(c,u,d){if(G(c)){let p=u(c,d);return p===void 0?c:p}else{if(P(c))return rr(c,p=>u(p,d));{let p=u(c,d);if(p===void 0){if(c===null)return c;throw new Error(W(9))}return p}}}function o(c=i(),u){let d=r[u.type],p;for(let{matcher:h,reducer:_}of n)h(u)&&_&&(p??=[]).push(_);if(!d&&!p)return s?a(c,s,u):c;if(d&&(c=a(c,d,u)),p)for(let h of p)c=a(c,h,u);return c}return o.getInitialState=i,o}var ui=Symbol.for("rtk-slice-createasyncthunk");function li(t,e){return`${t}/${e}`}function di({creators:t}={}){let e=t?.asyncThunk?.[ui];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(W(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(hi()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,E){let I=typeof g=="string"?g:g.type;if(!I)throw new Error(W(12));if(I in c.sliceCaseReducersByType)throw new Error(W(13));return c.sliceCaseReducersByType[I]=E,u},addMatcher(g,E){return c.sliceMatchers.push({matcher:g,reducer:E}),u},exposeAction(g,E){return c.actionCreators[g]=E,u},exposeCaseReducer(g,E){return c.sliceCaseReducersByName[g]=E,u}};o.forEach(g=>{let E=a[g],I={reducerName:g,type:li(s,g),createNotation:typeof n.reducers=="function"};mi(E)?gi(I,E,u,e):fi(I,E,u)});function d(){let[g={},E=[],I=void 0]=typeof n.extraReducers=="function"?Wn(n.extraReducers):[n.extraReducers],Z={...g,...c.sliceCaseReducersByType};return ci(n.initialState,$=>{for(let k in Z)$.addCase(k,Z[k]);for(let k of c.sliceMatchers)$.addMatcher(k.matcher,k.reducer);for(let k of E)$.addMatcher(k.matcher,k.reducer);I&&$.addDefaultCase(I)})}let p=g=>g,h=new Map,_=new WeakMap,O;function U(g,E){return O||(O=d()),O(g,E)}function y(){return O||(O=d()),O.getInitialState()}function V(g,E=!1){function I($){let k=$[g];return typeof k>"u"&&E&&(k=ft(_,I,y)),k}function Z($=p){return ft(ft(h,E,()=>new WeakMap),$,()=>{let k={};for(let[bs,_s]of Object.entries(n.selectors??{}))k[bs]=pi(_s,$,()=>ft(_,$,y),E);return k})}return{reducerPath:g,getSelectors:Z,get selectors(){return Z(I)},selectSlice:I}}let H={name:s,reducer:U,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...V(i),injectInto(g,{reducerPath:E,...I}={}){let Z=E??i;return g.inject({reducerPath:Z,reducer:U},I),{...H,...V(Z,!0)}}};return H}}function pi(t,e,r,n){function s(i,...a){let o=e(i);return typeof o>"u"&&n&&(o=r()),t(o,...a)}return s.unwrapped=t,s}var Qn=di();function hi(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function fi({type:t,reducerName:e,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!yi(n))throw new Error(W(17));i=n.reducer,a=n.prepare}else i=n;s.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,a?Pe(t,a):Pe(t))}function mi(t){return t._reducerDefinitionType==="asyncThunk"}function yi(t){return t._reducerDefinitionType==="reducerWithPrepare"}function gi({type:t,reducerName:e},r,n,s){if(!s)throw new Error(W(18));let{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:u,options:d}=r,p=s(t,i,d);n.exposeAction(e,p),a&&n.addCase(p.fulfilled,a),o&&n.addCase(p.pending,o),c&&n.addCase(p.rejected,c),u&&n.addMatcher(p.settled,u),n.exposeCaseReducer(e,{fulfilled:a||mt,pending:o||mt,rejected:c||mt,settled:u||mt})}function mt(){}var Yn="listener",Xn="completed",Jn="cancelled",Da=`task-${Jn}`,Na=`task-${Xn}`,La=`${Yn}-${Jn}`,Pa=`${Yn}-${Xn}`;var{assign:Zn}=Object;var nr="listenerMiddleware";var Ei=Zn(Pe(`${nr}/add`),{withTypes:()=>Ei}),Fa=Pe(`${nr}/removeAll`),Si=Zn(Pe(`${nr}/remove`),{withTypes:()=>Si});function W(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var vi=$e(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,s){this.eventBus.addEventListener(r,n,s)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,s){this.eventBus.removeEventListener(r,n,s)}}}),yt=class extends vi(Object){};window.ftReduxStores||(window.ftReduxStores={});var es=class t extends yt{static get(e){var r;let n=typeof e=="string"?e:e.name,s=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Qe(i))return i;if(s==null)return;let a=Qn({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),o=Gn({reducer:(c,u)=>{if(u.type==="CLEAR_FT_REDUX_STORE"){let d=we(a.getInitialState());for(let p of u.keeping)d[p]=(c??d)[p];return d}else if(typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...u.overwrites};return a.reducer(c,u)}});return window.ftReduxStores[s.name]=new t(a,o,s.eventBus,s.deprecatedKeys)}constructor(e,r,n,s){super(),this.reduxSlice=e,this.reduxStore=r,this.deprecatedKeys=s,this.isFtReduxStore=!0,this.commands=new Ke,this.injectInto=(a,o)=>this.reduxSlice.injectInto(a,o),this.selectSlice=a=>this.reduxSlice.selectSlice(a);let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,o,c)=>{let u=o,d=a[u];return d?(...p)=>{let h=d(...p.map(i));return this.reduxStore.dispatch(h),h}:p=>{let h=u,_=this.getState()[h];ge(_,p)||this.setState({[h]:i(p)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var gt=class{static format(e,r,n,s,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(e,r,n,s,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,s,i){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return i?c:s?`${o} ${c}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Et=f(C()),Ai="ft-app-info",Q=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Q.eventName="authentication-change";var Fe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Fe.eventName="ui-locale-changed";var bi={session:(t,e)=>{(0,Et.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>l.dispatchEvent(new Q(e.payload)),0))}},l=Et.FtReduxStore.get({name:Ai,reducers:bi,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var ts=f(C()),St=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},po=(0,ts.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(l)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var s,i;return((i=(s=this.metadataDescriptors.find(o=>o.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?o=>gt.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return St([(0,sr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),St([(0,sr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),St([Vt({store:l.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],e.prototype,"metadataDescriptors",void 0),St([Vt({store:l.name})],e.prototype,"uiLocale",void 0),e});var Ct=f(C());var ir=f(C());var ce=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=l.getState(),s=e??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let s=l.subscribe(()=>{n=t.get(e),n&&(s(),r(n))})}})}};var be=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ce.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ce.await()}};var R=class extends be{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[c])=>o.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new ir.CacheRegistry,this.cache=e?s.commonCache:new ir.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var vt=class extends R{async listMySearches(){let{session:e}=l.getState();return xe(e,v.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var At=class extends R{async listMyBookmarks(){let e=l.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var bt=class extends R{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/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(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=l.getState().session;return!!e?.sessionAuthenticated}};var _t=class extends R{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let e=l.getState().session;return!!e?.sessionAuthenticated}};var _i="ft-user-assets",Ci={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(B).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:n,asset:s}=e.payload;or(t,r,[...ar(t,r),s]),rs(t,r,1,n),ns(t,s)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;or(t,r,ar(t,r).map(s=>s.id===n.id?n:s)),ns(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:s}=e.payload;or(t,r,ar(t,r).filter(i=>i.id!==s)),rs(t,r,-1,n)}},ss={[B.SEARCHES]:"savedSearches",[B.BOOKMARKS]:"bookmarks",[B.BOOKS]:void 0,[B.COLLECTIONS]:void 0},ar=(t,e)=>{var r;let n=ss[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},or=(t,e,r)=>{let n=ss[e];n&&(t[n]=r)},rs=(t,e,r,n)=>{let s=t.assetCounts.allAsset[e];if(s!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,s+r),e===B.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},ns=(t,e)=>{let r=t.assetLabels.map(s=>s.title),n=e.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));t.assetLabels.push(...n)},M=Ct.FtReduxStore.get({name:_i,reducers:Ci,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(B).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),cr=class{constructor(e=new bt,r=new _t){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=l.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new At,this.savedSearchesService=new vt,l.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=l.getState();(0,Ct.deepEqual)((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(),M.actions.clearAssetCount(),M.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),M.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),M.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();M.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();M.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&M.getState().assetCounts.allAsset[e]!==r.count&&M.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&M.getState().assetCounts.bookmarkByMap[e]!==r.count&&M.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(M.getState().assetCounts.bookmarkByMap).length!==0;e===B.BOOKMARKS&&r&&M.actions.clearBookmarkCountByMap(),M.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;M.actions.bookmarks(r)}}},xi=new cr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=xi);var ur=class{addCommand(e,r=!1){l.commands.add(e,r)}consumeCommand(e){return l.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new ur;var j=f(C());var is,_e=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},wi=Symbol("clearAfterUnitTest"),xt=class extends(0,j.withEventBus)(R){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[is]=()=>{this.defaultMessages={},this.cache=new j.CacheRegistry,this.listeners={}},this.currentUiLocale=l.getState().uiLocale,l.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=l.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 n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let s={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,j.deepEqual)(this.defaultMessages[e],s)||(this.defaultMessages[e]=s,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var s;let i=e.toLowerCase(),a=this.resolveContext(i);return new j.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(s){!(s instanceof j.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var s;return(s=this.listeners[e])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new _e({loadedContexts:e})),this.dispatchEvent(new _e({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new _e({loadedContexts:[e]})),this.dispatchEvent(new _e({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,j.delay)(0).then(()=>n()).catch(()=>null)))}};is=wi;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends xt{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends xt{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var as=window.FluidTopicsI18nService,Go=window.FluidTopicsCustomI18nService;var os=f(C()),lr=class{highlightHtml(e,r,n){(0,os.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new lr;var cs=f(C());var dr=class{isDate(e){var r,n,s,i;return(i=(n=((s=(r=l.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&s!==void 0?s:[]).find(o=>o.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,s,i,a;if(e==null)return"";try{return cs.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:l.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new dr;var us=f(C());var Ue=class{static get(e,r,{baseUrl:n,localesConfiguration:s,availableContentLocales:i}=l.getState()){var a;if(r==="all"&&s?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(o=>o.lang===r)){let o=s?.defaultLocales.defaultContentLocale;r=o?`${o.lang}-${o.region}`:(a=i[0])===null||a===void 0?void 0:a.lang}return new us.SearchPlaceConverter(n,e??20,s?.allLanguagesAllowed,r,i)}};var wt=class extends R{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentOnDemandTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on_demand_translate event")}async sendTopicAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.ai_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,s])=>Array.isArray(s)?[n,s.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,a)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(a.key):typeof i=="string"&&typeof a=="string"?i.localeCompare(a):String(i).localeCompare(String(a)))]:typeof s=="object"&&s!==null?[n,this.sortEventArrays(s)]:[n,s]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return document.dispatchEvent(new CustomEvent("ft:analytics:userevents",{detail:e})),this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(s=>(console.info(r),console.debug(s),n)),1e3)}};var pr=class{urlToSearchRequest(e){return Ue.get().parse(e)}searchRequestToUrl(e){return Ue.get().serialize(e)}};window.FluidTopicsUrlService=new pr;var J=f(C());var ue=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};ue.eventName="before-location-change";var le=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};le.eventName="change";var hr=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))}},ls=new hr;var Tt=class t extends J.WithEventBus{static build(){return new t(window.history,ls,()=>window.location,!1)}constructor(e,r,n,s){var i,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,J.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new le(this.currentItem())),0)}installProxies(){let e=r=>(n,s,[i,a,o])=>{let c=new URL(typeof o=="string"?o:(o??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),u=new ue(c);this.dispatchEvent(u);let d=r(),p={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:u.detail.nextLocation.href};n.apply(s,[p,a,p.href]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let 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 n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(ue.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(ue.eventName,e)}addHistoryChangeListener(e){this.addEventListener(le.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(le.eventName,e)}currentItem(){return(0,J.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,J.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,J.deepCopy)(r.find(n=>e(n)))}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,J.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 r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let s=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}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 n;if(!this.hasState(e))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Tt.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var ds=f(fe());var ps=ds.css`
3
- `;var fs=f(fe()),D=f(ee()),he=f(C());var Y=f(C());function hs(t,e){let{authenticationRequired:r,session:n}=l.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Rt=class extends be{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var fr=class t extends Y.FtStateManager{static build(e){return new t(l,e)}constructor(e,r){super(),this.store=e,this.cache=new Y.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Rt,this.knownContexts=new Y.AbstractRegistry,this.knownCustomComponents=new Y.AbstractRegistry,this.cleanSessionDebouncer=new Y.Debouncer,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new Y.Debouncer(500),this.apiProvider=r??(()=>ce.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(Q.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(Q.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>hs(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Fe(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return un(l.getState().session,...e)}},de=fr.build();var pe=class extends Event{constructor(e,r,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=s??!1}};var Ve=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:s,callbackRef:i}of n){let a=s.deref(),o=i.deref();a===void 0||o===void 0||a.dispatchEvent(new pe(e.context,a,o,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,s=this.pendingContextRequests.get(e.context);s===void 0&&this.pendingContextRequests.set(e.context,s={callbacks:new WeakMap,requests:[]});let i=s.callbacks.get(r);i===void 0&&s.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),s.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var x=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},S=class extends he.FtLitElementRedux{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.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=de,this.contextRoot=new Ve}render(){return fs.html`
1
+ "use strict";(()=>{var li=Object.create;var jr=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var Zt=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var fi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of di(e))!pi.call(t,s)&&s!==r&&jr(t,s,{get:()=>e[s],enumerable:!(n=ui(e,s))||n.enumerable});return t};var f=(t,e,r)=>(r=t!=null?li(hi(t)):{},fi(e||!t||!t.__esModule?jr(r,"default",{value:t,enumerable:!0}):r,t));var x=Zt((ba,qr)=>{qr.exports=ftGlobals.wcUtils});var Se=Zt((Ca,Kr)=>{Kr.exports=ftGlobals.lit});var te=Zt((xa,zr)=>{zr.exports=ftGlobals.litDecorators});var ai=f(x());var si=f(Se()),U=f(te()),L=f(x());var Gr=f(Se());var Wr=Gr.css`
2
+ `;var ie=f(x()),et=f(te());var ke;(function(t){t.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(ke||(ke={}));var _=f(x());var Qr=f(x()),mi={setRequest:(t,e)=>{t.request=e.payload}},Yr=t=>Qr.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],sortId:void 0,paging:{page:1,perPage:20},keywordMatch:void 0},liveQuery:"",recentQueries:[],paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,announcements:void 0,suggestResults:void 0,configuration:void 0,propagatedFacets:[]},reducers:mi,deprecatedKeys:["locales"]});var Xr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Xr||(Xr={}));var Jr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Jr||(Jr={}));var Zr;(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"})(Zr||(Zr={}));var re;(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"})(re||(re={}));var en;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(en||(en={}));var tn;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(tn||(tn={}));var rn;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(rn||(rn={}));var ae;(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__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",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__AI_TRANSLATE="TOPIC__AI_TRANSLATE",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"})(ae||(ae={}));var nn;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(nn||(nn={}));var sn;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(sn||(sn={}));var an;(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",t.DOC_DIFF="DOC_DIFF"})(an||(an={}));var on;(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",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(on||(on={}));var cn;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(cn||(cn={}));var ln;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(ln||(ln={}));var un;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(un||(un={}));var dn;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(dn||(dn={}));var hn;(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"})(hn||(hn={}));var tt;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(tt||(tt={}));var pn;(function(t){t.ASC="ASC",t.DESC="DESC"})(pn||(pn={}));var fn;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(fn||(fn={}));var ve;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(ve||(ve={}));var mn;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(mn||(mn={}));var rt;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(rt||(rt={}));var yn;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(yn||(yn={}));var gn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(gn||(gn={}));var z;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(z||(z={}));var Ae;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ae||(Ae={}));var En;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(En||(En={}));var A;(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.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.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(A||(A={}));var V;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(V||(V={}));var Sn;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Sn||(Sn={}));var vn;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(vn||(vn={}));var An;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(An||(An={}));var _n;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(_n||(_n={}));var bn;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(bn||(bn={}));var Cn;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Cn||(Cn={}));var xn;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(xn||(xn={}));var wn;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(wn||(wn={}));var Tn;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Tn||(Tn={}));var Rn;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(Rn||(Rn={}));var On;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(On||(On={}));var In;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(In||(In={}));var kn;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(kn||(kn={}));var yi={[A.PERSONAL_BOOK_SHARE_USER]:[A.PERSONAL_BOOK_USER],[A.HTML_EXPORT_USER]:[A.PERSONAL_BOOK_USER],[A.PDF_EXPORT_USER]:[A.PERSONAL_BOOK_USER],[A.KHUB_ADMIN]:[A.CONTENT_PUBLISHER],[A.ADMIN]:[A.KHUB_ADMIN,A.USERS_ADMIN,A.PORTAL_ADMIN,A.BEHAVIOR_DATA_USER],[A.GENERATIVE_AI_EXPORT_USER]:[A.GENERATIVE_AI_USER]};function Mn(t,e){return t===e||(yi[t]??[]).some(r=>Mn(r,e))}function Me(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(n=>Mn(n,e))}function Nn(t,...e){return t==null?!1:e.some(r=>Me(t,r))}var vr=f(te());var Dn=f(te(),1);var er=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},gi=t=>({fromAttribute:e=>{if(e==null)return Ne(t);try{return JSON.parse(e)}catch{return Ne(t)}},toAttribute:e=>JSON.stringify(e)});function Ln(t,e){return(0,Dn.property)({type:Object,converter:gi(t),hasChanged:De,...e??{}})}function Ei(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!_e(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!_e(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[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 s=a=>Object.keys(a).filter(o=>a[o]!=null),i=s(t);if(r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!_e(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function _e(t,e){try{return Ei(t,e)}catch{return!1}}function De(t,e){return!_e(t,e)}function Ne(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function nt(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let s=e(n);return s[t]=!0,s}}var Pn=f(te(),1);var tr=t=>{let e=t??{};return(r,n)=>{var s;let i={hasChanged:De,attribute:!1,...e};(0,Pn.property)(i)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(s=e.selector)!==null&&s!==void 0?s:(o=>o[n]),store:e.store})}};var st=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var oe=f(te(),1);var it=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let s=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let a of n)try{await a()}catch(o){s(o);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ot=f(Se(),1);var at=class extends ot.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return(0,ot.adoptStyles)(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){er(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function Fn(t,e,...r){var n;let s=t.querySelector(e);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Ce=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},Vn,Un=Symbol("constructorPrototype"),$n=Symbol("constructorName"),Hn=Symbol("exportpartsDebouncer"),Bn=Symbol("dynamicDependenciesLoaded"),be=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};be.eventName="exportparts-updated";var G=class extends at{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Vn]=new it(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Hn].run(()=>{var s,i;!((s=this.exportpartsPrefix)===null||s===void 0)&&s.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[$n]=this.constructor.name,this[Un]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[$n]&&Object.setPrototypeOf(this,this[Un])}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(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Bn]||(r[Bn]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(be.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(be.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 be)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=Fn(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,s;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((s=this.customStylesheet)!==null&&s!==void 0?s:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(e){var r,n,s,i,a,o;let c=p=>p!=null&&p.trim().length>0,l=e.filter(c).map(p=>p.trim());if(l.length===0){this.exportparts=void 0;return}let d=new Set;for(let p of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let m=(a=(n=p.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],C=(o=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(g=>g.split(":")[1]))!==null&&o!==void 0?o:[],$=[...m,...C].filter(c).map(g=>g.trim());for(let g of $)d.add(g)}if(d.size===0){this.exportparts=void 0;return}let u=[...d.values()].flatMap(p=>l.map(m=>`${p}:${m}--${p}`));this.exportparts=[...this.part,...u].join(", ")}};Vn=Hn;Ce([(0,oe.property)()],G.prototype,"exportpartsPrefix",void 0);Ce([Ln([])],G.prototype,"exportpartsPrefixes",void 0);Ce([(0,oe.property)({reflect:!0})],G.prototype,"exportparts",void 0);Ce([(0,oe.property)()],G.prototype,"customStylesheet",void 0);Ce([(0,oe.property)()],G.prototype,"elementToFocus",void 0);Ce([(0,oe.state)()],G.prototype,"useAdoptedStyleSheets",void 0);function ct(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Le=Symbol("internalReduxEventsUnsubscribers"),ne=Symbol("internalStoresUnsubscribers"),ce=Symbol("internalStores"),Si=nt(Symbol("withRedux"),function(t){var e,r,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ce].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ce].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ce].get(a)}addStore(a,o){var c;o=(c=o??a.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(o),this[ce].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ce].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ce].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let c=this.constructor.getPropertyOptions(o);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:o)){let l=this.getStore(a.store);l&&(a.store?this[ne].has(a.store):this[ne].size>0)&&(this[o]=a.selector(l.getState(),this))}})}subscribeToStore(a,o){var c,l;this[ne].set(a,o.subscribe(()=>this.updateFromStores())),this[Le].set(a,[]),ct(o)&&(!((c=o.deprecatedKeys)===null||c===void 0)&&c.length&&this.reduxConstructor.reduxProperties.forEach((d,u)=>{this.getStore(d.store)===o&&o.deprecatedKeys.includes(u)&&console.warn("Element",this,"is subscribed to deprecated key",u,"in store",o.name)}),o.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((d,u)=>{if(typeof this[u]=="function"&&(!d.store||o.name===d.store)){let p=m=>this[u](m);o.addEventListener(d.eventName,p),this[Le].get(a).push(()=>o.removeEventListener(d.eventName,p))}}))),this.onStoreAvailable(a)}unsubscribeFromStores(){this[ne].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[ne].has(a)&&this[ne].get(a)(),this[ne].delete(a),(o=this[Le].get(a))===null||o===void 0||o.forEach(c=>c()),this[Le].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=ne,r=ce,n=Le,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),jn=class extends Si(G){};function R(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 vi=typeof Symbol=="function"&&Symbol.observable||"@@observable",qn=vi,rr=()=>Math.random().toString(36).substring(7).split("").join("."),Ai={INIT:`@@redux/INIT${rr()}`,REPLACE:`@@redux/REPLACE${rr()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${rr()}`},lt=Ai;function ut(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function nr(t,e,r){if(typeof t!="function")throw new Error(R(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(R(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(R(1));return r(nr)(t,e)}let n=t,s=e,i=new Map,a=i,o=0,c=!1;function l(){a===i&&(a=new Map,i.forEach((g,B)=>{a.set(B,g)}))}function d(){if(c)throw new Error(R(3));return s}function u(g){if(typeof g!="function")throw new Error(R(4));if(c)throw new Error(R(5));let B=!0;l();let q=o++;return a.set(q,g),function(){if(B){if(c)throw new Error(R(6));B=!1,l(),a.delete(q),i=null}}}function p(g){if(!ut(g))throw new Error(R(7));if(typeof g.type>"u")throw new Error(R(8));if(typeof g.type!="string")throw new Error(R(17));if(c)throw new Error(R(9));try{c=!0,s=n(s,g)}finally{c=!1}return(i=a).forEach(q=>{q()}),g}function m(g){if(typeof g!="function")throw new Error(R(10));n=g,p({type:lt.REPLACE})}function C(){let g=u;return{subscribe(B){if(typeof B!="object"||B===null)throw new Error(R(11));function q(){let S=B;S.next&&S.next(d())}return q(),{unsubscribe:g(q)}},[qn](){return this}}}return p({type:lt.INIT}),{dispatch:p,subscribe:u,getState:d,replaceReducer:m,[qn]:C}}function _i(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:lt.INIT})>"u")throw new Error(R(12));if(typeof r(void 0,{type:lt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(R(13))})}function sr(t){let e=Object.keys(t),r={};for(let a=0;a<e.length;a++){let o=e[a];typeof t[o]=="function"&&(r[o]=t[o])}let n=Object.keys(r),s,i;try{_i(r)}catch(a){i=a}return function(o={},c){if(i)throw i;let l=!1,d={};for(let u=0;u<n.length;u++){let p=n[u],m=r[p],C=o[p],$=m(C,c);if(typeof $>"u"){let g=c&&c.type;throw new Error(R(14))}d[p]=$,l=l||$!==C}return l=l||n.length!==Object.keys(o).length,l?d:o}}function Pe(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...n)=>e(r(...n)))}function Kn(...t){return e=>(r,n)=>{let s=e(r,n),i=()=>{throw new Error(R(15))},a={getState:s.getState,dispatch:(c,...l)=>i(c,...l)},o=t.map(c=>c(a));return i=Pe(...o)(s.dispatch),{...s,dispatch:i}}}function zn(t){return ut(t)&&"type"in t&&typeof t.type=="string"}var ts=Symbol.for("immer-nothing"),Gn=Symbol.for("immer-draftable"),O=Symbol.for("immer-state");function j(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var P=Object,we=P.getPrototypeOf,ft="constructor",vt="prototype",cr="configurable",mt="enumerable",ht="writable",Fe="value",W=t=>!!t&&!!t[O];function F(t){return t?rs(t)||_t(t)||!!t[Gn]||!!t[ft]?.[Gn]||bt(t)||Ve(t):!1}var bi=P[vt][ft].toString(),Wn=new WeakMap;function rs(t){if(!t||!yr(t))return!1;let e=we(t);if(e===null||e===P[vt])return!0;let r=P.hasOwnProperty.call(e,ft)&&e[ft];if(r===Object)return!0;if(!xe(r))return!1;let n=Wn.get(r);return n===void 0&&(n=Function.toString.call(r),Wn.set(r,n)),n===bi}function At(t,e,r=!0){Be(t)===0?(r?Reflect.ownKeys(t):P.keys(t)).forEach(s=>{e(s,t[s],t)}):t.forEach((n,s)=>e(s,n,t))}function Be(t){let e=t[O];return e?e.type_:_t(t)?1:bt(t)?2:Ve(t)?3:0}var ir=(t,e,r=Be(t))=>r===2?t.has(e):P[vt].hasOwnProperty.call(t,e),lr=(t,e,r=Be(t))=>r===2?t.get(e):t[e],yt=(t,e,r,n=Be(t))=>{n===2?t.set(e,r):n===3?t.add(r):t[e]=r};function Ci(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var _t=Array.isArray,bt=t=>t instanceof Map,Ve=t=>t instanceof Set,yr=t=>typeof t=="object",xe=t=>typeof t=="function",ar=t=>typeof t=="boolean";function xi(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var J=t=>t.copy_||t.base_;var gr=t=>t.modified_?t.copy_:t.base_;function ur(t,e){if(bt(t))return new Map(t);if(Ve(t))return new Set(t);if(_t(t))return Array[vt].slice.call(t);let r=rs(t);if(e===!0||e==="class_only"&&!r){let n=P.getOwnPropertyDescriptors(t);delete n[O];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let a=s[i],o=n[a];o[ht]===!1&&(o[ht]=!0,o[cr]=!0),(o.get||o.set)&&(n[a]={[cr]:!0,[ht]:!0,[mt]:o[mt],[Fe]:t[a]})}return P.create(we(t),n)}else{let n=we(t);if(n!==null&&r)return{...t};let s=P.create(n);return P.assign(s,t)}}function Ct(t,e=!1){return xt(t)||W(t)||!F(t)||(Be(t)>1&&P.defineProperties(t,{set:dt,add:dt,clear:dt,delete:dt}),P.freeze(t),e&&At(t,(r,n)=>{Ct(n,!0)},!1)),t}function wi(){j(2)}var dt={[Fe]:wi};function xt(t){return t===null||!yr(t)?!0:P.isFrozen(t)}var gt="MapSet",dr="Patches",Qn="ArrayMethods",ns={};function le(t){let e=ns[t];return e||j(0,t),e}var Yn=t=>!!ns[t];var Ue,ss=()=>Ue,Ti=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Yn(gt)?le(gt):void 0,arrayMethodsPlugin_:Yn(Qn)?le(Qn):void 0});function Xn(t,e){e&&(t.patchPlugin_=le(dr),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function hr(t){pr(t),t.drafts_.forEach(Ri),t.drafts_=null}function pr(t){t===Ue&&(Ue=t.parent_)}var Jn=t=>Ue=Ti(Ue,t);function Ri(t){let e=t[O];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Zn(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[O].modified_&&(hr(e),j(4)),F(t)&&(t=es(e,t));let{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(r[O].base_,t,e)}else t=es(e,r);return Oi(e,t,!0),hr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==ts?t:void 0}function es(t,e){if(xt(e))return e;let r=e[O];if(!r)return Et(e,t.handledSet_,t);if(!wt(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(t);os(r,t)}return r.copy_}function Oi(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Ct(e,r)}function is(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var wt=(t,e)=>t.scope_===e,Ii=[];function as(t,e,r,n){let s=J(t),i=t.type_;if(n!==void 0&&lr(s,n,i)===e){yt(s,n,r,i);return}if(!t.draftLocations_){let o=t.draftLocations_=new Map;At(s,(c,l)=>{if(W(l)){let d=o.get(l)||[];d.push(c),o.set(l,d)}})}let a=t.draftLocations_.get(e)??Ii;for(let o of a)yt(s,o,r,i)}function ki(t,e,r){t.callbacks_.push(function(s){let i=e;if(!i||!wt(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let a=gr(i);as(t,i.draft_??i,a,r),os(i,s)})}function os(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:n}=e;if(n){let s=n.getPath(t);s&&n.generatePatches_(t,s,e)}is(t)}}function Mi(t,e,r){let{scope_:n}=t;if(W(r)){let s=r[O];wt(s,n)&&s.callbacks_.push(function(){pt(t);let a=gr(s);as(t,r,a,e)})}else F(r)&&t.callbacks_.push(function(){let i=J(t);t.type_===3?i.has(r)&&Et(r,n.handledSet_,n):lr(i,e,t.type_)===r&&n.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&Et(lr(t.copy_,e,t.type_),n.handledSet_,n)})}function Et(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||W(t)||e.has(t)||!F(t)||xt(t)||(e.add(t),At(t,(n,s)=>{if(W(s)){let i=s[O];if(wt(i,r)){let a=gr(i);yt(t,n,a,t.type_),is(i)}}else F(s)&&Et(s,e,r)})),t}function Ni(t,e){let r=_t(t),n={type_:r?1:0,scope_:e?e.scope_:ss(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=St;r&&(s=[n],i=$e);let{revoke:a,proxy:o}=Proxy.revocable(s,i);return n.draft_=o,n.revoke_=a,[o,n]}var St={get(t,e){if(e===O)return t;let r=t.scope_.arrayMethodsPlugin_,n=t.type_===1&&typeof e=="string";if(n&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let s=J(t);if(!ir(s,e,t.type_))return Li(t,s,e);let i=s[e];if(t.finalized_||!F(i)||n&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&xi(e))return i;if(i===or(t.base_,e)||Di(t,e,i)){pt(t);let a=t.type_===1?+e:e,o=mr(t.scope_,i,t,a);return t.copy_[a]=o}return i},has(t,e){return e in J(t)},ownKeys(t){return Reflect.ownKeys(J(t))},set(t,e,r){let n=cs(J(t),e);if(n?.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){let s=or(J(t),e),i=s?.[O];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_.delete(e),!0;if(Ci(r,s)&&(r!==void 0||ir(t.base_,e,t.type_)))return!0;pt(t),fr(t)}return t.copy_[e]===r&&(r!==void 0||ir(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Mi(t,e,r)),!0},deleteProperty(t,e){return pt(t),or(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),fr(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=J(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{[ht]:!0,[cr]:t.type_!==1||e!=="length",[mt]:n[mt],[Fe]:r[e]}},defineProperty(){j(11)},getPrototypeOf(t){return we(t.base_)},setPrototypeOf(){j(12)}},$e={};for(let t in St){let e=St[t];$e[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}$e.deleteProperty=function(t,e){return $e.set.call(this,t,e,void 0)};$e.set=function(t,e,r){return St.set.call(this,t[0],e,r,t[0])};function or(t,e){let r=t[O];return(r?J(r):t)[e]}function Di(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||!F(r)||r[O]?!1:t.baseRefs_.has(r)}function Li(t,e,r){let n=cs(e,r);return n?Fe in n?n[Fe]:n.get?.call(t.draft_):void 0}function cs(t,e){if(!(e in t))return;let r=we(t);for(;r;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=we(r)}}function fr(t){t.modified_||(t.modified_=!0,t.parent_&&fr(t.parent_))}function pt(t){t.copy_||(t.assigned_=new Map,t.copy_=ur(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Pi=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,n)=>{if(xe(e)&&!xe(r)){let i=r;r=e;let a=this;return function(c=i,...l){return a.produce(c,d=>r.call(this,d,...l))}}xe(r)||j(6),n!==void 0&&!xe(n)&&j(7);let s;if(F(e)){let i=Jn(this),a=mr(i,e,void 0),o=!0;try{s=r(a),o=!1}finally{o?hr(i):pr(i)}return Xn(i,n),Zn(s,i)}else if(!e||!yr(e)){if(s=r(e),s===void 0&&(s=e),s===ts&&(s=void 0),this.autoFreeze_&&Ct(s,!0),n){let i=[],a=[];le(dr).generateReplacementPatches_(e,s,{patches_:i,inversePatches_:a}),n(i,a)}return s}else j(1,e)},this.produceWithPatches=(e,r)=>{if(xe(e))return(a,...o)=>this.produceWithPatches(a,c=>e(c,...o));let n,s;return[this.produce(e,r,(a,o)=>{n=a,s=o}),n,s]},ar(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),ar(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),ar(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){F(t)||j(8),W(t)&&(t=ls(t));let e=Jn(this),r=mr(e,t,void 0);return r[O].isManual_=!0,pr(e),r}finishDraft(t,e){let r=t&&t[O];(!r||!r.isManual_)&&j(9);let{scope_:n}=r;return Xn(n,e),Zn(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let s=e[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(e=e.slice(r+1));let n=le(dr).applyPatches_;return W(t)?n(t,e):this.produce(t,s=>n(s,e))}};function mr(t,e,r,n){let[s,i]=bt(e)?le(gt).proxyMap_(e,r):Ve(e)?le(gt).proxySet_(e,r):Ni(e,r);return(r?.scope_??ss()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?ki(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:l}=c;i.modified_&&l&&l.generatePatches_(i,[],c)}),s}function ls(t){return W(t)||j(10,t),us(t)}function us(t){if(!F(t)||xt(t))return t;let e=t[O],r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=ur(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=ur(t,!0);let s=r;return Ve(r)&&(r=new Set),At(s,(i,a)=>{yt(r,i,us(a))},n),e&&(e.finalized_=!1),r}var Fi=globalThis.Iterator,mo=typeof Fi?.from=="function";var Ui=new Pi,Er=Ui.produce;function ds(t){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,t):s(i)}var hs=ds(),ps=ds;var $i=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pe:Pe.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function je(t,e){function r(...n){if(e){let s=e(...n);if(!s)throw new Error(Q(0));return{type:t,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:t,payload:n[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=n=>n!=null&&n.type===t&&zn(n),r}var ys=class He extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,He.prototype)}static get[Symbol.species](){return He}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new He(...e[0].concat(this)):new He(...e.concat(this))}};function fs(t){return F(t)?Er(t,()=>{}):t}function Tt(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function Bi(t){return typeof t=="boolean"}var Vi=()=>function(e){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=e??{},a=new ys;return r&&(Bi(r)?a.push(hs):a.push(ps(r.extraArgument))),a},Hi="RTK_autoBatch";var ms=t=>e=>{setTimeout(e,t)},ji=(t,e,r)=>n=>{let s=!1,i,a,o=()=>{s||(s=!0,e?.(i),clearTimeout(a),n())};i=t(o),a=setTimeout(o,r)},qi=(t={type:"raf"})=>e=>(...r)=>{let n=e(...r),s=!0,i=!1,a=!1,o=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?ji(window.requestAnimationFrame,window.cancelAnimationFrame,100):ms(10):t.type==="callback"?t.queueNotification:ms(t.timeout),l=()=>{a=!1,i&&(i=!1,o.forEach(d=>d()))};return Object.assign({},n,{subscribe(d){let u=()=>s&&d(),p=n.subscribe(u);return o.add(d),()=>{p(),o.delete(d)}},dispatch(d){try{return s=!d?.meta?.[Hi],i=!s,i&&(a||(a=!0,c(l))),n.dispatch(d)}finally{s=!0}}})},Ki=t=>function(r){let{autoBatch:n=!0}=r??{},s=new ys(t);return n&&s.push(qi(typeof n=="object"?n:void 0)),s};function gs(t){let e=Vi(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=t||{},c;if(typeof r=="function")c=r;else if(ut(r))c=sr(r);else throw new Error(Q(1));let l;typeof n=="function"?l=n(e):l=e();let d=Pe;s&&(d=$i({trace:!1,...typeof s=="object"&&s}));let u=Kn(...l),p=Ki(u),m=typeof o=="function"?o(p):p(),C=d(...m);return nr(c,a,C)}function Es(t){let e={},r=[],n,s={addCase(i,a){let o=typeof i=="string"?i:i.type;if(!o)throw new Error(Q(28));if(o in e)throw new Error(Q(29));return e[o]=a,s},addAsyncThunk(i,a){return a.pending&&(e[i.pending.type]=a.pending),a.rejected&&(e[i.rejected.type]=a.rejected),a.fulfilled&&(e[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){return n=i,s}};return t(s),[e,r,n]}function zi(t){return typeof t=="function"}function Gi(t,e){let[r,n,s]=Es(e),i;if(zi(t))i=()=>fs(t());else{let c=fs(t);i=()=>c}function a(c,l,d){if(W(c)){let u=l(c,d);return u===void 0?c:u}else{if(F(c))return Er(c,u=>l(u,d));{let u=l(c,d);if(u===void 0){if(c===null)return c;throw new Error(Q(9))}return u}}}function o(c=i(),l){let d=r[l.type],u;for(let{matcher:p,reducer:m}of n)p(l)&&m&&(u??=[]).push(m);if(!d&&!u)return s?a(c,s,l):c;if(d&&(c=a(c,d,l)),u)for(let p of u)c=a(c,p,l);return c}return o.getInitialState=i,o}var Wi=Symbol.for("rtk-slice-createasyncthunk");function Qi(t,e){return`${t}/${e}`}function Yi({creators:t}={}){let e=t?.asyncThunk?.[Wi];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(Q(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Ji()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(E,S){let k=typeof E=="string"?E:E.type;if(!k)throw new Error(Q(12));if(k in c.sliceCaseReducersByType)throw new Error(Q(13));return c.sliceCaseReducersByType[k]=S,l},addMatcher(E,S){return c.sliceMatchers.push({matcher:E,reducer:S}),l},exposeAction(E,S){return c.actionCreators[E]=S,l},exposeCaseReducer(E,S){return c.sliceCaseReducersByName[E]=S,l}};o.forEach(E=>{let S=a[E],k={reducerName:E,type:Qi(s,E),createNotation:typeof n.reducers=="function"};ea(S)?ra(k,S,l,e):Zi(k,S,l)});function d(){let[E={},S=[],k=void 0]=typeof n.extraReducers=="function"?Es(n.extraReducers):[n.extraReducers],ee={...E,...c.sliceCaseReducersByType};return Gi(n.initialState,K=>{for(let M in ee)K.addCase(M,ee[M]);for(let M of c.sliceMatchers)K.addMatcher(M.matcher,M.reducer);for(let M of S)K.addMatcher(M.matcher,M.reducer);k&&K.addDefaultCase(k)})}let u=E=>E,p=new Map,m=new WeakMap,C;function $(E,S){return C||(C=d()),C(E,S)}function g(){return C||(C=d()),C.getInitialState()}function B(E,S=!1){function k(K){let M=K[E];return typeof M>"u"&&S&&(M=Tt(m,k,g)),M}function ee(K=u){return Tt(Tt(p,S,()=>new WeakMap),K,()=>{let M={};for(let[oi,ci]of Object.entries(n.selectors??{}))M[oi]=Xi(ci,K,()=>Tt(m,K,g),S);return M})}return{reducerPath:E,getSelectors:ee,get selectors(){return ee(k)},selectSlice:k}}let q={name:s,reducer:$,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:g,...B(i),injectInto(E,{reducerPath:S,...k}={}){let ee=S??i;return E.inject({reducerPath:ee,reducer:$},k),{...q,...B(ee,!0)}}};return q}}function Xi(t,e,r,n){function s(i,...a){let o=e(i);return typeof o>"u"&&n&&(o=r()),t(o,...a)}return s.unwrapped=t,s}var Ss=Yi();function Ji(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function Zi({type:t,reducerName:e,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!ta(n))throw new Error(Q(17));i=n.reducer,a=n.prepare}else i=n;s.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,a?je(t,a):je(t))}function ea(t){return t._reducerDefinitionType==="asyncThunk"}function ta(t){return t._reducerDefinitionType==="reducerWithPrepare"}function ra({type:t,reducerName:e},r,n,s){if(!s)throw new Error(Q(18));let{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:l,options:d}=r,u=s(t,i,d);n.exposeAction(e,u),a&&n.addCase(u.fulfilled,a),o&&n.addCase(u.pending,o),c&&n.addCase(u.rejected,c),l&&n.addMatcher(u.settled,l),n.exposeCaseReducer(e,{fulfilled:a||Rt,pending:o||Rt,rejected:c||Rt,settled:l||Rt})}function Rt(){}var vs="listener",As="completed",_s="cancelled",bo=`task-${_s}`,Co=`task-${As}`,xo=`${vs}-${_s}`,wo=`${vs}-${As}`;var{assign:bs}=Object;var Sr="listenerMiddleware";var na=bs(je(`${Sr}/add`),{withTypes:()=>na}),To=je(`${Sr}/removeAll`),sa=bs(je(`${Sr}/remove`),{withTypes:()=>sa});function Q(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var ia=nt(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,s){this.eventBus.addEventListener(r,n,s)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,s){this.eventBus.removeEventListener(r,n,s)}}}),Ot=class extends ia(Object){};window.ftReduxStores||(window.ftReduxStores={});var Cs=class t extends Ot{static get(e){var r;let n=typeof e=="string"?e:e.name,s=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(ct(i))return i;if(s==null)return;let a=Ss({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),o=gs({reducer:(c,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let d=Ne(a.getInitialState());for(let u of l.keeping)d[u]=(c??d)[u];return d}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...l.overwrites};return a.reducer(c,l)}});return window.ftReduxStores[s.name]=new t(a,o,s.eventBus,s.deprecatedKeys)}constructor(e,r,n,s){super(),this.reduxSlice=e,this.reduxStore=r,this.deprecatedKeys=s,this.isFtReduxStore=!0,this.commands=new st,this.injectInto=(a,o)=>this.reduxSlice.injectInto(a,o),this.selectSlice=a=>this.reduxSlice.selectSlice(a);let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,o,c)=>{let l=o,d=a[l];return d?(...u)=>{let p=d(...u.map(i));return this.reduxStore.dispatch(p),p}:u=>{let p=l,m=this.getState()[p];_e(m,u)||this.setState({[p]:i(u)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var It=class{static format(e,r,n,s,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(e,r,n,s,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,s,i){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return i?c:s?`${o} ${c}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var kt=f(x()),aa="ft-app-info",Y=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Y.eventName="authentication-change";var qe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};qe.eventName="ui-locale-changed";var oa={session:(t,e)=>{(0,kt.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>h.dispatchEvent(new Y(e.payload)),0))}},h=kt.FtReduxStore.get({name:aa,reducers:oa,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var xs=f(x()),Mt=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},tc=(0,xs.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(h)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var s,i;return((i=(s=this.metadataDescriptors.find(o=>o.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?o=>It.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Mt([(0,vr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Mt([(0,vr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Mt([tr({store:h.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],e.prototype,"metadataDescriptors",void 0),Mt([tr({store:h.name})],e.prototype,"uiLocale",void 0),e});var Ft=f(x());var Ar=f(x());var ue=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=h.getState(),s=e??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let s=h.subscribe(()=>{n=t.get(e),n&&(s(),r(n))})}})}};var Te=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ue.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ue.await()}};var I=class extends Te{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[c])=>o.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new Ar.CacheRegistry,this.cache=e?s.commonCache:new Ar.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Nt=class extends I{async listMySearches(){let{session:e}=h.getState();return Me(e,A.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Dt=class extends I{async listMyBookmarks(){let e=h.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Lt=class extends I{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/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(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=h.getState().session;return!!e?.sessionAuthenticated}};var Pt=class extends I{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let e=h.getState().session;return!!e?.sessionAuthenticated}};var ca="ft-user-assets",la={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(V).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:n,asset:s}=e.payload;br(t,r,[..._r(t,r),s]),ws(t,r,1,n),Ts(t,s)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;br(t,r,_r(t,r).map(s=>s.id===n.id?n:s)),Ts(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:s}=e.payload;br(t,r,_r(t,r).filter(i=>i.id!==s)),ws(t,r,-1,n)}},Rs={[V.SEARCHES]:"savedSearches",[V.BOOKMARKS]:"bookmarks",[V.BOOKS]:void 0,[V.COLLECTIONS]:void 0},_r=(t,e)=>{var r;let n=Rs[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},br=(t,e,r)=>{let n=Rs[e];n&&(t[n]=r)},ws=(t,e,r,n)=>{let s=t.assetCounts.allAsset[e];if(s!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,s+r),e===V.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Ts=(t,e)=>{let r=t.assetLabels.map(s=>s.title),n=e.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));t.assetLabels.push(...n)},N=Ft.FtReduxStore.get({name:ca,reducers:la,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(V).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Cr=class{constructor(e=new Lt,r=new Pt){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=h.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Dt,this.savedSearchesService=new Nt,h.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=h.getState();(0,Ft.deepEqual)((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(),N.actions.clearAssetCount(),N.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),N.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),N.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();N.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();N.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&N.getState().assetCounts.allAsset[e]!==r.count&&N.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&N.getState().assetCounts.bookmarkByMap[e]!==r.count&&N.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(N.getState().assetCounts.bookmarkByMap).length!==0;e===V.BOOKMARKS&&r&&N.actions.clearBookmarkCountByMap(),N.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;N.actions.bookmarks(r)}}},ua=new Cr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ua);var xr=class{addCommand(e,r=!1){h.commands.add(e,r)}consumeCommand(e){return h.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new xr;var H=f(x());var Os,Re=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},da=Symbol("clearAfterUnitTest"),Ut=class extends(0,H.withEventBus)(I){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Os]=()=>{this.defaultMessages={},this.cache=new H.CacheRegistry,this.listeners={}},this.currentUiLocale=h.getState().uiLocale,h.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=h.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 n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let s={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,H.deepEqual)(this.defaultMessages[e],s)||(this.defaultMessages[e]=s,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var s;let i=e.toLowerCase(),a=this.resolveContext(i);return new H.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(s){!(s instanceof H.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var s;return(s=this.listeners[e])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Re({loadedContexts:e})),this.dispatchEvent(new Re({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Re({loadedContexts:[e]})),this.dispatchEvent(new Re({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,H.delay)(0).then(()=>n()).catch(()=>null)))}};Os=da;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ut{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ut{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Is=window.FluidTopicsI18nService,Pc=window.FluidTopicsCustomI18nService;var ks=f(x()),wr=class{highlightHtml(e,r,n){(0,ks.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new wr;var Ms=f(x());var Tr=class{isDate(e){var r,n,s,i;return(i=(n=((s=(r=h.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&s!==void 0?s:[]).find(o=>o.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,s,i,a;if(e==null)return"";try{return Ms.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:h.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new Tr;var Ns=f(x());var Ke=class{static get(e,r,{baseUrl:n,localesConfiguration:s,availableContentLocales:i}=h.getState()){var a;if(r==="all"&&s?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(o=>o.lang===r)){let o=s?.defaultLocales.defaultContentLocale;r=o?`${o.lang}-${o.region}`:(a=i[0])===null||a===void 0?void 0:a.lang}return new Ns.SearchPlaceConverter(n,e??20,s?.allLanguagesAllowed,r,i)}};var $t=class extends I{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentOnDemandTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on_demand_translate event")}async sendTopicAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.ai_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,s])=>Array.isArray(s)?[n,s.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,a)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(a.key):typeof i=="string"&&typeof a=="string"?i.localeCompare(a):String(i).localeCompare(String(a)))]:typeof s=="object"&&s!==null?[n,this.sortEventArrays(s)]:[n,s]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return document.dispatchEvent(new CustomEvent("ft:analytics:userevents",{detail:e})),this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(s=>(console.info(r),console.debug(s),n)),1e3)}};var Rr=class{urlToSearchRequest(e){return Ke.get().parse(e)}searchRequestToUrl(e){return Ke.get().serialize(e)}};window.FluidTopicsUrlService=new Rr;var Z=f(x());var de=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};de.eventName="before-location-change";var he=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};he.eventName="change";var Or=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))}},Ds=new Or;var Bt=class t extends Z.WithEventBus{static build(){return new t(window.history,Ds,()=>window.location,!1)}constructor(e,r,n,s){var i,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Z.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new he(this.currentItem())),0)}installProxies(){let e=r=>(n,s,[i,a,o])=>{let c=new URL(typeof o=="string"?o:(o??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),l=new de(c);this.dispatchEvent(l);let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:l.detail.nextLocation.href};n.apply(s,[u,a,u.href]),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 n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(de.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(de.eventName,e)}addHistoryChangeListener(e){this.addEventListener(he.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(he.eventName,e)}currentItem(){return(0,Z.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,Z.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,Z.deepCopy)(r.find(n=>e(n)))}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,Z.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 r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let s=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}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 n;if(!this.hasState(e))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bt.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Ls=f(Se());var Ps=Ls.css`
3
+ `;var Us=f(Se()),D=f(te()),me=f(x());var X=f(x());function Fs(t,e){let{authenticationRequired:r,session:n}=h.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Vt=class extends Te{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Ir=class t extends X.FtStateManager{static build(e){return new t(h,e)}constructor(e,r){super(),this.store=e,this.cache=new X.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Vt,this.knownContexts=new X.AbstractRegistry,this.knownCustomComponents=new X.AbstractRegistry,this.cleanSessionDebouncer=new X.Debouncer,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new X.Debouncer(500),this.apiProvider=r??(()=>ue.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(Y.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(Y.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Fs(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new qe(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return Nn(h.getState().session,...e)}},pe=Ir.build();var fe=class extends Event{constructor(e,r,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=s??!1}};var ze=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:s,callbackRef:i}of n){let a=s.deref(),o=i.deref();a===void 0||o===void 0||a.dispatchEvent(new fe(e.context,a,o,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,s=this.pendingContextRequests.get(e.context);s===void 0&&this.pendingContextRequests.set(e.context,s={callbacks:new WeakMap,requests:[]});let i=s.callbacks.get(r);i===void 0&&s.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),s.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var T=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},v=class extends me.FtLitElementRedux{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.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=pe,this.contextRoot=new ze}render(){return Us.html`
4
4
  <slot></slot>
5
- `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>as.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};S.elementDefinitions={};S.styles=ps;x([(0,D.property)()],S.prototype,"baseUrl",void 0);x([(0,D.property)()],S.prototype,"tenantId",void 0);x([(0,D.property)()],S.prototype,"apiIntegrationIdentifier",void 0);x([(0,D.property)()],S.prototype,"apiIntegrationAppVersion",void 0);x([(0,D.property)()],S.prototype,"uiLocale",void 0);x([(0,he.jsonProperty)(null)],S.prototype,"availableUiLocales",void 0);x([(0,he.jsonProperty)(null)],S.prototype,"metadataConfiguration",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"editorMode",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"noCustom",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"openExternalDocumentInNewTab",void 0);x([(0,D.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],S.prototype,"noCustomComponent",void 0);x([(0,D.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],S.prototype,"noCustomCode",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"withManualResources",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"navigatorOnline",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"forcedOffline",void 0);x([(0,D.property)({type:Boolean})],S.prototype,"authenticationRequired",void 0);x([(0,he.jsonProperty)([])],S.prototype,"messageContexts",void 0);x([(0,he.jsonProperty)(void 0)],S.prototype,"session",void 0);var ys=f(C());var ms={"ft-app-context":S};(0,ys.customElements)(ms);var Ot=class extends R{constructor(e){super(!0,e),this.cache.registerFinal("search-configuration",async()=>(await this.awaitApi).getSearchConfiguration())}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,s)=>n.id.localeCompare(s.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),120*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),120*1e3)}async getConfiguration(){return this.cache.get("search-configuration")}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,s)=>n.localeCompare(s))}}).sort((r,n)=>r.key.localeCompare(n.key))}};var It=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e,composed:!0,bubbles:!0})}},kt=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e,composed:!0,bubbles:!0})}},Mt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n},composed:!0,bubbles:!0})}},Be=class t extends Event{constructor(){super(t.eventName)}};Be.eventName="search-context-clear-all-filters";var Oi=t=>t.request.virtualField===me.TITLE_ONLY&&t.request.scope===ye.DOCUMENTS,Ii=t=>t.request.keywordMatch==He.MANDATORY,je=class t extends A.FtStateManager{static build(e,r){return new t(xr(e.trim()||"context"),r)}constructor(e,r){super(),this.store=e,this.ignoreEmptyQuery=!1,this.canUpdateUiLocale=!1,this.openExternalDocumentInNewTab=!1,this.applyStickyFilters=!1,this.history=new A.QueryHistoryStorage(this.store.actions.recentQueries),this.onNewNeededRequest=n=>{n==Ce.CLUSTERED_SEARCH&&this.launchSearch()},this.onStorageEvent=n=>{n.key===this.taruqaConfigStorageKey&&this.loadTaruqaTemplate()},this.loadTaruqaTemplate=()=>{var n;let s;if(xe(l.getState().session,v.DEBUG_USER)){let i=JSON.parse((n=window.localStorage.getItem(this.taruqaConfigStorageKey))!==null&&n!==void 0?n:"{}");s=i.overrideEnabled?i.template:void 0}this.updateSearchRequest({taruqaTemplateOverride:s,changedByConfiguration:!0})},this.updateLocales=(n=l.getState().availableContentLocales)=>{this.store.actions.locales(n),n.length>0&&this.forceContentLocale(this.store.getState().request.contentLocale)},this.searchDebouncer=new A.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest())),this.buildSearchRequest=(n=this.store.getState())=>{var s;return{...n.request,facets:this.facetIds.map(i=>({id:i})),stickyFiltersId:this.applyStickyFilters?(s=l.getState().stickyFilters)===null||s===void 0?void 0:s.id:void 0}},this.suggestDebouncer=new A.Debouncer(1e3),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest())),this.buildSuggestRequest=(n=this.store.getState())=>{var s,i;return{input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:(i=n.request.sort)!==null&&i!==void 0?i:[],sortId:n.request.sortId,contentLocale:n.request.contentLocale,scope:n.request.scope,keywordMatch:n.request.keywordMatch,stickyFiltersId:this.applyStickyFilters?(s=l.getState().stickyFilters)===null||s===void 0?void 0:s.id:void 0}},this.service=r??new Ot,this.searchWatcher=new A.ReduxWatcher(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=new A.ReduxWatcher(e,this.buildSuggestRequest,this.launchSuggest),this.localesWatcher=new A.ReduxWatcher(l,n=>n.availableContentLocales,this.updateLocales),this.stickyFiltersIdWatcher=new A.ReduxWatcher(l,n=>{var s;return(s=n.stickyFilters)===null||s===void 0?void 0:s.id},()=>{this.applyStickyFilters&&(this.launchSearch(),this.launchSuggest())})}async initService(){return this.updateLocales(),this.service.getConfiguration().then(e=>{this.store.actions.configuration(e),this.setSortId(this.store.getState().request.sortId)}),this.loadTaruqaTemplate(),this.launchSearch()}addListeners(){window.addEventListener("storage",this.onStorageEvent),l.addEventListener(Q.eventName,this.loadTaruqaTemplate),this.searchWatcher.watch(),this.suggestWatcher.watch(),this.localesWatcher.watch(),this.stickyFiltersIdWatcher.watch(),this.history.enable(l.getState().tenantId+"-ft-recent-queries")}removeListeners(){window.removeEventListener("storage",this.onStorageEvent),l.removeEventListener(Q.eventName,this.loadTaruqaTemplate),this.searchWatcher.stop(),this.suggestWatcher.stop(),this.localesWatcher.stop(),this.stickyFiltersIdWatcher.stop(),this.history.disable()}get taruqaConfigStorageKey(){return l.getState().tenantId+"-taruqa-experiment-conf"}updateSearchRequest(e,r=!1){let n=(0,A.deepCopy)(this.store.getState().request);delete n.changedByConfiguration,this.store.actions.setRequest({...n,paging:{perPage:n.paging.perPage,page:r?1:n.paging.page},...e})}setQuery(e){this.updateSearchRequest({query:e},!0),this.setLiveQuery(e)}setContentLocale(e){var r;let n=this.store.getState().request.contentLocale;return e!==n&&(e=t.findKnownContentLocale(e,n),this.updateSearchRequest({contentLocale:e,metadataFilters:[]},!0),this.canUpdateUiLocale&&(!((r=l.getState().localesConfiguration)===null||r===void 0)&&r.searchLanguageSetsUiLanguage)&&e&&de.requestUiLocaleUpdate(e,e)),e}static findKnownContentLocale(...e){let{availableContentLocales:r,localesConfiguration:n}=l.getState();if(r.length===0)return e[0];let s=a=>r.some(o=>o.lang==a);for(let a of e)if(s(a))return a;let i=n?.defaultLocales.defaultContentLocale;return i?`${i.lang}-${i.region}`:r[0].lang}forceContentLocale(e){this.updateSearchRequest({contentLocale:t.findKnownContentLocale(e)})}setPageSize(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,perPage:isNaN(e)?20:(0,A.minmax)(1,e,1e3)}})}setPageNumber(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,page:isNaN(e)?1:Math.max(1,e)}})}get sortOptions(){var e,r;return(r=(e=this.store.getState().configuration)===null||e===void 0?void 0:e.sortOptions)!==null&&r!==void 0?r:[]}setSort(e){this.updateSearchRequest({sort:e},!0)}setSortId(e,r=!1){var n;let s=r?{changedByConfiguration:!0}:{};if(e==null||this.sortOptions.length==0)return this.updateSearchRequest({sortId:e,...s},!0),e;let i=(n=this.sortOptions.find(a=>a.id==e))!==null&&n!==void 0?n:this.sortOptions[0];return this.updateSearchRequest({sortId:i.id,...s},!0),i.id}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.updateSearchRequest({metadataFilters:r},!0)}setClusterSortCriterion(e){this.updateSearchRequest({clusterSortCriterions:e})}setSearchInDocumentTitlesOnly(e){e?this.updateSearchRequest({virtualField:me.TITLE_ONLY,scope:ye.DOCUMENTS},!0):this.updateSearchRequest({virtualField:me.EVERYWHERE,scope:ye.DEFAULT},!0)}setKeywordMatch(e){this.updateSearchRequest({keywordMatch:e},!0)}setVirtualField(e){this.updateSearchRequest({virtualField:e},!0)}get searchInDocumentTitlesOnly(){return Oi(this.store.getState())}get keywordMatch(){return Ii(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new Be)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(s=>s!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(s=>({id:s}));this.updateSearchRequest({facets:n})}addPropagatedFacet(e){let r=new Set(this.store.getState().propagatedFacets);r.add(e),this.store.actions.propagatedFacets([...r])}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,valueFilter:{values:r,negative:!1}},i=[...n.filter(a=>!a.valueFilter),...n.filter(a=>a.valueFilter&&a.key!==s.key),s];this.setFilters(i)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,dateFilter:{type:r}},i=[...n.filter(a=>!a.dateFilter),...n.filter(a=>a.dateFilter&&a.key!==s.key),s];this.setFilters(i)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.dateFilter),...r.filter(s=>s.dateFilter&&s.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let s=this.store.getState().request.metadataFilters,i={key:e,rangeFilter:{from:r,to:n}},a=[...s.filter(o=>!o.rangeFilter),...s.filter(o=>o.rangeFilter&&o.key!==i.key),i];this.setFilters(a)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.rangeFilter),...r.filter(s=>s.rangeFilter&&s.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.updateSearchRequest({...e,facets:this.store.getState().request.facets},!0),this.setLiveQuery(e.query)}setScope(e){this.updateSearchRequest({scope:e})}setOtherQueryParams(e){this.updateSearchRequest({otherQueryParams:e})}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}setCanUpdateUiLocale(e){this.canUpdateUiLocale=e}setApplyStickyFilters(e){this.applyStickyFilters=e,this.launchSearch(),this.launchSuggest()}addRecentQuery(e){this.history.addRecentQuery(e)}removeRecentQuery(e){this.history.removeRecentQuery(e)}async fetchSearchData(e){var r,n,s,i,a;if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),!!this.isRequestNeeded(Ce.CLUSTERED_SEARCH))try{if(this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{!((n=this.store.getState().results)===null||n===void 0)&&n.length||this.store.actions.results(void 0),this.cancelableSearch=(0,A.cancelable)(this.service.launchSearch(e));let o=await this.cancelableSearch;if(this.store.actions.announcements(o.announcements),o.paging.currentPage<=1)this.store.actions.results(o.results),this.store.actions.facets(o.facets),this.store.actions.spellcheck(o.spellcheck);else{let c=((i=this.store.getState().results)!==null&&i!==void 0?i:[]).concat(o.results);this.store.actions.results(c),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(o.paging.currentPage-1)*((a=e.paging.perPage)!==null&&a!==void 0?a:20)+1}`})}this.store.actions.paging(o.paging)}}catch(o){o instanceof A.CanceledPromiseError||(console.error(o),(s=this.errorHandler)===null||s===void 0||s.call(this,o))}}async fetchSuggestData(e){var r;try{if((r=this.cancelableSuggest)===null||r===void 0||r.cancel(),e.input.length<3){this.store.actions.suggestResults([]);return}this.cancelableSuggest=(0,A.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof A.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var mr=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},gr=class extends ne.FtContextRegistrationEvent{constructor(e){super("register-ft-search-component",e)}},gs=Symbol("registerInterval"),yr=Symbol("registerAttempts"),ki=40,Mi=(0,ne.applyMixinOnce)(Symbol("toFtSearchComponent"),function(t){class e extends t{constructor(){super(...arguments),this.neededSearchRequests=[]}willUpdate(n){var s,i,a;super.willUpdate(n),n.has("neededSearchRequests")&&((s=this.stateManager)===null||s===void 0||s.unregisterComponent(this,(a=n.get("neededSearchRequests"))!==null&&a!==void 0?a:[]),(i=this.stateManager)===null||i===void 0||i.registerComponent(this,this.neededSearchRequests))}setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.stateManager.registerComponent(this,this.neededSearchRequests),this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.stateManager.unregisterComponent(this,this.neededSearchRequests),this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[yr]=0,this.tryToRegisterToContext(),this[gs]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[yr]>ki?window.clearInterval(this[gs]):(this[yr]++,this.dispatchEvent(new gr({target:this,registrationId:this.searchRegistrationId})))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return mr([(0,qe.state)()],e.prototype,"stateManager",void 0),mr([(0,qe.state)({hasChanged:ne.hasChanged})],e.prototype,"neededSearchRequests",void 0),mr([(0,qe.property)()],e.prototype,"searchRegistrationId",void 0),e}),Es=class extends Mi(ne.FtLitElementRedux){};var Pt=f(C());function Dt(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function Nt(t){var e,r;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values,negative:(r=t.valueFilter)===null||r===void 0?void 0:r.negative}}var Lt=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.document=void 0,this.sendEvent=([n,s])=>{if(!this.canSendEvent()||!n||!s)return;let i=this.store.getState().request;this.document==null?this.sendKhubSearchEvent(i,n,s):this.sendDocumentSearchEvent(i,n,s)},this.eventsService=r??new wt,this.resultsWatcher=(0,Pt.watch)(e,n=>[n.results,n.paging],this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.document=e}setDocumentSearchFromMap(e){this.setDocumentSearch(this.eventsService.convertMapToAnalyticsDocument(e))}initAppInfo(){let{apiIntegrationIdentifier:e,apiIntegrationAppVersion:r}=l.getState();this.setAppName(e??"unknown"),this.setAppVersion(r??"unknown")}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=l.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r,n){let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Dt(e.metadataFilters),facets:e.metadataFilters.map(i=>Nt(i))}};this.eventsService.sendKhubSearchEvent(s)}sendDocumentSearchEvent(e,r,n){if(e.metadataFilters.find(i=>{var a;return i.key==="ft:publicationId"&&((a=i.valueFilter)===null||a===void 0?void 0:a.values[0])===this.document.id})!==void 0){let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query},document:this.document};this.eventsService.sendDocumentSearchEvent(i)}}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==K.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Dt(n.metadataFilters),facets:n.metadataFilters.map(a=>Nt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(i)}sendResultContextMenuOpenedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==K.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Dt(n.metadataFilters),facets:n.metadataFilters.map(a=>Nt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchResultOpenContextMenuEvent(i)}convertDocument(e){switch(e.type){case K.MAP:return{id:e.map.mapId,title:e.map.title,type:te.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case K.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:te.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case K.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:te.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};case K.HTML_PACKAGE:return{id:e.htmlPackage.packageId,title:e.htmlPackage.title,type:te.HTML_PACKAGE,metadata:e.htmlPackage.metadata};case K.HTML_PACKAGE_PAGE:return{id:e.htmlPackagePage.packageId,title:e.htmlPackagePage.title,type:te.HTML_PACKAGE,metadata:e.htmlPackagePage.metadata};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r;return(r=(0,Pt.accessResult)(e))===null||r===void 0?void 0:r.originUrl}};var b=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},m=class extends N.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=je.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new Lt(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.applyStickyFilters=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this._appIntegrationInfoReady=!1,this.disableAnalyticsEvents=!1,this.addStore(l)}render(){return Ss.html`
5
+ `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Is.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};v.elementDefinitions={};v.styles=Ps;T([(0,D.property)()],v.prototype,"baseUrl",void 0);T([(0,D.property)()],v.prototype,"tenantId",void 0);T([(0,D.property)()],v.prototype,"apiIntegrationIdentifier",void 0);T([(0,D.property)()],v.prototype,"apiIntegrationAppVersion",void 0);T([(0,D.property)()],v.prototype,"uiLocale",void 0);T([(0,me.jsonProperty)(null)],v.prototype,"availableUiLocales",void 0);T([(0,me.jsonProperty)(null)],v.prototype,"metadataConfiguration",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"editorMode",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"noCustom",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"openExternalDocumentInNewTab",void 0);T([(0,D.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],v.prototype,"noCustomComponent",void 0);T([(0,D.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],v.prototype,"noCustomCode",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"withManualResources",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"navigatorOnline",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"forcedOffline",void 0);T([(0,D.property)({type:Boolean})],v.prototype,"authenticationRequired",void 0);T([(0,me.jsonProperty)([])],v.prototype,"messageContexts",void 0);T([(0,me.jsonProperty)(void 0)],v.prototype,"session",void 0);var Bs=f(x());var $s={"ft-app-context":v};(0,Bs.customElements)($s);var Ht=class extends I{constructor(e){super(!0,e),this.cache.registerFinal("search-configuration",async()=>(await this.awaitApi).getSearchConfiguration())}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,s)=>n.id.localeCompare(s.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),120*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),120*1e3)}async getConfiguration(){return this.cache.get("search-configuration")}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,s)=>n.localeCompare(s))}}).sort((r,n)=>r.key.localeCompare(n.key))}};var Je=f(x());var Fr=globalThis,Vs=t=>t,jt=Fr.trustedTypes,Hs=jt?jt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ws="$lit$",se=`lit$${Math.random().toFixed(9).slice(2)}$`,Qs="?"+se,fa=`<${Qs}>`,Ee=document,qt=()=>Ee.createComment(""),We=t=>t===null||typeof t!="object"&&typeof t!="function",Ur=Array.isArray,ma=t=>Ur(t)||typeof t?.[Symbol.iterator]=="function",kr=`[
6
+ \f\r]`,Ge=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,js=/-->/g,qs=/>/g,ye=RegExp(`>|${kr}(?:([^\\s"'>=/]+)(${kr}*=${kr}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ks=/'/g,zs=/"/g,Ys=/^(?:script|style|textarea|title)$/i,$r=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Au=$r(1),_u=$r(2),bu=$r(3),Qe=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Gs=new WeakMap,ge=Ee.createTreeWalker(Ee,129);function Xs(t,e){if(!Ur(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hs!==void 0?Hs.createHTML(e):e}var ya=(t,e)=>{let r=t.length-1,n=[],s,i=e===2?"<svg>":e===3?"<math>":"",a=Ge;for(let o=0;o<r;o++){let c=t[o],l,d,u=-1,p=0;for(;p<c.length&&(a.lastIndex=p,d=a.exec(c),d!==null);)p=a.lastIndex,a===Ge?d[1]==="!--"?a=js:d[1]!==void 0?a=qs:d[2]!==void 0?(Ys.test(d[2])&&(s=RegExp("</"+d[2],"g")),a=ye):d[3]!==void 0&&(a=ye):a===ye?d[0]===">"?(a=s??Ge,u=-1):d[1]===void 0?u=-2:(u=a.lastIndex-d[2].length,l=d[1],a=d[3]===void 0?ye:d[3]==='"'?zs:Ks):a===zs||a===Ks?a=ye:a===js||a===qs?a=Ge:(a=ye,s=void 0);let m=a===ye&&t[o+1].startsWith("/>")?" ":"";i+=a===Ge?c+fa:u>=0?(n.push(l),c.slice(0,u)+Ws+c.slice(u)+se+m):c+se+(u===-2?o:m)}return[Xs(t,i+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Ye=class t{constructor({strings:e,_$litType$:r},n){let s;this.parts=[];let i=0,a=0,o=e.length-1,c=this.parts,[l,d]=ya(e,r);if(this.el=t.createElement(l,n),ge.currentNode=this.el.content,r===2||r===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=ge.nextNode())!==null&&c.length<o;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(Ws)){let p=d[a++],m=s.getAttribute(u).split(se),C=/([.?@])?(.*)/.exec(p);c.push({type:1,index:i,name:C[2],strings:m,ctor:C[1]==="."?Nr:C[1]==="?"?Dr:C[1]==="@"?Lr:Ie}),s.removeAttribute(u)}else u.startsWith(se)&&(c.push({type:6,index:i}),s.removeAttribute(u));if(Ys.test(s.tagName)){let u=s.textContent.split(se),p=u.length-1;if(p>0){s.textContent=jt?jt.emptyScript:"";for(let m=0;m<p;m++)s.append(u[m],qt()),ge.nextNode(),c.push({type:2,index:++i});s.append(u[p],qt())}}}else if(s.nodeType===8)if(s.data===Qs)c.push({type:2,index:i});else{let u=-1;for(;(u=s.data.indexOf(se,u+1))!==-1;)c.push({type:7,index:i}),u+=se.length-1}i++}}static createElement(e,r){let n=Ee.createElement("template");return n.innerHTML=e,n}};function Oe(t,e,r=t,n){if(e===Qe)return e;let s=n!==void 0?r._$Co?.[n]:r._$Cl,i=We(e)?void 0:e._$litDirective$;return s?.constructor!==i&&(s?._$AO?.(!1),i===void 0?s=void 0:(s=new i(t),s._$AT(t,r,n)),n!==void 0?(r._$Co??=[])[n]=s:r._$Cl=s),s!==void 0&&(e=Oe(t,s._$AS(t,e.values),s,n)),e}var Mr=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,s=(e?.creationScope??Ee).importNode(r,!0);ge.currentNode=s;let i=ge.nextNode(),a=0,o=0,c=n[0];for(;c!==void 0;){if(a===c.index){let l;c.type===2?l=new Kt(i,i.nextSibling,this,e):c.type===1?l=new c.ctor(i,c.name,c.strings,this,e):c.type===6&&(l=new Pr(i,this,e)),this._$AV.push(l),c=n[++o]}a!==c?.index&&(i=ge.nextNode(),a++)}return ge.currentNode=Ee,s}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Kt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Oe(this,e,r),We(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==Qe&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ma(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&We(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ee.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Ye.createElement(Xs(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(r);else{let i=new Mr(s,this),a=i.u(this.options);i.p(r),this.T(a),this._$AH=i}}_$AC(e){let r=Gs.get(e.strings);return r===void 0&&Gs.set(e.strings,r=new Ye(e)),r}k(e){Ur(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,s=0;for(let i of e)s===r.length?r.push(n=new t(this.O(qt()),this.O(qt()),this,this.options)):n=r[s],n._$AI(i),s++;s<r.length&&(this._$AR(n&&n._$AB.nextSibling,s),r.length=s)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=Vs(e).nextSibling;Vs(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ie=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,s,i){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=r,this._$AM=s,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=w}_$AI(e,r=this,n,s){let i=this.strings,a=!1;if(i===void 0)e=Oe(this,e,r,0),a=!We(e)||e!==this._$AH&&e!==Qe,a&&(this._$AH=e);else{let o=e,c,l;for(e=i[0],c=0;c<i.length-1;c++)l=Oe(this,o[n+c],r,c),l===Qe&&(l=this._$AH[c]),a||=!We(l)||l!==this._$AH[c],l===w?e=w:e!==w&&(e+=(l??"")+i[c+1]),this._$AH[c]=l}a&&!s&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Nr=class extends Ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},Dr=class extends Ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},Lr=class extends Ie{constructor(e,r,n,s,i){super(e,r,n,s,i),this.type=5}_$AI(e,r=this){if((e=Oe(this,e,r,0)??w)===Qe)return;let n=this._$AH,s=e===w&&n!==w||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==w&&(n===w||s);s&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Pr=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Oe(this,e)}};var ga=Fr.litHtmlPolyfillSupport;ga?.(Ye,Kt),(Fr.litHtmlVersions??=[]).push("3.3.3");var Js=t=>t??w;var zt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e,composed:!0,bubbles:!0})}},Gt=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e,composed:!0,bubbles:!0})}},Wt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n},composed:!0,bubbles:!0})}},Xe=class t extends Event{constructor(){super(t.eventName)}};Xe.eventName="search-context-clear-all-filters";function Zs(t){var e;return((e=(0,Je.accessResult)(t))===null||e===void 0?void 0:e.openMode)===rt.EXTERNAL}function ei(t,e){return Zs(t)?(0,Je.accessResult)(t).originUrl:(0,Je.accessResultUrl)(t,e)}function ti(t,e){return Js(e&&Zs(t)?"_blank":void 0)}var Ea=t=>t.request.virtualField===ve.TITLE_ONLY&&t.request.scope===Ae.DOCUMENTS,Sa=t=>t.request.keywordMatch==tt.MANDATORY,Ze=class t extends _.FtStateManager{static build(e,r){return new t(Yr(e.trim()||"context"),r)}constructor(e,r){super(),this.store=e,this.ignoreEmptyQuery=!1,this.canUpdateUiLocale=!1,this.openExternalDocumentInNewTab=!1,this.applyStickyFilters=!1,this.history=new _.QueryHistoryStorage(this.store.actions.recentQueries),this.onNewNeededRequest=n=>{n==ke.CLUSTERED_SEARCH&&this.launchSearch()},this.onStorageEvent=n=>{n.key===this.taruqaConfigStorageKey&&this.loadTaruqaTemplate()},this.loadTaruqaTemplate=()=>{var n;let s;if(Me(h.getState().session,A.DEBUG_USER)){let i=JSON.parse((n=window.localStorage.getItem(this.taruqaConfigStorageKey))!==null&&n!==void 0?n:"{}");s=i.overrideEnabled?i.template:void 0}this.updateSearchRequest({taruqaTemplateOverride:s,changedByConfiguration:!0})},this.updateLocales=(n=h.getState().availableContentLocales)=>{this.store.actions.locales(n),n.length>0&&this.forceContentLocale(this.store.getState().request.contentLocale)},this.searchDebouncer=new _.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest())),this.buildSearchRequest=(n=this.store.getState())=>{var s;return{...n.request,facets:this.facetIds.map(i=>({id:i})),stickyFiltersId:this.applyStickyFilters?(s=h.getState().stickyFilters)===null||s===void 0?void 0:s.id:void 0}},this.suggestDebouncer=new _.Debouncer(1e3),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest())),this.buildSuggestRequest=(n=this.store.getState())=>{var s,i;return{input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:(i=n.request.sort)!==null&&i!==void 0?i:[],sortId:n.request.sortId,contentLocale:n.request.contentLocale,scope:n.request.scope,keywordMatch:n.request.keywordMatch,stickyFiltersId:this.applyStickyFilters?(s=h.getState().stickyFilters)===null||s===void 0?void 0:s.id:void 0}},this.service=r??new Ht,this.searchWatcher=new _.ReduxWatcher(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=new _.ReduxWatcher(e,this.buildSuggestRequest,this.launchSuggest),this.localesWatcher=new _.ReduxWatcher(h,n=>n.availableContentLocales,this.updateLocales),this.stickyFiltersIdWatcher=new _.ReduxWatcher(h,n=>{var s;return(s=n.stickyFilters)===null||s===void 0?void 0:s.id},()=>{this.applyStickyFilters&&(this.launchSearch(),this.launchSuggest())})}async initService(){return this.updateLocales(),this.service.getConfiguration().then(e=>{this.store.actions.configuration(e),this.setSortId(this.store.getState().request.sortId)}),this.loadTaruqaTemplate(),this.launchSearch()}addListeners(){window.addEventListener("storage",this.onStorageEvent),h.addEventListener(Y.eventName,this.loadTaruqaTemplate),this.searchWatcher.watch(),this.suggestWatcher.watch(),this.localesWatcher.watch(),this.stickyFiltersIdWatcher.watch(),this.history.enable(h.getState().tenantId+"-ft-recent-queries")}removeListeners(){window.removeEventListener("storage",this.onStorageEvent),h.removeEventListener(Y.eventName,this.loadTaruqaTemplate),this.searchWatcher.stop(),this.suggestWatcher.stop(),this.localesWatcher.stop(),this.stickyFiltersIdWatcher.stop(),this.history.disable()}get taruqaConfigStorageKey(){return h.getState().tenantId+"-taruqa-experiment-conf"}updateSearchRequest(e,r=!1){let n=(0,_.deepCopy)(this.store.getState().request);delete n.changedByConfiguration,this.store.actions.setRequest({...n,paging:{perPage:n.paging.perPage,page:r?1:n.paging.page},...e})}setQuery(e){this.updateSearchRequest({query:e},!0),this.setLiveQuery(e)}setContentLocale(e){var r;let n=this.store.getState().request.contentLocale;return e!==n&&(e=t.findKnownContentLocale(e,n),this.updateSearchRequest({contentLocale:e,metadataFilters:[]},!0),this.canUpdateUiLocale&&(!((r=h.getState().localesConfiguration)===null||r===void 0)&&r.searchLanguageSetsUiLanguage)&&e&&pe.requestUiLocaleUpdate(e,e)),e}static findKnownContentLocale(...e){let{availableContentLocales:r,localesConfiguration:n}=h.getState();if(r.length===0)return e[0];let s=a=>r.some(o=>o.lang==a);for(let a of e)if(s(a))return a;let i=n?.defaultLocales.defaultContentLocale;return i?`${i.lang}-${i.region}`:r[0].lang}forceContentLocale(e){this.updateSearchRequest({contentLocale:t.findKnownContentLocale(e)})}setPageSize(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,perPage:isNaN(e)?20:(0,_.minmax)(1,e,1e3)}})}setPageNumber(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,page:isNaN(e)?1:Math.max(1,e)}})}get sortOptions(){var e,r;return(r=(e=this.store.getState().configuration)===null||e===void 0?void 0:e.sortOptions)!==null&&r!==void 0?r:[]}setSort(e){this.updateSearchRequest({sort:e},!0)}setSortId(e,r=!1){var n;let s=r?{changedByConfiguration:!0}:{};if(e==null||this.sortOptions.length==0)return this.updateSearchRequest({sortId:e,...s},!0),e;let i=(n=this.sortOptions.find(a=>a.id==e))!==null&&n!==void 0?n:this.sortOptions[0];return this.updateSearchRequest({sortId:i.id,...s},!0),i.id}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.updateSearchRequest({metadataFilters:r},!0)}setClusterSortCriterion(e){this.updateSearchRequest({clusterSortCriterions:e})}setSearchInDocumentTitlesOnly(e){e?this.updateSearchRequest({virtualField:ve.TITLE_ONLY,scope:Ae.DOCUMENTS},!0):this.updateSearchRequest({virtualField:ve.EVERYWHERE,scope:Ae.DEFAULT},!0)}setKeywordMatch(e){this.updateSearchRequest({keywordMatch:e},!0)}setVirtualField(e){this.updateSearchRequest({virtualField:e},!0)}get searchInDocumentTitlesOnly(){return Ea(this.store.getState())}get keywordMatch(){return Sa(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new Xe)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(s=>s!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(s=>({id:s}));this.updateSearchRequest({facets:n})}addPropagatedFacet(e){let r=new Set(this.store.getState().propagatedFacets);r.add(e),this.store.actions.propagatedFacets([...r])}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r,n){let s=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:r,negative:n??!1}},a=[...s.filter(o=>!o.valueFilter),...s.filter(o=>o.valueFilter&&o.key!==i.key),i];this.setFilters(a)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,dateFilter:{type:r}},i=[...n.filter(a=>!a.dateFilter),...n.filter(a=>a.dateFilter&&a.key!==s.key),s];this.setFilters(i)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.dateFilter),...r.filter(s=>s.dateFilter&&s.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let s=this.store.getState().request.metadataFilters,i={key:e,rangeFilter:{from:r,to:n}},a=[...s.filter(o=>!o.rangeFilter),...s.filter(o=>o.rangeFilter&&o.key!==i.key),i];this.setFilters(a)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.rangeFilter),...r.filter(s=>s.rangeFilter&&s.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.updateSearchRequest({...e,facets:this.store.getState().request.facets},!0),this.setLiveQuery(e.query)}setScope(e){this.updateSearchRequest({scope:e})}setOtherQueryParams(e){this.updateSearchRequest({otherQueryParams:e})}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}setCanUpdateUiLocale(e){this.canUpdateUiLocale=e}setApplyStickyFilters(e){this.applyStickyFilters=e,this.launchSearch(),this.launchSuggest()}addRecentQuery(e){this.history.addRecentQuery(e)}removeRecentQuery(e){this.history.removeRecentQuery(e)}async fetchSearchData(e){var r,n,s,i,a;if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),!!this.isRequestNeeded(ke.CLUSTERED_SEARCH))try{if(this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{!((n=this.store.getState().results)===null||n===void 0)&&n.length||this.store.actions.results(void 0),this.cancelableSearch=(0,_.cancelable)(this.service.launchSearch(e));let o=await this.cancelableSearch;if(this.store.actions.announcements(o.announcements),o.paging.currentPage<=1)this.store.actions.results(o.results),this.store.actions.facets(o.facets),this.store.actions.spellcheck(o.spellcheck);else{let c=((i=this.store.getState().results)!==null&&i!==void 0?i:[]).concat(o.results);this.store.actions.results(c),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(o.paging.currentPage-1)*((a=e.paging.perPage)!==null&&a!==void 0?a:20)+1}`})}this.store.actions.paging(o.paging)}}catch(o){o instanceof _.CanceledPromiseError||(console.error(o),(s=this.errorHandler)===null||s===void 0||s.call(this,o))}}async fetchSuggestData(e){var r;try{if((r=this.cancelableSuggest)===null||r===void 0||r.cancel(),e.input.length<3){this.store.actions.suggestResults([]);return}this.cancelableSuggest=(0,_.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof _.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}getResultUrl(e,r){var n,s;return(s=(n=this.resultUrlBuilder)===null||n===void 0?void 0:n.call(this,e,r))!==null&&s!==void 0?s:ei(e,r)}getResultTarget(e,r){var n,s;return(s=(n=this.resultTargetBuilder)===null||n===void 0?void 0:n.call(this,e,r))!==null&&s!==void 0?s:ti(e,r)}};var Br=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},Hr=class extends ie.FtContextRegistrationEvent{constructor(e){super("register-ft-search-component",e)}},ri=Symbol("registerInterval"),Vr=Symbol("registerAttempts"),va=40,Aa=(0,ie.applyMixinOnce)(Symbol("toFtSearchComponent"),function(t){class e extends t{constructor(){super(...arguments),this.neededSearchRequests=[]}willUpdate(n){var s,i,a;super.willUpdate(n),n.has("neededSearchRequests")&&((s=this.stateManager)===null||s===void 0||s.unregisterComponent(this,(a=n.get("neededSearchRequests"))!==null&&a!==void 0?a:[]),(i=this.stateManager)===null||i===void 0||i.registerComponent(this,this.neededSearchRequests))}setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.stateManager.registerComponent(this,this.neededSearchRequests),this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.stateManager.unregisterComponent(this,this.neededSearchRequests),this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Vr]=0,this.tryToRegisterToContext(),this[ri]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Vr]>va?window.clearInterval(this[ri]):(this[Vr]++,this.dispatchEvent(new Hr({target:this,registrationId:this.searchRegistrationId})))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Br([(0,et.state)()],e.prototype,"stateManager",void 0),Br([(0,et.state)({hasChanged:ie.hasChanged})],e.prototype,"neededSearchRequests",void 0),Br([(0,et.property)()],e.prototype,"searchRegistrationId",void 0),e}),ni=class extends Aa(ie.FtLitElementRedux){};var Jt=f(x());function Qt(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function Yt(t){var e,r;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values,negative:(r=t.valueFilter)===null||r===void 0?void 0:r.negative}}var Xt=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.document=void 0,this.sendEvent=([n,s])=>{if(!this.canSendEvent()||!n||!s)return;let i=this.store.getState().request;this.document==null?this.sendKhubSearchEvent(i,n,s):this.sendDocumentSearchEvent(i,n,s)},this.eventsService=r??new $t,this.resultsWatcher=(0,Jt.watch)(e,n=>[n.results,n.paging],this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.document=e}setDocumentSearchFromMap(e){this.setDocumentSearch(this.eventsService.convertMapToAnalyticsDocument(e))}initAppInfo(){let{apiIntegrationIdentifier:e,apiIntegrationAppVersion:r}=h.getState();this.setAppName(e??"unknown"),this.setAppVersion(r??"unknown")}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=h.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r,n){let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ae.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Qt(e.metadataFilters),facets:e.metadataFilters.map(i=>Yt(i))}};this.eventsService.sendKhubSearchEvent(s)}sendDocumentSearchEvent(e,r,n){if(e.metadataFilters.find(i=>{var a;return i.key==="ft:publicationId"&&((a=i.valueFilter)===null||a===void 0?void 0:a.values[0])===this.document.id})!==void 0){let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ae.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query},document:this.document};this.eventsService.sendDocumentSearchEvent(i)}}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==z.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ae.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Qt(n.metadataFilters),facets:n.metadataFilters.map(a=>Yt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(i)}sendResultContextMenuOpenedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==z.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ae.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Qt(n.metadataFilters),facets:n.metadataFilters.map(a=>Yt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchResultOpenContextMenuEvent(i)}convertDocument(e){switch(e.type){case z.MAP:return{id:e.map.mapId,title:e.map.title,type:re.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case z.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:re.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case z.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:re.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};case z.HTML_PACKAGE:return{id:e.htmlPackage.packageId,title:e.htmlPackage.title,type:re.HTML_PACKAGE,metadata:e.htmlPackage.metadata};case z.HTML_PACKAGE_PAGE:return{id:e.htmlPackagePage.packageId,title:e.htmlPackagePage.title,type:re.HTML_PACKAGE,metadata:e.htmlPackagePage.metadata};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r;return(r=(0,Jt.accessResult)(e))===null||r===void 0?void 0:r.originUrl}};var b=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},y=class extends L.FtLitElementRedux{get stateManager(){return this._stateManager==null&&this.buildStateManager(),this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new Xt(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.applyStickyFilters=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this._appIntegrationInfoReady=!1,this.disableAnalyticsEvents=!1,this.addStore(h)}buildStateManager(){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Ze.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}render(){return si.html`
6
8
  <slot @register-ft-search-component=${this.registerComponent} @ft-search-result-click=${this.onResultClicked}
7
9
  @ft-search-result-open-context-menu=${this.onResultContextMenuOpened}></slot>
8
- `}willUpdate(e){super.willUpdate(e),e.has("_appIntegrationInfoReady")&&this._appIntegrationInfoReady&&this.eventManager.initAppInfo(),e.has("disableAnalyticsEvents")&&this.eventManager.setEnableAnalyticsEvents(!this.disableAnalyticsEvents),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sortId")&&this.stateManager.setSortId(this.sortId),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("keywordMatch")&&this.stateManager.setKeywordMatch(this.keywordMatch),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("applyStickyFilters")&&this.stateManager.setApplyStickyFilters(this.applyStickyFilters),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),de.knownContexts.register(this),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams),this.stateManager.addListeners()}disconnectedCallback(){super.disconnectedCallback(),de.knownContexts.unregister(this),this.stateManager.removeListeners(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new kt(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Mt(this.request,this.paging,this.spellcheckAutocorrect))}registerComponent(e){var r,n,s;if(e.stopPropagation(),((r=e.detail)===null||r===void 0?void 0:r.registrationId)==this.registrationId){let i=(s=(n=e.detail)===null||n===void 0?void 0:n.target)!==null&&s!==void 0?s:e.composedPath()[0];this.register(i)}}register(e){e.setSearchStateManager(this.stateManager)}handleLoadError(e){this.dispatchEvent(new It(e))}clear(){this.stateManager.clear()}onResultClicked(e){this.eventManager.sendResultClickedEvent(e.detail.result,e.detail.rank)}onResultContextMenuOpened(e){this.eventManager.sendResultContextMenuOpenedEvent(e.detail.result,e.detail.rank)}};m.elementDefinitions={};m.styles=_r;b([(0,N.redux)({store:l.name})],m.prototype,"session",void 0);b([(0,F.property)()],m.prototype,"query",void 0);b([(0,F.property)()],m.prototype,"contentLocale",void 0);b([(0,N.numberProperty)()],m.prototype,"pageSize",void 0);b([(0,F.property)({type:Boolean})],m.prototype,"searchInDocumentTitlesOnly",void 0);b([(0,F.property)()],m.prototype,"keywordMatch",void 0);b([(0,F.property)()],m.prototype,"scope",void 0);b([(0,F.property)()],m.prototype,"virtualField",void 0);b([(0,F.property)()],m.prototype,"registrationId",void 0);b([(0,F.property)({type:Boolean})],m.prototype,"ignoreEmptyQuery",void 0);b([(0,F.property)({type:Boolean})],m.prototype,"applyStickyFilters",void 0);b([(0,N.redux)({store:l.name})],m.prototype,"openExternalDocumentInNewTab",void 0);b([(0,N.jsonProperty)([])],m.prototype,"filters",void 0);b([(0,F.property)()],m.prototype,"sortId",void 0);b([(0,N.jsonProperty)([])],m.prototype,"sort",void 0);b([(0,N.jsonProperty)({})],m.prototype,"otherQueryParams",void 0);b([(0,N.redux)({store:"search"})],m.prototype,"request",void 0);b([(0,N.redux)({store:"search"})],m.prototype,"paging",void 0);b([(0,N.redux)({store:"search",selector:t=>t.spellcheck})],m.prototype,"spellcheckAutocorrect",void 0);b([(0,N.redux)({store:l.name,selector:t=>t.apiIntegrationIdentifier!==void 0&&t.apiIntegrationAppVersion!==void 0})],m.prototype,"_appIntegrationInfoReady",void 0);b([(0,F.property)({attribute:!1})],m.prototype,"searchServiceProvider",void 0);b([(0,F.property)({type:Boolean})],m.prototype,"disableAnalyticsEvents",void 0);var vs={"ft-search-context":m};(0,As.customElements)(vs);})();
10
+ `}willUpdate(e){super.willUpdate(e),e.has("_appIntegrationInfoReady")&&this._appIntegrationInfoReady&&this.eventManager.initAppInfo(),e.has("disableAnalyticsEvents")&&this.eventManager.setEnableAnalyticsEvents(!this.disableAnalyticsEvents),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sortId")&&this.stateManager.setSortId(this.sortId),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("keywordMatch")&&this.stateManager.setKeywordMatch(this.keywordMatch),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("applyStickyFilters")&&this.stateManager.setApplyStickyFilters(this.applyStickyFilters),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),pe.knownContexts.register(this),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams),this.stateManager.addListeners()}disconnectedCallback(){super.disconnectedCallback(),pe.knownContexts.unregister(this),this.stateManager.removeListeners(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new Gt(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Wt(this.request,this.paging,this.spellcheckAutocorrect))}registerComponent(e){var r,n,s;if(e.stopPropagation(),((r=e.detail)===null||r===void 0?void 0:r.registrationId)==this.registrationId){let i=(s=(n=e.detail)===null||n===void 0?void 0:n.target)!==null&&s!==void 0?s:e.composedPath()[0];this.register(i)}}register(e){e.setSearchStateManager(this.stateManager)}handleLoadError(e){this.dispatchEvent(new zt(e))}clear(){this.stateManager.clear()}onResultClicked(e){this.eventManager.sendResultClickedEvent(e.detail.result,e.detail.rank)}onResultContextMenuOpened(e){this.eventManager.sendResultContextMenuOpenedEvent(e.detail.result,e.detail.rank)}};y.elementDefinitions={};y.styles=Wr;b([(0,L.redux)({store:h.name})],y.prototype,"session",void 0);b([(0,U.property)()],y.prototype,"query",void 0);b([(0,U.property)()],y.prototype,"contentLocale",void 0);b([(0,L.numberProperty)()],y.prototype,"pageSize",void 0);b([(0,U.property)({type:Boolean})],y.prototype,"searchInDocumentTitlesOnly",void 0);b([(0,U.property)()],y.prototype,"keywordMatch",void 0);b([(0,U.property)()],y.prototype,"scope",void 0);b([(0,U.property)()],y.prototype,"virtualField",void 0);b([(0,U.property)()],y.prototype,"registrationId",void 0);b([(0,U.property)({type:Boolean})],y.prototype,"ignoreEmptyQuery",void 0);b([(0,U.property)({type:Boolean})],y.prototype,"applyStickyFilters",void 0);b([(0,L.redux)({store:h.name})],y.prototype,"openExternalDocumentInNewTab",void 0);b([(0,L.jsonProperty)([])],y.prototype,"filters",void 0);b([(0,U.property)()],y.prototype,"sortId",void 0);b([(0,L.jsonProperty)([])],y.prototype,"sort",void 0);b([(0,L.jsonProperty)({})],y.prototype,"otherQueryParams",void 0);b([(0,L.redux)({store:"search"})],y.prototype,"request",void 0);b([(0,L.redux)({store:"search"})],y.prototype,"paging",void 0);b([(0,L.redux)({store:"search",selector:t=>t.spellcheck})],y.prototype,"spellcheckAutocorrect",void 0);b([(0,L.redux)({store:h.name,selector:t=>t.apiIntegrationIdentifier!==void 0&&t.apiIntegrationAppVersion!==void 0})],y.prototype,"_appIntegrationInfoReady",void 0);b([(0,U.property)({attribute:!1})],y.prototype,"searchServiceProvider",void 0);b([(0,U.property)({type:Boolean})],y.prototype,"disableAnalyticsEvents",void 0);var ii={"ft-search-context":y};(0,ai.customElements)(ii);})();
9
11
  /*! Bundled license information:
10
12
 
11
13
  .store/@lit-context-npm-1.1.6-2c155157c6/package/lib/context-request-event.js:
@@ -21,6 +23,7 @@
21
23
  *)
22
24
 
23
25
  .store/@lit-context-npm-1.1.6-2c155157c6/package/lib/decorators/provide.js:
26
+ .store/lit-html-npm-3.3.3-0f054b825a/package/lit-html.js:
24
27
  (**
25
28
  * @license
26
29
  * Copyright 2017 Google LLC
@@ -33,4 +36,11 @@
33
36
  * Copyright 2022 Google LLC
34
37
  * SPDX-License-Identifier: BSD-3-Clause
35
38
  *)
39
+
40
+ .store/lit-html-npm-3.3.3-0f054b825a/package/directives/if-defined.js:
41
+ (**
42
+ * @license
43
+ * Copyright 2018 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ *)
36
46
  */