@fluid-topics/ft-reader-attachments 2.1.19 → 2.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { I18nMessageContext } from "@fluid-topics/ft-i18n";
1
+ import { I18nMessageContext, } from "@fluid-topics/ft-i18n";
2
2
  export const attachmentsMessages = I18nMessageContext.build("designedReaderAttachments");
3
3
  export const defaultMessages = {
4
- download: "Download “{0}”"
4
+ download: "Download “{0}”",
5
5
  };
@@ -1,12 +1,12 @@
1
- "use strict";(()=>{var ja=Object.create;var bn=Object.defineProperty;var Ba=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var Ka=Object.getPrototypeOf,Fa=Object.prototype.hasOwnProperty;var De=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Ga=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Va(t))!Fa.call(e,i)&&i!==r&&bn(e,i,{get:()=>t[i],enumerable:!(n=Ba(t,i))||n.enumerable});return e};var g=(e,t,r)=>(r=e!=null?ja(Ka(e)):{},Ga(t||!e||!e.__esModule?bn(r,"default",{value:e,enumerable:!0}):r,e));var C=De((eu,En)=>{En.exports=ftGlobals.wcUtils});var j=De((ru,Cn)=>{Cn.exports=ftGlobals.litDecorators});var B=De((mu,Nn)=>{Nn.exports=ftGlobals.lit});var Ds=De((Gp,Ps)=>{Ps.exports=ftGlobals.litRepeat});var Us=De((qp,ks)=>{ks.exports=ftGlobals.litUnsafeHTML});var gn=De((Nf,ba)=>{ba.exports=ftGlobals.litClassMap});var $a=g(C());var hr=g(C());var P=g(C()),Sn={itemsGap:P.FtCssVariableFactory.create("--ft-reader-attachments-items-gap","","SIZE","8px"),itemPadding:P.FtCssVariableFactory.create("--ft-reader-attachments-item-padding","","SIZE","8px"),itemBorderWidth:P.FtCssVariableFactory.create("--ft-reader-attachments-item-border-width","","SIZE","1px"),itemBorderColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-border-color","",P.designSystemVariables.colorOutline),itemBorderRadius:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-border-radius","",P.designSystemVariables.borderRadiusS),itemBackgroundColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-background-color","",P.designSystemVariables.colorSurface),itemTextColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-text-color","",P.designSystemVariables.colorOnSurfaceMedium),itemHoverBackgroundColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-hover-background-color","",P.designSystemVariables.colorPrimary),itemHoverTextColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-hover-text-color","",P.designSystemVariables.colorOnSurfaceHigh),fileFormatIconSize:P.FtCssVariableFactory.create("--ft-reader-attachments-file-format-icon-size","","SIZE","30px"),downloadIconSize:P.FtCssVariableFactory.create("--ft-reader-attachments-down-icon-size","","SIZE","20px")};var Lt=g(C()),_n=g(j());var wt;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update",e.visibleTopicChange="visible-topic-change",e.requestedTopicNotFound="requested-topic-not-found"})(wt||(wt={}));var On;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(On||(On={}));var Wa=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},yr=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},mr=Symbol("registerInterval"),vr=(0,Lt.applyMixinOnce)(Symbol("toFtReaderComponent"),function(e){var t;class r extends e{constructor(){super(...arguments),this[t]=0}setReaderStateManager(i){this.clearStateManager(),this.stateManager=i,this.addStore(i.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var i;return(i=this.stateManager)===null||i===void 0?void 0:i.service}connectedCallback(){super.connectedCallback(),this[mr]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[mr]):this.dispatchEvent(new yr)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=mr,Wa([(0,_n.state)()],r.prototype,"stateManager",void 0),r}),Tn=class extends vr(Lt.FtLitElementRedux){};var Kr=g(j());var Rn=g(j(),1);var gr=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function wn(e,t){return(0,Rn.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return ct(e);try{return JSON.parse(r)}catch{return ct(e)}},toAttribute:r=>JSON.stringify(r)},hasChanged:dt,...t??{}})}function za(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(!Nt(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(!Nt(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=a=>Object.keys(a).filter(o=>a[o]!=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 a=s[n];if(!Nt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Nt(e,t){try{return za(e,t)}catch{return!1}}function dt(e,t){return!Nt(e,t)}function ct(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function Pt(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 Ln=g(j(),1);var Ar=e=>{let t=e??{};return(r,n)=>{var i;let s={hasChanged:dt,attribute:!1,...t};(0,Ln.property)(s)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:(o=>o[n]),store:t.store})}};var Dt=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 ge=g(j(),1);var It=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 a of n)try{await a()}catch(o){i(o);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 Dn=g(B(),1);var Mt=globalThis,qa=Mt.ShadowRoot&&(Mt.ShadyCSS===void 0||Mt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var Pn=(e,t)=>{if(qa)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),i=Mt.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}};var kt=class extends Dn.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 Pn(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){gr(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 In(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 Me=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Hn,Mn=Symbol("constructorPrototype"),kn=Symbol("constructorName"),$n=Symbol("exportpartsDebouncer"),Un=Symbol("dynamicDependenciesLoaded"),Ie=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Ie.eventName="exportparts-updated";var ee=class extends kt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Hn]=new It(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[$n].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[kn]=this.constructor.name,this[Mn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[kn]&&Object.setPrototypeOf(this,this[Mn])}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[Un]||(r[Un]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Ie.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Ie.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 Ie)})}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=In(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,a,o;let u=p=>p!=null&&p.trim().length>0,l=t.filter(u).map(p=>p.trim());if(l.length===0){this.exportparts=void 0;return}let c=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let y=(s=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],h=(o=(a=p.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(b=>b.split(":")[1]))!==null&&o!==void 0?o:[],v=[...y,...h].filter(u).map(b=>b.trim());for(let b of v)c.add(b)}if(c.size===0){this.exportparts=void 0;return}let d=[...c.values()].flatMap(p=>l.map(y=>`${p}:${y}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};Hn=$n;Me([(0,ge.property)()],ee.prototype,"exportpartsPrefix",void 0);Me([wn([])],ee.prototype,"exportpartsPrefixes",void 0);Me([(0,ge.property)({reflect:!0})],ee.prototype,"exportparts",void 0);Me([(0,ge.property)()],ee.prototype,"customStylesheet",void 0);Me([(0,ge.property)()],ee.prototype,"elementToFocus",void 0);Me([(0,ge.state)()],ee.prototype,"useAdoptedStyleSheets",void 0);function Ut(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var pt=Symbol("internalReduxEventsUnsubscribers"),ce=Symbol("internalStoresUnsubscribers"),Ae=Symbol("internalStores"),Ya=Pt(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(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[Ae].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ae].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[Ae].get(a)}addStore(a,o){var u;o=(u=o??a.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(o),this[Ae].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[Ae].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Ae].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let u=this.constructor.getPropertyOptions(o);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:o)){let l=this.getStore(a.store);l&&(a.store?this[ce].has(a.store):this[ce].size>0)&&(this[o]=a.selector(l.getState(),this))}})}subscribeToStore(a,o){var u;this[ce].set(a,o.subscribe(()=>this.updateFromStores())),this[pt].set(a,[]),Ut(o)&&o.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((l,c)=>{if(typeof this[c]=="function"&&(!l.store||o.name===l.store)){let d=p=>this[c](p);o.addEventListener(l.eventName,d),this[pt].get(a).push(()=>o.removeEventListener(l.eventName,d))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[ce].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[ce].has(a)&&this[ce].get(a)(),this[ce].delete(a),(o=this[pt].get(a))===null||o===void 0||o.forEach(u=>u()),this[pt].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=ce,r=Ae,n=pt,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),jn=class extends Ya(ee){};function G(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(a){return"'"+a+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ie(e){return!!e&&!!e[T]}function J(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)===no})(e)||Array.isArray(e)||!!e[zn]||!!(!((t=e.constructor)===null||t===void 0)&&t[zn])||Rr(e)||wr(e))}function xe(e,t,r){r===void 0&&(r=!1),He(e)===0?(r?Object.keys:Ue)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function He(e){var t=e[T];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Rr(e)?2:wr(e)?3:0}function ke(e,t){return He(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xa(e,t){return He(e)===2?e.get(t):e[t]}function qn(e,t,r){var n=He(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Yn(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Rr(e){return to&&e instanceof Map}function wr(e){return ro&&e instanceof Set}function de(e){return e.o||e.t}function Lr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Qn(e);delete t[T];for(var r=Ue(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 Nr(e,t){return t===void 0&&(t=!1),Pr(e)||ie(e)||!J(e)||(He(e)>1&&(e.set=e.add=e.clear=e.delete=Ja),Object.freeze(e),t&&xe(e,(function(r,n){return Nr(n,!0)}),!0)),e}function Ja(){G(2)}function Pr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function te(e){var t=_r[e];return t||G(18,e),t}function Qa(e,t){_r[e]||(_r[e]=t)}function Cr(){return ht}function xr(e,t){t&&(te("Patches"),e.u=[],e.s=[],e.v=t)}function Ht(e){Or(e),e.p.forEach(Za),e.p=null}function Or(e){e===ht&&(ht=e.l)}function Bn(e){return ht={p:[],l:ht,h:e,m:!0,_:0}}function Za(e){var t=e[T];t.i===0||t.i===1?t.j():t.g=!0}function br(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||te("ES5").S(t,e,n),n?(r[T].P&&(Ht(t),G(4)),J(e)&&(e=$t(t,e),t.l||jt(t,e)),t.u&&te("Patches").M(r[T].t,e,t.u,t.s)):e=$t(t,r,[]),Ht(t),t.u&&t.v(t.u,t.s),e!==Jn?e:void 0}function $t(e,t,r){if(Pr(t))return t;var n=t[T];if(!n)return xe(t,(function(o,u){return Vn(e,n,t,o,u,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return jt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Lr(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),xe(s,(function(o,u){return Vn(e,n,i,o,u,r,a)})),jt(e,i,!1),r&&e.u&&te("Patches").N(n,r,e.u,e.s)}return n.o}function Vn(e,t,r,n,i,s,a){if(ie(i)){var o=$t(e,i,s&&t&&t.i!==3&&!ke(t.R,n)?s.concat(n):void 0);if(qn(r,n,o),!ie(o))return;e.m=!1}else a&&r.add(i);if(J(i)&&!Pr(i)){if(!e.h.D&&e._<1)return;$t(e,i),t&&t.A.l||jt(e,i)}}function jt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Nr(t,r)}function Er(e,t){var r=e[T];return(r?de(r):e)[t]}function Kn(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 pe(e){e.P||(e.P=!0,e.l&&pe(e.l))}function Sr(e){e.o||(e.o=Lr(e.t))}function Tr(e,t,r){var n=Rr(t)?te("MapSet").F(t,r):wr(t)?te("MapSet").T(t,r):e.O?(function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:Cr(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=o,l=mt;a&&(u=[o],l=ft);var c=Proxy.revocable(u,l),d=c.revoke,p=c.proxy;return o.k=p,o.j=d,p})(t,r):te("ES5").J(t,r);return(r?r.A:Cr()).p.push(n),n}function eo(e){return ie(e)||G(22,e),(function t(r){if(!J(r))return r;var n,i=r[T],s=He(r);if(i){if(!i.P&&(i.i<4||!te("ES5").K(i)))return i.t;i.I=!0,n=Fn(r,s),i.I=!1}else n=Fn(r,s);return xe(n,(function(a,o){i&&Xa(i.t,a)===o||qn(n,a,t(o))})),s===3?new Set(n):n})(e)}function Fn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Lr(e)}function Xn(){function e(a,o){var u=s[a];return u?u.enumerable=o:s[a]=u={configurable:!0,enumerable:o,get:function(){var l=this[T];return mt.get(l,a)},set:function(l){var c=this[T];mt.set(c,a,l)}},u}function t(a){for(var o=a.length-1;o>=0;o--){var u=a[o][T];if(!u.P)switch(u.i){case 5:n(u)&&pe(u);break;case 4:r(u)&&pe(u)}}}function r(a){for(var o=a.t,u=a.k,l=Ue(u),c=l.length-1;c>=0;c--){var d=l[c];if(d!==T){var p=o[d];if(p===void 0&&!ke(o,d))return!0;var y=u[d],h=y&&y[T];if(h?h.t!==p:!Yn(y,p))return!0}}var v=!!o[T];return l.length!==Ue(o).length+(v?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var u=Object.getOwnPropertyDescriptor(o,o.length-1);if(u&&!u.get)return!0;for(var l=0;l<o.length;l++)if(!o.hasOwnProperty(l))return!0;return!1}function i(a){a.g&&G(3,JSON.stringify(de(a)))}var s={};Qa("ES5",{J:function(a,o){var u=Array.isArray(a),l=(function(d,p){if(d){for(var y=Array(p.length),h=0;h<p.length;h++)Object.defineProperty(y,""+h,e(h,!0));return y}var v=Qn(p);delete v[T];for(var b=Ue(v),E=0;E<b.length;E++){var S=b[E];v[S]=e(S,d||!!v[S].enumerable)}return Object.create(Object.getPrototypeOf(p),v)})(u,a),c={i:u?5:4,A:o?o.A:Cr(),P:!1,I:!1,R:{},l:o,t:a,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,T,{value:c,writable:!0}),l},S:function(a,o,u){u?ie(o)&&o[T].A===a&&t(a.p):(a.u&&(function l(c){if(c&&typeof c=="object"){var d=c[T];if(d){var p=d.t,y=d.k,h=d.R,v=d.i;if(v===4)xe(y,(function(O){O!==T&&(p[O]!==void 0||ke(p,O)?h[O]||l(y[O]):(h[O]=!0,pe(d)))})),xe(p,(function(O){y[O]!==void 0||ke(y,O)||(h[O]=!1,pe(d))}));else if(v===5){if(n(d)&&(pe(d),h.length=!0),y.length<p.length)for(var b=y.length;b<p.length;b++)h[b]=!1;else for(var E=p.length;E<y.length;E++)h[E]=!0;for(var S=Math.min(y.length,p.length),_=0;_<S;_++)y.hasOwnProperty(_)||(h[_]=!0),h[_]===void 0&&l(y[_])}}}})(a.p[0]),t(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var Gn,ht,Dr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",to=typeof Map<"u",ro=typeof Set<"u",Wn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Jn=Dr?Symbol.for("immer-nothing"):((Gn={})["immer-nothing"]=!0,Gn),zn=Dr?Symbol.for("immer-draftable"):"__$immer_draftable",T=Dr?Symbol.for("immer-state"):"__$immer_state";var no=""+Object.prototype.constructor,Ue=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Qn=Object.getOwnPropertyDescriptors||function(e){var t={};return Ue(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},_r={},mt={get:function(e,t){if(t===T)return e;var r=de(e);if(!ke(r,t))return(function(i,s,a){var o,u=Kn(s,a);return u?"value"in u?u.value:(o=u.get)===null||o===void 0?void 0:o.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!J(n)?n:n===Er(e.t,t)?(Sr(e),e.o[t]=Tr(e.A.h,n,e)):n},has:function(e,t){return t in de(e)},ownKeys:function(e){return Reflect.ownKeys(de(e))},set:function(e,t,r){var n=Kn(de(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var i=Er(de(e),t),s=i?.[T];if(s&&s.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Yn(r,i)&&(r!==void 0||ke(e.t,t)))return!0;Sr(e),pe(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 Er(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Sr(e),pe(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=de(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){G(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){G(12)}},ft={};xe(mt,(function(e,t){ft[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ft.deleteProperty=function(e,t){return ft.set.call(this,e,t,void 0)},ft.set=function(e,t,r){return mt.set.call(this,e[0],t,r,e[0])};var io=(function(){function e(r){var n=this;this.O=Wn,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var u=n;return function(v){var b=this;v===void 0&&(v=o);for(var E=arguments.length,S=Array(E>1?E-1:0),_=1;_<E;_++)S[_-1]=arguments[_];return u.produce(v,(function(O){var le;return(le=s).call.apply(le,[b,O].concat(S))}))}}var l;if(typeof s!="function"&&G(6),a!==void 0&&typeof a!="function"&&G(7),J(i)){var c=Bn(n),d=Tr(n,i,void 0),p=!0;try{l=s(d),p=!1}finally{p?Ht(c):Or(c)}return typeof Promise<"u"&&l instanceof Promise?l.then((function(v){return xr(c,a),br(v,c)}),(function(v){throw Ht(c),v})):(xr(c,a),br(l,c))}if(!i||typeof i!="object"){if((l=s(i))===void 0&&(l=i),l===Jn&&(l=void 0),n.D&&Nr(l,!0),a){var y=[],h=[];te("Patches").M(i,l,y,h),a(y,h)}return l}G(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(l){for(var c=arguments.length,d=Array(c>1?c-1:0),p=1;p<c;p++)d[p-1]=arguments[p];return n.produceWithPatches(l,(function(y){return i.apply(void 0,[y].concat(d))}))};var a,o,u=n.produce(i,s,(function(l,c){a=l,o=c}));return typeof Promise<"u"&&u instanceof Promise?u.then((function(l){return[l,a,o]})):[u,a,o]},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){J(r)||G(8),ie(r)&&(r=eo(r));var n=Bn(this),i=Tr(this,r,void 0);return i[T].C=!0,Or(n),i},t.finishDraft=function(r,n){var i=r&&r[T],s=i.A;return xr(s,n),br(void 0,s)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Wn&&G(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 a=te("Patches").$;return ie(r)?a(r,n):this.produce(r,(function(o){return a(o,n)}))},e})(),V=new io,so=V.produce,Nu=V.produceWithPatches.bind(V),Pu=V.setAutoFreeze.bind(V),Du=V.setUseProxies.bind(V),Iu=V.applyPatches.bind(V),Mu=V.createDraft.bind(V),ku=V.finishDraft.bind(V),Bt=so;function be(e){"@babel/helpers - typeof";return be=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},be(e)}function Zn(e,t){if(be(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(be(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ei(e){var t=Zn(e,"string");return be(t)=="symbol"?t:t+""}function ti(e,t,r){return(t=ei(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ri(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 Ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){ti(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(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 ni=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Mr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Vt={INIT:"@@redux/INIT"+Mr(),REPLACE:"@@redux/REPLACE"+Mr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Mr()}};function ao(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 kr(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(kr)(e,t)}if(typeof e!="function")throw new Error(k(2));var i=e,s=t,a=[],o=a,u=!1;function l(){o===a&&(o=a.slice())}function c(){if(u)throw new Error(k(3));return s}function d(v){if(typeof v!="function")throw new Error(k(4));if(u)throw new Error(k(5));var b=!0;return l(),o.push(v),function(){if(b){if(u)throw new Error(k(6));b=!1,l();var S=o.indexOf(v);o.splice(S,1),a=null}}}function p(v){if(!ao(v))throw new Error(k(7));if(typeof v.type>"u")throw new Error(k(8));if(u)throw new Error(k(9));try{u=!0,s=i(s,v)}finally{u=!1}for(var b=a=o,E=0;E<b.length;E++){var S=b[E];S()}return v}function y(v){if(typeof v!="function")throw new Error(k(10));i=v,p({type:Vt.REPLACE})}function h(){var v,b=d;return v={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(k(11));function _(){S.next&&S.next(c())}_();var O=b(_);return{unsubscribe:O}}},v[ni]=function(){return this},v}return p({type:Vt.INIT}),n={dispatch:p,subscribe:d,getState:c,replaceReducer:y},n[ni]=h,n}function oo(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Vt.INIT});if(typeof n>"u")throw new Error(k(12));if(typeof r(void 0,{type:Vt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(k(13))})}function ii(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),a,o;try{oo(r)}catch(u){o=u}return function(l,c){if(l===void 0&&(l={}),o)throw o;if(0)var d;for(var p=!1,y={},h=0;h<s.length;h++){var v=s[h],b=r[v],E=l[v],S=b(E,c);if(typeof S>"u"){var _=c&&c.type;throw new Error(k(14))}y[v]=S,p=p||S!==E}return p=p||s.length!==Object.keys(l).length,p?y:l}}function $e(){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 si(){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))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=t.map(function(u){return u(a)});return s=$e.apply(void 0,o)(i.dispatch),Ir(Ir({},i),{},{dispatch:s})}}}function ai(e){var t=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,e):a(o)}}};return t}var oi=ai();oi.withExtraArgument=ai;var Ur=oi;var pi=(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)}})(),uo=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},je=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},lo=Object.defineProperty,co=Object.defineProperties,po=Object.getOwnPropertyDescriptors,ui=Object.getOwnPropertySymbols,fo=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,li=function(e,t,r){return t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},fe=function(e,t){for(var r in t||(t={}))fo.call(t,r)&&li(e,r,t[r]);if(ui)for(var n=0,i=ui(t);n<i.length;n++){var r=i[n];ho.call(t,r)&&li(e,r,t[r])}return e},Hr=function(e,t){return co(e,po(t))},mo=function(e,t,r){return new Promise(function(n,i){var s=function(u){try{o(r.next(u))}catch(l){i(l)}},a=function(u){try{o(r.throw(u))}catch(l){i(l)}},o=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,a)};o((r=r.apply(e,t)).next())})};var yo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$e:$e.apply(null,arguments)},el=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function vo(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 he(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 fe(fe({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 go=(function(e){pi(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,je([void 0],r[0].concat(this)))):new(t.bind.apply(t,je([void 0],r.concat(this))))},t})(Array),Ao=(function(e){pi(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,je([void 0],r[0].concat(this)))):new(t.bind.apply(t,je([void 0],r.concat(this))))},t})(Array);function Br(e){return J(e)?Bt(e,function(){}):e}function xo(e){return typeof e=="boolean"}function bo(){return function(t){return Eo(t)}}function Eo(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,a=s===void 0?!0:s,o=e.actionCreatorCheck,u=o===void 0?!0:o,l=new go;if(r&&(xo(r)?l.push(Ur):l.push(Ur.withExtraArgument(r.extraArgument))),0){if(i)var c;if(a)var d;if(u)var p}return l}var $r=!0;function fi(e){var t=bo(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?t():s,o=r.devTools,u=o===void 0?!0:o,l=r.preloadedState,c=l===void 0?void 0:l,d=r.enhancers,p=d===void 0?void 0:d,y;if(typeof i=="function")y=i;else if(vo(i))y=ii(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 h=a;if(typeof h=="function"&&(h=h(t),!$r&&!Array.isArray(h)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!$r&&h.some(function(O){return typeof O!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=si.apply(void 0,h),b=$e;u&&(b=yo(fe({trace:!$r},typeof u=="object"&&u)));var E=new Ao(v),S=E;Array.isArray(p)?S=je([v],p):typeof p=="function"&&(S=p(E));var _=b.apply(void 0,S);return kr(y,c,_)}function hi(e){var t={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(!o)throw new Error("`builder.addCase` cannot be called with an empty action type");if(o in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return e(i),[t,r,n]}function So(e){return typeof e=="function"}function Co(e,t,r,n){r===void 0&&(r=[]);var i=typeof t=="function"?hi(t):[t,r,n],s=i[0],a=i[1],o=i[2],u;if(So(e))u=function(){return Br(e())};else{var l=Br(e);u=function(){return l}}function c(d,p){d===void 0&&(d=u());var y=je([s[p.type]],a.filter(function(h){var v=h.matcher;return v(p)}).map(function(h){var v=h.reducer;return v}));return y.filter(function(h){return!!h}).length===0&&(y=[o]),y.reduce(function(h,v){if(v)if(ie(h)){var b=h,E=v(b,p);return E===void 0?h:E}else{if(J(h))return Bt(h,function(S){return v(S,p)});var E=v(h,p);if(E===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}return h},d)}return c.getInitialState=u,c}function Oo(e,t){return e+"/"+t}function mi(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:Br(e.initialState),n=e.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(c){var d=n[c],p=Oo(t,c),y,h;"reducer"in d?(y=d.reducer,h=d.prepare):y=d,s[c]=y,a[p]=y,o[c]=h?he(p,h):he(p)});function u(){var c=typeof e.extraReducers=="function"?hi(e.extraReducers):[e.extraReducers],d=c[0],p=d===void 0?{}:d,y=c[1],h=y===void 0?[]:y,v=c[2],b=v===void 0?void 0:v,E=fe(fe({},p),a);return Co(r,function(S){for(var _ in E)S.addCase(_,E[_]);for(var O=0,le=h;O<le.length;O++){var ne=le[O];S.addMatcher(ne.matcher,ne.reducer)}b&&S.addDefaultCase(b)})}var l;return{name:t,reducer:function(c,d){return l||(l=u()),l(c,d)},actions:o,caseReducers:s,getInitialState:function(){return l||(l=u()),l.getInitialState()}}}var To="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_o=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=To[Math.random()*64|0];return t},Ro=["name","message","stack","code"],jr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),ci=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),wo=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Ro;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},il=(function(){function e(t,r,n){var i=he(t+"/fulfilled",function(c,d,p,y){return{payload:c,meta:Hr(fe({},y||{}),{arg:p,requestId:d,requestStatus:"fulfilled"})}}),s=he(t+"/pending",function(c,d,p){return{payload:void 0,meta:Hr(fe({},p||{}),{arg:d,requestId:c,requestStatus:"pending"})}}),a=he(t+"/rejected",function(c,d,p,y,h){return{payload:y,error:(n&&n.serializeError||wo)(c||"Rejected"),meta:Hr(fe({},h||{}),{arg:p,requestId:d,rejectedWithValue:!!y,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"})}}),o=!1,u=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 l(c){return function(d,p,y){var h=n?.idGenerator?n.idGenerator(c):_o(),v=new u,b,E=!1;function S(O){b=O,v.abort()}var _=(function(){return mo(this,null,function(){var O,le,ne,ot,An,ut,xn;return uo(this,function(Pe){switch(Pe.label){case 0:return Pe.trys.push([0,4,,5]),ot=(O=n?.condition)==null?void 0:O.call(n,c,{getState:p,extra:y}),No(ot)?[4,ot]:[3,2];case 1:ot=Pe.sent(),Pe.label=2;case 2:if(ot===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=!0,An=new Promise(function(X,lt){return v.signal.addEventListener("abort",function(){return lt({name:"AbortError",message:b||"Aborted"})})}),d(s(h,c,(le=n?.getPendingMeta)==null?void 0:le.call(n,{requestId:h,arg:c},{getState:p,extra:y}))),[4,Promise.race([An,Promise.resolve(r(c,{dispatch:d,getState:p,extra:y,requestId:h,signal:v.signal,abort:S,rejectWithValue:function(X,lt){return new jr(X,lt)},fulfillWithValue:function(X,lt){return new ci(X,lt)}})).then(function(X){if(X instanceof jr)throw X;return X instanceof ci?i(X.payload,h,c,X.meta):i(X,h,c)})])];case 3:return ne=Pe.sent(),[3,5];case 4:return ut=Pe.sent(),ne=ut instanceof jr?a(null,h,c,ut.payload,ut.meta):a(ut,h,c),[3,5];case 5:return xn=n&&!n.dispatchConditionRejection&&a.match(ne)&&ne.meta.condition,xn||d(ne),[2,ne]}})})})();return Object.assign(_,{abort:S,requestId:h,arg:c,unwrap:function(){return _.then(Lo)}})}}return Object.assign(l,{pending:s,rejected:a,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function Lo(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function No(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var yi="listener",vi="completed",gi="cancelled",sl="task-"+gi,al="task-"+vi,ol=yi+"-"+gi,ul=yi+"-"+vi;var Vr="listenerMiddleware";var ll=he(Vr+"/add"),cl=he(Vr+"/removeAll"),dl=he(Vr+"/remove");var di,pl=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(di||(di=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Po=function(e){return function(t){setTimeout(t,e)}},fl=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Po(10);Xn();var Do=Pt(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)}}}),Kt=class extends Do(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ai=class e extends Kt{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(Ut(s))return s;if(i==null)return;let a=mi({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=fi({reducer:(u,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let c=ct(a.getInitialState());for(let d of l.keeping)c[d]=(u??c)[d];return c}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...l.overwrites};return a.reducer(u,l)}});return window.ftReduxStores[i.name]=new e(a,o,i.eventBus)}constructor(t,r,n){super(),this.reduxSlice=t,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Dt;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,o)=>{let u=a,l=s[u];return l?(...c)=>{let d=l(...c.map(i));return this.reduxStore.dispatch(d),d}:c=>{this.setState({[u]: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 Ft=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 a=typeof t=="string"?new Date(t):t,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),u=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return s?u:i?`${o} ${u}`:o}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 Gt=g(C()),Io="ft-app-info",Be=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Be.eventName="authentication-change";var yt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};yt.eventName="ui-locale-changed";var Mo={session:(e,t)=>{(0,Gt.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>x.dispatchEvent(new Be(t.payload)),0))}},x=Gt.FtReduxStore.get({name:Io,reducers:Mo,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var xi=g(C()),Wt=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Bl=(0,xi.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(x)}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(o=>o.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?o=>Ft.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Wt([(0,Kr.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Wt([(0,Kr.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Wt([Ar({store:x.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),Wt([Ar({store:x.name})],t.prototype,"uiLocale",void 0),t});var bi;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(bi||(bi={}));var Ei;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Ei||(Ei={}));var Si;(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"})(Si||(Si={}));var Ci;(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"})(Ci||(Ci={}));var Oi;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Oi||(Oi={}));var Ti;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Ti||(Ti={}));var _i;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(_i||(_i={}));var Ri;(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"})(Ri||(Ri={}));var wi;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(wi||(wi={}));var Li;(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"})(Li||(Li={}));var Ni;(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"})(Ni||(Ni={}));var Pi;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Pi||(Pi={}));var Di;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Di||(Di={}));var Ii;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Ii||(Ii={}));var Mi;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Mi||(Mi={}));var ki;(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"})(ki||(ki={}));var Ui;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Ui||(Ui={}));var Hi;(function(e){e.ASC="ASC",e.DESC="DESC"})(Hi||(Hi={}));var $i;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})($i||($i={}));var ji;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ji||(ji={}));var Bi;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Bi||(Bi={}));var Vi;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Vi||(Vi={}));var Ki;(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"})(Ki||(Ki={}));var Fi;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Fi||(Fi={}));var Gi;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Gi||(Gi={}));var Wi;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Wi||(Wi={}));var zi;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(zi||(zi={}));var L;(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"})(L||(L={}));var W;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(W||(W={}));var qi;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(qi||(qi={}));var Yi;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Yi||(Yi={}));var Xi;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Xi||(Xi={}));var Ji;(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"})(Ji||(Ji={}));var Qi;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Qi||(Qi={}));var Zi;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Zi||(Zi={}));var es;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(es||(es={}));var ts;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(ts||(ts={}));var rs;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(rs||(rs={}));var ns;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(ns||(ns={}));var is;(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"})(is||(is={}));var ss;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(ss||(ss={}));var ko={[L.PERSONAL_BOOK_SHARE_USER]:[L.PERSONAL_BOOK_USER],[L.HTML_EXPORT_USER]:[L.PERSONAL_BOOK_USER],[L.PDF_EXPORT_USER]:[L.PERSONAL_BOOK_USER],[L.KHUB_ADMIN]:[L.CONTENT_PUBLISHER],[L.ADMIN]:[L.KHUB_ADMIN,L.USERS_ADMIN,L.PORTAL_ADMIN,L.BEHAVIOR_DATA_USER],[L.GENERATIVE_AI_EXPORT_USER]:[L.GENERATIVE_AI_USER]};function as(e,t){return e===t||(ko[e]??[]).some(r=>as(r,t))}function os(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=>as(n,t))}var Jt=g(C());var Fr=g(C());var Ee=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=x.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=x.subscribe(()=>{n=e.get(t),n&&(i(),r(n))})}})}};var Ve=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Ee.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ee.await()}};var K=class extends Ve{constructor(t=!0,r){var n;super(r),this.sortObjectFields=(s,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[u])=>o.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Fr.CacheRegistry,this.cache=t?i.commonCache:new Fr.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 zt=class extends K{async listMySearches(){let{session:t}=x.getState();return os(t,L.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var qt=class extends K{async listMyBookmarks(){let t=x.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Yt=class extends K{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=x.getState().session;return!!t?.sessionAuthenticated}};var Xt=class extends K{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=x.getState().session;return!!t?.sessionAuthenticated}};var Uo="ft-user-assets",Ho={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(W).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;Wr(e,r,[...Gr(e,r),i]),us(e,r,1,n),ls(e,i)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;Wr(e,r,Gr(e,r).map(i=>i.id===n.id?n:i)),ls(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:i}=t.payload;Wr(e,r,Gr(e,r).filter(s=>s.id!==i)),us(e,r,-1,n)}},cs={[W.SEARCHES]:"savedSearches",[W.BOOKMARKS]:"bookmarks",[W.BOOKS]:void 0,[W.COLLECTIONS]:void 0},Gr=(e,t)=>{var r;let n=cs[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},Wr=(e,t,r)=>{let n=cs[t];n&&(e[n]=r)},us=(e,t,r,n)=>{let i=e.assetCounts.allAsset[t];if(i!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,i+r),t===W.BOOKMARKS&&n)){let s=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},ls=(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)},U=Jt.FtReduxStore.get({name:Uo,reducers:Ho,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(W).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),zr=class{constructor(t=new Yt,r=new Xt){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=x.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new qt,this.savedSearchesService=new zt,x.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=x.getState();(0,Jt.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(),U.actions.clearAssetCount(),U.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),U.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),U.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();U.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();U.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&U.getState().assetCounts.allAsset[t]!==r.count&&U.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&U.getState().assetCounts.bookmarkByMap[t]!==r.count&&U.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(U.getState().assetCounts.bookmarkByMap).length!==0;t===W.BOOKMARKS&&r&&U.actions.clearBookmarkCountByMap(),U.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;U.actions.bookmarks(r)}}},$o=new zr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=$o);var qr=class{addCommand(t,r=!1){x.commands.add(t,r)}consumeCommand(t){return x.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new qr;var z=g(C());var ds,Ke=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},jo=Symbol("clearAfterUnitTest"),Qt=class extends(0,z.withEventBus)(K){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ds]=()=>{this.defaultMessages={},this.cache=new z.CacheRegistry,this.listeners={}},this.currentUiLocale=x.getState().uiLocale,x.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=x.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,z.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(),a=this.resolveContext(s);return new z.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},a).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 z.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 Ke({loadedContexts:t})),this.dispatchEvent(new Ke({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new Ke({loadedContexts:[t]})),this.dispatchEvent(new Ke({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,z.delay)(0).then(()=>n()).catch(()=>null)))}};ds=jo;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Qt{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Qt{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Fe=window.FluidTopicsI18nService,Zt=window.FluidTopicsCustomI18nService;var ps=g(C()),Yr=class{highlightHtml(t,r,n){(0,ps.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new Yr;var fs=g(C());var Xr=class{isDate(t){var r,n,i,s;return(s=(i=((n=(r=x.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===t))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(t,r){var n,i,s,a;if(t==null)return"";try{return fs.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:x.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(t)} is not valid`,o),o}}};window.FluidTopicsDateService=new Xr;var hs=g(C());var vt=class{static get(t,r){var n,i,s,a;let o=x.getState(),{lang:u,region:l}=(s=(i=(n=o.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 hs.SearchPlaceConverter(o.baseUrl,t??20,(a=o.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed,r??`${u}-${l}`)}};var Jr=class{urlToSearchRequest(t){return vt.get().parse(t)}searchRequestToUrl(t){return vt.get().serialize(t)}};window.FluidTopicsUrlService=new Jr;var se=g(C());var Se=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Se.eventName="change";var Qr=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))}},ms=new Qr;var er=class e extends se.WithEventBus{static build(){return new e(window.history,ms,()=>window.location,!1)}constructor(t,r,n,i){var s,a;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(a=(s=t.state)===null||s===void 0?void 0:s.index)!==null&&a!==void 0?a: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,se.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Se(this.currentItem())),0)}installProxies(){let t=r=>(n,i,[s,a,o])=>{let u=r(),l={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(i,[l,a,o]),this.setCurrentState(l,!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(Se.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Se.eventName,t)}currentItem(){return(0,se.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,se.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,se.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,se.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 ys=g(B());var vs=ys.css`
2
- `;var xs=g(B()),H=g(j()),Te=g(C());var Ce=g(C());function gs(e,t){let{authenticationRequired:r,session:n}=x.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var tr=class extends Ve{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var Zr=class e extends Ce.FtStateManager{static build(t){return new e(x,t)}constructor(t,r){super(),this.store=t,this.cache=new Ce.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new tr,this.cleanSessionDebouncer=new Ce.Debouncer,this.reloadDebouncer=new Ce.Debouncer(500),this.apiProvider=r??(()=>Ee.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener(Be.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",()=>gs(()=>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}setTenantId(t){this.store.actions.tenantId(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 yt(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)}},As=Zr.build();var Oe=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 gt=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 a=i.deref(),o=s.deref();a===void 0||o===void 0||a.dispatchEvent(new Oe(t.context,a,o,!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 I=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},R=class extends Te.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=As,this.contextRoot=new gt}render(){return xs.html`
1
+ "use strict";(()=>{var ja=Object.create;var bn=Object.defineProperty;var Ba=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var Ka=Object.getPrototypeOf,Fa=Object.prototype.hasOwnProperty;var De=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Ga=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Va(t))!Fa.call(e,i)&&i!==r&&bn(e,i,{get:()=>t[i],enumerable:!(n=Ba(t,i))||n.enumerable});return e};var g=(e,t,r)=>(r=e!=null?ja(Ka(e)):{},Ga(t||!e||!e.__esModule?bn(r,"default",{value:e,enumerable:!0}):r,e));var C=De((eu,En)=>{En.exports=ftGlobals.wcUtils});var j=De((ru,Cn)=>{Cn.exports=ftGlobals.litDecorators});var B=De((mu,Nn)=>{Nn.exports=ftGlobals.lit});var Ds=De((Gp,Ps)=>{Ps.exports=ftGlobals.litRepeat});var Us=De((qp,ks)=>{ks.exports=ftGlobals.litUnsafeHTML});var gn=De((Nf,ba)=>{ba.exports=ftGlobals.litClassMap});var $a=g(C());var hr=g(C());var P=g(C()),Sn={itemsGap:P.FtCssVariableFactory.create("--ft-reader-attachments-items-gap","","SIZE","8px"),itemPadding:P.FtCssVariableFactory.create("--ft-reader-attachments-item-padding","","SIZE","8px"),itemBorderWidth:P.FtCssVariableFactory.create("--ft-reader-attachments-item-border-width","","SIZE","1px"),itemBorderColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-border-color","",P.designSystemVariables.colorOutline),itemBorderRadius:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-border-radius","",P.designSystemVariables.borderRadiusS),itemBackgroundColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-background-color","",P.designSystemVariables.colorSurface),itemTextColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-text-color","",P.designSystemVariables.colorOnSurfaceMedium),itemHoverBackgroundColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-hover-background-color","",P.designSystemVariables.colorPrimary),itemHoverTextColor:P.FtCssVariableFactory.extend("--ft-reader-attachments-item-hover-text-color","",P.designSystemVariables.colorOnSurfaceHigh),fileFormatIconSize:P.FtCssVariableFactory.create("--ft-reader-attachments-file-format-icon-size","","SIZE","30px"),downloadIconSize:P.FtCssVariableFactory.create("--ft-reader-attachments-down-icon-size","","SIZE","20px")};var Lt=g(C()),_n=g(j());var wt;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update",e.visibleTopicChange="visible-topic-change",e.requestedTopicNotFound="requested-topic-not-found"})(wt||(wt={}));var On;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(On||(On={}));var Wa=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},yr=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},mr=Symbol("registerInterval"),vr=(0,Lt.applyMixinOnce)(Symbol("toFtReaderComponent"),function(e){var t;class r extends e{constructor(){super(...arguments),this[t]=0}setReaderStateManager(i){this.clearStateManager(),this.stateManager=i,this.addStore(i.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var i;return(i=this.stateManager)===null||i===void 0?void 0:i.service}connectedCallback(){super.connectedCallback(),this[mr]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[mr]):this.dispatchEvent(new yr)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=mr,Wa([(0,_n.state)()],r.prototype,"stateManager",void 0),r}),Tn=class extends vr(Lt.FtLitElementRedux){};var Kr=g(j());var Rn=g(j(),1);var gr=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function wn(e,t){return(0,Rn.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return ct(e);try{return JSON.parse(r)}catch{return ct(e)}},toAttribute:r=>JSON.stringify(r)},hasChanged:dt,...t??{}})}function za(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(!Nt(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(!Nt(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=a=>Object.keys(a).filter(o=>a[o]!=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 a=s[n];if(!Nt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Nt(e,t){try{return za(e,t)}catch{return!1}}function dt(e,t){return!Nt(e,t)}function ct(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function Pt(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 Ln=g(j(),1);var Ar=e=>{let t=e??{};return(r,n)=>{var i;let s={hasChanged:dt,attribute:!1,...t};(0,Ln.property)(s)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:(o=>o[n]),store:t.store})}};var Dt=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 ge=g(j(),1);var Mt=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 a of n)try{await a()}catch(o){i(o);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 Dn=g(B(),1);var It=globalThis,qa=It.ShadowRoot&&(It.ShadyCSS===void 0||It.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var Pn=(e,t)=>{if(qa)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),i=It.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}};var kt=class extends Dn.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 Pn(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){gr(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 Mn(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 Ie=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Hn,In=Symbol("constructorPrototype"),kn=Symbol("constructorName"),$n=Symbol("exportpartsDebouncer"),Un=Symbol("dynamicDependenciesLoaded"),Me=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Me.eventName="exportparts-updated";var ee=class extends kt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Hn]=new Mt(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[$n].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[kn]=this.constructor.name,this[In]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[kn]&&Object.setPrototypeOf(this,this[In])}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[Un]||(r[Un]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Me.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Me.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 Me)})}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=Mn(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,a,o;let u=p=>p!=null&&p.trim().length>0,l=t.filter(u).map(p=>p.trim());if(l.length===0){this.exportparts=void 0;return}let c=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let y=(s=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],h=(o=(a=p.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(b=>b.split(":")[1]))!==null&&o!==void 0?o:[],v=[...y,...h].filter(u).map(b=>b.trim());for(let b of v)c.add(b)}if(c.size===0){this.exportparts=void 0;return}let d=[...c.values()].flatMap(p=>l.map(y=>`${p}:${y}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};Hn=$n;Ie([(0,ge.property)()],ee.prototype,"exportpartsPrefix",void 0);Ie([wn([])],ee.prototype,"exportpartsPrefixes",void 0);Ie([(0,ge.property)({reflect:!0})],ee.prototype,"exportparts",void 0);Ie([(0,ge.property)()],ee.prototype,"customStylesheet",void 0);Ie([(0,ge.property)()],ee.prototype,"elementToFocus",void 0);Ie([(0,ge.state)()],ee.prototype,"useAdoptedStyleSheets",void 0);function Ut(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var pt=Symbol("internalReduxEventsUnsubscribers"),ce=Symbol("internalStoresUnsubscribers"),Ae=Symbol("internalStores"),Ya=Pt(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(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[Ae].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ae].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[Ae].get(a)}addStore(a,o){var u;o=(u=o??a.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(o),this[Ae].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[Ae].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Ae].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let u=this.constructor.getPropertyOptions(o);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:o)){let l=this.getStore(a.store);l&&(a.store?this[ce].has(a.store):this[ce].size>0)&&(this[o]=a.selector(l.getState(),this))}})}subscribeToStore(a,o){var u;this[ce].set(a,o.subscribe(()=>this.updateFromStores())),this[pt].set(a,[]),Ut(o)&&o.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((l,c)=>{if(typeof this[c]=="function"&&(!l.store||o.name===l.store)){let d=p=>this[c](p);o.addEventListener(l.eventName,d),this[pt].get(a).push(()=>o.removeEventListener(l.eventName,d))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[ce].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[ce].has(a)&&this[ce].get(a)(),this[ce].delete(a),(o=this[pt].get(a))===null||o===void 0||o.forEach(u=>u()),this[pt].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=ce,r=Ae,n=pt,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),jn=class extends Ya(ee){};function G(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(a){return"'"+a+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ie(e){return!!e&&!!e[T]}function J(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)===no})(e)||Array.isArray(e)||!!e[zn]||!!(!((t=e.constructor)===null||t===void 0)&&t[zn])||Rr(e)||wr(e))}function xe(e,t,r){r===void 0&&(r=!1),He(e)===0?(r?Object.keys:Ue)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function He(e){var t=e[T];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Rr(e)?2:wr(e)?3:0}function ke(e,t){return He(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xa(e,t){return He(e)===2?e.get(t):e[t]}function qn(e,t,r){var n=He(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Yn(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Rr(e){return to&&e instanceof Map}function wr(e){return ro&&e instanceof Set}function de(e){return e.o||e.t}function Lr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Qn(e);delete t[T];for(var r=Ue(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 Nr(e,t){return t===void 0&&(t=!1),Pr(e)||ie(e)||!J(e)||(He(e)>1&&(e.set=e.add=e.clear=e.delete=Ja),Object.freeze(e),t&&xe(e,(function(r,n){return Nr(n,!0)}),!0)),e}function Ja(){G(2)}function Pr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function te(e){var t=_r[e];return t||G(18,e),t}function Qa(e,t){_r[e]||(_r[e]=t)}function Cr(){return ht}function xr(e,t){t&&(te("Patches"),e.u=[],e.s=[],e.v=t)}function Ht(e){Or(e),e.p.forEach(Za),e.p=null}function Or(e){e===ht&&(ht=e.l)}function Bn(e){return ht={p:[],l:ht,h:e,m:!0,_:0}}function Za(e){var t=e[T];t.i===0||t.i===1?t.j():t.g=!0}function br(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||te("ES5").S(t,e,n),n?(r[T].P&&(Ht(t),G(4)),J(e)&&(e=$t(t,e),t.l||jt(t,e)),t.u&&te("Patches").M(r[T].t,e,t.u,t.s)):e=$t(t,r,[]),Ht(t),t.u&&t.v(t.u,t.s),e!==Jn?e:void 0}function $t(e,t,r){if(Pr(t))return t;var n=t[T];if(!n)return xe(t,(function(o,u){return Vn(e,n,t,o,u,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return jt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Lr(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),xe(s,(function(o,u){return Vn(e,n,i,o,u,r,a)})),jt(e,i,!1),r&&e.u&&te("Patches").N(n,r,e.u,e.s)}return n.o}function Vn(e,t,r,n,i,s,a){if(ie(i)){var o=$t(e,i,s&&t&&t.i!==3&&!ke(t.R,n)?s.concat(n):void 0);if(qn(r,n,o),!ie(o))return;e.m=!1}else a&&r.add(i);if(J(i)&&!Pr(i)){if(!e.h.D&&e._<1)return;$t(e,i),t&&t.A.l||jt(e,i)}}function jt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Nr(t,r)}function Er(e,t){var r=e[T];return(r?de(r):e)[t]}function Kn(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 pe(e){e.P||(e.P=!0,e.l&&pe(e.l))}function Sr(e){e.o||(e.o=Lr(e.t))}function Tr(e,t,r){var n=Rr(t)?te("MapSet").F(t,r):wr(t)?te("MapSet").T(t,r):e.O?(function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:Cr(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=o,l=mt;a&&(u=[o],l=ft);var c=Proxy.revocable(u,l),d=c.revoke,p=c.proxy;return o.k=p,o.j=d,p})(t,r):te("ES5").J(t,r);return(r?r.A:Cr()).p.push(n),n}function eo(e){return ie(e)||G(22,e),(function t(r){if(!J(r))return r;var n,i=r[T],s=He(r);if(i){if(!i.P&&(i.i<4||!te("ES5").K(i)))return i.t;i.I=!0,n=Fn(r,s),i.I=!1}else n=Fn(r,s);return xe(n,(function(a,o){i&&Xa(i.t,a)===o||qn(n,a,t(o))})),s===3?new Set(n):n})(e)}function Fn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Lr(e)}function Xn(){function e(a,o){var u=s[a];return u?u.enumerable=o:s[a]=u={configurable:!0,enumerable:o,get:function(){var l=this[T];return mt.get(l,a)},set:function(l){var c=this[T];mt.set(c,a,l)}},u}function t(a){for(var o=a.length-1;o>=0;o--){var u=a[o][T];if(!u.P)switch(u.i){case 5:n(u)&&pe(u);break;case 4:r(u)&&pe(u)}}}function r(a){for(var o=a.t,u=a.k,l=Ue(u),c=l.length-1;c>=0;c--){var d=l[c];if(d!==T){var p=o[d];if(p===void 0&&!ke(o,d))return!0;var y=u[d],h=y&&y[T];if(h?h.t!==p:!Yn(y,p))return!0}}var v=!!o[T];return l.length!==Ue(o).length+(v?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var u=Object.getOwnPropertyDescriptor(o,o.length-1);if(u&&!u.get)return!0;for(var l=0;l<o.length;l++)if(!o.hasOwnProperty(l))return!0;return!1}function i(a){a.g&&G(3,JSON.stringify(de(a)))}var s={};Qa("ES5",{J:function(a,o){var u=Array.isArray(a),l=(function(d,p){if(d){for(var y=Array(p.length),h=0;h<p.length;h++)Object.defineProperty(y,""+h,e(h,!0));return y}var v=Qn(p);delete v[T];for(var b=Ue(v),E=0;E<b.length;E++){var S=b[E];v[S]=e(S,d||!!v[S].enumerable)}return Object.create(Object.getPrototypeOf(p),v)})(u,a),c={i:u?5:4,A:o?o.A:Cr(),P:!1,I:!1,R:{},l:o,t:a,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,T,{value:c,writable:!0}),l},S:function(a,o,u){u?ie(o)&&o[T].A===a&&t(a.p):(a.u&&(function l(c){if(c&&typeof c=="object"){var d=c[T];if(d){var p=d.t,y=d.k,h=d.R,v=d.i;if(v===4)xe(y,(function(O){O!==T&&(p[O]!==void 0||ke(p,O)?h[O]||l(y[O]):(h[O]=!0,pe(d)))})),xe(p,(function(O){y[O]!==void 0||ke(y,O)||(h[O]=!1,pe(d))}));else if(v===5){if(n(d)&&(pe(d),h.length=!0),y.length<p.length)for(var b=y.length;b<p.length;b++)h[b]=!1;else for(var E=p.length;E<y.length;E++)h[E]=!0;for(var S=Math.min(y.length,p.length),_=0;_<S;_++)y.hasOwnProperty(_)||(h[_]=!0),h[_]===void 0&&l(y[_])}}}})(a.p[0]),t(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var Gn,ht,Dr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",to=typeof Map<"u",ro=typeof Set<"u",Wn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Jn=Dr?Symbol.for("immer-nothing"):((Gn={})["immer-nothing"]=!0,Gn),zn=Dr?Symbol.for("immer-draftable"):"__$immer_draftable",T=Dr?Symbol.for("immer-state"):"__$immer_state";var no=""+Object.prototype.constructor,Ue=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Qn=Object.getOwnPropertyDescriptors||function(e){var t={};return Ue(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},_r={},mt={get:function(e,t){if(t===T)return e;var r=de(e);if(!ke(r,t))return(function(i,s,a){var o,u=Kn(s,a);return u?"value"in u?u.value:(o=u.get)===null||o===void 0?void 0:o.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!J(n)?n:n===Er(e.t,t)?(Sr(e),e.o[t]=Tr(e.A.h,n,e)):n},has:function(e,t){return t in de(e)},ownKeys:function(e){return Reflect.ownKeys(de(e))},set:function(e,t,r){var n=Kn(de(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var i=Er(de(e),t),s=i?.[T];if(s&&s.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Yn(r,i)&&(r!==void 0||ke(e.t,t)))return!0;Sr(e),pe(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 Er(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Sr(e),pe(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=de(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){G(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){G(12)}},ft={};xe(mt,(function(e,t){ft[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ft.deleteProperty=function(e,t){return ft.set.call(this,e,t,void 0)},ft.set=function(e,t,r){return mt.set.call(this,e[0],t,r,e[0])};var io=(function(){function e(r){var n=this;this.O=Wn,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var u=n;return function(v){var b=this;v===void 0&&(v=o);for(var E=arguments.length,S=Array(E>1?E-1:0),_=1;_<E;_++)S[_-1]=arguments[_];return u.produce(v,(function(O){var le;return(le=s).call.apply(le,[b,O].concat(S))}))}}var l;if(typeof s!="function"&&G(6),a!==void 0&&typeof a!="function"&&G(7),J(i)){var c=Bn(n),d=Tr(n,i,void 0),p=!0;try{l=s(d),p=!1}finally{p?Ht(c):Or(c)}return typeof Promise<"u"&&l instanceof Promise?l.then((function(v){return xr(c,a),br(v,c)}),(function(v){throw Ht(c),v})):(xr(c,a),br(l,c))}if(!i||typeof i!="object"){if((l=s(i))===void 0&&(l=i),l===Jn&&(l=void 0),n.D&&Nr(l,!0),a){var y=[],h=[];te("Patches").M(i,l,y,h),a(y,h)}return l}G(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(l){for(var c=arguments.length,d=Array(c>1?c-1:0),p=1;p<c;p++)d[p-1]=arguments[p];return n.produceWithPatches(l,(function(y){return i.apply(void 0,[y].concat(d))}))};var a,o,u=n.produce(i,s,(function(l,c){a=l,o=c}));return typeof Promise<"u"&&u instanceof Promise?u.then((function(l){return[l,a,o]})):[u,a,o]},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){J(r)||G(8),ie(r)&&(r=eo(r));var n=Bn(this),i=Tr(this,r,void 0);return i[T].C=!0,Or(n),i},t.finishDraft=function(r,n){var i=r&&r[T],s=i.A;return xr(s,n),br(void 0,s)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Wn&&G(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 a=te("Patches").$;return ie(r)?a(r,n):this.produce(r,(function(o){return a(o,n)}))},e})(),V=new io,so=V.produce,Nu=V.produceWithPatches.bind(V),Pu=V.setAutoFreeze.bind(V),Du=V.setUseProxies.bind(V),Mu=V.applyPatches.bind(V),Iu=V.createDraft.bind(V),ku=V.finishDraft.bind(V),Bt=so;function be(e){"@babel/helpers - typeof";return be=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},be(e)}function Zn(e,t){if(be(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(be(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ei(e){var t=Zn(e,"string");return be(t)=="symbol"?t:t+""}function ti(e,t,r){return(t=ei(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ri(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 Mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){ti(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(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 ni=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ir=function(){return Math.random().toString(36).substring(7).split("").join(".")},Vt={INIT:"@@redux/INIT"+Ir(),REPLACE:"@@redux/REPLACE"+Ir(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ir()}};function ao(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 kr(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(kr)(e,t)}if(typeof e!="function")throw new Error(k(2));var i=e,s=t,a=[],o=a,u=!1;function l(){o===a&&(o=a.slice())}function c(){if(u)throw new Error(k(3));return s}function d(v){if(typeof v!="function")throw new Error(k(4));if(u)throw new Error(k(5));var b=!0;return l(),o.push(v),function(){if(b){if(u)throw new Error(k(6));b=!1,l();var S=o.indexOf(v);o.splice(S,1),a=null}}}function p(v){if(!ao(v))throw new Error(k(7));if(typeof v.type>"u")throw new Error(k(8));if(u)throw new Error(k(9));try{u=!0,s=i(s,v)}finally{u=!1}for(var b=a=o,E=0;E<b.length;E++){var S=b[E];S()}return v}function y(v){if(typeof v!="function")throw new Error(k(10));i=v,p({type:Vt.REPLACE})}function h(){var v,b=d;return v={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(k(11));function _(){S.next&&S.next(c())}_();var O=b(_);return{unsubscribe:O}}},v[ni]=function(){return this},v}return p({type:Vt.INIT}),n={dispatch:p,subscribe:d,getState:c,replaceReducer:y},n[ni]=h,n}function oo(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Vt.INIT});if(typeof n>"u")throw new Error(k(12));if(typeof r(void 0,{type:Vt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(k(13))})}function ii(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),a,o;try{oo(r)}catch(u){o=u}return function(l,c){if(l===void 0&&(l={}),o)throw o;if(0)var d;for(var p=!1,y={},h=0;h<s.length;h++){var v=s[h],b=r[v],E=l[v],S=b(E,c);if(typeof S>"u"){var _=c&&c.type;throw new Error(k(14))}y[v]=S,p=p||S!==E}return p=p||s.length!==Object.keys(l).length,p?y:l}}function $e(){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 si(){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))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=t.map(function(u){return u(a)});return s=$e.apply(void 0,o)(i.dispatch),Mr(Mr({},i),{},{dispatch:s})}}}function ai(e){var t=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,e):a(o)}}};return t}var oi=ai();oi.withExtraArgument=ai;var Ur=oi;var pi=(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)}})(),uo=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},je=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},lo=Object.defineProperty,co=Object.defineProperties,po=Object.getOwnPropertyDescriptors,ui=Object.getOwnPropertySymbols,fo=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,li=function(e,t,r){return t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},fe=function(e,t){for(var r in t||(t={}))fo.call(t,r)&&li(e,r,t[r]);if(ui)for(var n=0,i=ui(t);n<i.length;n++){var r=i[n];ho.call(t,r)&&li(e,r,t[r])}return e},Hr=function(e,t){return co(e,po(t))},mo=function(e,t,r){return new Promise(function(n,i){var s=function(u){try{o(r.next(u))}catch(l){i(l)}},a=function(u){try{o(r.throw(u))}catch(l){i(l)}},o=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,a)};o((r=r.apply(e,t)).next())})};var yo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$e:$e.apply(null,arguments)},el=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function vo(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 he(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 fe(fe({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 go=(function(e){pi(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,je([void 0],r[0].concat(this)))):new(t.bind.apply(t,je([void 0],r.concat(this))))},t})(Array),Ao=(function(e){pi(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,je([void 0],r[0].concat(this)))):new(t.bind.apply(t,je([void 0],r.concat(this))))},t})(Array);function Br(e){return J(e)?Bt(e,function(){}):e}function xo(e){return typeof e=="boolean"}function bo(){return function(t){return Eo(t)}}function Eo(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,a=s===void 0?!0:s,o=e.actionCreatorCheck,u=o===void 0?!0:o,l=new go;if(r&&(xo(r)?l.push(Ur):l.push(Ur.withExtraArgument(r.extraArgument))),0){if(i)var c;if(a)var d;if(u)var p}return l}var $r=!0;function fi(e){var t=bo(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?t():s,o=r.devTools,u=o===void 0?!0:o,l=r.preloadedState,c=l===void 0?void 0:l,d=r.enhancers,p=d===void 0?void 0:d,y;if(typeof i=="function")y=i;else if(vo(i))y=ii(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 h=a;if(typeof h=="function"&&(h=h(t),!$r&&!Array.isArray(h)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!$r&&h.some(function(O){return typeof O!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=si.apply(void 0,h),b=$e;u&&(b=yo(fe({trace:!$r},typeof u=="object"&&u)));var E=new Ao(v),S=E;Array.isArray(p)?S=je([v],p):typeof p=="function"&&(S=p(E));var _=b.apply(void 0,S);return kr(y,c,_)}function hi(e){var t={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(!o)throw new Error("`builder.addCase` cannot be called with an empty action type");if(o in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return e(i),[t,r,n]}function So(e){return typeof e=="function"}function Co(e,t,r,n){r===void 0&&(r=[]);var i=typeof t=="function"?hi(t):[t,r,n],s=i[0],a=i[1],o=i[2],u;if(So(e))u=function(){return Br(e())};else{var l=Br(e);u=function(){return l}}function c(d,p){d===void 0&&(d=u());var y=je([s[p.type]],a.filter(function(h){var v=h.matcher;return v(p)}).map(function(h){var v=h.reducer;return v}));return y.filter(function(h){return!!h}).length===0&&(y=[o]),y.reduce(function(h,v){if(v)if(ie(h)){var b=h,E=v(b,p);return E===void 0?h:E}else{if(J(h))return Bt(h,function(S){return v(S,p)});var E=v(h,p);if(E===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}return h},d)}return c.getInitialState=u,c}function Oo(e,t){return e+"/"+t}function mi(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:Br(e.initialState),n=e.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(c){var d=n[c],p=Oo(t,c),y,h;"reducer"in d?(y=d.reducer,h=d.prepare):y=d,s[c]=y,a[p]=y,o[c]=h?he(p,h):he(p)});function u(){var c=typeof e.extraReducers=="function"?hi(e.extraReducers):[e.extraReducers],d=c[0],p=d===void 0?{}:d,y=c[1],h=y===void 0?[]:y,v=c[2],b=v===void 0?void 0:v,E=fe(fe({},p),a);return Co(r,function(S){for(var _ in E)S.addCase(_,E[_]);for(var O=0,le=h;O<le.length;O++){var ne=le[O];S.addMatcher(ne.matcher,ne.reducer)}b&&S.addDefaultCase(b)})}var l;return{name:t,reducer:function(c,d){return l||(l=u()),l(c,d)},actions:o,caseReducers:s,getInitialState:function(){return l||(l=u()),l.getInitialState()}}}var To="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_o=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=To[Math.random()*64|0];return t},Ro=["name","message","stack","code"],jr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),ci=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),wo=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Ro;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},il=(function(){function e(t,r,n){var i=he(t+"/fulfilled",function(c,d,p,y){return{payload:c,meta:Hr(fe({},y||{}),{arg:p,requestId:d,requestStatus:"fulfilled"})}}),s=he(t+"/pending",function(c,d,p){return{payload:void 0,meta:Hr(fe({},p||{}),{arg:d,requestId:c,requestStatus:"pending"})}}),a=he(t+"/rejected",function(c,d,p,y,h){return{payload:y,error:(n&&n.serializeError||wo)(c||"Rejected"),meta:Hr(fe({},h||{}),{arg:p,requestId:d,rejectedWithValue:!!y,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"})}}),o=!1,u=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 l(c){return function(d,p,y){var h=n?.idGenerator?n.idGenerator(c):_o(),v=new u,b,E=!1;function S(O){b=O,v.abort()}var _=(function(){return mo(this,null,function(){var O,le,ne,ot,An,ut,xn;return uo(this,function(Pe){switch(Pe.label){case 0:return Pe.trys.push([0,4,,5]),ot=(O=n?.condition)==null?void 0:O.call(n,c,{getState:p,extra:y}),No(ot)?[4,ot]:[3,2];case 1:ot=Pe.sent(),Pe.label=2;case 2:if(ot===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=!0,An=new Promise(function(X,lt){return v.signal.addEventListener("abort",function(){return lt({name:"AbortError",message:b||"Aborted"})})}),d(s(h,c,(le=n?.getPendingMeta)==null?void 0:le.call(n,{requestId:h,arg:c},{getState:p,extra:y}))),[4,Promise.race([An,Promise.resolve(r(c,{dispatch:d,getState:p,extra:y,requestId:h,signal:v.signal,abort:S,rejectWithValue:function(X,lt){return new jr(X,lt)},fulfillWithValue:function(X,lt){return new ci(X,lt)}})).then(function(X){if(X instanceof jr)throw X;return X instanceof ci?i(X.payload,h,c,X.meta):i(X,h,c)})])];case 3:return ne=Pe.sent(),[3,5];case 4:return ut=Pe.sent(),ne=ut instanceof jr?a(null,h,c,ut.payload,ut.meta):a(ut,h,c),[3,5];case 5:return xn=n&&!n.dispatchConditionRejection&&a.match(ne)&&ne.meta.condition,xn||d(ne),[2,ne]}})})})();return Object.assign(_,{abort:S,requestId:h,arg:c,unwrap:function(){return _.then(Lo)}})}}return Object.assign(l,{pending:s,rejected:a,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function Lo(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function No(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var yi="listener",vi="completed",gi="cancelled",sl="task-"+gi,al="task-"+vi,ol=yi+"-"+gi,ul=yi+"-"+vi;var Vr="listenerMiddleware";var ll=he(Vr+"/add"),cl=he(Vr+"/removeAll"),dl=he(Vr+"/remove");var di,pl=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(di||(di=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Po=function(e){return function(t){setTimeout(t,e)}},fl=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Po(10);Xn();var Do=Pt(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)}}}),Kt=class extends Do(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ai=class e extends Kt{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(Ut(s))return s;if(i==null)return;let a=mi({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=fi({reducer:(u,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let c=ct(a.getInitialState());for(let d of l.keeping)c[d]=(u??c)[d];return c}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...l.overwrites};return a.reducer(u,l)}});return window.ftReduxStores[i.name]=new e(a,o,i.eventBus)}constructor(t,r,n){super(),this.reduxSlice=t,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Dt;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,o)=>{let u=a,l=s[u];return l?(...c)=>{let d=l(...c.map(i));return this.reduxStore.dispatch(d),d}:c=>{this.setState({[u]: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 Ft=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 a=typeof t=="string"?new Date(t):t,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),u=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return s?u:i?`${o} ${u}`:o}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 Gt=g(C()),Mo="ft-app-info",Be=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Be.eventName="authentication-change";var yt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};yt.eventName="ui-locale-changed";var Io={session:(e,t)=>{(0,Gt.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>x.dispatchEvent(new Be(t.payload)),0))}},x=Gt.FtReduxStore.get({name:Mo,reducers:Io,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var xi=g(C()),Wt=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Bl=(0,xi.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(x)}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(o=>o.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?o=>Ft.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Wt([(0,Kr.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Wt([(0,Kr.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Wt([Ar({store:x.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),Wt([Ar({store:x.name})],t.prototype,"uiLocale",void 0),t});var bi;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(bi||(bi={}));var Ei;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Ei||(Ei={}));var Si;(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"})(Si||(Si={}));var Ci;(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"})(Ci||(Ci={}));var Oi;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Oi||(Oi={}));var Ti;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Ti||(Ti={}));var _i;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(_i||(_i={}));var Ri;(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"})(Ri||(Ri={}));var wi;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(wi||(wi={}));var Li;(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"})(Li||(Li={}));var Ni;(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"})(Ni||(Ni={}));var Pi;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Pi||(Pi={}));var Di;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Di||(Di={}));var Mi;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Mi||(Mi={}));var Ii;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Ii||(Ii={}));var ki;(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"})(ki||(ki={}));var Ui;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Ui||(Ui={}));var Hi;(function(e){e.ASC="ASC",e.DESC="DESC"})(Hi||(Hi={}));var $i;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})($i||($i={}));var ji;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ji||(ji={}));var Bi;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Bi||(Bi={}));var Vi;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Vi||(Vi={}));var Ki;(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"})(Ki||(Ki={}));var Fi;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Fi||(Fi={}));var Gi;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Gi||(Gi={}));var Wi;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Wi||(Wi={}));var zi;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(zi||(zi={}));var L;(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"})(L||(L={}));var W;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(W||(W={}));var qi;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(qi||(qi={}));var Yi;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Yi||(Yi={}));var Xi;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Xi||(Xi={}));var Ji;(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"})(Ji||(Ji={}));var Qi;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Qi||(Qi={}));var Zi;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Zi||(Zi={}));var es;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(es||(es={}));var ts;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(ts||(ts={}));var rs;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(rs||(rs={}));var ns;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(ns||(ns={}));var is;(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"})(is||(is={}));var ss;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(ss||(ss={}));var ko={[L.PERSONAL_BOOK_SHARE_USER]:[L.PERSONAL_BOOK_USER],[L.HTML_EXPORT_USER]:[L.PERSONAL_BOOK_USER],[L.PDF_EXPORT_USER]:[L.PERSONAL_BOOK_USER],[L.KHUB_ADMIN]:[L.CONTENT_PUBLISHER],[L.ADMIN]:[L.KHUB_ADMIN,L.USERS_ADMIN,L.PORTAL_ADMIN,L.BEHAVIOR_DATA_USER],[L.GENERATIVE_AI_EXPORT_USER]:[L.GENERATIVE_AI_USER]};function as(e,t){return e===t||(ko[e]??[]).some(r=>as(r,t))}function os(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=>as(n,t))}var Jt=g(C());var Fr=g(C());var Ee=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=x.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=x.subscribe(()=>{n=e.get(t),n&&(i(),r(n))})}})}};var Ve=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Ee.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ee.await()}};var K=class extends Ve{constructor(t=!0,r){var n;super(r),this.sortObjectFields=(s,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[u])=>o.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Fr.CacheRegistry,this.cache=t?i.commonCache:new Fr.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 zt=class extends K{async listMySearches(){let{session:t}=x.getState();return os(t,L.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var qt=class extends K{async listMyBookmarks(){let t=x.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Yt=class extends K{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=x.getState().session;return!!t?.sessionAuthenticated}};var Xt=class extends K{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=x.getState().session;return!!t?.sessionAuthenticated}};var Uo="ft-user-assets",Ho={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(W).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;Wr(e,r,[...Gr(e,r),i]),us(e,r,1,n),ls(e,i)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;Wr(e,r,Gr(e,r).map(i=>i.id===n.id?n:i)),ls(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:i}=t.payload;Wr(e,r,Gr(e,r).filter(s=>s.id!==i)),us(e,r,-1,n)}},cs={[W.SEARCHES]:"savedSearches",[W.BOOKMARKS]:"bookmarks",[W.BOOKS]:void 0,[W.COLLECTIONS]:void 0},Gr=(e,t)=>{var r;let n=cs[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},Wr=(e,t,r)=>{let n=cs[t];n&&(e[n]=r)},us=(e,t,r,n)=>{let i=e.assetCounts.allAsset[t];if(i!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,i+r),t===W.BOOKMARKS&&n)){let s=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},ls=(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)},U=Jt.FtReduxStore.get({name:Uo,reducers:Ho,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(W).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),zr=class{constructor(t=new Yt,r=new Xt){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=x.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new qt,this.savedSearchesService=new zt,x.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=x.getState();(0,Jt.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(),U.actions.clearAssetCount(),U.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),U.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),U.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();U.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();U.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&U.getState().assetCounts.allAsset[t]!==r.count&&U.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&U.getState().assetCounts.bookmarkByMap[t]!==r.count&&U.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(U.getState().assetCounts.bookmarkByMap).length!==0;t===W.BOOKMARKS&&r&&U.actions.clearBookmarkCountByMap(),U.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;U.actions.bookmarks(r)}}},$o=new zr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=$o);var qr=class{addCommand(t,r=!1){x.commands.add(t,r)}consumeCommand(t){return x.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new qr;var z=g(C());var ds,Ke=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},jo=Symbol("clearAfterUnitTest"),Qt=class extends(0,z.withEventBus)(K){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ds]=()=>{this.defaultMessages={},this.cache=new z.CacheRegistry,this.listeners={}},this.currentUiLocale=x.getState().uiLocale,x.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=x.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,z.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(),a=this.resolveContext(s);return new z.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},a).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 z.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 Ke({loadedContexts:t})),this.dispatchEvent(new Ke({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new Ke({loadedContexts:[t]})),this.dispatchEvent(new Ke({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,z.delay)(0).then(()=>n()).catch(()=>null)))}};ds=jo;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Qt{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Qt{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Fe=window.FluidTopicsI18nService,Zt=window.FluidTopicsCustomI18nService;var ps=g(C()),Yr=class{highlightHtml(t,r,n){(0,ps.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new Yr;var fs=g(C());var Xr=class{isDate(t){var r,n,i,s;return(s=(i=((n=(r=x.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===t))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(t,r){var n,i,s,a;if(t==null)return"";try{return fs.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:x.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(t)} is not valid`,o),o}}};window.FluidTopicsDateService=new Xr;var hs=g(C());var vt=class{static get(t,r){var n,i,s,a;let o=x.getState(),{lang:u,region:l}=(s=(i=(n=o.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 hs.SearchPlaceConverter(o.baseUrl,t??20,(a=o.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed,r??`${u}-${l}`)}};var Jr=class{urlToSearchRequest(t){return vt.get().parse(t)}searchRequestToUrl(t){return vt.get().serialize(t)}};window.FluidTopicsUrlService=new Jr;var se=g(C());var Se=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Se.eventName="change";var Qr=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))}},ms=new Qr;var er=class e extends se.WithEventBus{static build(){return new e(window.history,ms,()=>window.location,!1)}constructor(t,r,n,i){var s,a;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(a=(s=t.state)===null||s===void 0?void 0:s.index)!==null&&a!==void 0?a: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,se.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Se(this.currentItem())),0)}installProxies(){let t=r=>(n,i,[s,a,o])=>{let u=r(),l={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(i,[l,a,o]),this.setCurrentState(l,!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(Se.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Se.eventName,t)}currentItem(){return(0,se.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,se.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,se.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,se.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 ys=g(B());var vs=ys.css`
2
+ `;var xs=g(B()),H=g(j()),Te=g(C());var Ce=g(C());function gs(e,t){let{authenticationRequired:r,session:n}=x.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var tr=class extends Ve{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var Zr=class e extends Ce.FtStateManager{static build(t){return new e(x,t)}constructor(t,r){super(),this.store=t,this.cache=new Ce.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new tr,this.cleanSessionDebouncer=new Ce.Debouncer,this.reloadDebouncer=new Ce.Debouncer(500),this.apiProvider=r??(()=>Ee.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener(Be.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",()=>gs(()=>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}setTenantId(t){this.store.actions.tenantId(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,r){this.userLocaleService.updateUiLocale({uiLocale:t,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new yt(n)))}).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)}},As=Zr.build();var Oe=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 gt=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 a=i.deref(),o=s.deref();a===void 0||o===void 0||a.dispatchEvent(new Oe(t.context,a,o,!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 M=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},R=class extends Te.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=As,this.contextRoot=new gt}render(){return xs.html`
3
3
  <slot></slot>
4
- `}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("tenantId")&&this.stateManager.setTenantId(this.tenantId),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=>Fe.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())}};R.elementDefinitions={};R.styles=vs;I([(0,H.property)()],R.prototype,"baseUrl",void 0);I([(0,H.property)()],R.prototype,"tenantId",void 0);I([(0,H.property)()],R.prototype,"apiIntegrationIdentifier",void 0);I([(0,H.property)()],R.prototype,"apiIntegrationAppVersion",void 0);I([(0,H.property)()],R.prototype,"uiLocale",void 0);I([(0,Te.jsonProperty)(null)],R.prototype,"availableUiLocales",void 0);I([(0,Te.jsonProperty)(null)],R.prototype,"metadataConfiguration",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"editorMode",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"noCustom",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"openExternalDocumentInNewTab",void 0);I([(0,H.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],R.prototype,"noCustomComponent",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"withManualResources",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"navigatorOnline",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"forcedOffline",void 0);I([(0,H.property)({type:Boolean})],R.prototype,"authenticationRequired",void 0);I([(0,Te.jsonProperty)([])],R.prototype,"messageContexts",void 0);I([(0,Te.jsonProperty)(void 0)],R.prototype,"session",void 0);var Es=g(C());var bs={"ft-app-context":R};(0,Es.customElements)(bs);var rr=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?Zt:Fe}constructor(t,r=!1){this.name=t,this.custom=r,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return a=>({context:this.name,key:s,custom:this.custom,args:typeof a=="function"?void 0:a,argsProvider:typeof a=="function"?a: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 Ge=g(C());var Os=g(j());var en=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-]+$/)}},Ss=new en;var Ko=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Fo=Symbol("i18nAttributes"),Go=Symbol("i18nListAttributes"),Ts=Symbol("i18nProperties"),nr=Symbol("i18nContexts"),At=Symbol("i18nUnsubs"),sr=(0,Ge.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?Zt:Fe}i18n(s){let{context:a,key:o,message:u}=s,{custom:l,args:c,argsProvider:d}=s;if(a&&o){this.hasI18nContext(a)||this.addI18nContext(a,void 0,l);let p=c??(d?d(this):[]);return this.getI18nService(l).resolveMessage(a,o,...p)}return u}async awaitI18n(s){let{context:a,custom:o}=s;return a&&await this.getI18nService(o).prepareContext(a),this.i18n(s)}customI18n(s,a){if(Ss.isI18nKey(s)){let[o,u]=s.split(".");return this.i18n({custom:!0,context:o,key:u,...a})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((a,o,u)=>s.has(o)||typeof a.argsProvider=="function"),this.updateI18nProperties(a=>typeof a.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((a,o,u)=>{var l;return((l=u?.context)===null||l===void 0?void 0:l.toLowerCase())===s}),this.updateI18nProperties(a=>a.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var a,o;let u=this,l=(c,d,p)=>p?.context&&p.key&&s(c,d,p)?{...p,message:this.i18n({context:p.context,key:p.key,custom:p.custom,...c})}:p;(a=this[Fo])===null||a===void 0||a.forEach((c,d)=>u[d]=l(c,d,u[d])),(o=this[Go])===null||o===void 0||o.forEach((c,d)=>{var p;return u[d]=(p=u[d])===null||p===void 0?void 0:p.map(y=>l(c,d,y))})}updateI18nProperties(s){var a;(a=this[Ts])===null||a===void 0||a.forEach((o,u)=>{s(o,u)&&(this[u]=this.i18n(o))})}addI18nMessages(s,a,o){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,a,o)}addI18nContext(s,a,o){let u=(typeof s=="string"?s:s.name).toLowerCase();o=typeof s=="string"?o:s.custom,this[nr].set(u,{isCustomContext:o}),this[At].has(u)||this[At].set(u,this.getI18nService(o).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(o).prepareContext(u,a)}hasI18nContext(s){return this[nr].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[nr].forEach((s,a)=>this.addI18nContext(a,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[At].forEach(s=>s()),this[At].clear()}}return t=nr,r=At,Ko([(0,Os.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Cs=class extends sr(Ge.FtLitElement){},ir=class extends sr(Ge.FtLitElementRedux){};var _s=g(B());var Rs=_s.css`
4
+ `}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("tenantId")&&this.stateManager.setTenantId(this.tenantId),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=>Fe.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())}};R.elementDefinitions={};R.styles=vs;M([(0,H.property)()],R.prototype,"baseUrl",void 0);M([(0,H.property)()],R.prototype,"tenantId",void 0);M([(0,H.property)()],R.prototype,"apiIntegrationIdentifier",void 0);M([(0,H.property)()],R.prototype,"apiIntegrationAppVersion",void 0);M([(0,H.property)()],R.prototype,"uiLocale",void 0);M([(0,Te.jsonProperty)(null)],R.prototype,"availableUiLocales",void 0);M([(0,Te.jsonProperty)(null)],R.prototype,"metadataConfiguration",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"editorMode",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"noCustom",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"openExternalDocumentInNewTab",void 0);M([(0,H.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],R.prototype,"noCustomComponent",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"withManualResources",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"navigatorOnline",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"forcedOffline",void 0);M([(0,H.property)({type:Boolean})],R.prototype,"authenticationRequired",void 0);M([(0,Te.jsonProperty)([])],R.prototype,"messageContexts",void 0);M([(0,Te.jsonProperty)(void 0)],R.prototype,"session",void 0);var Es=g(C());var bs={"ft-app-context":R};(0,Es.customElements)(bs);var rr=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?Zt:Fe}constructor(t,r=!1){this.name=t,this.custom=r,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return a=>({context:this.name,key:s,custom:this.custom,args:typeof a=="function"?void 0:a,argsProvider:typeof a=="function"?a: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 Ge=g(C());var Os=g(j());var en=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-]+$/)}},Ss=new en;var Ko=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Fo=Symbol("i18nAttributes"),Go=Symbol("i18nListAttributes"),Ts=Symbol("i18nProperties"),nr=Symbol("i18nContexts"),At=Symbol("i18nUnsubs"),sr=(0,Ge.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?Zt:Fe}i18n(s){let{context:a,key:o,message:u}=s,{custom:l,args:c,argsProvider:d}=s;if(a&&o){this.hasI18nContext(a)||this.addI18nContext(a,void 0,l);let p=c??(d?d(this):[]);return this.getI18nService(l).resolveMessage(a,o,...p)}return u}async awaitI18n(s){let{context:a,custom:o}=s;return a&&await this.getI18nService(o).prepareContext(a),this.i18n(s)}customI18n(s,a){if(Ss.isI18nKey(s)){let[o,u]=s.split(".");return this.i18n({custom:!0,context:o,key:u,...a})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((a,o,u)=>s.has(o)||typeof a.argsProvider=="function"),this.updateI18nProperties(a=>typeof a.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((a,o,u)=>{var l;return((l=u?.context)===null||l===void 0?void 0:l.toLowerCase())===s}),this.updateI18nProperties(a=>a.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var a,o;let u=this,l=(c,d,p)=>p?.context&&p.key&&s(c,d,p)?{...p,message:this.i18n({context:p.context,key:p.key,custom:p.custom,...c})}:p;(a=this[Fo])===null||a===void 0||a.forEach((c,d)=>u[d]=l(c,d,u[d])),(o=this[Go])===null||o===void 0||o.forEach((c,d)=>{var p;return u[d]=(p=u[d])===null||p===void 0?void 0:p.map(y=>l(c,d,y))})}updateI18nProperties(s){var a;(a=this[Ts])===null||a===void 0||a.forEach((o,u)=>{s(o,u)&&(this[u]=this.i18n(o))})}addI18nMessages(s,a,o){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,a,o)}addI18nContext(s,a,o){let u=(typeof s=="string"?s:s.name).toLowerCase();o=typeof s=="string"?o:s.custom,this[nr].set(u,{isCustomContext:o}),this[At].has(u)||this[At].set(u,this.getI18nService(o).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(o).prepareContext(u,a)}hasI18nContext(s){return this[nr].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[nr].forEach((s,a)=>this.addI18nContext(a,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[At].forEach(s=>s()),this[At].clear()}}return t=nr,r=At,Ko([(0,Os.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Cs=class extends sr(Ge.FtLitElement){},ir=class extends sr(Ge.FtLitElementRedux){};var _s=g(B());var Rs=_s.css`
5
5
  `;var ar=g(B()),or=g(j()),ur=g(C());var xt=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Q=class extends ir{constructor(){super(),this.editorMode=!1,this.addStore(x)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":ar.nothing:ar.html`
6
6
  <span class="ft-i18n">
7
7
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
8
8
  </span>
9
- `}update(t){var r;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(r=this.defaultMessage)!==null&&r!==void 0?r:""})}};Q.elementDefinitions={};Q.styles=Rs;xt([(0,ur.redux)()],Q.prototype,"editorMode",void 0);xt([(0,or.property)()],Q.prototype,"context",void 0);xt([(0,or.property)()],Q.prototype,"key",void 0);xt([(0,ur.jsonProperty)([])],Q.prototype,"args",void 0);xt([(0,or.property)()],Q.prototype,"defaultMessage",void 0);var Ls=g(C());var ws={"ft-i18n":Q};(0,Ls.customElements)(ws);var tn=rr.build("designedReaderAttachments"),Ns={download:"Download \u201C{0}\u201D"};var Le=g(B()),st=g(j()),at=g(C()),Da=g(Ds());var Is=g(B()),Z=g(C()),q={size:Z.FtCssVariableFactory.create("--ft-icon-font-size","","SIZE","24px"),fluidTopicsFontFamily:Z.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family","",Z.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-icons")),fileFormatFontFamily:Z.FtCssVariableFactory.extend("--ft-icon-file-format-font-family","",Z.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-mime")),materialFontFamily:Z.FtCssVariableFactory.extend("--ft-icon-material-font-family","",Z.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","Material Icons")),verticalAlign:Z.FtCssVariableFactory.create("--ft-icon-vertical-align","","UNKNOWN","unset")},Ms=[Is.css`
9
+ `}update(t){var r;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(r=this.defaultMessage)!==null&&r!==void 0?r:""})}};Q.elementDefinitions={};Q.styles=Rs;xt([(0,ur.redux)()],Q.prototype,"editorMode",void 0);xt([(0,or.property)()],Q.prototype,"context",void 0);xt([(0,or.property)()],Q.prototype,"key",void 0);xt([(0,ur.jsonProperty)([])],Q.prototype,"args",void 0);xt([(0,or.property)()],Q.prototype,"defaultMessage",void 0);var Ls=g(C());var ws={"ft-i18n":Q};(0,Ls.customElements)(ws);var tn=rr.build("designedReaderAttachments"),Ns={download:"Download \u201C{0}\u201D"};var Le=g(B()),st=g(j()),at=g(C()),Da=g(Ds());var Ms=g(B()),Z=g(C()),q={size:Z.FtCssVariableFactory.create("--ft-icon-font-size","","SIZE","24px"),fluidTopicsFontFamily:Z.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family","",Z.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-icons")),fileFormatFontFamily:Z.FtCssVariableFactory.extend("--ft-icon-file-format-font-family","",Z.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-mime")),materialFontFamily:Z.FtCssVariableFactory.extend("--ft-icon-material-font-family","",Z.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","Material Icons")),verticalAlign:Z.FtCssVariableFactory.create("--ft-icon-vertical-align","","UNKNOWN","unset")},Is=[Ms.css`
10
10
  :host, i.ft-icon {
11
11
  display: inline-flex;
12
12
  align-items: center;
@@ -59,7 +59,7 @@
59
59
  ${(0,js.unsafeHTML)(this.resolvedIcon)}
60
60
  <slot ?hidden=${r}></slot>
61
61
  </i>
62
- `}getTextContent(){var t,r;return(r=(t=this.slottedContent)===null||t===void 0?void 0:t.assignedNodes().map(n=>n.textContent).join("").trim())!==null&&r!==void 0?r:""}update(t){super.update(t),["value","variant"].some(r=>t.has(r))&&this.resolveIcon()}resolveIcon(){var t,r;let n=this.value||this.getTextContent();switch(this.variant){case me.file_format:this.resolvedIcon=(t=f[n.replace("-","_").toUpperCase()])!==null&&t!==void 0?t:n;break;case me.material:this.resolvedIcon=this.value||bt.nothing;break;default:this.resolvedIcon=(r=lr[n.replace("-","_").toUpperCase()])!==null&&r!==void 0?r:n;break}}firstUpdated(t){super.firstUpdated(t),setTimeout(()=>this.resolveIcon())}};F.elementDefinitions={};F.styles=Ms;Et([(0,ye.property)()],F.prototype,"variant",void 0);Et([(0,ye.property)()],F.prototype,"value",void 0);Et([(0,ye.property)({reflect:!0,attribute:"aria-hidden"})],F.prototype,"ariaHidden",void 0);Et([(0,ye.state)()],F.prototype,"resolvedIcon",void 0);Et([(0,ye.query)("slot")],F.prototype,"slottedContent",void 0);var Vs=g(C());var Bs={"ft-icon":F};(0,Vs.customElements)(Bs);var dn=globalThis,Ks=e=>e,cr=dn.trustedTypes,Fs=cr?cr.createPolicy("lit-html",{createHTML:e=>e}):void 0,Xs="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,Js="?"+ve,zo=`<${Js}>`,we=document,dr=()=>we.createComment(""),Ct=e=>e===null||typeof e!="object"&&typeof e!="function",pn=Array.isArray,qo=e=>pn(e)||typeof e?.[Symbol.iterator]=="function",sn=`[
62
+ `}getTextContent(){var t,r;return(r=(t=this.slottedContent)===null||t===void 0?void 0:t.assignedNodes().map(n=>n.textContent).join("").trim())!==null&&r!==void 0?r:""}update(t){super.update(t),["value","variant"].some(r=>t.has(r))&&this.resolveIcon()}resolveIcon(){var t,r;let n=this.value||this.getTextContent();switch(this.variant){case me.file_format:this.resolvedIcon=(t=f[n.replace("-","_").toUpperCase()])!==null&&t!==void 0?t:n;break;case me.material:this.resolvedIcon=this.value||bt.nothing;break;default:this.resolvedIcon=(r=lr[n.replace("-","_").toUpperCase()])!==null&&r!==void 0?r:n;break}}firstUpdated(t){super.firstUpdated(t),setTimeout(()=>this.resolveIcon())}};F.elementDefinitions={};F.styles=Is;Et([(0,ye.property)()],F.prototype,"variant",void 0);Et([(0,ye.property)()],F.prototype,"value",void 0);Et([(0,ye.property)({reflect:!0,attribute:"aria-hidden"})],F.prototype,"ariaHidden",void 0);Et([(0,ye.state)()],F.prototype,"resolvedIcon",void 0);Et([(0,ye.query)("slot")],F.prototype,"slottedContent",void 0);var Vs=g(C());var Bs={"ft-icon":F};(0,Vs.customElements)(Bs);var dn=globalThis,Ks=e=>e,cr=dn.trustedTypes,Fs=cr?cr.createPolicy("lit-html",{createHTML:e=>e}):void 0,Xs="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,Js="?"+ve,zo=`<${Js}>`,we=document,dr=()=>we.createComment(""),Ct=e=>e===null||typeof e!="object"&&typeof e!="function",pn=Array.isArray,qo=e=>pn(e)||typeof e?.[Symbol.iterator]=="function",sn=`[
63
63
  \f\r]`,St=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gs=/-->/g,Ws=/>/g,_e=RegExp(`>|${sn}(?:([^\\s"'>=/]+)(${sn}*=${sn}*(?:[^
64
64
  \f\r"'\`<>=]|("|')|))|$)`,"g"),zs=/'/g,qs=/"/g,Qs=/^(?:script|style|textarea|title)$/i,fn=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),Zs=fn(1),ea=fn(2),ta=fn(3),Ot=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),Ys=new WeakMap,Re=we.createTreeWalker(we,129);function ra(e,t){if(!pn(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fs!==void 0?Fs.createHTML(t):t}var Yo=(e,t)=>{let r=e.length-1,n=[],i,s=t===2?"<svg>":t===3?"<math>":"",a=St;for(let o=0;o<r;o++){let u=e[o],l,c,d=-1,p=0;for(;p<u.length&&(a.lastIndex=p,c=a.exec(u),c!==null);)p=a.lastIndex,a===St?c[1]==="!--"?a=Gs:c[1]!==void 0?a=Ws:c[2]!==void 0?(Qs.test(c[2])&&(i=RegExp("</"+c[2],"g")),a=_e):c[3]!==void 0&&(a=_e):a===_e?c[0]===">"?(a=i??St,d=-1):c[1]===void 0?d=-2:(d=a.lastIndex-c[2].length,l=c[1],a=c[3]===void 0?_e:c[3]==='"'?qs:zs):a===qs||a===zs?a=_e:a===Gs||a===Ws?a=St:(a=_e,i=void 0);let y=a===_e&&e[o+1].startsWith("/>")?" ":"";s+=a===St?u+zo:d>=0?(n.push(l),u.slice(0,d)+Xs+u.slice(d)+ve+y):u+ve+(d===-2?o:y)}return[ra(e,s+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},Tt=class e{constructor({strings:t,_$litType$:r},n){let i;this.parts=[];let s=0,a=0,o=t.length-1,u=this.parts,[l,c]=Yo(t,r);if(this.el=e.createElement(l,n),Re.currentNode=this.el.content,r===2||r===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Re.nextNode())!==null&&u.length<o;){if(i.nodeType===1){if(i.hasAttributes())for(let d of i.getAttributeNames())if(d.endsWith(Xs)){let p=c[a++],y=i.getAttribute(d).split(ve),h=/([.?@])?(.*)/.exec(p);u.push({type:1,index:s,name:h[2],strings:y,ctor:h[1]==="."?on:h[1]==="?"?un:h[1]==="@"?ln:ze}),i.removeAttribute(d)}else d.startsWith(ve)&&(u.push({type:6,index:s}),i.removeAttribute(d));if(Qs.test(i.tagName)){let d=i.textContent.split(ve),p=d.length-1;if(p>0){i.textContent=cr?cr.emptyScript:"";for(let y=0;y<p;y++)i.append(d[y],dr()),Re.nextNode(),u.push({type:2,index:++s});i.append(d[p],dr())}}}else if(i.nodeType===8)if(i.data===Js)u.push({type:2,index:s});else{let d=-1;for(;(d=i.data.indexOf(ve,d+1))!==-1;)u.push({type:7,index:s}),d+=ve.length-1}s++}}static createElement(t,r){let n=we.createElement("template");return n.innerHTML=t,n}};function We(e,t,r=e,n){if(t===Ot)return t;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=Ct(t)?void 0:t._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(e),i._$AT(e,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(t=We(e,i._$AS(e,t.values),i,n)),t}var an=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:n}=this._$AD,i=(t?.creationScope??we).importNode(r,!0);Re.currentNode=i;let s=Re.nextNode(),a=0,o=0,u=n[0];for(;u!==void 0;){if(a===u.index){let l;u.type===2?l=new pr(s,s.nextSibling,this,t):u.type===1?l=new u.ctor(s,u.name,u.strings,this,t):u.type===6&&(l=new cn(s,this,t)),this._$AV.push(l),u=n[++o]}a!==u?.index&&(s=Re.nextNode(),a++)}return Re.currentNode=we,i}p(t){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}},pr=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,n,i){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=We(this,t,r),Ct(t)?t===D||t==null||t===""?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==Ot&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):qo(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==D&&Ct(this._$AH)?this._$AA.nextSibling.data=t:this.T(we.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Tt.createElement(ra(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new an(i,this),a=s.u(this.options);s.p(r),this.T(a),this._$AH=s}}_$AC(t){let r=Ys.get(t.strings);return r===void 0&&Ys.set(t.strings,r=new Tt(t)),r}k(t){pn(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of t)i===r.length?r.push(n=new e(this.O(dr()),this.O(dr()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t!==this._$AB;){let n=Ks(t).nextSibling;Ks(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ze=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,n,i,s){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=D}_$AI(t,r=this,n,i){let s=this.strings,a=!1;if(s===void 0)t=We(this,t,r,0),a=!Ct(t)||t!==this._$AH&&t!==Ot,a&&(this._$AH=t);else{let o=t,u,l;for(t=s[0],u=0;u<s.length-1;u++)l=We(this,o[n+u],r,u),l===Ot&&(l=this._$AH[u]),a||=!Ct(l)||l!==this._$AH[u],l===D?t=D:t!==D&&(t+=(l??"")+s[u+1]),this._$AH[u]=l}a&&!i&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},on=class extends ze{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}},un=class extends ze{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==D)}},ln=class extends ze{constructor(t,r,n,i,s){super(t,r,n,i,s),this.type=5}_$AI(t,r=this){if((t=We(this,t,r,0)??D)===Ot)return;let n=this._$AH,i=t===D&&n!==D||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==D&&(n===D||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},cn=class{constructor(t,r,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){We(this,t)}};var Xo=dn.litHtmlPolyfillSupport;Xo?.(Tt,pr),(dn.litHtmlVersions??=[]).push("3.3.3");var ia=Symbol.for(""),Jo=e=>{if(e?.r===ia)return e?._$litStatic$},hn=e=>({_$litStatic$:e,r:ia});var na=new Map,mn=e=>(t,...r)=>{let n=r.length,i,s,a=[],o=[],u,l=0,c=!1;for(;l<n;){for(u=t[l];l<n&&(s=r[l],(i=Jo(s))!==void 0);)u+=i+t[++l],c=!0;l!==n&&o.push(s),a.push(u),l++}if(l===n&&a.push(t[n]),c){let d=a.join("$$lit$$");(t=na.get(d))===void 0&&(a.raw=a,na.set(d,t=a)),r=o}return e(t,...r)},yn=mn(Zs),pf=mn(ea),ff=mn(ta);var vn=g(j()),ga=g(C());var qe;(function(e){e.title="title",e.title_dense="title-dense",e.subtitle1="subtitle1",e.subtitle2="subtitle2",e.body1="body1",e.body2="body2",e.caption="caption",e.breadcrumb="breadcrumb",e.overline="overline",e.button="button"})(qe||(qe={}));var Y=g(B()),m=g(C()),sa=m.FtCssVariableFactory.extend("--ft-typography-font-family","",m.designSystemVariables.titleFont),ae=m.FtCssVariableFactory.extend("--ft-typography-font-family","",m.designSystemVariables.contentFont),A={fontFamily:ae,fontSize:m.FtCssVariableFactory.create("--ft-typography-font-size","","SIZE","16px"),fontWeight:m.FtCssVariableFactory.create("--ft-typography-font-weight","","UNKNOWN","normal"),letterSpacing:m.FtCssVariableFactory.create("--ft-typography-letter-spacing","","SIZE","0.496px"),lineHeight:m.FtCssVariableFactory.create("--ft-typography-line-height","","NUMBER","1.5"),textTransform:m.FtCssVariableFactory.create("--ft-typography-text-transform","","UNKNOWN","inherit")},Ye={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-title-font-family","",sa),fontSize:m.FtCssVariableFactory.extend("--ft-typography-title-font-size","",A.fontSize,"20px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-title-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing","",A.letterSpacing,"0.15px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-title-line-height","",A.lineHeight,"1.2"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-title-text-transform","",A.textTransform,"inherit")},Xe={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family","",sa),fontSize:m.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size","",A.fontSize,"14px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing","",A.letterSpacing,"0.105px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height","",A.lineHeight,"1.7"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform","",A.textTransform,"inherit")},Je={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size","",A.fontSize,"16px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight","",A.fontWeight,"600"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing","",A.letterSpacing,"0.144px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height","",A.lineHeight,"1.5"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform","",A.textTransform,"inherit")},Qe={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size","",A.fontSize,"14px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing","",A.letterSpacing,"0.098px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height","",A.lineHeight,"1.7"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform","",A.textTransform,"inherit")},Ze={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-body1-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-body1-font-size","",A.fontSize,"16px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-body1-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing","",A.letterSpacing,"0.496px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-body1-line-height","",A.lineHeight,"1.5"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-body1-text-transform","",A.textTransform,"inherit")},et={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-body2-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-body2-font-size","",A.fontSize,"14px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-body2-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing","",A.letterSpacing,"0.252px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-body2-line-height","",A.lineHeight,"1.4"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-body2-text-transform","",A.textTransform,"inherit")},tt={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-caption-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-caption-font-size","",A.fontSize,"12px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-caption-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing","",A.letterSpacing,"0.396px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-caption-line-height","",A.lineHeight,"1.33"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-caption-text-transform","",A.textTransform,"inherit")},rt={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size","",A.fontSize,"10px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing","",A.letterSpacing,"0.33px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height","",A.lineHeight,"1.6"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform","",A.textTransform,"inherit")},nt={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-overline-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-overline-font-size","",A.fontSize,"10px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-overline-font-weight","",A.fontWeight,"normal"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing","",A.letterSpacing,"1.5px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-overline-line-height","",A.lineHeight,"1.6"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-overline-text-transform","",A.textTransform,"uppercase")},it={fontFamily:m.FtCssVariableFactory.extend("--ft-typography-button-font-family","",ae),fontSize:m.FtCssVariableFactory.extend("--ft-typography-button-font-size","",A.fontSize,"14px"),fontWeight:m.FtCssVariableFactory.extend("--ft-typography-button-font-weight","",A.fontWeight,"600"),letterSpacing:m.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing","",A.letterSpacing,"1.246px"),lineHeight:m.FtCssVariableFactory.extend("--ft-typography-button-line-height","",A.lineHeight,"1.15"),textTransform:m.FtCssVariableFactory.extend("--ft-typography-button-text-transform","",A.textTransform,"uppercase")},aa=Y.css`
65
65
  .ft-typography--title {
@@ -164,7 +164,7 @@
164
164
  </${hn(this.element)}>
165
165
  `:yn`
166
166
  <slot part="text" class="ft-typography ft-typography--${this.variant}"></slot>
167
- `}};oe.styles=[aa,oa,ua,la,ca,da,pa,fa,ha,ma,ya];va([(0,vn.property)()],oe.prototype,"element",void 0);va([(0,vn.property)()],oe.prototype,"variant",void 0);var xa=g(C());var Aa={"ft-typography":oe};(0,xa.customElements)(Aa);var Ia=g(gn());var wa=g(B()),M=g(j()),La=g(gn()),_t=g(C());var _a=g(B()),N=g(C()),Ea=N.FtCssVariableFactory.extend("--ft-ripple-color","",N.designSystemVariables.colorContent),re={color:Ea,backgroundColor:N.FtCssVariableFactory.extend("--ft-ripple-background-color","",Ea),opacityContentOnSurfacePressed:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:N.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},Sa=N.FtCssVariableFactory.extend("--ft-ripple-color","",N.designSystemVariables.colorPrimary),Ca={color:Sa,backgroundColor:N.FtCssVariableFactory.extend("--ft-ripple-background-color","",Sa)},Oa=N.FtCssVariableFactory.extend("--ft-ripple-color","",N.designSystemVariables.colorSecondary),Ta={color:Oa,backgroundColor:N.FtCssVariableFactory.extend("--ft-ripple-background-color","",Oa)},Ra=_a.css`
167
+ `}};oe.styles=[aa,oa,ua,la,ca,da,pa,fa,ha,ma,ya];va([(0,vn.property)()],oe.prototype,"element",void 0);va([(0,vn.property)()],oe.prototype,"variant",void 0);var xa=g(C());var Aa={"ft-typography":oe};(0,xa.customElements)(Aa);var Ma=g(gn());var wa=g(B()),I=g(j()),La=g(gn()),_t=g(C());var _a=g(B()),N=g(C()),Ea=N.FtCssVariableFactory.extend("--ft-ripple-color","",N.designSystemVariables.colorContent),re={color:Ea,backgroundColor:N.FtCssVariableFactory.extend("--ft-ripple-background-color","",Ea),opacityContentOnSurfacePressed:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:N.FtCssVariableFactory.external(N.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:N.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},Sa=N.FtCssVariableFactory.extend("--ft-ripple-color","",N.designSystemVariables.colorPrimary),Ca={color:Sa,backgroundColor:N.FtCssVariableFactory.extend("--ft-ripple-background-color","",Sa)},Oa=N.FtCssVariableFactory.extend("--ft-ripple-color","",N.designSystemVariables.colorSecondary),Ta={color:Oa,backgroundColor:N.FtCssVariableFactory.extend("--ft-ripple-background-color","",Oa)},Ra=_a.css`
168
168
  :host {
169
169
  display: contents;
170
170
  }
@@ -287,8 +287,8 @@
287
287
  <div class="ft-ripple--background"></div>
288
288
  <div class="ft-ripple--effect"></div>
289
289
  </div>
290
- `}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var r,n;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),(r=this.target)===null||r===void 0||r.removeAttribute("data-is-ft-ripple-target")):(n=this.target)===null||n===void 0||n.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run(()=>this.defaultSetup())}defaultSetup(){var t,r;let n=(t=this.shadowRoot)===null||t===void 0?void 0:t.host.parentElement;n&&this.setupFor((r=this.target)!==null&&r!==void 0?r:n)}forceFocusUpdate(){var t;!((t=this.target)===null||t===void 0)&&t.matches(":focus-within")?this.startFocus():this.endFocus()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");let r=(...o)=>u=>{o.forEach(l=>window.addEventListener(l,this.endPress,{once:!0})),this.startPress(u)},n=r("mouseup","contextmenu"),i=r("touchend","touchcancel"),s=o=>{["Enter"," "].includes(o.key)&&r("keyup")(o)},a={passive:!0};t.addEventListener("mouseover",this.startHover,a),t.addEventListener("mousemove",this.moveRipple,a),t.addEventListener("mouseleave",this.endHover,a),t.addEventListener("mousedown",n,a),t.addEventListener("touchstart",i,a),t.addEventListener("touchmove",this.moveRipple,a),t.addEventListener("keydown",s,a),t.addEventListener("focus",this.startFocus,a),t.addEventListener("blur",this.endFocus,a),t.addEventListener("focusin",this.startFocus,a),t.addEventListener("focusout",this.endFocus,a),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,a),t.removeEventListener("mousemove",this.moveRipple,a),t.removeEventListener("mouseleave",this.endHover,a),t.removeEventListener("mousedown",n,a),t.removeEventListener("touchstart",i,a),t.removeEventListener("touchmove",this.moveRipple,a),t.removeEventListener("keydown",s,a),t.removeEventListener("focus",this.startFocus,a),t.removeEventListener("blur",this.endFocus,a),t.removeEventListener("focusin",this.startFocus,a),t.removeEventListener("focusout",this.endFocus,a),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){let r=t,n=t,i,s;return r.x!=null?{x:i,y:s}=r:n.touches!=null&&(i=n.touches[0].clientX,s=n.touches[0].clientY),{x:i,y:s}}isFocusVisible(t){return t instanceof HTMLElement?t.matches(":focus-visible"):!0}isIgnored(t){if(this.disabled)return!0;if(t!=null)for(let r of t.composedPath()){if(r===this.target)break;if("hasAttribute"in r&&r.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};w.elementDefinitions={};w.styles=Ra;$([(0,M.property)({type:Boolean})],w.prototype,"primary",void 0);$([(0,M.property)({type:Boolean})],w.prototype,"secondary",void 0);$([(0,M.property)({type:Boolean})],w.prototype,"unbounded",void 0);$([(0,M.property)({type:Boolean})],w.prototype,"activated",void 0);$([(0,M.property)({type:Boolean})],w.prototype,"selected",void 0);$([(0,M.property)({type:Boolean})],w.prototype,"disabled",void 0);$([(0,M.state)()],w.prototype,"hovered",void 0);$([(0,M.state)()],w.prototype,"focused",void 0);$([(0,M.state)()],w.prototype,"pressed",void 0);$([(0,M.state)()],w.prototype,"rippling",void 0);$([(0,M.state)()],w.prototype,"originX",void 0);$([(0,M.state)()],w.prototype,"originY",void 0);$([(0,M.query)(".ft-ripple")],w.prototype,"ripple",void 0);$([(0,M.query)(".ft-ripple--effect")],w.prototype,"rippleEffect",void 0);var Pa=g(C());var Na={"ft-ripple":w};(0,Pa.customElements)(Na);var fr=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Qo={"attachment-viewed":{label:"Opening attachment",defaultEventName:"attachment-open",defaultComponentId:"ft-reader-attachments"},"attachment-downloaded":{label:"Downloading attachment",defaultEventName:"attachment-download",defaultComponentId:"ft-reader-attachments"}},ue=class extends(0,at.withAnalytics)(at.FtLitElementRedux,Qo){constructor(){super(...arguments),this.hideFileFormatIcon=!1,this.hideFilename=!1,this.hideDownloadIcon=!1}render(){if(this.canRender()){let t={"hide-file-format-icon":this.hideFileFormatIcon,"hide-filename":this.hideFilename,"hide-download-icon":this.hideDownloadIcon};return Le.html`
291
- <div part="container" class="${(0,Ia.classMap)(t)}">
290
+ `}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var r,n;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),(r=this.target)===null||r===void 0||r.removeAttribute("data-is-ft-ripple-target")):(n=this.target)===null||n===void 0||n.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run(()=>this.defaultSetup())}defaultSetup(){var t,r;let n=(t=this.shadowRoot)===null||t===void 0?void 0:t.host.parentElement;n&&this.setupFor((r=this.target)!==null&&r!==void 0?r:n)}forceFocusUpdate(){var t;!((t=this.target)===null||t===void 0)&&t.matches(":focus-within")?this.startFocus():this.endFocus()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");let r=(...o)=>u=>{o.forEach(l=>window.addEventListener(l,this.endPress,{once:!0})),this.startPress(u)},n=r("mouseup","contextmenu"),i=r("touchend","touchcancel"),s=o=>{["Enter"," "].includes(o.key)&&r("keyup")(o)},a={passive:!0};t.addEventListener("mouseover",this.startHover,a),t.addEventListener("mousemove",this.moveRipple,a),t.addEventListener("mouseleave",this.endHover,a),t.addEventListener("mousedown",n,a),t.addEventListener("touchstart",i,a),t.addEventListener("touchmove",this.moveRipple,a),t.addEventListener("keydown",s,a),t.addEventListener("focus",this.startFocus,a),t.addEventListener("blur",this.endFocus,a),t.addEventListener("focusin",this.startFocus,a),t.addEventListener("focusout",this.endFocus,a),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,a),t.removeEventListener("mousemove",this.moveRipple,a),t.removeEventListener("mouseleave",this.endHover,a),t.removeEventListener("mousedown",n,a),t.removeEventListener("touchstart",i,a),t.removeEventListener("touchmove",this.moveRipple,a),t.removeEventListener("keydown",s,a),t.removeEventListener("focus",this.startFocus,a),t.removeEventListener("blur",this.endFocus,a),t.removeEventListener("focusin",this.startFocus,a),t.removeEventListener("focusout",this.endFocus,a),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){let r=t,n=t,i,s;return r.x!=null?{x:i,y:s}=r:n.touches!=null&&(i=n.touches[0].clientX,s=n.touches[0].clientY),{x:i,y:s}}isFocusVisible(t){return t instanceof HTMLElement?t.matches(":focus-visible"):!0}isIgnored(t){if(this.disabled)return!0;if(t!=null)for(let r of t.composedPath()){if(r===this.target)break;if("hasAttribute"in r&&r.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};w.elementDefinitions={};w.styles=Ra;$([(0,I.property)({type:Boolean})],w.prototype,"primary",void 0);$([(0,I.property)({type:Boolean})],w.prototype,"secondary",void 0);$([(0,I.property)({type:Boolean})],w.prototype,"unbounded",void 0);$([(0,I.property)({type:Boolean})],w.prototype,"activated",void 0);$([(0,I.property)({type:Boolean})],w.prototype,"selected",void 0);$([(0,I.property)({type:Boolean})],w.prototype,"disabled",void 0);$([(0,I.state)()],w.prototype,"hovered",void 0);$([(0,I.state)()],w.prototype,"focused",void 0);$([(0,I.state)()],w.prototype,"pressed",void 0);$([(0,I.state)()],w.prototype,"rippling",void 0);$([(0,I.state)()],w.prototype,"originX",void 0);$([(0,I.state)()],w.prototype,"originY",void 0);$([(0,I.query)(".ft-ripple")],w.prototype,"ripple",void 0);$([(0,I.query)(".ft-ripple--effect")],w.prototype,"rippleEffect",void 0);var Pa=g(C());var Na={"ft-ripple":w};(0,Pa.customElements)(Na);var fr=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},Qo={"attachment-viewed":{label:"Opening attachment",defaultEventName:"attachment-open",defaultComponentId:"ft-reader-attachments"},"attachment-downloaded":{label:"Downloading attachment",defaultEventName:"attachment-download",defaultComponentId:"ft-reader-attachments"}},ue=class extends(0,at.withAnalytics)(at.FtLitElementRedux,Qo){constructor(){super(...arguments),this.hideFileFormatIcon=!1,this.hideFilename=!1,this.hideDownloadIcon=!1}render(){if(this.canRender()){let t={"hide-file-format-icon":this.hideFileFormatIcon,"hide-filename":this.hideFilename,"hide-download-icon":this.hideDownloadIcon};return Le.html`
291
+ <div part="container" class="${(0,Ma.classMap)(t)}">
292
292
  ${(0,Da.repeat)(this.attachments,r=>r.id,r=>{var n;let i=Hs(r.mimeType,(0,at.last)(r.file.split(".")));return Le.html`
293
293
  <div part="attachment">
294
294
  <a part="viewer-link" href="${this.getAttachmentViewerLink(r)}"
@@ -314,7 +314,7 @@
314
314
  </div>
315
315
  `})}
316
316
  </div>
317
- `}return Le.nothing}getAttachmentAriaLabel(t){var r;let n=t.name,i=t.file;if(n===i)return i;let s=(r=i.includes(".")?i.split(".").pop():t.mimeType)!==null&&r!==void 0?r:"";return n+" "+s}canRender(){var t,r;return((r=(t=this.attachments)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)>0}getAttachmentDownloadLink(t){throw new Error("Not implemented")}getAttachmentDownloadLinkAriaLabel(t){throw new Error("Not implemented")}getAttachmentViewerLink(t){throw new Error("Not implemented")}};ue.elementDefinitions={"ft-icon":F,"ft-ripple":w,"ft-typography":oe};fr([(0,st.property)({type:Boolean})],ue.prototype,"hideFileFormatIcon",void 0);fr([(0,st.property)({type:Boolean})],ue.prototype,"hideFilename",void 0);fr([(0,st.property)({type:Boolean})],ue.prototype,"hideDownloadIcon",void 0);fr([(0,st.state)()],ue.prototype,"attachments",void 0);var Ma=g(B()),Rt=g(C());function ka(e){return Ma.css`
317
+ `}return Le.nothing}getAttachmentAriaLabel(t){var r;let n=t.name,i=t.file;if(n===i)return i;let s=(r=i.includes(".")?i.split(".").pop():t.mimeType)!==null&&r!==void 0?r:"";return n+" "+s}canRender(){var t,r;return((r=(t=this.attachments)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)>0}getAttachmentDownloadLink(t){throw new Error("Not implemented")}getAttachmentDownloadLinkAriaLabel(t){throw new Error("Not implemented")}getAttachmentViewerLink(t){throw new Error("Not implemented")}};ue.elementDefinitions={"ft-icon":F,"ft-ripple":w,"ft-typography":oe};fr([(0,st.property)({type:Boolean})],ue.prototype,"hideFileFormatIcon",void 0);fr([(0,st.property)({type:Boolean})],ue.prototype,"hideFilename",void 0);fr([(0,st.property)({type:Boolean})],ue.prototype,"hideDownloadIcon",void 0);fr([(0,st.state)()],ue.prototype,"attachments",void 0);var Ia=g(B()),Rt=g(C());function ka(e){return Ia.css`
318
318
  [part="container"] {
319
319
  display: flex;
320
320
  flex-direction: column;
@@ -5,7 +5,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
5
5
  .highlight-html-match {
6
6
  background: ${Ms};
7
7
  }
8
- `;function Wn(t,e,r){var n,a;let i=t.getAttribute("data-highlight-html-query");if((i??"")!==(e??"")){let s=new Xu(t);if(s.unmark(),e&&e.trim()){let l={className:(n=r?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};r?.attributes!=null&&(l.each=(p=>{for(let h in r.attributes)p.setAttribute(h,r.attributes[h])})),s.mark(e.replace(/"[^"]+"/g,""),{...l,separateWordSearch:!0}),((a=e.match(/"[^"]+"/g))!==null&&a!==void 0?a:[]).forEach(p=>s.mark(p.replace(/"/g,""),{...l,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var jn={};U(jn,{noTextInputDefaultClearButton:()=>tp,noTextSelect:()=>Gn,safariEllipsisFix:()=>ep,wordWrap:()=>Qu});var Gn=I`
8
+ `;function Wn(t,e,r){var n,a;let i=t.getAttribute("data-highlight-html-query");if((i??"")!==(e??"")){let s=new Xu(t);if(s.unmark(),e&&e.trim()){let l={className:(n=r?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};r?.attributes!=null&&(l.each=p=>{for(let h in r.attributes)p.setAttribute(h,r.attributes[h])}),s.mark(e.replace(/"[^"]+"/g,""),{...l,separateWordSearch:!0}),((a=e.match(/"[^"]+"/g))!==null&&a!==void 0?a:[]).forEach(p=>s.mark(p.replace(/"/g,""),{...l,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var jn={};U(jn,{noTextInputDefaultClearButton:()=>tp,noTextSelect:()=>Gn,safariEllipsisFix:()=>ep,wordWrap:()=>Qu});var Gn=I`
9
9
  .ft-no-text-select {
10
10
  -webkit-touch-callout: none;
11
11
  -webkit-user-select: none;
@@ -82,7 +82,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
82
82
  `)}
83
83
  </ul>
84
84
  `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?gt.error:this.warningMessages.length?gt.warning:gt.default}}return Y([A()],e.prototype,"warningRules",void 0),Y([A()],e.prototype,"errorRules",void 0),Y([A()],e.prototype,"validateOn",void 0),Y([A({type:Boolean})],e.prototype,"validateAtRender",void 0),Y([A()],e.prototype,"label",void 0),Y([A({type:Boolean})],e.prototype,"hideLabel",void 0),Y([A()],e.prototype,"name",void 0),Y([A({type:Boolean})],e.prototype,"disabled",void 0),Y([A()],e.prototype,"helperText",void 0),Y([A()],e.prototype,"forceStatus",void 0),Y([A({reflect:!0})],e.prototype,"value",void 0),Y([H()],e.prototype,"errorMessages",void 0),Y([H()],e.prototype,"warningMessages",void 0),Y([H()],e.prototype,"status",void 0),Y([H()],e.prototype,"focused",void 0),Y([H()],e.prototype,"additionalWarningRules",void 0),Y([H()],e.prototype,"additionalErrorRules",void 0),e});var Ur=(t,e)=>{let r=t._$AN;if(r===void 0)return!1;for(let n of r)n._$AO?.(e,!1),Ur(n,e);return!0},go=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while(r?.size===0)},ll=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),ef(e)}};function Jp(t){this._$AN!==void 0?(go(this),this._$AM=t,ll(this)):this._$AM=t}function Qp(t,e=!1,r=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=r;i<n.length;i++)Ur(n[i],!1),go(n[i]);else n!=null&&(Ur(n,!1),go(n));else Ur(this,t)}var ef=t=>{t.type==Ae.CHILD&&(t._$AP??=Qp,t._$AQ??=Jp)},Vt=class extends de{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,n){super._$AT(e,r,n),ll(this),this.isConnected=e._$AU}_$AO(e,r=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),r&&(Ur(this,e),go(this))}setValue(e){if(Ai(this._$Ct))this._$Ct._$AI(e,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};var ka=class extends Vt{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async r=>{if(!this.element||!r.relatedTarget)return;let n=r.relatedTarget;this.isInsideElement(n,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async r=>{if(!this.element||!r.relatedTarget)return;let n=r.relatedTarget;this.isInsideElement(n,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return K}update(e){return this.part=e,this.ensureFocusTrap(e.element),K}reconnected(){var e;this.ensureFocusTrap((e=this.part)===null||e===void 0?void 0:e.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(e){var r,n;this.isElementTrappable(e)&&(((r=this.firstTrap)===null||r===void 0?void 0:r.parentElement)===e&&((n=this.lastTrap)===null||n===void 0?void 0:n.parentElement)===e||(this.removeFocusTrap(),this.createFocusTrap(e)))}removeFocusTrap(){var e,r,n,a;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(r=this.lastTrap)===null||r===void 0||r.removeEventListener("focus",this.onLastTrapFocus),(n=this.firstTrap)===null||n===void 0||n.remove(),(a=this.lastTrap)===null||a===void 0||a.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let r=this.getChildren(e);for(let n=0;n<r.length;n++){let a=r[n];if(a instanceof HTMLElement&&(this.attemptFocus(a)||await this.focusFirstDescendant(a)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let r=this.getChildren(e);for(let n=r.length-1;n>=0;n--){let a=r[n];if(a instanceof HTMLElement&&(this.attemptFocus(a)||await this.focusLastDescendant(a)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof le&&await e.updateComplete}isInsideElement(e,r){for(let n=e;n;n=n.parentNode){if(n===r)return!0;n instanceof ShadowRoot?n=n.host:n.assignedSlot&&(n=n.assignedSlot)}return!1}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},l0=oe(ka);var dl;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(dl||(dl={}));var tf={sm:640,md:768,lg:1024,xl:1280},Da=class extends Vt{constructor(e){super(e),this.size=0,this.onResize=()=>{let r=window.innerWidth;this.size!==r&&(this.size=r,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[r,n,a]){return this.lastArgs=[r,n,a],this.render(r,n,a)}render(e,r,n){let a=this.resolveThreshold(e),i=n??(()=>F);return this.size>a?r():i()}resolveThreshold(e){return typeof e=="number"?e:tf[e]}},f0=oe(Da);var rf=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Ma=class extends CustomEvent{constructor(e){super("ft-analytics-action",{composed:!0,bubbles:!0,detail:e})}};function ul(t,e){class r extends t{constructor(){super(...arguments),this.configuredAnalyticsActions={}}emitAnalyticsAction(a,i){var s,l;let d=(l=(s=this.configuredAnalyticsActions)===null||s===void 0?void 0:s[a])===null||l===void 0?void 0:l.eventName;if(!d)return;let p=e[a];this.dispatchEvent(new Ma({eventName:d,actionType:a,componentType:this.tagName.toLowerCase(),componentId:this.id||p?.defaultComponentId||this.tagName.toLowerCase(),data:i}))}}return r.analyticsActions=e,rf([ue({})],r.prototype,"configuredAnalyticsActions",void 0),r}var Ua,Ba,Fa,Ha,of=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Fa=(Ba=(Ua=window.safari)===null||Ua===void 0?void 0:Ua.pushNotification)===null||Ba===void 0?void 0:Ba.toString())!==null&&Fa!==void 0?Fa:"")==="[object SafariRemoteNotification]",nf="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ha=window.ftGlobals)!==null&&Ha!==void 0?Ha:{lit:Ko,litDecorators:Zo,litRepeat:qo,litClassMap:Yo,litStyleMap:Xo,litUnsafeHTML:Qo,wcUtils:{...dn,...tn,...mn,...Aa,...yn,...rn,...vn,...ln,...Pn,...La,...al,...va,...kn,...xn,...Hn,...Oa,...Bn,..._a,...Ia,...Ds,...an,...zn,...Sn,...jn,...il,...Us,...Vn,...ga,...Ra,...Dn,...Un,...Ea,...pn,isSafari:of,isTouchScreen:nf,setVariable:be}};var pl={itemsGap:o.create("--ft-reader-attachments-items-gap","","SIZE","8px"),itemPadding:o.create("--ft-reader-attachments-item-padding","","SIZE","8px"),itemBorderWidth:o.create("--ft-reader-attachments-item-border-width","","SIZE","1px"),itemBorderColor:o.extend("--ft-reader-attachments-item-border-color","",q.colorOutline),itemBorderRadius:o.extend("--ft-reader-attachments-item-border-radius","",q.borderRadiusS),itemBackgroundColor:o.extend("--ft-reader-attachments-item-background-color","",q.colorSurface),itemTextColor:o.extend("--ft-reader-attachments-item-text-color","",q.colorOnSurfaceMedium),itemHoverBackgroundColor:o.extend("--ft-reader-attachments-item-hover-background-color","",q.colorPrimary),itemHoverTextColor:o.extend("--ft-reader-attachments-item-hover-text-color","",q.colorOnSurfaceHigh),fileFormatIconSize:o.create("--ft-reader-attachments-file-format-icon-size","","SIZE","30px"),downloadIconSize:o.create("--ft-reader-attachments-down-icon-size","","SIZE","20px")};var bo;(function(t){t.clusteringHelperCreated="clustering-helper-created",t.mapAttachmentsUpdate="map-attachments-update",t.visibleTopicChange="visible-topic-change",t.requestedTopicNotFound="requested-topic-not-found"})(bo||(bo={}));var fl;(function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"})(fl||(fl={}));var af=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Wa=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},$a=Symbol("registerInterval"),za=Z(Symbol("toFtReaderComponent"),function(t){var e;class r extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(a){this.clearStateManager(),this.stateManager=a,this.addStore(a.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var a;return(a=this.stateManager)===null||a===void 0?void 0:a.service}connectedCallback(){super.connectedCallback(),this[$a]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[$a]):this.dispatchEvent(new Wa)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=$a,af([H()],r.prototype,"stateManager",void 0),r}),hl=class extends za(Se){};var sf="ft-app-info",Kt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Kt.eventName="authentication-change";var Br=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Br.eventName="ui-locale-changed";var cf={session:(t,e)=>{ne(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>D.dispatchEvent(new Kt(e.payload)),0))}},D=ht.get({name:sf,reducers:cf,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var xo=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},SS=Z(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(D)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>mt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return xo([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),xo([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),xo([ze({store:D.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),xo([ze({store:D.name})],e.prototype,"uiLocale",void 0),e});var bt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=D.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=D.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Zt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:bt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):bt.await()}};var se=class extends Zt{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new we,this.cache=e?a.commonCache:new we}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var vo=class extends se{async listMySearches(){let{session:e}=D.getState();return rl(e,V.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var So=class extends se{async listMyBookmarks(){let e=D.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Eo=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=D.getState().session;return!!e?.sessionAuthenticated}};var Co=class extends se{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 e=D.getState().session;return!!e?.sessionAuthenticated}};var lf="ft-user-assets",df={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(fe).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;ja(t,r,[...Ga(t,r),a]),ml(t,r,1,n),yl(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;ja(t,r,Ga(t,r).map(a=>a.id===n.id?n:a)),yl(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;ja(t,r,Ga(t,r).filter(i=>i.id!==a)),ml(t,r,-1,n)}},gl={[fe.SEARCHES]:"savedSearches",[fe.BOOKMARKS]:"bookmarks",[fe.BOOKS]:void 0,[fe.COLLECTIONS]:void 0},Ga=(t,e)=>{var r;let n=gl[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},ja=(t,e,r)=>{let n=gl[e];n&&(t[n]=r)},ml=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===fe.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},yl=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},ee=ht.get({name:lf,reducers:df,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(fe).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Va=class{constructor(e=new Eo,r=new Co){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=D.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new So,this.savedSearchesService=new vo,D.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=D.getState();ne((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ee.actions.clearAssetCount(),ee.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ee.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ee.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ee.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ee.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ee.getState().assetCounts.allAsset[e]!==r.count&&ee.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ee.getState().assetCounts.bookmarkByMap[e]!==r.count&&ee.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ee.getState().assetCounts.bookmarkByMap).length!==0;e===fe.BOOKMARKS&&r&&ee.actions.clearBookmarkCountByMap(),ee.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ee.actions.bookmarks(r)}}},uf=new Va;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=uf);var Ka=class{addCommand(e,r=!1){D.commands.add(e,r)}consumeCommand(e){return D.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ka;var bl,qt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},pf=Symbol("clearAfterUnitTest"),Oo=class extends ro(se){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[bl]=()=>{this.defaultMessages={},this.cache=new we,this.listeners={}},this.currentUiLocale=D.getState().uiLocale,D.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=D.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};ne(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new _r((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof tt)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new qt({loadedContexts:e})),this.dispatchEvent(new qt({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new qt({loadedContexts:[e]})),this.dispatchEvent(new qt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>to(0).then(()=>n()).catch(()=>null)))}};bl=pf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Oo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Oo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Yt=window.FluidTopicsI18nService,Ao=window.FluidTopicsCustomI18nService;var Za=class{highlightHtml(e,r,n){Wn(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Za;var qa=class{isDate(e){var r,n,a,i;return(i=(a=((n=(r=D.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return mt.format(e,(n=r?.locale)!==null&&n!==void 0?n:D.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(e)} is not valid`,l),l}}};window.FluidTopicsDateService=new qa;var Fr=class{static get(e,r){var n,a,i,s;let l=D.getState(),{lang:d,region:p}=(i=(a=(n=l.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||a===void 0?void 0:a.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Gt(l.baseUrl,e??20,(s=l.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${d}-${p}`)}};var Ya=class{urlToSearchRequest(e){return Fr.get().parse(e)}searchRequestToUrl(e){return Fr.get().serialize(e)}};window.FluidTopicsUrlService=new Ya;var xt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};xt.eventName="change";var Xa=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},xl=new Xa;var wo=class t extends Pe{static build(){return new t(window.history,xl,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),ne(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new xt(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,l])=>{let d=r(),p={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[p,s,l]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(xt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(xt.eventName,e)}currentItem(){return ye(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return ye(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return ye(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return ye(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let a=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=wo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var vl=I`
85
- `;function Sl(t,e){let{authenticationRequired:r,session:n}=D.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Ro=class extends Zt{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Ja=class t extends Mr{static build(e){return new t(D,e)}constructor(e,r){super(),this.store=e,this.cache=new we,this.withManualResources=!0,this.userLocaleService=new Ro,this.cleanSessionDebouncer=new ge,this.reloadDebouncer=new ge(500),this.apiProvider=r??(()=>bt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(Kt.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Sl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Br(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},El=Ja.build();var vt=class extends Event{constructor(e,r,n,a){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=a??!1}};var Hr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:a,callbackRef:i}of n){let s=a.deref(),l=i.deref();s===void 0||l===void 0||s.dispatchEvent(new vt(e.context,s,l,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,a=this.pendingContextRequests.get(e.context);a===void 0&&this.pendingContextRequests.set(e.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(r);i===void 0&&a.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),a.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var X=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},W=class extends Se{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=El,this.contextRoot=new Hr}render(){return j`
85
+ `;function Sl(t,e){let{authenticationRequired:r,session:n}=D.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Ro=class extends Zt{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Ja=class t extends Mr{static build(e){return new t(D,e)}constructor(e,r){super(),this.store=e,this.cache=new we,this.withManualResources=!0,this.userLocaleService=new Ro,this.cleanSessionDebouncer=new ge,this.reloadDebouncer=new ge(500),this.apiProvider=r??(()=>bt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(Kt.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Sl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Br(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},El=Ja.build();var vt=class extends Event{constructor(e,r,n,a){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=a??!1}};var Hr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:a,callbackRef:i}of n){let s=a.deref(),l=i.deref();s===void 0||l===void 0||s.dispatchEvent(new vt(e.context,s,l,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,a=this.pendingContextRequests.get(e.context);a===void 0&&this.pendingContextRequests.set(e.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(r);i===void 0&&a.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),a.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var X=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},W=class extends Se{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=El,this.contextRoot=new Hr}render(){return j`
86
86
  <slot></slot>
87
87
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Yt.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};W.elementDefinitions={};W.styles=vl;X([A()],W.prototype,"baseUrl",void 0);X([A()],W.prototype,"tenantId",void 0);X([A()],W.prototype,"apiIntegrationIdentifier",void 0);X([A()],W.prototype,"apiIntegrationAppVersion",void 0);X([A()],W.prototype,"uiLocale",void 0);X([ue(null)],W.prototype,"availableUiLocales",void 0);X([ue(null)],W.prototype,"metadataConfiguration",void 0);X([A({type:Boolean})],W.prototype,"editorMode",void 0);X([A({type:Boolean})],W.prototype,"noCustom",void 0);X([A({type:Boolean})],W.prototype,"openExternalDocumentInNewTab",void 0);X([A({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],W.prototype,"noCustomComponent",void 0);X([A({type:Boolean})],W.prototype,"withManualResources",void 0);X([A({type:Boolean})],W.prototype,"navigatorOnline",void 0);X([A({type:Boolean})],W.prototype,"forcedOffline",void 0);X([A({type:Boolean})],W.prototype,"authenticationRequired",void 0);X([ue([])],W.prototype,"messageContexts",void 0);X([ue(void 0)],W.prototype,"session",void 0);var Cl={"ft-app-context":W};ae(Cl);var To=class t{static build(e){return new t(e)}static buildCustom(e){return new t(e,!0)}static fromGwt(e){return new t(e)}get service(){return this.custom?Ao:Yt}constructor(e,r=!1){this.name=e,this.custom=r,this.properties=new Proxy({},{get:(n,a)=>{let i=a;return s=>({context:this.name,key:i,custom:this.custom,args:typeof s=="function"?void 0:s,argsProvider:typeof s=="function"?s:void 0})}}),this.messages=new Proxy({},{get:(n,a)=>(...i)=>this.service.resolveMessage(this.name,a,...i)}),this.rawMessages=new Proxy({},{get:(n,a)=>this.service.resolveRawMessage(this.name,a)}),this.keys=new Proxy({},{get:(n,a)=>()=>a}),this.attributes=new Proxy({},{get:(n,a)=>()=>({context:this.name,key:a,message:this.service.resolveRawMessage(this.name,a)})})}};var Qa=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[r,n]=e.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Ol=new Qa;var mf=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},yf=Symbol("i18nAttributes"),gf=Symbol("i18nListAttributes"),wl=Symbol("i18nProperties"),Lo=Symbol("i18nContexts"),$r=Symbol("i18nUnsubs"),Io=Z(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?Ao:Yt}i18n(i){let{context:s,key:l,message:d}=i,{custom:p,args:h,argsProvider:f}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let m=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,l,...m)}return d}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(Ol.isI18nKey(i)){let[l,d]=i.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,d)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let d=this,p=(h,f,m)=>m?.context&&m.key&&i(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[yf])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(l=this[gf])===null||l===void 0||l.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(y=>p(h,f,y))})}updateI18nProperties(i){var s;(s=this[wl])===null||s===void 0||s.forEach((l,d)=>{i(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let d=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[Lo].set(d,{isCustomContext:l}),this[$r].has(d)||this[$r].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(i){return this[Lo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Lo].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[$r].forEach(i=>i()),this[$r].clear()}}return e=Lo,r=$r,mf([A({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Al=class extends Io(G){},_o=class extends Io(Se){};var Rl=I`
88
88
  `;var Wr=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Ce=class extends _o{constructor(){super(),this.editorMode=!1,this.addStore(D)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":F:j`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-attachments",
3
- "version": "2.1.19",
3
+ "version": "2.1.20",
4
4
  "description": "Reader component to list map attachments",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,15 +19,15 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "2.1.19",
23
- "@fluid-topics/ft-i18n": "2.1.19",
24
- "@fluid-topics/ft-icon": "2.1.19",
25
- "@fluid-topics/ft-reader-context": "2.1.19",
26
- "@fluid-topics/ft-ripple": "2.1.19",
27
- "@fluid-topics/ft-typography": "2.1.19",
28
- "@fluid-topics/ft-wc-utils": "2.1.19",
29
- "@fluid-topics/public-api": "1.0.133",
22
+ "@fluid-topics/ft-app-context": "2.1.20",
23
+ "@fluid-topics/ft-i18n": "2.1.20",
24
+ "@fluid-topics/ft-icon": "2.1.20",
25
+ "@fluid-topics/ft-reader-context": "2.1.20",
26
+ "@fluid-topics/ft-ripple": "2.1.20",
27
+ "@fluid-topics/ft-typography": "2.1.20",
28
+ "@fluid-topics/ft-wc-utils": "2.1.20",
29
+ "@fluid-topics/public-api": "1.0.136",
30
30
  "lit": "3.1.0"
31
31
  },
32
- "gitHead": "c2c202986d05fbee1378d8dbb74fa609e89260ec"
32
+ "gitHead": "77e9f03085f977dde887e175b964bf66b862253f"
33
33
  }