@fluid-topics/ft-search-sort-selector 2.1.14 → 2.1.16

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.
@@ -642,8 +642,8 @@
642
642
  label="${t.label}"
643
643
  .value=${t.value}
644
644
  ></ft-select-option>
645
- `}willUpdate(t){super.willUpdate(t),t.has("options")&&(this.selectedOption=this.options.filter(r=>r.selected)[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(t){var r,n;if(super.contentAvailableCallback(t),t.has("focusOptions")&&this.focusOptions&&((n=(r=this.selectedOptionElement)!==null&&r!==void 0?r:this.firstOption)===null||n===void 0||n.focus(),this.focusOptions=!1),t.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.minWidth=this.mainPanel.getBoundingClientRect().width+"px";let i=["bottom","top"];(0,te.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",i,"fixed",E.optionsHeight,0).then(({x:s,y:o})=>{this.optionsMenu.style.left=`${s}px`,this.optionsMenu.style.top=`${o}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var r;t.stopPropagation(),this.isSlotEmpty=(0,te.isSlotEmptyOrWithoutContent)(this.optionsSlot);let n=(r=this.optionsSlot)===null||r===void 0?void 0:r.assignedElements().map(i=>i);n&&n.length>0&&(this.options=n)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(t){var r,n;let i,s=this.focusedOption?this.optionsList.indexOf(this.focusedOption):0;switch(t.key){case" ":case"Enter":t.preventDefault(),t.stopPropagation(),this.onSelectOption(t),this.optionsDisplayed=!1,(r=this.mainPanel)===null||r===void 0||r.focus();break;case"Escape":this.optionsDisplayed=!1,(n=this.mainPanel)===null||n===void 0||n.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),i=this.optionsList[(s-1+this.optionsList.length)%this.optionsList.length];break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),i=this.optionsList[(s+1)%this.optionsList.length];break;default:if(t.key.length!=1)break;this.isKeyAlphanumeric(t.key)&&(i=this.handleAlphanumericPress(t.key));break}i?.focus()}isKeyAlphanumeric(t){let r=t.charCodeAt(0);return r>47&&r<58||r>64&&r<91||r>96&&r<123}handleAlphanumericPress(t){let r=new Date;r.getTime()-this.lastSearchInputDate.getTime()>e.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=t.toLowerCase();let n=this.options.find(i=>{var s;return((s=i.label)===null||s===void 0?void 0:s.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});return this.lastSearchInputDate=r,n&&this.optionsList.find(i=>i.value===n.value)}getOptionId(t){if(!t)return;let r=this.options.findIndex(n=>(0,te.deepEqual)(n.value,t.value));if(r!==-1)return`option-${r}`}onSelectOption(t){t.stopPropagation(),this.setValue(t.target.value)}setValue(t,r=!0){let n=this.options.find(i=>(0,te.deepEqual)(i.value,t));n&&this.selectOption(n,r)}selectOption(t,r=!0){var n,i;if(!(0,te.deepEqual)((n=this.selectedOption)===null||n===void 0?void 0:n.value,t?.value)){this.selectedOption=t;for(let s of this.options)s.selected=s===t;r&&this.dispatchEvent(new CustomEvent("change",{detail:(i=this.selectedOption)===null||i===void 0?void 0:i.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};R.elementDefinitions={"ft-input-label":oe,"ft-typography":ve,"ft-ripple":N,"ft-icon":X,"ft-select-option":V};R.searchTimeoutMilliseconds=2e3;R.styles=[st,as];B([(0,U.property)({type:String})],R.prototype,"label",void 0);B([(0,U.property)({type:String})],R.prototype,"ariaLabel",void 0);B([(0,U.property)({type:String})],R.prototype,"helper",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"outlined",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"disabled",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"error",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"fixedMenuPosition",void 0);B([(0,U.property)({type:Array})],R.prototype,"options",void 0);B([(0,U.state)()],R.prototype,"selectedOption",void 0);B([(0,U.state)()],R.prototype,"optionsDisplayed",void 0);B([(0,U.state)()],R.prototype,"focusOptions",void 0);B([(0,U.state)()],R.prototype,"currentSearch",void 0);B([(0,U.state)()],R.prototype,"lastSearchInputDate",void 0);B([(0,U.query)(".ft-select")],R.prototype,"container",void 0);B([(0,U.query)(".ft-select--options")],R.prototype,"optionsMenu",void 0);B([(0,U.query)(".ft-select--input-panel")],R.prototype,"mainPanel",void 0);B([(0,U.query)("slot:not([name])")],R.prototype,"optionsSlot",void 0);var hs=f(S());var fs={"ft-select":R,"ft-select-option":V};(0,hs.customElements)(fs);var xa=f(kr());var Tn=f(F());var ms=f(F(),1);var tn=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function ys(e,t){return(0,ms.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return Mt(e);try{return JSON.parse(r)}catch{return Mt(e)}},toAttribute:r=>JSON.stringify(r)},hasChanged:It,...t??{}})}function Ma(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!er(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!er(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let i=o=>Object.keys(o).filter(a=>o[a]!=null),s=i(e);if(r=s.length,r!==i(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){let o=s[n];if(!er(e[o],t[o]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function er(e,t){try{return Ma(e,t)}catch{return!1}}function It(e,t){return!er(e,t)}function Mt(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function tr(e,t){let r=n=>n[e]===!0;return n=>{if(r(n))return n;let i=t(n);return i[e]=!0,i}}var vs=f(F(),1);var rn=e=>{let t=e??{};return(r,n)=>{var i;let s={hasChanged:It,attribute:!1,...t};(0,vs.property)(s)(r,n);let o=r.constructor;o.reduxProperties=new Map(o.reduxProperties),o.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:(a=>a[n]),store:t.store})}};var rr=class{constructor(){this.queue=[]}add(t,r=!1){r&&this.clear(t.type),this.queue.push(t)}consume(t){let r=this.queue.find(n=>n.type===t);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(t){typeof t=="string"?this.queue=this.queue.filter(r=>r.type!==t):this.queue=this.queue.filter(r=>!t.test(r.type))}};var ke=f(F(),1);var nr=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,r){return this.callbacks=[t],this.debounce(r)}queue(t,r){return this.callbacks.push(t),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,r;let n=[...this.callbacks];this.callbacks=[];let i=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),s=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let o of n)try{await o()}catch(a){i(a);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var bs=f(H(),1);var ir=globalThis,Ia=ir.ShadowRoot&&(ir.ShadyCSS===void 0||ir.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var gs=(e,t)=>{if(Ia)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),i=ir.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}};var sr=class extends bs.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let r={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return gs(n,t.elementStyles),n}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(t,r){tn(t)(r),this.canDefineScopedElement(t)&&this.registry.define(t,r)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,r){this.scopedRegistryConstructor.defineScopedElement(t,r)}};function xs(e,t,...r){var n;let i=e.querySelector(t);for(let s of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var ut=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Os,Ss=Symbol("constructorPrototype"),As=Symbol("constructorName"),Cs=Symbol("exportpartsDebouncer"),Es=Symbol("dynamicDependenciesLoaded"),lt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};lt.eventName="exportparts-updated";var pe=class extends sr{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Os]=new nr(5),this.scheduleExportpartsUpdate=()=>{var t,r,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Cs].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[As]=this.constructor.name,this[Ss]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[As]&&Object.setPrototypeOf(this,this[Ss])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Es]||(r[Es]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(lt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(lt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new lt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];r=xs(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(t){var r,n,i,s,o,a;let l=d=>d!=null&&d.trim().length>0,u=t.filter(l).map(d=>d.trim());if(u.length===0){this.exportparts=void 0;return}let c=new Set;for(let d of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=d.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],m=(a=(o=d.getAttribute("exportparts"))===null||o===void 0?void 0:o.split(",").map(O=>O.split(":")[1]))!==null&&a!==void 0?a:[],g=[...v,...m].filter(l).map(O=>O.trim());for(let O of g)c.add(O)}if(c.size===0){this.exportparts=void 0;return}let p=[...c.values()].flatMap(d=>u.map(v=>`${d}:${v}--${d}`));this.exportparts=[...this.part,...p].join(", ")}};Os=Cs;ut([(0,ke.property)()],pe.prototype,"exportpartsPrefix",void 0);ut([ys([])],pe.prototype,"exportpartsPrefixes",void 0);ut([(0,ke.property)({reflect:!0})],pe.prototype,"exportparts",void 0);ut([(0,ke.property)()],pe.prototype,"customStylesheet",void 0);ut([(0,ke.property)()],pe.prototype,"elementToFocus",void 0);ut([(0,ke.state)()],pe.prototype,"useAdoptedStyleSheets",void 0);function or(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var kt=Symbol("internalReduxEventsUnsubscribers"),Ce=Symbol("internalStoresUnsubscribers"),Ue=Symbol("internalStores"),ka=tr(Symbol("withRedux"),function(e){var t,r,n;class i extends e{constructor(){super(...arguments),this[t]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(o){super.willUpdate(o),[...this.reduxConstructor.reduxReactiveProperties].some(a=>o.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Ue].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ue].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[Ue].get(o)}addStore(o,a){var l;a=(l=a??o.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Ue].set(a,o),this.subscribeToStore(a,o),this.updateFromStores()}removeStore(o){let a=typeof o=="string"?o:o.name;this.unsubscribeFromStore(a),this[Ue].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Ue].forEach((o,a)=>this.subscribeToStore(a,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let u=this.getStore(o.store);u&&(o.store?this[Ce].has(o.store):this[Ce].size>0)&&(this[a]=o.selector(u.getState(),this))}})}subscribeToStore(o,a){var l;this[Ce].set(o,a.subscribe(()=>this.updateFromStores())),this[kt].set(o,[]),or(a)&&a.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((u,c)=>{if(typeof this[c]=="function"&&(!u.store||a.name===u.store)){let p=d=>this[c](d);a.addEventListener(u.eventName,p),this[kt].get(o).push(()=>a.removeEventListener(u.eventName,p))}})),this.onStoreAvailable(o)}unsubscribeFromStores(){this[Ce].forEach((o,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(o){var a;this[Ce].has(o)&&this[Ce].get(o)(),this[Ce].delete(o),(a=this[kt].get(o))===null||a===void 0||a.forEach(l=>l()),this[kt].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=Ce,r=Ue,n=kt,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),_s=class extends ka(pe){};function re(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(o){return"'"+o+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ge(e){return!!e&&!!e[D]}function ue(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Ka})(e)||Array.isArray(e)||!!e[Ps]||!!(!((t=e.constructor)===null||t===void 0)&&t[Ps])||dn(e)||fn(e))}function $e(e,t,r){r===void 0&&(r=!1),dt(e)===0?(r?Object.keys:pt)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function dt(e){var t=e[D];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:dn(e)?2:fn(e)?3:0}function ct(e,t){return dt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ua(e,t){return dt(e)===2?e.get(t):e[t]}function Ms(e,t,r){var n=dt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Is(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function dn(e){return Fa&&e instanceof Map}function fn(e){return Va&&e instanceof Set}function _e(e){return e.o||e.t}function hn(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=$s(e);delete t[D];for(var r=pt(t),n=0;n<r.length;n++){var i=r[n],s=t[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function mn(e,t){return t===void 0&&(t=!1),yn(e)||ge(e)||!ue(e)||(dt(e)>1&&(e.set=e.add=e.clear=e.delete=$a),Object.freeze(e),t&&$e(e,(function(r,n){return mn(n,!0)}),!0)),e}function $a(){re(2)}function yn(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function de(e){var t=pn[e];return t||re(18,e),t}function Ha(e,t){pn[e]||(pn[e]=t)}function ln(){return $t}function nn(e,t){t&&(de("Patches"),e.u=[],e.s=[],e.v=t)}function ar(e){un(e),e.p.forEach(ja),e.p=null}function un(e){e===$t&&($t=e.l)}function Ts(e){return $t={p:[],l:$t,h:e,m:!0,_:0}}function ja(e){var t=e[D];t.i===0||t.i===1?t.j():t.g=!0}function sn(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||de("ES5").S(t,e,n),n?(r[D].P&&(ar(t),re(4)),ue(e)&&(e=lr(t,e),t.l||ur(t,e)),t.u&&de("Patches").M(r[D].t,e,t.u,t.s)):e=lr(t,r,[]),ar(t),t.u&&t.v(t.u,t.s),e!==Us?e:void 0}function lr(e,t,r){if(yn(t))return t;var n=t[D];if(!n)return $e(t,(function(a,l){return Rs(e,n,t,a,l,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ur(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=hn(n.k):n.o,s=i,o=!1;n.i===3&&(s=new Set(i),i.clear(),o=!0),$e(s,(function(a,l){return Rs(e,n,i,a,l,r,o)})),ur(e,i,!1),r&&e.u&&de("Patches").N(n,r,e.u,e.s)}return n.o}function Rs(e,t,r,n,i,s,o){if(ge(i)){var a=lr(e,i,s&&t&&t.i!==3&&!ct(t.R,n)?s.concat(n):void 0);if(Ms(r,n,a),!ge(a))return;e.m=!1}else o&&r.add(i);if(ue(i)&&!yn(i)){if(!e.h.D&&e._<1)return;lr(e,i),t&&t.A.l||ur(e,i)}}function ur(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&mn(t,r)}function on(e,t){var r=e[D];return(r?_e(r):e)[t]}function ws(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Te(e){e.P||(e.P=!0,e.l&&Te(e.l))}function an(e){e.o||(e.o=hn(e.t))}function cn(e,t,r){var n=dn(t)?de("MapSet").F(t,r):fn(t)?de("MapSet").T(t,r):e.O?(function(i,s){var o=Array.isArray(i),a={i:o?1:0,A:s?s.A:ln(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},l=a,u=Ht;o&&(l=[a],u=Ut);var c=Proxy.revocable(l,u),p=c.revoke,d=c.proxy;return a.k=d,a.j=p,d})(t,r):de("ES5").J(t,r);return(r?r.A:ln()).p.push(n),n}function Ba(e){return ge(e)||re(22,e),(function t(r){if(!ue(r))return r;var n,i=r[D],s=dt(r);if(i){if(!i.P&&(i.i<4||!de("ES5").K(i)))return i.t;i.I=!0,n=Ls(r,s),i.I=!1}else n=Ls(r,s);return $e(n,(function(o,a){i&&Ua(i.t,o)===a||Ms(n,o,t(a))})),s===3?new Set(n):n})(e)}function Ls(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return hn(e)}function ks(){function e(o,a){var l=s[o];return l?l.enumerable=a:s[o]=l={configurable:!0,enumerable:a,get:function(){var u=this[D];return Ht.get(u,o)},set:function(u){var c=this[D];Ht.set(c,o,u)}},l}function t(o){for(var a=o.length-1;a>=0;a--){var l=o[a][D];if(!l.P)switch(l.i){case 5:n(l)&&Te(l);break;case 4:r(l)&&Te(l)}}}function r(o){for(var a=o.t,l=o.k,u=pt(l),c=u.length-1;c>=0;c--){var p=u[c];if(p!==D){var d=a[p];if(d===void 0&&!ct(a,p))return!0;var v=l[p],m=v&&v[D];if(m?m.t!==d:!Is(v,d))return!0}}var g=!!a[D];return u.length!==pt(a).length+(g?0:1)}function n(o){var a=o.k;if(a.length!==o.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function i(o){o.g&&re(3,JSON.stringify(_e(o)))}var s={};Ha("ES5",{J:function(o,a){var l=Array.isArray(o),u=(function(p,d){if(p){for(var v=Array(d.length),m=0;m<d.length;m++)Object.defineProperty(v,""+m,e(m,!0));return v}var g=$s(d);delete g[D];for(var O=pt(g),_=0;_<O.length;_++){var T=O[_];g[T]=e(T,p||!!g[T].enumerable)}return Object.create(Object.getPrototypeOf(d),g)})(l,o),c={i:l?5:4,A:a?a.A:ln(),P:!1,I:!1,R:{},l:a,t:o,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,D,{value:c,writable:!0}),u},S:function(o,a,l){l?ge(a)&&a[D].A===o&&t(o.p):(o.u&&(function u(c){if(c&&typeof c=="object"){var p=c[D];if(p){var d=p.t,v=p.k,m=p.R,g=p.i;if(g===4)$e(v,(function(w){w!==D&&(d[w]!==void 0||ct(d,w)?m[w]||u(v[w]):(m[w]=!0,Te(p)))})),$e(d,(function(w){v[w]!==void 0||ct(v,w)||(m[w]=!1,Te(p))}));else if(g===5){if(n(p)&&(Te(p),m.length=!0),v.length<d.length)for(var O=v.length;O<d.length;O++)m[O]=!1;else for(var _=d.length;_<v.length;_++)m[_]=!0;for(var T=Math.min(v.length,d.length),P=0;P<T;P++)v.hasOwnProperty(P)||(m[P]=!0),m[P]===void 0&&u(v[P])}}}})(o.p[0]),t(o.p))},K:function(o){return o.i===4?r(o):n(o)}})}var Ns,$t,vn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Fa=typeof Map<"u",Va=typeof Set<"u",Ds=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Us=vn?Symbol.for("immer-nothing"):((Ns={})["immer-nothing"]=!0,Ns),Ps=vn?Symbol.for("immer-draftable"):"__$immer_draftable",D=vn?Symbol.for("immer-state"):"__$immer_state";var Ka=""+Object.prototype.constructor,pt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,$s=Object.getOwnPropertyDescriptors||function(e){var t={};return pt(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},pn={},Ht={get:function(e,t){if(t===D)return e;var r=_e(e);if(!ct(r,t))return(function(i,s,o){var a,l=ws(s,o);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!ue(n)?n:n===on(e.t,t)?(an(e),e.o[t]=cn(e.A.h,n,e)):n},has:function(e,t){return t in _e(e)},ownKeys:function(e){return Reflect.ownKeys(_e(e))},set:function(e,t,r){var n=ws(_e(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var i=on(_e(e),t),s=i?.[D];if(s&&s.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Is(r,i)&&(r!==void 0||ct(e.t,t)))return!0;an(e),Te(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return on(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,an(e),Te(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=_e(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){re(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){re(12)}},Ut={};$e(Ht,(function(e,t){Ut[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ut.deleteProperty=function(e,t){return Ut.set.call(this,e,t,void 0)},Ut.set=function(e,t,r){return Ht.set.call(this,e[0],t,r,e[0])};var qa=(function(){function e(r){var n=this;this.O=Ds,this.D=!0,this.produce=function(i,s,o){if(typeof i=="function"&&typeof s!="function"){var a=s;s=i;var l=n;return function(g){var O=this;g===void 0&&(g=a);for(var _=arguments.length,T=Array(_>1?_-1:0),P=1;P<_;P++)T[P-1]=arguments[P];return l.produce(g,(function(w){var xe;return(xe=s).call.apply(xe,[O,w].concat(T))}))}}var u;if(typeof s!="function"&&re(6),o!==void 0&&typeof o!="function"&&re(7),ue(i)){var c=Ts(n),p=cn(n,i,void 0),d=!0;try{u=s(p),d=!1}finally{d?ar(c):un(c)}return typeof Promise<"u"&&u instanceof Promise?u.then((function(g){return nn(c,o),sn(g,c)}),(function(g){throw ar(c),g})):(nn(c,o),sn(u,c))}if(!i||typeof i!="object"){if((u=s(i))===void 0&&(u=i),u===Us&&(u=void 0),n.D&&mn(u,!0),o){var v=[],m=[];de("Patches").M(i,u,v,m),o(v,m)}return u}re(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(u){for(var c=arguments.length,p=Array(c>1?c-1:0),d=1;d<c;d++)p[d-1]=arguments[d];return n.produceWithPatches(u,(function(v){return i.apply(void 0,[v].concat(p))}))};var o,a,l=n.produce(i,s,(function(u,c){o=u,a=c}));return typeof Promise<"u"&&l instanceof Promise?l.then((function(u){return[u,o,a]})):[l,o,a]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){ue(r)||re(8),ge(r)&&(r=Ba(r));var n=Ts(this),i=cn(this,r,void 0);return i[D].C=!0,un(n),i},t.finishDraft=function(r,n){var i=r&&r[D],s=i.A;return nn(s,n),sn(void 0,s)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Ds&&re(20),this.O=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var o=de("Patches").$;return ge(r)?o(r,n):this.produce(r,(function(a){return o(a,n)}))},e})(),J=new qa,za=J.produce,sp=J.produceWithPatches.bind(J),op=J.setAutoFreeze.bind(J),ap=J.setUseProxies.bind(J),lp=J.applyPatches.bind(J),up=J.createDraft.bind(J),cp=J.finishDraft.bind(J),cr=za;function He(e){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(e)}function Hs(e,t){if(He(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(He(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function js(e){var t=Hs(e,"string");return He(t)=="symbol"?t:t+""}function Bs(e,t,r){return(t=js(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fs(Object(r),!0).forEach(function(n){Bs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function K(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Vs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bn=function(){return Math.random().toString(36).substring(7).split("").join(".")},pr={INIT:"@@redux/INIT"+bn(),REPLACE:"@@redux/REPLACE"+bn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bn()}};function Wa(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function xn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(K(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(K(1));return r(xn)(e,t)}if(typeof e!="function")throw new Error(K(2));var i=e,s=t,o=[],a=o,l=!1;function u(){a===o&&(a=o.slice())}function c(){if(l)throw new Error(K(3));return s}function p(g){if(typeof g!="function")throw new Error(K(4));if(l)throw new Error(K(5));var O=!0;return u(),a.push(g),function(){if(O){if(l)throw new Error(K(6));O=!1,u();var T=a.indexOf(g);a.splice(T,1),o=null}}}function d(g){if(!Wa(g))throw new Error(K(7));if(typeof g.type>"u")throw new Error(K(8));if(l)throw new Error(K(9));try{l=!0,s=i(s,g)}finally{l=!1}for(var O=o=a,_=0;_<O.length;_++){var T=O[_];T()}return g}function v(g){if(typeof g!="function")throw new Error(K(10));i=g,d({type:pr.REPLACE})}function m(){var g,O=p;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(K(11));function P(){T.next&&T.next(c())}P();var w=O(P);return{unsubscribe:w}}},g[Vs]=function(){return this},g}return d({type:pr.INIT}),n={dispatch:d,subscribe:p,getState:c,replaceReducer:v},n[Vs]=m,n}function Ga(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:pr.INIT});if(typeof n>"u")throw new Error(K(12));if(typeof r(void 0,{type:pr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(K(13))})}function Ks(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];typeof e[i]=="function"&&(r[i]=e[i])}var s=Object.keys(r),o,a;try{Ga(r)}catch(l){a=l}return function(u,c){if(u===void 0&&(u={}),a)throw a;if(0)var p;for(var d=!1,v={},m=0;m<s.length;m++){var g=s[m],O=r[g],_=u[g],T=O(_,c);if(typeof T>"u"){var P=c&&c.type;throw new Error(K(14))}v[g]=T,d=d||T!==_}return d=d||s.length!==Object.keys(u).length,d?v:u}}function ft(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function qs(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(K(15))},o={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},a=t.map(function(l){return l(o)});return s=ft.apply(void 0,a)(i.dispatch),gn(gn({},i),{},{dispatch:s})}}}function zs(e){var t=function(n){var i=n.dispatch,s=n.getState;return function(o){return function(a){return typeof a=="function"?a(i,s,e):o(a)}}};return t}var Ws=zs();Ws.withExtraArgument=zs;var Sn=Ws;var Js=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Ya=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(c){u=[6,c],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},ht=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},Qa=Object.defineProperty,Xa=Object.defineProperties,Ja=Object.getOwnPropertyDescriptors,Gs=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,Ys=function(e,t,r){return t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Re=function(e,t){for(var r in t||(t={}))Za.call(t,r)&&Ys(e,r,t[r]);if(Gs)for(var n=0,i=Gs(t);n<i.length;n++){var r=i[n];el.call(t,r)&&Ys(e,r,t[r])}return e},An=function(e,t){return Xa(e,Ja(t))},tl=function(e,t,r){return new Promise(function(n,i){var s=function(l){try{a(r.next(l))}catch(u){i(u)}},o=function(l){try{a(r.throw(l))}catch(u){i(u)}},a=function(l){return l.done?n(l.value):Promise.resolve(l.value).then(s,o)};a((r=r.apply(e,t)).next())})};var rl=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ft:ft.apply(null,arguments)},Rp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function nl(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}function we(e,t){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var s=t.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Re(Re({type:e,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}var il=(function(e){Js(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,ht([void 0],r[0].concat(this)))):new(t.bind.apply(t,ht([void 0],r.concat(this))))},t})(Array),sl=(function(e){Js(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,ht([void 0],r[0].concat(this)))):new(t.bind.apply(t,ht([void 0],r.concat(this))))},t})(Array);function Cn(e){return ue(e)?cr(e,function(){}):e}function ol(e){return typeof e=="boolean"}function al(){return function(t){return ll(t)}}function ll(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,i=n===void 0?!0:n,s=e.serializableCheck,o=s===void 0?!0:s,a=e.actionCreatorCheck,l=a===void 0?!0:a,u=new il;if(r&&(ol(r)?u.push(Sn):u.push(Sn.withExtraArgument(r.extraArgument))),0){if(i)var c;if(o)var p;if(l)var d}return u}var En=!0;function Zs(e){var t=al(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,o=s===void 0?t():s,a=r.devTools,l=a===void 0?!0:a,u=r.preloadedState,c=u===void 0?void 0:u,p=r.enhancers,d=p===void 0?void 0:p,v;if(typeof i=="function")v=i;else if(nl(i))v=Ks(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=o;if(typeof m=="function"&&(m=m(t),!En&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!En&&m.some(function(w){return typeof w!="function"}))throw new Error("each middleware provided to configureStore must be a function");var g=qs.apply(void 0,m),O=ft;l&&(O=rl(Re({trace:!En},typeof l=="object"&&l)));var _=new sl(g),T=_;Array.isArray(d)?T=ht([g],d):typeof d=="function"&&(T=d(_));var P=O.apply(void 0,T);return xn(v,c,P)}function eo(e){var t={},r=[],n,i={addCase:function(s,o){var a=typeof s=="string"?s:s.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[a]=o,i},addMatcher:function(s,o){return r.push({matcher:s,reducer:o}),i},addDefaultCase:function(s){return n=s,i}};return e(i),[t,r,n]}function ul(e){return typeof e=="function"}function cl(e,t,r,n){r===void 0&&(r=[]);var i=typeof t=="function"?eo(t):[t,r,n],s=i[0],o=i[1],a=i[2],l;if(ul(e))l=function(){return Cn(e())};else{var u=Cn(e);l=function(){return u}}function c(p,d){p===void 0&&(p=l());var v=ht([s[d.type]],o.filter(function(m){var g=m.matcher;return g(d)}).map(function(m){var g=m.reducer;return g}));return v.filter(function(m){return!!m}).length===0&&(v=[a]),v.reduce(function(m,g){if(g)if(ge(m)){var O=m,_=g(O,d);return _===void 0?m:_}else{if(ue(m))return cr(m,function(T){return g(T,d)});var _=g(m,d);if(_===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return m},p)}return c.getInitialState=l,c}function pl(e,t){return e+"/"+t}function to(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof e.initialState=="function"?e.initialState:Cn(e.initialState),n=e.reducers||{},i=Object.keys(n),s={},o={},a={};i.forEach(function(c){var p=n[c],d=pl(t,c),v,m;"reducer"in p?(v=p.reducer,m=p.prepare):v=p,s[c]=v,o[d]=v,a[c]=m?we(d,m):we(d)});function l(){var c=typeof e.extraReducers=="function"?eo(e.extraReducers):[e.extraReducers],p=c[0],d=p===void 0?{}:p,v=c[1],m=v===void 0?[]:v,g=c[2],O=g===void 0?void 0:g,_=Re(Re({},d),o);return cl(r,function(T){for(var P in _)T.addCase(P,_[P]);for(var w=0,xe=m;w<xe.length;w++){var he=xe[w];T.addMatcher(he.matcher,he.reducer)}O&&T.addDefaultCase(O)})}var u;return{name:t,reducer:function(c,p){return u||(u=l()),u(c,p)},actions:a,caseReducers:s,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var dl="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",fl=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=dl[Math.random()*64|0];return t},hl=["name","message","stack","code"],On=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Qs=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),ml=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=hl;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},Dp=(function(){function e(t,r,n){var i=we(t+"/fulfilled",function(c,p,d,v){return{payload:c,meta:An(Re({},v||{}),{arg:d,requestId:p,requestStatus:"fulfilled"})}}),s=we(t+"/pending",function(c,p,d){return{payload:void 0,meta:An(Re({},d||{}),{arg:p,requestId:c,requestStatus:"pending"})}}),o=we(t+"/rejected",function(c,p,d,v,m){return{payload:v,error:(n&&n.serializeError||ml)(c||"Rejected"),meta:An(Re({},m||{}),{arg:d,requestId:p,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:(function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c})();function u(c){return function(p,d,v){var m=n?.idGenerator?n.idGenerator(c):fl(),g=new l,O,_=!1;function T(w){O=w,g.abort()}var P=(function(){return tl(this,null,function(){var w,xe,he,St,Gn,At,Yn;return Ya(this,function(We){switch(We.label){case 0:return We.trys.push([0,4,,5]),St=(w=n?.condition)==null?void 0:w.call(n,c,{getState:d,extra:v}),vl(St)?[4,St]:[3,2];case 1:St=We.sent(),We.label=2;case 2:if(St===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=!0,Gn=new Promise(function(se,Et){return g.signal.addEventListener("abort",function(){return Et({name:"AbortError",message:O||"Aborted"})})}),p(s(m,c,(xe=n?.getPendingMeta)==null?void 0:xe.call(n,{requestId:m,arg:c},{getState:d,extra:v}))),[4,Promise.race([Gn,Promise.resolve(r(c,{dispatch:p,getState:d,extra:v,requestId:m,signal:g.signal,abort:T,rejectWithValue:function(se,Et){return new On(se,Et)},fulfillWithValue:function(se,Et){return new Qs(se,Et)}})).then(function(se){if(se instanceof On)throw se;return se instanceof Qs?i(se.payload,m,c,se.meta):i(se,m,c)})])];case 3:return he=We.sent(),[3,5];case 4:return At=We.sent(),he=At instanceof On?o(null,m,c,At.payload,At.meta):o(At,m,c),[3,5];case 5:return Yn=n&&!n.dispatchConditionRejection&&o.match(he)&&he.meta.condition,Yn||p(he),[2,he]}})})})();return Object.assign(P,{abort:T,requestId:m,arg:c,unwrap:function(){return P.then(yl)}})}}return Object.assign(u,{pending:s,rejected:o,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function yl(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vl(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var ro="listener",no="completed",io="cancelled",Pp="task-"+io,Mp="task-"+no,Ip=ro+"-"+io,kp=ro+"-"+no;var _n="listenerMiddleware";var Up=we(_n+"/add"),$p=we(_n+"/removeAll"),Hp=we(_n+"/remove");var Xs,jp=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Xs||(Xs=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},gl=function(e){return function(t){setTimeout(t,e)}},Bp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:gl(10);ks();var bl=tr(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}),dr=class extends bl(Object){};window.ftReduxStores||(window.ftReduxStores={});var so=class e extends dr{static get(t){var r;let n=typeof t=="string"?t:t.name,i=typeof t=="string"?void 0:t,s=window.ftReduxStores[n];if(or(s))return s;if(i==null)return;let o=to({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),a=Zs({reducer:(l,u)=>{if(u.type==="CLEAR_FT_REDUX_STORE"){let c=Mt(o.getInitialState());for(let p of u.keeping)c[p]=(l??c)[p];return c}else if(typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...u.overwrites};return o.reducer(l,u)}});return window.ftReduxStores[i.name]=new e(o,a,i.eventBus)}constructor(t,r,n){super(),this.reduxSlice=t,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new rr;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,o,a)=>{let l=o,u=s[l];return u?(...c)=>{let p=u(...c.map(i));return this.reduxStore.dispatch(p),p}:c=>{this.setState({[l]:i(c)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var fr=class{static format(t,r,n,i,s){return window.moment?window.moment(t).locale(r).format(this.getMomentDateFormat(n,i,!!s)):this.getIntlDateTime(t,r,n,i,!!s)}static getMomentDateFormat(t,r,n){return n?"LT":t?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(t,r,n,i,s){let o=typeof t=="string"?new Date(t):t,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(o),l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(o);return s?l:i?`${a} ${l}`:a}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${t(Math.abs(r)/60)}:${t(Math.abs(r)%60)}`}};var hr=f(S()),xl="ft-app-info",mt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};mt.eventName="authentication-change";var jt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};jt.eventName="ui-locale-changed";var Sl={session:(e,t)=>{(0,hr.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>A.dispatchEvent(new mt(t.payload)),0))}},A=hr.FtReduxStore.get({name:xl,reducers:Sl,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,searchLanguageSetsUiLanguage:!1,uiLanguageSetsSearchLanguage:!1,uiLanguageSetsReaderLanguage:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var oo=f(S()),mr=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},md=(0,oo.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(A)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(a=>a.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?a=>fr.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return mr([(0,Tn.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),mr([(0,Tn.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),mr([rn({store:A.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],t.prototype,"metadataDescriptors",void 0),mr([rn({store:A.name})],t.prototype,"uiLocale",void 0),t});var ao;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(ao||(ao={}));var lo;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(lo||(lo={}));var uo;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(uo||(uo={}));var co;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(co||(co={}));var po;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(po||(po={}));var fo;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(fo||(fo={}));var ho;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(ho||(ho={}));var mo;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(mo||(mo={}));var yo;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(yo||(yo={}));var vo;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(vo||(vo={}));var go;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(go||(go={}));var bo;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(bo||(bo={}));var xo;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(xo||(xo={}));var So;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(So||(So={}));var Ao;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Ao||(Ao={}));var Eo;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Eo||(Eo={}));var Rn;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Rn||(Rn={}));var Oo;(function(e){e.ASC="ASC",e.DESC="DESC"})(Oo||(Oo={}));var Co;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Co||(Co={}));var wn;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(wn||(wn={}));var _o;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(_o||(_o={}));var To;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(To||(To={}));var Ro;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Ro||(Ro={}));var wo;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(wo||(wo={}));var Lo;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Lo||(Lo={}));var Ln;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ln||(Ln={}));var No;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(No||(No={}));var $;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})($||($={}));var ne;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(ne||(ne={}));var Do;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Do||(Do={}));var Po;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Po||(Po={}));var Mo;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Mo||(Mo={}));var Io;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Io||(Io={}));var ko;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(ko||(ko={}));var Uo;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Uo||(Uo={}));var $o;(function(e){e.JSON="JSON",e.TEXT="TEXT"})($o||($o={}));var Ho;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Ho||(Ho={}));var jo;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(jo||(jo={}));var Bo;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Bo||(Bo={}));var Fo;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Fo||(Fo={}));var Vo;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Vo||(Vo={}));var Al={[$.PERSONAL_BOOK_SHARE_USER]:[$.PERSONAL_BOOK_USER],[$.HTML_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.PDF_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.KHUB_ADMIN]:[$.CONTENT_PUBLISHER],[$.ADMIN]:[$.KHUB_ADMIN,$.USERS_ADMIN,$.PORTAL_ADMIN,$.BEHAVIOR_DATA_USER],[$.GENERATIVE_AI_EXPORT_USER]:[$.GENERATIVE_AI_USER]};function Ko(e,t){return e===t||(Al[e]??[]).some(r=>Ko(r,t))}function qo(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>Ko(n,t))}var xr=f(S());var Nn=f(S());var je=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=A.getState(),i=t??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(t){return new Promise(r=>{let n=e.get(t);if(n)r(n);else{let i=A.subscribe(()=>{n=e.get(t),n&&(i(),r(n))})}})}};var yt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:je.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):je.await()}};var Y=class extends yt{constructor(t=!0,r){var n;super(r),this.sortObjectFields=(s,o)=>typeof o!="object"||o==null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).sort(([a],[l])=>a.localeCompare(l)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Nn.CacheRegistry,this.cache=t?i.commonCache:new Nn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var yr=class extends Y{async listMySearches(){let{session:t}=A.getState();return qo(t,$.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var vr=class extends Y{async listMyBookmarks(){let t=A.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var gr=class extends Y{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=A.getState().session;return!!t?.sessionAuthenticated}};var br=class extends Y{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=A.getState().session;return!!t?.sessionAuthenticated}};var El="ft-user-assets",Ol={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(ne).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let r=t.payload.mapId;e.assetCounts.bookmarkByMap[r]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:r,mapId:n,asset:i}=t.payload;Pn(e,r,[...Dn(e,r),i]),zo(e,r,1,n),Wo(e,i)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;Pn(e,r,Dn(e,r).map(i=>i.id===n.id?n:i)),Wo(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:i}=t.payload;Pn(e,r,Dn(e,r).filter(s=>s.id!==i)),zo(e,r,-1,n)}},Go={[ne.SEARCHES]:"savedSearches",[ne.BOOKMARKS]:"bookmarks",[ne.BOOKS]:void 0,[ne.COLLECTIONS]:void 0},Dn=(e,t)=>{var r;let n=Go[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},Pn=(e,t,r)=>{let n=Go[t];n&&(e[n]=r)},zo=(e,t,r,n)=>{let i=e.assetCounts.allAsset[t];if(i!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,i+r),t===ne.BOOKMARKS&&n)){let s=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},Wo=(e,t)=>{let r=e.assetLabels.map(i=>i.title),n=t.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));e.assetLabels.push(...n)},z=xr.FtReduxStore.get({name:El,reducers:Ol,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ne).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Mn=class{constructor(t=new gr,r=new br){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=A.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new vr,this.savedSearchesService=new yr,A.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=A.getState();(0,xr.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),z.actions.clearAssetCount(),z.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),z.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),z.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();z.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();z.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&z.getState().assetCounts.allAsset[t]!==r.count&&z.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&z.getState().assetCounts.bookmarkByMap[t]!==r.count&&z.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(z.getState().assetCounts.bookmarkByMap).length!==0;t===ne.BOOKMARKS&&r&&z.actions.clearBookmarkCountByMap(),z.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let r=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;z.actions.bookmarks(r)}}},Cl=new Mn;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Cl);var In=class{addCommand(t,r=!1){A.commands.add(t,r)}consumeCommand(t){return A.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new In;var ie=f(S());var Yo,vt=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},_l=Symbol("clearAfterUnitTest"),Sr=class extends(0,ie.withEventBus)(Y){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Yo]=()=>{this.defaultMessages={},this.cache=new ie.CacheRegistry,this.listeners={}},this.currentUiLocale=A.getState().uiLocale,A.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=A.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let r=t.name.toLowerCase();this.cache.setFinal(r,t),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,r){var n;if(t=t.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...r};(0,ie.deepEqual)(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var r,n;return this.fetchContext(t),(n=(r=this.cache.getNow(t))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,r){let n=t.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(t,r,...n){var i;let s=t.toLowerCase(),o=this.resolveContext(s);return new ie.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},o).resolve(r,...n)}async fetchContext(t){let r=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),r&&await this.notify(t)}catch(i){!(i instanceof ie.CanceledPromiseError)&&r&&console.error(i)}return n}subscribe(t,r){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(r),()=>{var i;return(i=this.listeners[t])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new vt({loadedContexts:t})),this.dispatchEvent(new vt({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new vt({loadedContexts:[t]})),this.dispatchEvent(new vt({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,ie.delay)(0).then(()=>n()).catch(()=>null)))}};Yo=_l;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Sr{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Sr{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var gt=window.FluidTopicsI18nService,Ar=window.FluidTopicsCustomI18nService;var Qo=f(S()),kn=class{highlightHtml(t,r,n){(0,Qo.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new kn;var Xo=f(S());var Un=class{isDate(t){var r,n,i,s;return(s=(i=((n=(r=A.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===t))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(t,r){var n,i,s,o;if(t==null)return"";try{return Xo.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:A.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(o=r?.onlyTime)!==null&&o!==void 0?o:!1)}catch(a){throw console.error(`Date ${JSON.stringify(t)} is not valid`,a),a}}};window.FluidTopicsDateService=new Un;var Jo=f(S());var Bt=class{static get(t,r){var n,i;let s=A.getState(),{lang:o,region:a}=(i=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Jo.SearchPlaceConverter(s.baseUrl,t??20,s.searchInAllLanguagesAllowed,r??`${o}-${a}`)}};var $n=class{urlToSearchRequest(t){return Bt.get().parse(t)}searchRequestToUrl(t){return Bt.get().serialize(t)}};window.FluidTopicsUrlService=new $n;var be=f(S());var Be=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Be.eventName="change";var Hn=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let r=sessionStorage.getItem(this.itemName(t));return r?JSON.parse(r):void 0}set(t,r){sessionStorage.setItem(this.itemName(t),JSON.stringify(r))}},Zo=new Hn;var Er=class e extends be.WithEventBus{static build(){return new e(window.history,Zo,()=>window.location,!1)}constructor(t,r,n,i){var s,o;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(o=(s=t.state)===null||s===void 0?void 0:s.index)!==null&&o!==void 0?o:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(t,r=!1){let n=r&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,be.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Be(this.currentItem())),0)}installProxies(){let t=r=>(n,i,[s,o,a])=>{let l=r(),u={...l===this.currentIndex?this.currentState:void 0,...s,index:l,href:typeof a=="string"?a:(a??this.windowLocation()).href};n.apply(i,[u,o,a]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let r=this.history.length-1;r>=0;r--)t?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(t){var r;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(r=t?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(Be.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Be.eventName,t)}currentItem(){return(0,be.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,be.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,be.deepCopy)(r.find(n=>t(n)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,be.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var r;let n=(r=this.states[t])===null||r===void 0?void 0:r.majorStateId;if(!n)return t;let i=t,s=t+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;return i}buildCurrentState(){var t,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&r!==void 0?r:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,r){var n;if(!this.hasState(t))return!1;let i=r??this.currentState.majorStateId,s=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Er.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});var ea=f(H());var ta=ea.css`
646
- `;var na=f(H()),Z=f(F()),Ke=f(S());var Fe=f(S());function ra(e,t){let{authenticationRequired:r,session:n}=A.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var Or=class extends yt{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var jn=class e extends Fe.FtStateManager{static build(t){return new e(A,t)}constructor(t,r){super(),this.store=t,this.cache=new Fe.CacheRegistry,this.withManualResources=!0,this.localesConfiguration=null,this.userLocaleService=new Or,this.cleanSessionDebouncer=new Fe.Debouncer,this.reloadDebouncer=new Fe.Debouncer(500),this.apiProvider=r??(()=>je.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener(mt.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let t=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(t)}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 t;let r=await this.cache.get("availableContentLocales",()=>ra(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=r.contentLocales)!==null&&t!==void 0?t:[])}reloadConfiguration(){var t;(t=this.cache)===null||t===void 0||t.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){var r,n,i,s,o;this.localesConfiguration=t,this.store.actions.defaultLocales(this.localesConfiguration.defaultLocales),this.store.actions.availableUiLocales((r=this.localesConfiguration.availableUiLocales)!==null&&r!==void 0?r:[]),this.store.actions.searchInAllLanguagesAllowed((n=this.localesConfiguration.allLanguagesAllowed)!==null&&n!==void 0?n:!1),this.store.actions.searchLanguageSetsUiLanguage((i=this.localesConfiguration.searchLanguageSetsUiLanguage)!==null&&i!==void 0?i:!1),this.store.actions.uiLanguageSetsSearchLanguage((s=this.localesConfiguration.uiLanguageSetsSearchLanguage)!==null&&s!==void 0?s:!1),this.store.actions.uiLanguageSetsReaderLanguage((o=this.localesConfiguration.uiLanguageSetsReaderLanguage)!==null&&o!==void 0?o:!1),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t){this.userLocaleService.updateUiLocale({uiLocale:t}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new jt(r)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}},Bn=jn.build();var Ve=class extends Event{constructor(t,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var Ft=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let r=this.pendingContextRequests.get(t.context);if(r===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:s}of n){let o=i.deref(),a=s.deref();o===void 0||a===void 0||o.dispatchEvent(new Ve(t.context,o,a,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let r=t.contextTarget??t.composedPath()[0],n=t.callback,i=this.pendingContextRequests.get(t.context);i===void 0&&this.pendingContextRequests.set(t.context,i={callbacks:new WeakMap,requests:[]});let s=i.callbacks.get(r);s===void 0&&i.callbacks.set(r,s=new WeakSet),s.has(n)||(s.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var q=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},M=class extends Ke.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.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Bn,this.contextRoot=new Ft}render(){return na.html`
645
+ `}willUpdate(t){super.willUpdate(t),t.has("options")&&(this.selectedOption=this.options.filter(r=>r.selected)[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(t){var r,n;if(super.contentAvailableCallback(t),t.has("focusOptions")&&this.focusOptions&&((n=(r=this.selectedOptionElement)!==null&&r!==void 0?r:this.firstOption)===null||n===void 0||n.focus(),this.focusOptions=!1),t.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.minWidth=this.mainPanel.getBoundingClientRect().width+"px";let i=["bottom","top"];(0,te.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",i,"fixed",E.optionsHeight,0).then(({x:s,y:o})=>{this.optionsMenu.style.left=`${s}px`,this.optionsMenu.style.top=`${o}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var r;t.stopPropagation(),this.isSlotEmpty=(0,te.isSlotEmptyOrWithoutContent)(this.optionsSlot);let n=(r=this.optionsSlot)===null||r===void 0?void 0:r.assignedElements().map(i=>i);n&&n.length>0&&(this.options=n)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(t){var r,n;let i,s=this.focusedOption?this.optionsList.indexOf(this.focusedOption):0;switch(t.key){case" ":case"Enter":t.preventDefault(),t.stopPropagation(),this.onSelectOption(t),this.optionsDisplayed=!1,(r=this.mainPanel)===null||r===void 0||r.focus();break;case"Escape":this.optionsDisplayed=!1,(n=this.mainPanel)===null||n===void 0||n.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),i=this.optionsList[(s-1+this.optionsList.length)%this.optionsList.length];break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),i=this.optionsList[(s+1)%this.optionsList.length];break;default:if(t.key.length!=1)break;this.isKeyAlphanumeric(t.key)&&(i=this.handleAlphanumericPress(t.key));break}i?.focus()}isKeyAlphanumeric(t){let r=t.charCodeAt(0);return r>47&&r<58||r>64&&r<91||r>96&&r<123}handleAlphanumericPress(t){let r=new Date;r.getTime()-this.lastSearchInputDate.getTime()>e.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=t.toLowerCase();let n=this.options.find(i=>{var s;return((s=i.label)===null||s===void 0?void 0:s.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});return this.lastSearchInputDate=r,n&&this.optionsList.find(i=>i.value===n.value)}getOptionId(t){if(!t)return;let r=this.options.findIndex(n=>(0,te.deepEqual)(n.value,t.value));if(r!==-1)return`option-${r}`}onSelectOption(t){t.stopPropagation(),this.setValue(t.target.value)}setValue(t,r=!0){let n=this.options.find(i=>(0,te.deepEqual)(i.value,t));n&&this.selectOption(n,r)}selectOption(t,r=!0){var n,i;if(!(0,te.deepEqual)((n=this.selectedOption)===null||n===void 0?void 0:n.value,t?.value)){this.selectedOption=t;for(let s of this.options)s.selected=s===t;r&&this.dispatchEvent(new CustomEvent("change",{detail:(i=this.selectedOption)===null||i===void 0?void 0:i.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};R.elementDefinitions={"ft-input-label":oe,"ft-typography":ve,"ft-ripple":N,"ft-icon":X,"ft-select-option":V};R.searchTimeoutMilliseconds=2e3;R.styles=[st,as];B([(0,U.property)({type:String})],R.prototype,"label",void 0);B([(0,U.property)({type:String})],R.prototype,"ariaLabel",void 0);B([(0,U.property)({type:String})],R.prototype,"helper",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"outlined",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"disabled",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"error",void 0);B([(0,U.property)({type:Boolean})],R.prototype,"fixedMenuPosition",void 0);B([(0,U.property)({type:Array})],R.prototype,"options",void 0);B([(0,U.state)()],R.prototype,"selectedOption",void 0);B([(0,U.state)()],R.prototype,"optionsDisplayed",void 0);B([(0,U.state)()],R.prototype,"focusOptions",void 0);B([(0,U.state)()],R.prototype,"currentSearch",void 0);B([(0,U.state)()],R.prototype,"lastSearchInputDate",void 0);B([(0,U.query)(".ft-select")],R.prototype,"container",void 0);B([(0,U.query)(".ft-select--options")],R.prototype,"optionsMenu",void 0);B([(0,U.query)(".ft-select--input-panel")],R.prototype,"mainPanel",void 0);B([(0,U.query)("slot:not([name])")],R.prototype,"optionsSlot",void 0);var hs=f(S());var fs={"ft-select":R,"ft-select-option":V};(0,hs.customElements)(fs);var xa=f(kr());var Tn=f(F());var ms=f(F(),1);var tn=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function ys(e,t){return(0,ms.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return Mt(e);try{return JSON.parse(r)}catch{return Mt(e)}},toAttribute:r=>JSON.stringify(r)},hasChanged:It,...t??{}})}function Ma(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!er(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!er(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let i=o=>Object.keys(o).filter(a=>o[a]!=null),s=i(e);if(r=s.length,r!==i(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){let o=s[n];if(!er(e[o],t[o]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function er(e,t){try{return Ma(e,t)}catch{return!1}}function It(e,t){return!er(e,t)}function Mt(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function tr(e,t){let r=n=>n[e]===!0;return n=>{if(r(n))return n;let i=t(n);return i[e]=!0,i}}var vs=f(F(),1);var rn=e=>{let t=e??{};return(r,n)=>{var i;let s={hasChanged:It,attribute:!1,...t};(0,vs.property)(s)(r,n);let o=r.constructor;o.reduxProperties=new Map(o.reduxProperties),o.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:(a=>a[n]),store:t.store})}};var rr=class{constructor(){this.queue=[]}add(t,r=!1){r&&this.clear(t.type),this.queue.push(t)}consume(t){let r=this.queue.find(n=>n.type===t);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(t){typeof t=="string"?this.queue=this.queue.filter(r=>r.type!==t):this.queue=this.queue.filter(r=>!t.test(r.type))}};var ke=f(F(),1);var nr=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,r){return this.callbacks=[t],this.debounce(r)}queue(t,r){return this.callbacks.push(t),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,r;let n=[...this.callbacks];this.callbacks=[];let i=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),s=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let o of n)try{await o()}catch(a){i(a);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var bs=f(H(),1);var ir=globalThis,Ia=ir.ShadowRoot&&(ir.ShadyCSS===void 0||ir.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var gs=(e,t)=>{if(Ia)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),i=ir.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}};var sr=class extends bs.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let r={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return gs(n,t.elementStyles),n}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(t,r){tn(t)(r),this.canDefineScopedElement(t)&&this.registry.define(t,r)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,r){this.scopedRegistryConstructor.defineScopedElement(t,r)}};function xs(e,t,...r){var n;let i=e.querySelector(t);for(let s of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var ut=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Os,Ss=Symbol("constructorPrototype"),As=Symbol("constructorName"),Cs=Symbol("exportpartsDebouncer"),Es=Symbol("dynamicDependenciesLoaded"),lt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};lt.eventName="exportparts-updated";var pe=class extends sr{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Os]=new nr(5),this.scheduleExportpartsUpdate=()=>{var t,r,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Cs].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[As]=this.constructor.name,this[Ss]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[As]&&Object.setPrototypeOf(this,this[Ss])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Es]||(r[Es]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(lt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(lt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new lt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];r=xs(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(t){var r,n,i,s,o,a;let l=d=>d!=null&&d.trim().length>0,u=t.filter(l).map(d=>d.trim());if(u.length===0){this.exportparts=void 0;return}let c=new Set;for(let d of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=d.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],m=(a=(o=d.getAttribute("exportparts"))===null||o===void 0?void 0:o.split(",").map(O=>O.split(":")[1]))!==null&&a!==void 0?a:[],g=[...v,...m].filter(l).map(O=>O.trim());for(let O of g)c.add(O)}if(c.size===0){this.exportparts=void 0;return}let p=[...c.values()].flatMap(d=>u.map(v=>`${d}:${v}--${d}`));this.exportparts=[...this.part,...p].join(", ")}};Os=Cs;ut([(0,ke.property)()],pe.prototype,"exportpartsPrefix",void 0);ut([ys([])],pe.prototype,"exportpartsPrefixes",void 0);ut([(0,ke.property)({reflect:!0})],pe.prototype,"exportparts",void 0);ut([(0,ke.property)()],pe.prototype,"customStylesheet",void 0);ut([(0,ke.property)()],pe.prototype,"elementToFocus",void 0);ut([(0,ke.state)()],pe.prototype,"useAdoptedStyleSheets",void 0);function or(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var kt=Symbol("internalReduxEventsUnsubscribers"),Ce=Symbol("internalStoresUnsubscribers"),Ue=Symbol("internalStores"),ka=tr(Symbol("withRedux"),function(e){var t,r,n;class i extends e{constructor(){super(...arguments),this[t]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(o){super.willUpdate(o),[...this.reduxConstructor.reduxReactiveProperties].some(a=>o.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Ue].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ue].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[Ue].get(o)}addStore(o,a){var l;a=(l=a??o.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Ue].set(a,o),this.subscribeToStore(a,o),this.updateFromStores()}removeStore(o){let a=typeof o=="string"?o:o.name;this.unsubscribeFromStore(a),this[Ue].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Ue].forEach((o,a)=>this.subscribeToStore(a,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let u=this.getStore(o.store);u&&(o.store?this[Ce].has(o.store):this[Ce].size>0)&&(this[a]=o.selector(u.getState(),this))}})}subscribeToStore(o,a){var l;this[Ce].set(o,a.subscribe(()=>this.updateFromStores())),this[kt].set(o,[]),or(a)&&a.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((u,c)=>{if(typeof this[c]=="function"&&(!u.store||a.name===u.store)){let p=d=>this[c](d);a.addEventListener(u.eventName,p),this[kt].get(o).push(()=>a.removeEventListener(u.eventName,p))}})),this.onStoreAvailable(o)}unsubscribeFromStores(){this[Ce].forEach((o,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(o){var a;this[Ce].has(o)&&this[Ce].get(o)(),this[Ce].delete(o),(a=this[kt].get(o))===null||a===void 0||a.forEach(l=>l()),this[kt].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=Ce,r=Ue,n=kt,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),_s=class extends ka(pe){};function re(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(o){return"'"+o+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ge(e){return!!e&&!!e[D]}function ue(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Ka})(e)||Array.isArray(e)||!!e[Ps]||!!(!((t=e.constructor)===null||t===void 0)&&t[Ps])||dn(e)||fn(e))}function $e(e,t,r){r===void 0&&(r=!1),dt(e)===0?(r?Object.keys:pt)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function dt(e){var t=e[D];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:dn(e)?2:fn(e)?3:0}function ct(e,t){return dt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ua(e,t){return dt(e)===2?e.get(t):e[t]}function Ms(e,t,r){var n=dt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Is(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function dn(e){return Fa&&e instanceof Map}function fn(e){return Va&&e instanceof Set}function _e(e){return e.o||e.t}function hn(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=$s(e);delete t[D];for(var r=pt(t),n=0;n<r.length;n++){var i=r[n],s=t[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function mn(e,t){return t===void 0&&(t=!1),yn(e)||ge(e)||!ue(e)||(dt(e)>1&&(e.set=e.add=e.clear=e.delete=$a),Object.freeze(e),t&&$e(e,(function(r,n){return mn(n,!0)}),!0)),e}function $a(){re(2)}function yn(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function de(e){var t=pn[e];return t||re(18,e),t}function Ha(e,t){pn[e]||(pn[e]=t)}function ln(){return $t}function nn(e,t){t&&(de("Patches"),e.u=[],e.s=[],e.v=t)}function ar(e){un(e),e.p.forEach(ja),e.p=null}function un(e){e===$t&&($t=e.l)}function Ts(e){return $t={p:[],l:$t,h:e,m:!0,_:0}}function ja(e){var t=e[D];t.i===0||t.i===1?t.j():t.g=!0}function sn(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||de("ES5").S(t,e,n),n?(r[D].P&&(ar(t),re(4)),ue(e)&&(e=lr(t,e),t.l||ur(t,e)),t.u&&de("Patches").M(r[D].t,e,t.u,t.s)):e=lr(t,r,[]),ar(t),t.u&&t.v(t.u,t.s),e!==Us?e:void 0}function lr(e,t,r){if(yn(t))return t;var n=t[D];if(!n)return $e(t,(function(a,l){return Rs(e,n,t,a,l,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ur(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=hn(n.k):n.o,s=i,o=!1;n.i===3&&(s=new Set(i),i.clear(),o=!0),$e(s,(function(a,l){return Rs(e,n,i,a,l,r,o)})),ur(e,i,!1),r&&e.u&&de("Patches").N(n,r,e.u,e.s)}return n.o}function Rs(e,t,r,n,i,s,o){if(ge(i)){var a=lr(e,i,s&&t&&t.i!==3&&!ct(t.R,n)?s.concat(n):void 0);if(Ms(r,n,a),!ge(a))return;e.m=!1}else o&&r.add(i);if(ue(i)&&!yn(i)){if(!e.h.D&&e._<1)return;lr(e,i),t&&t.A.l||ur(e,i)}}function ur(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&mn(t,r)}function on(e,t){var r=e[D];return(r?_e(r):e)[t]}function ws(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Te(e){e.P||(e.P=!0,e.l&&Te(e.l))}function an(e){e.o||(e.o=hn(e.t))}function cn(e,t,r){var n=dn(t)?de("MapSet").F(t,r):fn(t)?de("MapSet").T(t,r):e.O?(function(i,s){var o=Array.isArray(i),a={i:o?1:0,A:s?s.A:ln(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},l=a,u=Ht;o&&(l=[a],u=Ut);var c=Proxy.revocable(l,u),p=c.revoke,d=c.proxy;return a.k=d,a.j=p,d})(t,r):de("ES5").J(t,r);return(r?r.A:ln()).p.push(n),n}function Ba(e){return ge(e)||re(22,e),(function t(r){if(!ue(r))return r;var n,i=r[D],s=dt(r);if(i){if(!i.P&&(i.i<4||!de("ES5").K(i)))return i.t;i.I=!0,n=Ls(r,s),i.I=!1}else n=Ls(r,s);return $e(n,(function(o,a){i&&Ua(i.t,o)===a||Ms(n,o,t(a))})),s===3?new Set(n):n})(e)}function Ls(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return hn(e)}function ks(){function e(o,a){var l=s[o];return l?l.enumerable=a:s[o]=l={configurable:!0,enumerable:a,get:function(){var u=this[D];return Ht.get(u,o)},set:function(u){var c=this[D];Ht.set(c,o,u)}},l}function t(o){for(var a=o.length-1;a>=0;a--){var l=o[a][D];if(!l.P)switch(l.i){case 5:n(l)&&Te(l);break;case 4:r(l)&&Te(l)}}}function r(o){for(var a=o.t,l=o.k,u=pt(l),c=u.length-1;c>=0;c--){var p=u[c];if(p!==D){var d=a[p];if(d===void 0&&!ct(a,p))return!0;var v=l[p],m=v&&v[D];if(m?m.t!==d:!Is(v,d))return!0}}var g=!!a[D];return u.length!==pt(a).length+(g?0:1)}function n(o){var a=o.k;if(a.length!==o.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function i(o){o.g&&re(3,JSON.stringify(_e(o)))}var s={};Ha("ES5",{J:function(o,a){var l=Array.isArray(o),u=(function(p,d){if(p){for(var v=Array(d.length),m=0;m<d.length;m++)Object.defineProperty(v,""+m,e(m,!0));return v}var g=$s(d);delete g[D];for(var O=pt(g),_=0;_<O.length;_++){var T=O[_];g[T]=e(T,p||!!g[T].enumerable)}return Object.create(Object.getPrototypeOf(d),g)})(l,o),c={i:l?5:4,A:a?a.A:ln(),P:!1,I:!1,R:{},l:a,t:o,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,D,{value:c,writable:!0}),u},S:function(o,a,l){l?ge(a)&&a[D].A===o&&t(o.p):(o.u&&(function u(c){if(c&&typeof c=="object"){var p=c[D];if(p){var d=p.t,v=p.k,m=p.R,g=p.i;if(g===4)$e(v,(function(w){w!==D&&(d[w]!==void 0||ct(d,w)?m[w]||u(v[w]):(m[w]=!0,Te(p)))})),$e(d,(function(w){v[w]!==void 0||ct(v,w)||(m[w]=!1,Te(p))}));else if(g===5){if(n(p)&&(Te(p),m.length=!0),v.length<d.length)for(var O=v.length;O<d.length;O++)m[O]=!1;else for(var _=d.length;_<v.length;_++)m[_]=!0;for(var T=Math.min(v.length,d.length),P=0;P<T;P++)v.hasOwnProperty(P)||(m[P]=!0),m[P]===void 0&&u(v[P])}}}})(o.p[0]),t(o.p))},K:function(o){return o.i===4?r(o):n(o)}})}var Ns,$t,vn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Fa=typeof Map<"u",Va=typeof Set<"u",Ds=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Us=vn?Symbol.for("immer-nothing"):((Ns={})["immer-nothing"]=!0,Ns),Ps=vn?Symbol.for("immer-draftable"):"__$immer_draftable",D=vn?Symbol.for("immer-state"):"__$immer_state";var Ka=""+Object.prototype.constructor,pt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,$s=Object.getOwnPropertyDescriptors||function(e){var t={};return pt(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},pn={},Ht={get:function(e,t){if(t===D)return e;var r=_e(e);if(!ct(r,t))return(function(i,s,o){var a,l=ws(s,o);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!ue(n)?n:n===on(e.t,t)?(an(e),e.o[t]=cn(e.A.h,n,e)):n},has:function(e,t){return t in _e(e)},ownKeys:function(e){return Reflect.ownKeys(_e(e))},set:function(e,t,r){var n=ws(_e(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var i=on(_e(e),t),s=i?.[D];if(s&&s.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Is(r,i)&&(r!==void 0||ct(e.t,t)))return!0;an(e),Te(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return on(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,an(e),Te(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=_e(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){re(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){re(12)}},Ut={};$e(Ht,(function(e,t){Ut[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ut.deleteProperty=function(e,t){return Ut.set.call(this,e,t,void 0)},Ut.set=function(e,t,r){return Ht.set.call(this,e[0],t,r,e[0])};var qa=(function(){function e(r){var n=this;this.O=Ds,this.D=!0,this.produce=function(i,s,o){if(typeof i=="function"&&typeof s!="function"){var a=s;s=i;var l=n;return function(g){var O=this;g===void 0&&(g=a);for(var _=arguments.length,T=Array(_>1?_-1:0),P=1;P<_;P++)T[P-1]=arguments[P];return l.produce(g,(function(w){var xe;return(xe=s).call.apply(xe,[O,w].concat(T))}))}}var u;if(typeof s!="function"&&re(6),o!==void 0&&typeof o!="function"&&re(7),ue(i)){var c=Ts(n),p=cn(n,i,void 0),d=!0;try{u=s(p),d=!1}finally{d?ar(c):un(c)}return typeof Promise<"u"&&u instanceof Promise?u.then((function(g){return nn(c,o),sn(g,c)}),(function(g){throw ar(c),g})):(nn(c,o),sn(u,c))}if(!i||typeof i!="object"){if((u=s(i))===void 0&&(u=i),u===Us&&(u=void 0),n.D&&mn(u,!0),o){var v=[],m=[];de("Patches").M(i,u,v,m),o(v,m)}return u}re(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(u){for(var c=arguments.length,p=Array(c>1?c-1:0),d=1;d<c;d++)p[d-1]=arguments[d];return n.produceWithPatches(u,(function(v){return i.apply(void 0,[v].concat(p))}))};var o,a,l=n.produce(i,s,(function(u,c){o=u,a=c}));return typeof Promise<"u"&&l instanceof Promise?l.then((function(u){return[u,o,a]})):[l,o,a]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){ue(r)||re(8),ge(r)&&(r=Ba(r));var n=Ts(this),i=cn(this,r,void 0);return i[D].C=!0,un(n),i},t.finishDraft=function(r,n){var i=r&&r[D],s=i.A;return nn(s,n),sn(void 0,s)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Ds&&re(20),this.O=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var o=de("Patches").$;return ge(r)?o(r,n):this.produce(r,(function(a){return o(a,n)}))},e})(),J=new qa,za=J.produce,sp=J.produceWithPatches.bind(J),op=J.setAutoFreeze.bind(J),ap=J.setUseProxies.bind(J),lp=J.applyPatches.bind(J),up=J.createDraft.bind(J),cp=J.finishDraft.bind(J),cr=za;function He(e){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(e)}function Hs(e,t){if(He(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(He(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function js(e){var t=Hs(e,"string");return He(t)=="symbol"?t:t+""}function Bs(e,t,r){return(t=js(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fs(Object(r),!0).forEach(function(n){Bs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function K(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Vs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bn=function(){return Math.random().toString(36).substring(7).split("").join(".")},pr={INIT:"@@redux/INIT"+bn(),REPLACE:"@@redux/REPLACE"+bn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bn()}};function Wa(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function xn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(K(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(K(1));return r(xn)(e,t)}if(typeof e!="function")throw new Error(K(2));var i=e,s=t,o=[],a=o,l=!1;function u(){a===o&&(a=o.slice())}function c(){if(l)throw new Error(K(3));return s}function p(g){if(typeof g!="function")throw new Error(K(4));if(l)throw new Error(K(5));var O=!0;return u(),a.push(g),function(){if(O){if(l)throw new Error(K(6));O=!1,u();var T=a.indexOf(g);a.splice(T,1),o=null}}}function d(g){if(!Wa(g))throw new Error(K(7));if(typeof g.type>"u")throw new Error(K(8));if(l)throw new Error(K(9));try{l=!0,s=i(s,g)}finally{l=!1}for(var O=o=a,_=0;_<O.length;_++){var T=O[_];T()}return g}function v(g){if(typeof g!="function")throw new Error(K(10));i=g,d({type:pr.REPLACE})}function m(){var g,O=p;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(K(11));function P(){T.next&&T.next(c())}P();var w=O(P);return{unsubscribe:w}}},g[Vs]=function(){return this},g}return d({type:pr.INIT}),n={dispatch:d,subscribe:p,getState:c,replaceReducer:v},n[Vs]=m,n}function Ga(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:pr.INIT});if(typeof n>"u")throw new Error(K(12));if(typeof r(void 0,{type:pr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(K(13))})}function Ks(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];typeof e[i]=="function"&&(r[i]=e[i])}var s=Object.keys(r),o,a;try{Ga(r)}catch(l){a=l}return function(u,c){if(u===void 0&&(u={}),a)throw a;if(0)var p;for(var d=!1,v={},m=0;m<s.length;m++){var g=s[m],O=r[g],_=u[g],T=O(_,c);if(typeof T>"u"){var P=c&&c.type;throw new Error(K(14))}v[g]=T,d=d||T!==_}return d=d||s.length!==Object.keys(u).length,d?v:u}}function ft(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function qs(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(K(15))},o={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},a=t.map(function(l){return l(o)});return s=ft.apply(void 0,a)(i.dispatch),gn(gn({},i),{},{dispatch:s})}}}function zs(e){var t=function(n){var i=n.dispatch,s=n.getState;return function(o){return function(a){return typeof a=="function"?a(i,s,e):o(a)}}};return t}var Ws=zs();Ws.withExtraArgument=zs;var Sn=Ws;var Js=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Ya=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(c){u=[6,c],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},ht=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},Qa=Object.defineProperty,Xa=Object.defineProperties,Ja=Object.getOwnPropertyDescriptors,Gs=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,Ys=function(e,t,r){return t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Re=function(e,t){for(var r in t||(t={}))Za.call(t,r)&&Ys(e,r,t[r]);if(Gs)for(var n=0,i=Gs(t);n<i.length;n++){var r=i[n];el.call(t,r)&&Ys(e,r,t[r])}return e},An=function(e,t){return Xa(e,Ja(t))},tl=function(e,t,r){return new Promise(function(n,i){var s=function(l){try{a(r.next(l))}catch(u){i(u)}},o=function(l){try{a(r.throw(l))}catch(u){i(u)}},a=function(l){return l.done?n(l.value):Promise.resolve(l.value).then(s,o)};a((r=r.apply(e,t)).next())})};var rl=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ft:ft.apply(null,arguments)},Rp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function nl(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}function we(e,t){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var s=t.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Re(Re({type:e,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}var il=(function(e){Js(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,ht([void 0],r[0].concat(this)))):new(t.bind.apply(t,ht([void 0],r.concat(this))))},t})(Array),sl=(function(e){Js(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,ht([void 0],r[0].concat(this)))):new(t.bind.apply(t,ht([void 0],r.concat(this))))},t})(Array);function Cn(e){return ue(e)?cr(e,function(){}):e}function ol(e){return typeof e=="boolean"}function al(){return function(t){return ll(t)}}function ll(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,i=n===void 0?!0:n,s=e.serializableCheck,o=s===void 0?!0:s,a=e.actionCreatorCheck,l=a===void 0?!0:a,u=new il;if(r&&(ol(r)?u.push(Sn):u.push(Sn.withExtraArgument(r.extraArgument))),0){if(i)var c;if(o)var p;if(l)var d}return u}var En=!0;function Zs(e){var t=al(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,o=s===void 0?t():s,a=r.devTools,l=a===void 0?!0:a,u=r.preloadedState,c=u===void 0?void 0:u,p=r.enhancers,d=p===void 0?void 0:p,v;if(typeof i=="function")v=i;else if(nl(i))v=Ks(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=o;if(typeof m=="function"&&(m=m(t),!En&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!En&&m.some(function(w){return typeof w!="function"}))throw new Error("each middleware provided to configureStore must be a function");var g=qs.apply(void 0,m),O=ft;l&&(O=rl(Re({trace:!En},typeof l=="object"&&l)));var _=new sl(g),T=_;Array.isArray(d)?T=ht([g],d):typeof d=="function"&&(T=d(_));var P=O.apply(void 0,T);return xn(v,c,P)}function eo(e){var t={},r=[],n,i={addCase:function(s,o){var a=typeof s=="string"?s:s.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[a]=o,i},addMatcher:function(s,o){return r.push({matcher:s,reducer:o}),i},addDefaultCase:function(s){return n=s,i}};return e(i),[t,r,n]}function ul(e){return typeof e=="function"}function cl(e,t,r,n){r===void 0&&(r=[]);var i=typeof t=="function"?eo(t):[t,r,n],s=i[0],o=i[1],a=i[2],l;if(ul(e))l=function(){return Cn(e())};else{var u=Cn(e);l=function(){return u}}function c(p,d){p===void 0&&(p=l());var v=ht([s[d.type]],o.filter(function(m){var g=m.matcher;return g(d)}).map(function(m){var g=m.reducer;return g}));return v.filter(function(m){return!!m}).length===0&&(v=[a]),v.reduce(function(m,g){if(g)if(ge(m)){var O=m,_=g(O,d);return _===void 0?m:_}else{if(ue(m))return cr(m,function(T){return g(T,d)});var _=g(m,d);if(_===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return m},p)}return c.getInitialState=l,c}function pl(e,t){return e+"/"+t}function to(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof e.initialState=="function"?e.initialState:Cn(e.initialState),n=e.reducers||{},i=Object.keys(n),s={},o={},a={};i.forEach(function(c){var p=n[c],d=pl(t,c),v,m;"reducer"in p?(v=p.reducer,m=p.prepare):v=p,s[c]=v,o[d]=v,a[c]=m?we(d,m):we(d)});function l(){var c=typeof e.extraReducers=="function"?eo(e.extraReducers):[e.extraReducers],p=c[0],d=p===void 0?{}:p,v=c[1],m=v===void 0?[]:v,g=c[2],O=g===void 0?void 0:g,_=Re(Re({},d),o);return cl(r,function(T){for(var P in _)T.addCase(P,_[P]);for(var w=0,xe=m;w<xe.length;w++){var he=xe[w];T.addMatcher(he.matcher,he.reducer)}O&&T.addDefaultCase(O)})}var u;return{name:t,reducer:function(c,p){return u||(u=l()),u(c,p)},actions:a,caseReducers:s,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var dl="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",fl=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=dl[Math.random()*64|0];return t},hl=["name","message","stack","code"],On=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Qs=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),ml=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=hl;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},Dp=(function(){function e(t,r,n){var i=we(t+"/fulfilled",function(c,p,d,v){return{payload:c,meta:An(Re({},v||{}),{arg:d,requestId:p,requestStatus:"fulfilled"})}}),s=we(t+"/pending",function(c,p,d){return{payload:void 0,meta:An(Re({},d||{}),{arg:p,requestId:c,requestStatus:"pending"})}}),o=we(t+"/rejected",function(c,p,d,v,m){return{payload:v,error:(n&&n.serializeError||ml)(c||"Rejected"),meta:An(Re({},m||{}),{arg:d,requestId:p,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:(function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c})();function u(c){return function(p,d,v){var m=n?.idGenerator?n.idGenerator(c):fl(),g=new l,O,_=!1;function T(w){O=w,g.abort()}var P=(function(){return tl(this,null,function(){var w,xe,he,St,Gn,At,Yn;return Ya(this,function(We){switch(We.label){case 0:return We.trys.push([0,4,,5]),St=(w=n?.condition)==null?void 0:w.call(n,c,{getState:d,extra:v}),vl(St)?[4,St]:[3,2];case 1:St=We.sent(),We.label=2;case 2:if(St===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=!0,Gn=new Promise(function(se,Et){return g.signal.addEventListener("abort",function(){return Et({name:"AbortError",message:O||"Aborted"})})}),p(s(m,c,(xe=n?.getPendingMeta)==null?void 0:xe.call(n,{requestId:m,arg:c},{getState:d,extra:v}))),[4,Promise.race([Gn,Promise.resolve(r(c,{dispatch:p,getState:d,extra:v,requestId:m,signal:g.signal,abort:T,rejectWithValue:function(se,Et){return new On(se,Et)},fulfillWithValue:function(se,Et){return new Qs(se,Et)}})).then(function(se){if(se instanceof On)throw se;return se instanceof Qs?i(se.payload,m,c,se.meta):i(se,m,c)})])];case 3:return he=We.sent(),[3,5];case 4:return At=We.sent(),he=At instanceof On?o(null,m,c,At.payload,At.meta):o(At,m,c),[3,5];case 5:return Yn=n&&!n.dispatchConditionRejection&&o.match(he)&&he.meta.condition,Yn||p(he),[2,he]}})})})();return Object.assign(P,{abort:T,requestId:m,arg:c,unwrap:function(){return P.then(yl)}})}}return Object.assign(u,{pending:s,rejected:o,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function yl(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vl(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var ro="listener",no="completed",io="cancelled",Pp="task-"+io,Mp="task-"+no,Ip=ro+"-"+io,kp=ro+"-"+no;var _n="listenerMiddleware";var Up=we(_n+"/add"),$p=we(_n+"/removeAll"),Hp=we(_n+"/remove");var Xs,jp=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Xs||(Xs=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},gl=function(e){return function(t){setTimeout(t,e)}},Bp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:gl(10);ks();var bl=tr(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}),dr=class extends bl(Object){};window.ftReduxStores||(window.ftReduxStores={});var so=class e extends dr{static get(t){var r;let n=typeof t=="string"?t:t.name,i=typeof t=="string"?void 0:t,s=window.ftReduxStores[n];if(or(s))return s;if(i==null)return;let o=to({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),a=Zs({reducer:(l,u)=>{if(u.type==="CLEAR_FT_REDUX_STORE"){let c=Mt(o.getInitialState());for(let p of u.keeping)c[p]=(l??c)[p];return c}else if(typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...u.overwrites};return o.reducer(l,u)}});return window.ftReduxStores[i.name]=new e(o,a,i.eventBus)}constructor(t,r,n){super(),this.reduxSlice=t,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new rr;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,o,a)=>{let l=o,u=s[l];return u?(...c)=>{let p=u(...c.map(i));return this.reduxStore.dispatch(p),p}:c=>{this.setState({[l]:i(c)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var fr=class{static format(t,r,n,i,s){return window.moment?window.moment(t).locale(r).format(this.getMomentDateFormat(n,i,!!s)):this.getIntlDateTime(t,r,n,i,!!s)}static getMomentDateFormat(t,r,n){return n?"LT":t?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(t,r,n,i,s){let o=typeof t=="string"?new Date(t):t,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(o),l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(o);return s?l:i?`${a} ${l}`:a}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${t(Math.abs(r)/60)}:${t(Math.abs(r)%60)}`}};var hr=f(S()),xl="ft-app-info",mt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};mt.eventName="authentication-change";var jt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};jt.eventName="ui-locale-changed";var Sl={session:(e,t)=>{(0,hr.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>A.dispatchEvent(new mt(t.payload)),0))}},A=hr.FtReduxStore.get({name:xl,reducers:Sl,initialState:{baseUrl: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,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var oo=f(S()),mr=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},md=(0,oo.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(A)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(a=>a.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?a=>fr.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return mr([(0,Tn.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),mr([(0,Tn.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),mr([rn({store:A.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],t.prototype,"metadataDescriptors",void 0),mr([rn({store:A.name})],t.prototype,"uiLocale",void 0),t});var ao;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(ao||(ao={}));var lo;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(lo||(lo={}));var uo;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(uo||(uo={}));var co;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(co||(co={}));var po;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(po||(po={}));var fo;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(fo||(fo={}));var ho;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(ho||(ho={}));var mo;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(mo||(mo={}));var yo;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(yo||(yo={}));var vo;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(vo||(vo={}));var go;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(go||(go={}));var bo;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(bo||(bo={}));var xo;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(xo||(xo={}));var So;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(So||(So={}));var Ao;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Ao||(Ao={}));var Eo;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Eo||(Eo={}));var Rn;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Rn||(Rn={}));var Oo;(function(e){e.ASC="ASC",e.DESC="DESC"})(Oo||(Oo={}));var Co;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Co||(Co={}));var wn;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(wn||(wn={}));var _o;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(_o||(_o={}));var To;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(To||(To={}));var Ro;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Ro||(Ro={}));var wo;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(wo||(wo={}));var Lo;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Lo||(Lo={}));var Ln;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ln||(Ln={}));var No;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(No||(No={}));var $;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})($||($={}));var ne;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(ne||(ne={}));var Do;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Do||(Do={}));var Po;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Po||(Po={}));var Mo;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Mo||(Mo={}));var Io;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Io||(Io={}));var ko;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(ko||(ko={}));var Uo;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Uo||(Uo={}));var $o;(function(e){e.JSON="JSON",e.TEXT="TEXT"})($o||($o={}));var Ho;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Ho||(Ho={}));var jo;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(jo||(jo={}));var Bo;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Bo||(Bo={}));var Fo;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Fo||(Fo={}));var Vo;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Vo||(Vo={}));var Al={[$.PERSONAL_BOOK_SHARE_USER]:[$.PERSONAL_BOOK_USER],[$.HTML_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.PDF_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.KHUB_ADMIN]:[$.CONTENT_PUBLISHER],[$.ADMIN]:[$.KHUB_ADMIN,$.USERS_ADMIN,$.PORTAL_ADMIN,$.BEHAVIOR_DATA_USER],[$.GENERATIVE_AI_EXPORT_USER]:[$.GENERATIVE_AI_USER]};function Ko(e,t){return e===t||(Al[e]??[]).some(r=>Ko(r,t))}function qo(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>Ko(n,t))}var xr=f(S());var Nn=f(S());var je=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=A.getState(),i=t??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(t){return new Promise(r=>{let n=e.get(t);if(n)r(n);else{let i=A.subscribe(()=>{n=e.get(t),n&&(i(),r(n))})}})}};var yt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:je.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):je.await()}};var Y=class extends yt{constructor(t=!0,r){var n;super(r),this.sortObjectFields=(s,o)=>typeof o!="object"||o==null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).sort(([a],[l])=>a.localeCompare(l)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Nn.CacheRegistry,this.cache=t?i.commonCache:new Nn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var yr=class extends Y{async listMySearches(){let{session:t}=A.getState();return qo(t,$.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var vr=class extends Y{async listMyBookmarks(){let t=A.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var gr=class extends Y{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=A.getState().session;return!!t?.sessionAuthenticated}};var br=class extends Y{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=A.getState().session;return!!t?.sessionAuthenticated}};var El="ft-user-assets",Ol={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(ne).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let r=t.payload.mapId;e.assetCounts.bookmarkByMap[r]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:r,mapId:n,asset:i}=t.payload;Pn(e,r,[...Dn(e,r),i]),zo(e,r,1,n),Wo(e,i)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;Pn(e,r,Dn(e,r).map(i=>i.id===n.id?n:i)),Wo(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:i}=t.payload;Pn(e,r,Dn(e,r).filter(s=>s.id!==i)),zo(e,r,-1,n)}},Go={[ne.SEARCHES]:"savedSearches",[ne.BOOKMARKS]:"bookmarks",[ne.BOOKS]:void 0,[ne.COLLECTIONS]:void 0},Dn=(e,t)=>{var r;let n=Go[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},Pn=(e,t,r)=>{let n=Go[t];n&&(e[n]=r)},zo=(e,t,r,n)=>{let i=e.assetCounts.allAsset[t];if(i!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,i+r),t===ne.BOOKMARKS&&n)){let s=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},Wo=(e,t)=>{let r=e.assetLabels.map(i=>i.title),n=t.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));e.assetLabels.push(...n)},z=xr.FtReduxStore.get({name:El,reducers:Ol,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ne).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Mn=class{constructor(t=new gr,r=new br){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=A.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new vr,this.savedSearchesService=new yr,A.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=A.getState();(0,xr.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),z.actions.clearAssetCount(),z.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),z.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),z.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();z.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();z.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&z.getState().assetCounts.allAsset[t]!==r.count&&z.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&z.getState().assetCounts.bookmarkByMap[t]!==r.count&&z.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(z.getState().assetCounts.bookmarkByMap).length!==0;t===ne.BOOKMARKS&&r&&z.actions.clearBookmarkCountByMap(),z.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let r=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;z.actions.bookmarks(r)}}},Cl=new Mn;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Cl);var In=class{addCommand(t,r=!1){A.commands.add(t,r)}consumeCommand(t){return A.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new In;var ie=f(S());var Yo,vt=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},_l=Symbol("clearAfterUnitTest"),Sr=class extends(0,ie.withEventBus)(Y){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Yo]=()=>{this.defaultMessages={},this.cache=new ie.CacheRegistry,this.listeners={}},this.currentUiLocale=A.getState().uiLocale,A.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=A.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let r=t.name.toLowerCase();this.cache.setFinal(r,t),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,r){var n;if(t=t.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...r};(0,ie.deepEqual)(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var r,n;return this.fetchContext(t),(n=(r=this.cache.getNow(t))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,r){let n=t.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(t,r,...n){var i;let s=t.toLowerCase(),o=this.resolveContext(s);return new ie.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},o).resolve(r,...n)}async fetchContext(t){let r=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),r&&await this.notify(t)}catch(i){!(i instanceof ie.CanceledPromiseError)&&r&&console.error(i)}return n}subscribe(t,r){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(r),()=>{var i;return(i=this.listeners[t])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new vt({loadedContexts:t})),this.dispatchEvent(new vt({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new vt({loadedContexts:[t]})),this.dispatchEvent(new vt({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,ie.delay)(0).then(()=>n()).catch(()=>null)))}};Yo=_l;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Sr{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Sr{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var gt=window.FluidTopicsI18nService,Ar=window.FluidTopicsCustomI18nService;var Qo=f(S()),kn=class{highlightHtml(t,r,n){(0,Qo.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new kn;var Xo=f(S());var Un=class{isDate(t){var r,n,i,s;return(s=(i=((n=(r=A.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===t))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(t,r){var n,i,s,o;if(t==null)return"";try{return Xo.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:A.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(o=r?.onlyTime)!==null&&o!==void 0?o:!1)}catch(a){throw console.error(`Date ${JSON.stringify(t)} is not valid`,a),a}}};window.FluidTopicsDateService=new Un;var Jo=f(S());var Bt=class{static get(t,r){var n,i,s,o;let a=A.getState(),{lang:l,region:u}=(s=(i=(n=a.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&s!==void 0?s:{lang:"en",region:"US"};return new Jo.SearchPlaceConverter(a.baseUrl,t??20,(o=a.localesConfiguration)===null||o===void 0?void 0:o.allLanguagesAllowed,r??`${l}-${u}`)}};var $n=class{urlToSearchRequest(t){return Bt.get().parse(t)}searchRequestToUrl(t){return Bt.get().serialize(t)}};window.FluidTopicsUrlService=new $n;var be=f(S());var Be=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Be.eventName="change";var Hn=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let r=sessionStorage.getItem(this.itemName(t));return r?JSON.parse(r):void 0}set(t,r){sessionStorage.setItem(this.itemName(t),JSON.stringify(r))}},Zo=new Hn;var Er=class e extends be.WithEventBus{static build(){return new e(window.history,Zo,()=>window.location,!1)}constructor(t,r,n,i){var s,o;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(o=(s=t.state)===null||s===void 0?void 0:s.index)!==null&&o!==void 0?o:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(t,r=!1){let n=r&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,be.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Be(this.currentItem())),0)}installProxies(){let t=r=>(n,i,[s,o,a])=>{let l=r(),u={...l===this.currentIndex?this.currentState:void 0,...s,index:l,href:typeof a=="string"?a:(a??this.windowLocation()).href};n.apply(i,[u,o,a]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let r=this.history.length-1;r>=0;r--)t?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(t){var r;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(r=t?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(Be.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Be.eventName,t)}currentItem(){return(0,be.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,be.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,be.deepCopy)(r.find(n=>t(n)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,be.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var r;let n=(r=this.states[t])===null||r===void 0?void 0:r.majorStateId;if(!n)return t;let i=t,s=t+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;return i}buildCurrentState(){var t,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&r!==void 0?r:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,r){var n;if(!this.hasState(t))return!1;let i=r??this.currentState.majorStateId,s=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Er.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});var ea=f(H());var ta=ea.css`
646
+ `;var na=f(H()),Z=f(F()),Ke=f(S());var Fe=f(S());function ra(e,t){let{authenticationRequired:r,session:n}=A.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var Or=class extends yt{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var jn=class e extends Fe.FtStateManager{static build(t){return new e(A,t)}constructor(t,r){super(),this.store=t,this.cache=new Fe.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Or,this.cleanSessionDebouncer=new Fe.Debouncer,this.reloadDebouncer=new Fe.Debouncer(500),this.apiProvider=r??(()=>je.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener(mt.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 t=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(t)}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 t;let r=await this.cache.get("availableContentLocales",()=>ra(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=r.contentLocales)!==null&&t!==void 0?t:[])}reloadConfiguration(){var t;(t=this.cache)===null||t===void 0||t.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t){this.userLocaleService.updateUiLocale({uiLocale:t}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new jt(r)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}},Bn=jn.build();var Ve=class extends Event{constructor(t,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var Ft=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let r=this.pendingContextRequests.get(t.context);if(r===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:s}of n){let o=i.deref(),a=s.deref();o===void 0||a===void 0||o.dispatchEvent(new Ve(t.context,o,a,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let r=t.contextTarget??t.composedPath()[0],n=t.callback,i=this.pendingContextRequests.get(t.context);i===void 0&&this.pendingContextRequests.set(t.context,i={callbacks:new WeakMap,requests:[]});let s=i.callbacks.get(r);s===void 0&&i.callbacks.set(r,s=new WeakSet),s.has(n)||(s.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var q=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},M=class extends Ke.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.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Bn,this.contextRoot=new Ft}render(){return na.html`
647
647
  <slot></slot>
648
648
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(t){var r;super.update(t),t.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),t.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),t.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),t.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>gt.addContext(n)),t.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),t.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),t.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};M.elementDefinitions={};M.styles=ta;q([(0,Z.property)()],M.prototype,"baseUrl",void 0);q([(0,Z.property)()],M.prototype,"apiIntegrationIdentifier",void 0);q([(0,Z.property)()],M.prototype,"apiIntegrationAppVersion",void 0);q([(0,Z.property)()],M.prototype,"uiLocale",void 0);q([(0,Ke.jsonProperty)(null)],M.prototype,"availableUiLocales",void 0);q([(0,Ke.jsonProperty)(null)],M.prototype,"metadataConfiguration",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"editorMode",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"noCustom",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"openExternalDocumentInNewTab",void 0);q([(0,Z.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],M.prototype,"noCustomComponent",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"withManualResources",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"navigatorOnline",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"forcedOffline",void 0);q([(0,Z.property)({type:Boolean})],M.prototype,"authenticationRequired",void 0);q([(0,Ke.jsonProperty)([])],M.prototype,"messageContexts",void 0);q([(0,Ke.jsonProperty)(void 0)],M.prototype,"session",void 0);var sa=f(S());var ia={"ft-app-context":M};(0,sa.customElements)(ia);var Cr=class e{static build(t){return new e(t)}static buildCustom(t){return new e(t,!0)}static fromGwt(t){return new e(t)}get service(){return this.custom?Ar:gt}constructor(t,r=!1){this.name=t,this.custom=r,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return o=>({context:this.name,key:s,custom:this.custom,args:typeof o=="function"?void 0:o,argsProvider:typeof o=="function"?o:void 0})}}),this.messages=new Proxy({},{get:(n,i)=>(...s)=>this.service.resolveMessage(this.name,i,...s)}),this.rawMessages=new Proxy({},{get:(n,i)=>this.service.resolveRawMessage(this.name,i)}),this.keys=new Proxy({},{get:(n,i)=>()=>i}),this.attributes=new Proxy({},{get:(n,i)=>()=>({context:this.name,key:i,message:this.service.resolveRawMessage(this.name,i)})})}};var bt=f(S());var aa=f(F());var Fn=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[r,n]=t.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},qe=new Fn;var wl=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},la=Symbol("i18nAttributes"),Kt=Symbol("i18nListAttributes"),ua=Symbol("i18nProperties"),_r=Symbol("i18nContexts"),Vt=Symbol("i18nUnsubs"),Rr=(0,bt.applyMixinOnce)(Symbol("withI18n"),function(e){var t,r;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[r]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Ar:gt}i18n(s){let{context:o,key:a,message:l}=s,{custom:u,args:c,argsProvider:p}=s;if(o&&a){this.hasI18nContext(o)||this.addI18nContext(o,void 0,u);let d=c??(p?p(this):[]);return this.getI18nService(u).resolveMessage(o,a,...d)}return l}async awaitI18n(s){let{context:o,custom:a}=s;return o&&await this.getI18nService(a).prepareContext(o),this.i18n(s)}customI18n(s,o){if(qe.isI18nKey(s)){let[a,l]=s.split(".");return this.i18n({custom:!0,context:a,key:l,...o})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((o,a,l)=>s.has(a)||typeof o.argsProvider=="function"),this.updateI18nProperties(o=>typeof o.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((o,a,l)=>{var u;return((u=l?.context)===null||u===void 0?void 0:u.toLowerCase())===s}),this.updateI18nProperties(o=>o.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var o,a;let l=this,u=(c,p,d)=>d?.context&&d.key&&s(c,p,d)?{...d,message:this.i18n({context:d.context,key:d.key,custom:d.custom,...c})}:d;(o=this[la])===null||o===void 0||o.forEach((c,p)=>l[p]=u(c,p,l[p])),(a=this[Kt])===null||a===void 0||a.forEach((c,p)=>{var d;return l[p]=(d=l[p])===null||d===void 0?void 0:d.map(v=>u(c,p,v))})}updateI18nProperties(s){var o;(o=this[ua])===null||o===void 0||o.forEach((a,l)=>{s(a,l)&&(this[l]=this.i18n(a))})}addI18nMessages(s,o,a){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,o,a)}addI18nContext(s,o,a){let l=(typeof s=="string"?s:s.name).toLowerCase();a=typeof s=="string"?a:s.custom,this[_r].set(l,{isCustomContext:a}),this[Vt].has(l)||this[Vt].set(l,this.getI18nService(a).subscribe(l,()=>this.onI18nUpdate(l))),this.getI18nService(a).prepareContext(l,o)}hasI18nContext(s){return this[_r].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[_r].forEach((s,o)=>this.addI18nContext(o,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Vt].forEach(s=>s()),this[Vt].clear()}}return t=_r,r=Vt,wl([(0,aa.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),oa=class extends Rr(bt.FtLitElement){},Tr=class extends Rr(bt.FtLitElementRedux){};var ca=f(H());var pa=ca.css`
649
649
  `;var wr=f(H()),Lr=f(F()),Nr=f(S());var qt=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},ce=class extends Tr{constructor(){super(),this.editorMode=!1,this.addStore(A)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":wr.nothing:wr.html`