@fluid-topics/ft-tabs 1.3.54 → 1.3.56

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.
@@ -346,7 +346,7 @@ Also for action icons.`,s.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
346
346
  word-break: break-word;
347
347
  }
348
348
  `;var fi=["top","right","bottom","left"],pi=["start","end"],on=fi.reduce((e,t)=>e.concat(t,t+"-"+pi[0],t+"-"+pi[1]),[]),hi=Math.min,yi=Math.max;var oc={left:"right",right:"left",bottom:"top",top:"bottom"},nc={start:"end",end:"start"};function nn(e,t,o){return yi(e,hi(t,o))}function Nr(e,t){return typeof e=="function"?e(t):e}function Ht(e){return e.split("-")[0]}function Ye(e){return e.split("-")[1]}function an(e){return e==="x"?"y":"x"}function sn(e){return e==="y"?"height":"width"}function Lr(e){return["top","bottom"].includes(Ht(e))?"y":"x"}function ln(e){return an(Lr(e))}function mi(e,t,o){o===void 0&&(o=!1);let n=Ye(e),a=ln(e),i=sn(a),l=a==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=rn(l)),[l,rn(l)]}function gi(e){return e.replace(/start|end/g,t=>nc[t])}function rn(e){return e.replace(/left|right|bottom|top/g,t=>oc[t])}function ac(e){return{top:0,right:0,bottom:0,left:0,...e}}function bi(e){return typeof e!="number"?ac(e):{top:e,right:e,bottom:e,left:e}}function dt(e){let{x:t,y:o,width:n,height:a}=e;return{width:n,height:a,top:o,left:t,right:t+n,bottom:o+a,x:t,y:o}}function xi(e,t,o){let{reference:n,floating:a}=e,i=Lr(t),l=ln(t),c=sn(l),u=Ht(t),p=i==="y",h=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,y=n[c]/2-a[c]/2,b;switch(u){case"top":b={x:h,y:n.y-a.height};break;case"bottom":b={x:h,y:n.y+n.height};break;case"right":b={x:n.x+n.width,y:f};break;case"left":b={x:n.x-a.width,y:f};break;default:b={x:n.x,y:n.y}}switch(Ye(t)){case"start":b[l]-=y*(o&&p?-1:1);break;case"end":b[l]+=y*(o&&p?-1:1);break}return b}var vi=async(e,t,o)=>{let{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:l}=o,c=i.filter(Boolean),u=await(l.isRTL==null?void 0:l.isRTL(t)),p=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:f}=xi(p,n,u),y=n,b={},g=0;for(let v=0;v<c.length;v++){let{name:E,fn:A}=c[v],{x:w,y:L,data:I,reset:k}=await A({x:h,y:f,initialPlacement:n,placement:y,strategy:a,middlewareData:b,rects:p,platform:l,elements:{reference:e,floating:t}});h=w??h,f=L??f,b={...b,[E]:{...b[E],...I}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(p=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:h,y:f}=xi(p,y,u)),v=-1)}return{x:h,y:f,placement:y,strategy:a,middlewareData:b}};async function cn(e,t){var o;t===void 0&&(t={});let{x:n,y:a,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:y=!1,padding:b=0}=Nr(t,e),g=bi(b),E=c[y?f==="floating"?"reference":"floating":f],A=dt(await i.getClippingRect({element:(o=await(i.isElement==null?void 0:i.isElement(E)))==null||o?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:p,rootBoundary:h,strategy:u})),w=f==="floating"?{x:n,y:a,width:l.floating.width,height:l.floating.height}:l.reference,L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),I=await(i.isElement==null?void 0:i.isElement(L))?await(i.getScale==null?void 0:i.getScale(L))||{x:1,y:1}:{x:1,y:1},k=dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:L,strategy:u}):w);return{top:(A.top-k.top+g.top)/I.y,bottom:(k.bottom-A.bottom+g.bottom)/I.y,left:(A.left-k.left+g.left)/I.x,right:(k.right-A.right+g.right)/I.x}}function ic(e,t,o){return(e?[...o.filter(a=>Ye(a)===e),...o.filter(a=>Ye(a)!==e)]:o.filter(a=>Ht(a)===a)).filter(a=>e?Ye(a)===e||(t?gi(a)!==a:!1):!0)}var dn=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var o,n,a;let{rects:i,middlewareData:l,placement:c,platform:u,elements:p}=t,{crossAxis:h=!1,alignment:f,allowedPlacements:y=on,autoAlignment:b=!0,...g}=Nr(e,t),v=f!==void 0||y===on?ic(f||null,b,y):y,E=await cn(t,g),A=((o=l.autoPlacement)==null?void 0:o.index)||0,w=v[A];if(w==null)return{};let L=mi(w,i,await(u.isRTL==null?void 0:u.isRTL(p.floating)));if(c!==w)return{reset:{placement:v[0]}};let I=[E[Ht(w)],E[L[0]],E[L[1]]],k=[...((n=l.autoPlacement)==null?void 0:n.overflows)||[],{placement:w,overflows:I}],re=v[A+1];if(re)return{data:{index:A+1,overflows:k},reset:{placement:re}};let Ae=k.map(V=>{let m=Ye(V.placement);return[V.placement,m&&h?V.overflows.slice(0,2).reduce((x,N)=>x+N,0):V.overflows[0],V.overflows]}).sort((V,m)=>V[1]-m[1]),we=((a=Ae.filter(V=>V[2].slice(0,Ye(V[0])?2:3).every(m=>m<=0))[0])==null?void 0:a[0])||Ae[0][0];return we!==c?{data:{index:A+1,overflows:k},reset:{placement:we}}:{}}}};var un=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:o,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:E=>{let{x:A,y:w}=E;return{x:A,y:w}}},...u}=Nr(e,t),p={x:o,y:n},h=await cn(t,u),f=Lr(Ht(a)),y=an(f),b=p[y],g=p[f];if(i){let E=y==="y"?"top":"left",A=y==="y"?"bottom":"right",w=b+h[E],L=b-h[A];b=nn(w,b,L)}if(l){let E=f==="y"?"top":"left",A=f==="y"?"bottom":"right",w=g+h[E],L=g-h[A];g=nn(w,g,L)}let v=c.fn({...t,[y]:b,[f]:g});return{...v,data:{x:v.x-o,y:v.y-n,enabled:{[y]:i,[f]:l}}}}}};var pn=Math.min,Wt=Math.max,lr=Math.round;var He=e=>({x:e,y:e});function We(e){return Oi(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ze(e){var t;return(t=(Oi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Oi(e){return e instanceof Node||e instanceof ne(e).Node}function Te(e){return e instanceof Element||e instanceof ne(e).Element}function ve(e){return e instanceof HTMLElement||e instanceof ne(e).HTMLElement}function Si(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function zt(e){let{overflow:t,overflowX:o,overflowY:n,display:a}=ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(a)}function Ci(e){return["table","td","th"].includes(We(e))}function Ir(e){let t=Pr(),o=ie(e);return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Ei(e){let t=ut(e);for(;ve(t)&&!cr(t);){if(Ir(t))return t;t=ut(t)}return null}function Pr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function cr(e){return["html","body","#document"].includes(We(e))}function ie(e){return ne(e).getComputedStyle(e)}function dr(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(e){if(We(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Si(e)&&e.host||ze(e);return Si(t)?t.host:t}function Ai(e){let t=ut(e);return cr(t)?e.ownerDocument?e.ownerDocument.body:e.body:ve(t)&&zt(t)?t:Ai(t)}function _r(e,t,o){var n;t===void 0&&(t=[]),o===void 0&&(o=!0);let a=Ai(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),l=ne(a);return i?t.concat(l,l.visualViewport||[],zt(a)?a:[],l.frameElement&&o?_r(l.frameElement):[]):t.concat(a,_r(a,[],o))}function Ti(e){let t=ie(e),o=parseFloat(t.width)||0,n=parseFloat(t.height)||0,a=ve(e),i=a?e.offsetWidth:o,l=a?e.offsetHeight:n,c=lr(o)!==i||lr(n)!==l;return c&&(o=i,n=l),{width:o,height:n,$:c}}function Ni(e){return Te(e)?e:e.contextElement}function Ft(e){let t=Ni(e);if(!ve(t))return He(1);let o=t.getBoundingClientRect(),{width:n,height:a,$:i}=Ti(t),l=(i?lr(o.width):o.width)/n,c=(i?lr(o.height):o.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}var cc=He(0);function Li(e){let t=ne(e);return!Pr()||!t.visualViewport?cc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dc(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==ne(e)?!1:t}function ur(e,t,o,n){t===void 0&&(t=!1),o===void 0&&(o=!1);let a=e.getBoundingClientRect(),i=Ni(e),l=He(1);t&&(n?Te(n)&&(l=Ft(n)):l=Ft(e));let c=dc(i,o,n)?Li(i):He(0),u=(a.left+c.x)/l.x,p=(a.top+c.y)/l.y,h=a.width/l.x,f=a.height/l.y;if(i){let y=ne(i),b=n&&Te(n)?ne(n):n,g=y.frameElement;for(;g&&n&&b!==y;){let v=Ft(g),E=g.getBoundingClientRect(),A=ie(g),w=E.left+(g.clientLeft+parseFloat(A.paddingLeft))*v.x,L=E.top+(g.clientTop+parseFloat(A.paddingTop))*v.y;u*=v.x,p*=v.y,h*=v.x,f*=v.y,u+=w,p+=L,g=ne(g).frameElement}}return dt({width:h,height:f,x:u,y:p})}function uc(e){let{rect:t,offsetParent:o,strategy:n}=e,a=ve(o),i=ze(o);if(o===i)return t;let l={scrollLeft:0,scrollTop:0},c=He(1),u=He(0);if((a||!a&&n!=="fixed")&&((We(o)!=="body"||zt(i))&&(l=dr(o)),ve(o))){let p=ur(o);c=Ft(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x,y:t.y*c.y-l.scrollTop*c.y+u.y}}function pc(e){return Array.from(e.getClientRects())}function _i(e){return ur(ze(e)).left+dr(e).scrollLeft}function fc(e){let t=ze(e),o=dr(e),n=e.ownerDocument.body,a=Wt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Wt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),l=-o.scrollLeft+_i(e),c=-o.scrollTop;return ie(n).direction==="rtl"&&(l+=Wt(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:l,y:c}}function hc(e,t){let o=ne(e),n=ze(e),a=o.visualViewport,i=n.clientWidth,l=n.clientHeight,c=0,u=0;if(a){i=a.width,l=a.height;let p=Pr();(!p||p&&t==="fixed")&&(c=a.offsetLeft,u=a.offsetTop)}return{width:i,height:l,x:c,y:u}}function yc(e,t){let o=ur(e,!0,t==="fixed"),n=o.top+e.clientTop,a=o.left+e.clientLeft,i=ve(e)?Ft(e):He(1),l=e.clientWidth*i.x,c=e.clientHeight*i.y,u=a*i.x,p=n*i.y;return{width:l,height:c,x:u,y:p}}function wi(e,t,o){let n;if(t==="viewport")n=hc(e,o);else if(t==="document")n=fc(ze(e));else if(Te(t))n=yc(t,o);else{let a=Li(e);n={...t,x:t.x-a.x,y:t.y-a.y}}return dt(n)}function Ii(e,t){let o=ut(e);return o===t||!Te(o)||cr(o)?!1:ie(o).position==="fixed"||Ii(o,t)}function mc(e,t){let o=t.get(e);if(o)return o;let n=_r(e,[],!1).filter(c=>Te(c)&&We(c)!=="body"),a=null,i=ie(e).position==="fixed",l=i?ut(e):e;for(;Te(l)&&!cr(l);){let c=ie(l),u=Ir(l);!u&&c.position==="fixed"&&(a=null),(i?!u&&!a:!u&&c.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||zt(l)&&!u&&Ii(e,l))?n=n.filter(h=>h!==l):a=c,l=ut(l)}return t.set(e,n),n}function gc(e){let{element:t,boundary:o,rootBoundary:n,strategy:a}=e,l=[...o==="clippingAncestors"?mc(t,this._c):[].concat(o),n],c=l[0],u=l.reduce((p,h)=>{let f=wi(t,h,a);return p.top=Wt(f.top,p.top),p.right=pn(f.right,p.right),p.bottom=pn(f.bottom,p.bottom),p.left=Wt(f.left,p.left),p},wi(t,c,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function bc(e){return Ti(e)}function xc(e,t,o){let n=ve(t),a=ze(t),i=o==="fixed",l=ur(e,!0,i,t),c={scrollLeft:0,scrollTop:0},u=He(0);if(n||!n&&!i)if((We(t)!=="body"||zt(a))&&(c=dr(t)),n){let p=ur(t,!0,i,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else a&&(u.x=_i(a));return{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Ri(e,t){return!ve(e)||ie(e).position==="fixed"?null:t?t(e):e.offsetParent}function Pi(e,t){let o=ne(e);if(!ve(e))return o;let n=Ri(e,t);for(;n&&Ci(n)&&ie(n).position==="static";)n=Ri(n,t);return n&&(We(n)==="html"||We(n)==="body"&&ie(n).position==="static"&&!Ir(n))?o:n||Ei(e)||o}var vc=async function(e){let{reference:t,floating:o,strategy:n}=e,a=this.getOffsetParent||Pi,i=this.getDimensions;return{reference:xc(t,await a(o),n),floating:{x:0,y:0,...await i(o)}}};function Sc(e){return ie(e).direction==="rtl"}var kr={convertOffsetParentRelativeRectToViewportRelativeRect:uc,getDocumentElement:ze,getClippingRect:gc,getOffsetParent:Pi,getElementRects:vc,getClientRects:pc,getDimensions:bc,getScale:Ft,isElement:Te,isRTL:Sc};var ki=(e,t,o)=>{let n=new Map,a={platform:kr,...o},i={...a.platform,_c:n};return vi(e,t,{...a,platform:i})};function Di(e){return Oc(e)}function fn(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function Oc(e){for(let t=e;t;t=fn(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=fn(e);t;t=fn(t)){if(!(t instanceof Element))continue;let o=getComputedStyle(t);if(o.display!=="contents"&&(o.position!=="static"||o.filter!=="none"||t.tagName==="BODY"))return t}return null}async function Bi(e,t,o){return ki(e,t,{platform:{...kr,getOffsetParent:n=>kr.getOffsetParent(n,Di)},middleware:[un({crossAxis:!0}),dn({allowedPlacements:[o]})]})}var Qt=S(P());var Ol=S(P());var ws=S(z()),X=S(q()),Se=S(P());var Mi=S(z());var Ui=Mi.css`
349
- `;var Dr=S(P()),Cc="ft-app-info",pt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};pt.eventName="authentication-change";var Ec={session:(e,t)=>{(0,Dr.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>R.dispatchEvent(new pt(t.payload)),0))}},R=Dr.FtReduxStore.get({name:Cc,reducers:Ec,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var hn=S(P());var ft=class e{static get(t){let{baseUrl:o,apiIntegrationIdentifier:n}=R.getState(),a=t??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(t){return new Promise(o=>{let n=e.get(t);if(n)o(n);else{let a=R.subscribe(()=>{n=e.get(t),n&&(a(),o(n))})}})}};var Br=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:ft.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ft.await()}};var se=class extends Br{constructor(t=!0,o){var n;super(o),this.sortObjectFields=(i,l)=>typeof l!="object"||l==null||Array.isArray(l)?l:Object.fromEntries(Object.entries(l).sort(([c],[u])=>c.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new hn.CacheRegistry,this.cache=t?a.commonCache:new hn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var Mr=class extends se{async listMyBookmarks(){let t=R.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),5*60*1e3):[]}};var yn=class{addCommand(t,o=!1){R.commands.add(t,o)}consumeCommand(t){return R.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new yn;var pe=S(P());var Hi,$t=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Ac=Symbol("clearAfterUnitTest"),Ur=class extends(0,pe.withEventBus)(se){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Hi]=()=>{this.defaultMessages={},this.cache=new pe.CacheRegistry,this.listeners={}},this.currentUiLocale=R.getState().uiLocale,R.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=R.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var n;if(t=t.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...o};(0,pe.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var o,n;return this.fetchContext(t),(n=(o=this.cache.getNow(t))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,o){let n=t.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(t,o,...n){var a;let i=t.toLowerCase(),l=this.resolveContext(i);return new pe.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},l).resolve(o,...n)}async fetchContext(t){let o=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),o&&await this.notify(t)}catch(a){!(a instanceof pe.CanceledPromiseError)&&o&&console.error(a)}return n}subscribe(t,o){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(o),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new $t({loadedContexts:t})),this.dispatchEvent(new $t({loadedContexts:t})),await Promise.all(t.map(o=>this.notify(o,!1)))}async notify(t,o=!0){o&&(document.body.dispatchEvent(new $t({loadedContexts:[t]})),this.dispatchEvent(new $t({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,pe.delay)(0).then(()=>n()).catch(()=>null)))}};Hi=Ac;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ur{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ur{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var pr=window.FluidTopicsI18nService,mn=window.FluidTopicsCustomI18nService;var Wi=S(P()),gn=class{highlightHtml(t,o,n){(0,Wi.highlightHtml)(t,o,n)}};window.FluidTopicsHighlightHtmlService=new gn;var Rc=S(Fi(),1);var $i;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})($i||($i={}));var Gi;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Gi||(Gi={}));var ji;(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"})(ji||(ji={}));var Ki;(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"})(Ki||(Ki={}));var Vi;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Vi||(Vi={}));var Zi;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Zi||(Zi={}));var qi;(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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",e.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",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__DISPLAY="TOPIC__DISPLAY",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"})(qi||(qi={}));var Yi;(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"})(Yi||(Yi={}));var Xi;(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"})(Xi||(Xi={}));var Ji;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Ji||(Ji={}));var Qi;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Qi||(Qi={}));var es;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(es||(es={}));var ts;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(ts||(ts={}));var rs;(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"})(rs||(rs={}));var os;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(os||(os={}));var ns;(function(e){e.ASC="ASC",e.DESC="DESC"})(ns||(ns={}));var as;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(as||(as={}));var is;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(is||(is={}));var ss;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ss||(ss={}));var ls;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(ls||(ls={}));var cs;(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"})(cs||(cs={}));var ds;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(ds||(ds={}));var us;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(us||(us={}));var ps;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ps||(ps={}));var fs;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(fs||(fs={}));var $;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})($||($={}));var fe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(fe||(fe={}));var hs;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(hs||(hs={}));var ys;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(ys||(ys={}));var ms;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(ms||(ms={}));var gs;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(gs||(gs={}));var bs;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(bs||(bs={}));var wc={[$.PERSONAL_BOOK_SHARE_USER]:[$.PERSONAL_BOOK_USER],[$.HTML_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.PDF_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.KHUB_ADMIN]:[$.CONTENT_PUBLISHER],[$.ADMIN]:[$.KHUB_ADMIN,$.USERS_ADMIN,$.PORTAL_ADMIN],[$.GENERATIVE_AI_EXPORT_USER]:[$.GENERATIVE_AI_USER]};function xs(e,t){return e===t||(wc[e]??[]).some(o=>xs(o,t))}function vs(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=>xs(n,t))}var zr=class extends se{async listMySearches(){let{session:t}=R.getState();return vs(t,$.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),5*60*1e3):[]}};var Ss=S(P());var bn=class{isDate(t){var o,n,a,i;return(i=(a=((n=(o=R.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,o){var n,a,i;return Ss.DateFormatter.format(t,(n=o?.locale)!==null&&n!==void 0?n:R.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new bn;var Os=S(P());var fr=class{static get(t,o){var n,a;let i=R.getState(),{lang:l,region:c}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Os.SearchPlaceConverter(i.baseUrl,t??20,i.searchInAllLanguagesAllowed,o??`${l}-${c}`)}};var xn=class{urlToSearchRequest(t){return fr.get().parse(t)}searchRequestToUrl(t){return fr.get().serialize(t)}};window.FluidTopicsUrlService=new xn;var Je=S(P());var ht=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};ht.eventName="change";var vn=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let o=sessionStorage.getItem(this.itemName(t));return o?JSON.parse(o):void 0}set(t,o){sessionStorage.setItem(this.itemName(t),JSON.stringify(o))}},Cs=new vn;var Fr=class e extends Je.WithEventBus{static build(){return new e(window.history,Cs,()=>window.location,!1)}constructor(t,o,n,a){var i,l;super(),this.history=t,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(l=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&l!==void 0?l:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,o=!1){let n=o&&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,Je.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ht(this.currentItem())),0)}installProxies(){let t=o=>(n,a,[i,l,c])=>{let u=o(),p={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[p,l,c]),this.setCurrentState(p,!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 o=this.history.length-1;o>=0;o--)t?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(t){var o;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(o=t?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(ht.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(ht.eventName,t)}currentItem(){return(0,Je.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,Je.deepCopy)(this.states[this.previousDifferentMajorPosition()])}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,Je.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 o;let n=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;if(!n)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&o!==void 0?o:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,o){var n;if(!this.hasState(t))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Fr.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});var Es=R;function As(e,t){var o;return Es.getState().authenticationRequired&&!(!((o=Es.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(t):e()}var G=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},M=class extends Se.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>ft.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Se.CacheRegistry,this.cleanSessionDebouncer=new Se.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return ws.html`
349
+ `;var Dr=S(P()),Cc="ft-app-info",pt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};pt.eventName="authentication-change";var Ec={session:(e,t)=>{(0,Dr.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>R.dispatchEvent(new pt(t.payload)),0))}},R=Dr.FtReduxStore.get({name:Cc,reducers:Ec,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var hn=S(P());var ft=class e{static get(t){let{baseUrl:o,apiIntegrationIdentifier:n}=R.getState(),a=t??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(t){return new Promise(o=>{let n=e.get(t);if(n)o(n);else{let a=R.subscribe(()=>{n=e.get(t),n&&(a(),o(n))})}})}};var Br=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:ft.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ft.await()}};var se=class extends Br{constructor(t=!0,o){var n;super(o),this.sortObjectFields=(i,l)=>typeof l!="object"||l==null||Array.isArray(l)?l:Object.fromEntries(Object.entries(l).sort(([c],[u])=>c.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new hn.CacheRegistry,this.cache=t?a.commonCache:new hn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var Mr=class extends se{async listMyBookmarks(){let t=R.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),5*60*1e3):[]}};var yn=class{addCommand(t,o=!1){R.commands.add(t,o)}consumeCommand(t){return R.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new yn;var pe=S(P());var Hi,$t=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Ac=Symbol("clearAfterUnitTest"),Ur=class extends(0,pe.withEventBus)(se){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Hi]=()=>{this.defaultMessages={},this.cache=new pe.CacheRegistry,this.listeners={}},this.currentUiLocale=R.getState().uiLocale,R.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=R.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var n;if(t=t.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...o};(0,pe.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var o,n;return this.fetchContext(t),(n=(o=this.cache.getNow(t))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,o){let n=t.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(t,o,...n){var a;let i=t.toLowerCase(),l=this.resolveContext(i);return new pe.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},l).resolve(o,...n)}async fetchContext(t){let o=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),o&&await this.notify(t)}catch(a){!(a instanceof pe.CanceledPromiseError)&&o&&console.error(a)}return n}subscribe(t,o){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(o),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new $t({loadedContexts:t})),this.dispatchEvent(new $t({loadedContexts:t})),await Promise.all(t.map(o=>this.notify(o,!1)))}async notify(t,o=!0){o&&(document.body.dispatchEvent(new $t({loadedContexts:[t]})),this.dispatchEvent(new $t({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,pe.delay)(0).then(()=>n()).catch(()=>null)))}};Hi=Ac;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ur{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ur{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var pr=window.FluidTopicsI18nService,mn=window.FluidTopicsCustomI18nService;var Wi=S(P()),gn=class{highlightHtml(t,o,n){(0,Wi.highlightHtml)(t,o,n)}};window.FluidTopicsHighlightHtmlService=new gn;var Rc=S(Fi(),1);var $i;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})($i||($i={}));var Gi;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Gi||(Gi={}));var ji;(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"})(ji||(ji={}));var Ki;(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"})(Ki||(Ki={}));var Vi;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Vi||(Vi={}));var Zi;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Zi||(Zi={}));var qi;(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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",e.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",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__DISPLAY="TOPIC__DISPLAY",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"})(qi||(qi={}));var Yi;(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"})(Yi||(Yi={}));var Xi;(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"})(Xi||(Xi={}));var Ji;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Ji||(Ji={}));var Qi;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Qi||(Qi={}));var es;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(es||(es={}));var ts;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(ts||(ts={}));var rs;(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"})(rs||(rs={}));var os;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(os||(os={}));var ns;(function(e){e.ASC="ASC",e.DESC="DESC"})(ns||(ns={}));var as;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(as||(as={}));var is;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(is||(is={}));var ss;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ss||(ss={}));var ls;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(ls||(ls={}));var cs;(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"})(cs||(cs={}));var ds;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(ds||(ds={}));var us;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(us||(us={}));var ps;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ps||(ps={}));var fs;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(fs||(fs={}));var $;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})($||($={}));var fe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(fe||(fe={}));var hs;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(hs||(hs={}));var ys;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(ys||(ys={}));var ms;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(ms||(ms={}));var gs;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(gs||(gs={}));var bs;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(bs||(bs={}));var xs;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(xs||(xs={}));var wc={[$.PERSONAL_BOOK_SHARE_USER]:[$.PERSONAL_BOOK_USER],[$.HTML_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.PDF_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.KHUB_ADMIN]:[$.CONTENT_PUBLISHER],[$.ADMIN]:[$.KHUB_ADMIN,$.USERS_ADMIN,$.PORTAL_ADMIN],[$.GENERATIVE_AI_EXPORT_USER]:[$.GENERATIVE_AI_USER]};function vs(e,t){return e===t||(wc[e]??[]).some(o=>vs(o,t))}function Ss(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=>vs(n,t))}var zr=class extends se{async listMySearches(){let{session:t}=R.getState();return Ss(t,$.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),5*60*1e3):[]}};var Os=S(P());var bn=class{isDate(t){var o,n,a,i;return(i=(a=((n=(o=R.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,o){var n,a,i;return Os.DateFormatter.format(t,(n=o?.locale)!==null&&n!==void 0?n:R.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new bn;var Cs=S(P());var fr=class{static get(t,o){var n,a;let i=R.getState(),{lang:l,region:c}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Cs.SearchPlaceConverter(i.baseUrl,t??20,i.searchInAllLanguagesAllowed,o??`${l}-${c}`)}};var xn=class{urlToSearchRequest(t){return fr.get().parse(t)}searchRequestToUrl(t){return fr.get().serialize(t)}};window.FluidTopicsUrlService=new xn;var Je=S(P());var ht=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};ht.eventName="change";var vn=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let o=sessionStorage.getItem(this.itemName(t));return o?JSON.parse(o):void 0}set(t,o){sessionStorage.setItem(this.itemName(t),JSON.stringify(o))}},Es=new vn;var Fr=class e extends Je.WithEventBus{static build(){return new e(window.history,Es,()=>window.location,!1)}constructor(t,o,n,a){var i,l;super(),this.history=t,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(l=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&l!==void 0?l:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,o=!1){let n=o&&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,Je.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ht(this.currentItem())),0)}installProxies(){let t=o=>(n,a,[i,l,c])=>{let u=o(),p={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[p,l,c]),this.setCurrentState(p,!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 o=this.history.length-1;o>=0;o--)t?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(t){var o;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(o=t?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(ht.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(ht.eventName,t)}currentItem(){return(0,Je.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,Je.deepCopy)(this.states[this.previousDifferentMajorPosition()])}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,Je.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 o;let n=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;if(!n)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&o!==void 0?o:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,o){var n;if(!this.hasState(t))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Fr.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});function As(e,t){let{authenticationRequired:o,session:n}=R.getState();return o&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var G=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},M=class extends Se.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>ft.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Se.CacheRegistry,this.cleanSessionDebouncer=new Se.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return ws.html`
350
350
  <slot></slot>
351
351
  `}connectedCallback(){super.connectedCallback(),R.addEventListener(pt.eventName,this.reloadConfiguration)}disconnectedCallback(){R.addEventListener(pt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var o,n,a,i,l,c,u;super.update(t),t.has("baseUrl")&&(R.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&R.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&R.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&R.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&R.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&R.actions.noCustom(this.noCustom),t.has("editorMode")&&R.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&R.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&R.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>pr.addContext(p)),t.has("openExternalDocumentInNewTab")&&R.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&R.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&R.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(R.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),R.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),R.actions.searchInAllLanguagesAllowed((l=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),t.has("authenticationRequired")&&R.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&R.actions.availableContentLocales((u=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>As(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};M.elementDefinitions={};M.styles=Ui;G([(0,X.property)()],M.prototype,"baseUrl",void 0);G([(0,X.property)()],M.prototype,"apiIntegrationIdentifier",void 0);G([(0,X.property)()],M.prototype,"apiIntegrationAppVersion",void 0);G([(0,X.property)()],M.prototype,"uiLocale",void 0);G([(0,Se.jsonProperty)(null)],M.prototype,"availableUiLocales",void 0);G([(0,Se.jsonProperty)(null)],M.prototype,"metadataConfiguration",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"editorMode",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"noCustom",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"openExternalDocumentInNewTab",void 0);G([(0,X.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],M.prototype,"noCustomComponent",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"withManualResources",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"navigatorOnline",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"forcedOffline",void 0);G([(0,X.property)({type:Object})],M.prototype,"apiProvider",void 0);G([(0,X.property)({type:Boolean})],M.prototype,"authenticationRequired",void 0);G([(0,Se.jsonProperty)([])],M.prototype,"messageContexts",void 0);G([(0,Se.jsonProperty)(void 0)],M.prototype,"session",void 0);G([(0,X.state)()],M.prototype,"localesConfiguration",void 0);G([(0,X.state)()],M.prototype,"availableContentLocales",void 0);var jn=S(q());function Tc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let o,n,a;if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!$r(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(!$r(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=l=>Object.keys(l).filter(c=>l[c]!=null);if(a=i(e),o=a.length,o!==i(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;for(n=o;n--!==0;){let l=a[n];if(!$r(e[l],t[l]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function $r(e,t){try{return Tc(e,t)}catch{return!1}}function hr(e,t){return!$r(e,t)}function Gr(e,t){let o=n=>n[e]===!0;return n=>{if(o(n))return n;let a=t(n);return a[e]=!0,a}}var Rs=S(q(),1);var Sn=e=>{let t=e??{};return(o,n)=>{var a;let i={hasChanged:hr,attribute:!1,...t};(0,Rs.property)(i)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=t.selector)!==null&&a!==void 0?a:c=>c[n],store:t.store})}};var jr=class{constructor(){this.queue=[]}add(t,o=!1){o&&this.clear(t.type),this.queue.push(t)}consume(t){let o=this.queue.find(n=>n.type===t);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(t){typeof t=="string"?this.queue=this.queue.filter(o=>o.type!==t):this.queue=this.queue.filter(o=>!t.test(o.type))}};var yt=S(q(),1);var Ts=S(q(),1);function Ns(e,t){let o=()=>JSON.parse(JSON.stringify(e));return(0,Ts.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:hr,...t??{}})}var Kr=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,o){return this.callbacks=[t],this.debounce(o)}queue(t,o){return this.callbacks.push(t),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,o;let n=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(c){a(c);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var _s=S(z(),1);var Vr=globalThis,Nc=Vr.ShadowRoot&&(Vr.ShadyCSS===void 0||Vr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yb=Symbol();var Ls=(e,t)=>{if(Nc)e.adoptedStyleSheets=t.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of t){let n=document.createElement("style"),a=Vr.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,e.appendChild(n)}};var Zr=class extends _s.LitElement{createRenderRoot(){let t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach(([a,i])=>t.registry.define(a,i)));let o={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Ls(n,t.elementStyles),n}};function Is(e,t,...o){var n;let a=e.querySelector(t);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var Kt=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Bs,Ps=Symbol("constructorPrototype"),ks=Symbol("constructorName"),Ms=Symbol("exportpartsDebouncer"),Ds=Symbol("dynamicDependenciesLoaded"),jt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};jt.eventName="exportparts-updated";var Ne=class extends Zr{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Bs]=new Kr(5),this.scheduleExportpartsUpdate=()=>{var t,o,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[Ms].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[ks]=this.constructor.name,this[Ps]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[ks]&&Object.setPrototypeOf(this,this[Ps])}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 o=this.constructor;o[Ds]||(o[Ds]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(jt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(jt.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 jt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=Is(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var o,n,a,i,l,c;let u=y=>y!=null&&y.trim().length>0,p=t.filter(u).map(y=>y.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let y of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let b=(i=(a=y.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],g=(c=(l=y.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(E=>E.split(":")[1]))!==null&&c!==void 0?c:[],v=[...b,...g].filter(u).map(E=>E.trim());for(let E of v)h.add(E)}if(h.size===0){this.exportparts=void 0;return}let f=[...h.values()].flatMap(y=>p.map(b=>`${y}:${b}--${y}`));this.exportparts=[...this.part,...f].join(", ")}};Bs=Ms;Kt([(0,yt.property)()],Ne.prototype,"exportpartsPrefix",void 0);Kt([Ns([])],Ne.prototype,"exportpartsPrefixes",void 0);Kt([(0,yt.property)({reflect:!0})],Ne.prototype,"exportparts",void 0);Kt([(0,yt.property)()],Ne.prototype,"customStylesheet",void 0);Kt([(0,yt.property)()],Ne.prototype,"elementToFocus",void 0);Kt([(0,yt.state)()],Ne.prototype,"useAdoptedStyleSheets",void 0);function qr(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var yr=Symbol("internalReduxEventsUnsubscribers"),Qe=Symbol("internalStoresUnsubscribers"),mt=Symbol("internalStores"),Lc=Gr(Symbol("withRedux"),function(e){var t,o,n;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(c=>l.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[mt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[mt].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[mt].get(l)}addStore(l,c){var u;c=(u=c??l.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(c),this[mt].set(c,l),this.subscribeToStore(c,l),this.updateFromStores()}removeStore(l){let c=typeof l=="string"?l:l.name;this.unsubscribeFromStore(c),this[mt].delete(c)}setupStores(){this.unsubscribeFromStores(),this[mt].forEach((l,c)=>this.subscribeToStore(c,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,c)=>{let u=this.constructor.getPropertyOptions(c);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:c)){let p=this.getStore(l.store);p&&(l.store?this[Qe].has(l.store):this[Qe].size>0)&&(this[c]=l.selector(p.getState(),this))}})}subscribeToStore(l,c){var u;this[Qe].set(l,c.subscribe(()=>this.updateFromStores())),this[yr].set(l,[]),qr(c)&&c.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||c.name===p.store)){let f=y=>this[h](y);c.addEventListener(p.eventName,f),this[yr].get(l).push(()=>c.removeEventListener(p.eventName,f))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[Qe].forEach((l,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(l){var c;this[Qe].has(l)&&this[Qe].get(l)(),this[Qe].delete(l),(c=this[yr].get(l))===null||c===void 0||c.forEach(u=>u()),this[yr].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=Qe,o=mt,n=yr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Us=class extends Lc(Ne){};function he(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(o.length?" "+o.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Fe(e){return!!e&&!!e[U]}function Oe(e){var t;return!!e&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Uc}(e)||Array.isArray(e)||!!e[js]||!!(!((t=e.constructor)===null||t===void 0)&&t[js])||Ln(e)||_n(e))}function gt(e,t,o){o===void 0&&(o=!1),qt(e)===0?(o?Object.keys:Zt)(e).forEach(function(n){o&&typeof n=="symbol"||t(n,e[n],e)}):e.forEach(function(n,a){return t(a,n,e)})}function qt(e){var t=e[U];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ln(e)?2:_n(e)?3:0}function Vt(e,t){return qt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _c(e,t){return qt(e)===2?e.get(t):e[t]}function Ks(e,t,o){var n=qt(e);n===2?e.set(t,o):n===3?e.add(o):e[t]=o}function Vs(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Ln(e){return Bc&&e instanceof Map}function _n(e){return Mc&&e instanceof Set}function et(e){return e.o||e.t}function In(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Ys(e);delete t[U];for(var o=Zt(t),n=0;n<o.length;n++){var a=o[n],i=t[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),t)}function Pn(e,t){return t===void 0&&(t=!1),kn(e)||Fe(e)||!Oe(e)||(qt(e)>1&&(e.set=e.add=e.clear=e.delete=Ic),Object.freeze(e),t&&gt(e,function(o,n){return Pn(n,!0)},!0)),e}function Ic(){he(2)}function kn(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Le(e){var t=Nn[e];return t||he(18,e),t}function Pc(e,t){Nn[e]||(Nn[e]=t)}function wn(){return gr}function On(e,t){t&&(Le("Patches"),e.u=[],e.s=[],e.v=t)}function Yr(e){Rn(e),e.p.forEach(kc),e.p=null}function Rn(e){e===gr&&(gr=e.l)}function Hs(e){return gr={p:[],l:gr,h:e,m:!0,_:0}}function kc(e){var t=e[U];t.i===0||t.i===1?t.j():t.g=!0}function Cn(e,t){t._=t.p.length;var o=t.p[0],n=e!==void 0&&e!==o;return t.h.O||Le("ES5").S(t,e,n),n?(o[U].P&&(Yr(t),he(4)),Oe(e)&&(e=Xr(t,e),t.l||Jr(t,e)),t.u&&Le("Patches").M(o[U].t,e,t.u,t.s)):e=Xr(t,o,[]),Yr(t),t.u&&t.v(t.u,t.s),e!==qs?e:void 0}function Xr(e,t,o){if(kn(t))return t;var n=t[U];if(!n)return gt(t,function(c,u){return Ws(e,n,t,c,u,o)},!0),t;if(n.A!==e)return t;if(!n.P)return Jr(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=In(n.k):n.o,i=a,l=!1;n.i===3&&(i=new Set(a),a.clear(),l=!0),gt(i,function(c,u){return Ws(e,n,a,c,u,o,l)}),Jr(e,a,!1),o&&e.u&&Le("Patches").N(n,o,e.u,e.s)}return n.o}function Ws(e,t,o,n,a,i,l){if(Fe(a)){var c=Xr(e,a,i&&t&&t.i!==3&&!Vt(t.R,n)?i.concat(n):void 0);if(Ks(o,n,c),!Fe(c))return;e.m=!1}else l&&o.add(a);if(Oe(a)&&!kn(a)){if(!e.h.D&&e._<1)return;Xr(e,a),t&&t.A.l||Jr(e,a)}}function Jr(e,t,o){o===void 0&&(o=!1),!e.l&&e.h.D&&e.m&&Pn(t,o)}function En(e,t){var o=e[U];return(o?et(o):e)[t]}function zs(e,t){if(t in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function tt(e){e.P||(e.P=!0,e.l&&tt(e.l))}function An(e){e.o||(e.o=In(e.t))}function Tn(e,t,o){var n=Ln(t)?Le("MapSet").F(t,o):_n(t)?Le("MapSet").T(t,o):e.O?function(a,i){var l=Array.isArray(a),c={i:l?1:0,A:i?i.A:wn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=c,p=br;l&&(u=[c],p=mr);var h=Proxy.revocable(u,p),f=h.revoke,y=h.proxy;return c.k=y,c.j=f,y}(t,o):Le("ES5").J(t,o);return(o?o.A:wn()).p.push(n),n}function Dc(e){return Fe(e)||he(22,e),function t(o){if(!Oe(o))return o;var n,a=o[U],i=qt(o);if(a){if(!a.P&&(a.i<4||!Le("ES5").K(a)))return a.t;a.I=!0,n=Fs(o,i),a.I=!1}else n=Fs(o,i);return gt(n,function(l,c){a&&_c(a.t,l)===c||Ks(n,l,t(c))}),i===3?new Set(n):n}(e)}function Fs(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return In(e)}function Zs(){function e(l,c){var u=i[l];return u?u.enumerable=c:i[l]=u={configurable:!0,enumerable:c,get:function(){var p=this[U];return br.get(p,l)},set:function(p){var h=this[U];br.set(h,l,p)}},u}function t(l){for(var c=l.length-1;c>=0;c--){var u=l[c][U];if(!u.P)switch(u.i){case 5:n(u)&&tt(u);break;case 4:o(u)&&tt(u)}}}function o(l){for(var c=l.t,u=l.k,p=Zt(u),h=p.length-1;h>=0;h--){var f=p[h];if(f!==U){var y=c[f];if(y===void 0&&!Vt(c,f))return!0;var b=u[f],g=b&&b[U];if(g?g.t!==y:!Vs(b,y))return!0}}var v=!!c[U];return p.length!==Zt(c).length+(v?0:1)}function n(l){var c=l.k;if(c.length!==l.t.length)return!0;var u=Object.getOwnPropertyDescriptor(c,c.length-1);if(u&&!u.get)return!0;for(var p=0;p<c.length;p++)if(!c.hasOwnProperty(p))return!0;return!1}function a(l){l.g&&he(3,JSON.stringify(et(l)))}var i={};Pc("ES5",{J:function(l,c){var u=Array.isArray(l),p=function(f,y){if(f){for(var b=Array(y.length),g=0;g<y.length;g++)Object.defineProperty(b,""+g,e(g,!0));return b}var v=Ys(y);delete v[U];for(var E=Zt(v),A=0;A<E.length;A++){var w=E[A];v[w]=e(w,f||!!v[w].enumerable)}return Object.create(Object.getPrototypeOf(y),v)}(u,l),h={i:u?5:4,A:c?c.A:wn(),P:!1,I:!1,R:{},l:c,t:l,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,U,{value:h,writable:!0}),p},S:function(l,c,u){u?Fe(c)&&c[U].A===l&&t(l.p):(l.u&&function p(h){if(h&&typeof h=="object"){var f=h[U];if(f){var y=f.t,b=f.k,g=f.R,v=f.i;if(v===4)gt(b,function(I){I!==U&&(y[I]!==void 0||Vt(y,I)?g[I]||p(b[I]):(g[I]=!0,tt(f)))}),gt(y,function(I){b[I]!==void 0||Vt(b,I)||(g[I]=!1,tt(f))});else if(v===5){if(n(f)&&(tt(f),g.length=!0),b.length<y.length)for(var E=b.length;E<y.length;E++)g[E]=!1;else for(var A=y.length;A<b.length;A++)g[A]=!0;for(var w=Math.min(b.length,y.length),L=0;L<w;L++)b.hasOwnProperty(L)||(g[L]=!0),g[L]===void 0&&p(b[L])}}}}(l.p[0]),t(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var $s,gr,Dn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Bc=typeof Map<"u",Mc=typeof Set<"u",Gs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",qs=Dn?Symbol.for("immer-nothing"):(($s={})["immer-nothing"]=!0,$s),js=Dn?Symbol.for("immer-draftable"):"__$immer_draftable",U=Dn?Symbol.for("immer-state"):"__$immer_state";var Uc=""+Object.prototype.constructor,Zt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Ys=Object.getOwnPropertyDescriptors||function(e){var t={};return Zt(e).forEach(function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)}),t},Nn={},br={get:function(e,t){if(t===U)return e;var o=et(e);if(!Vt(o,t))return function(a,i,l){var c,u=zs(i,l);return u?"value"in u?u.value:(c=u.get)===null||c===void 0?void 0:c.call(a.k):void 0}(e,o,t);var n=o[t];return e.I||!Oe(n)?n:n===En(e.t,t)?(An(e),e.o[t]=Tn(e.A.h,n,e)):n},has:function(e,t){return t in et(e)},ownKeys:function(e){return Reflect.ownKeys(et(e))},set:function(e,t,o){var n=zs(et(e),t);if(n?.set)return n.set.call(e.k,o),!0;if(!e.P){var a=En(et(e),t),i=a?.[U];if(i&&i.t===o)return e.o[t]=o,e.R[t]=!1,!0;if(Vs(o,a)&&(o!==void 0||Vt(e.t,t)))return!0;An(e),tt(e)}return e.o[t]===o&&(o!==void 0||t in e.o)||Number.isNaN(o)&&Number.isNaN(e.o[t])||(e.o[t]=o,e.R[t]=!0),!0},deleteProperty:function(e,t){return En(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,An(e),tt(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=et(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:o[t]}},defineProperty:function(){he(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){he(12)}},mr={};gt(br,function(e,t){mr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),mr.deleteProperty=function(e,t){return mr.set.call(this,e,t,void 0)},mr.set=function(e,t,o){return br.set.call(this,e[0],t,o,e[0])};var Hc=function(){function e(o){var n=this;this.O=Gs,this.D=!0,this.produce=function(a,i,l){if(typeof a=="function"&&typeof i!="function"){var c=i;i=a;var u=n;return function(v){var E=this;v===void 0&&(v=c);for(var A=arguments.length,w=Array(A>1?A-1:0),L=1;L<A;L++)w[L-1]=arguments[L];return u.produce(v,function(I){var k;return(k=i).call.apply(k,[E,I].concat(w))})}}var p;if(typeof i!="function"&&he(6),l!==void 0&&typeof l!="function"&&he(7),Oe(a)){var h=Hs(n),f=Tn(n,a,void 0),y=!0;try{p=i(f),y=!1}finally{y?Yr(h):Rn(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(v){return On(h,l),Cn(v,h)},function(v){throw Yr(h),v}):(On(h,l),Cn(p,h))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===qs&&(p=void 0),n.D&&Pn(p,!0),l){var b=[],g=[];Le("Patches").M(a,p,b,g),l(b,g)}return p}he(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var h=arguments.length,f=Array(h>1?h-1:0),y=1;y<h;y++)f[y-1]=arguments[y];return n.produceWithPatches(p,function(b){return a.apply(void 0,[b].concat(f))})};var l,c,u=n.produce(a,i,function(p,h){l=p,c=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,l,c]}):[u,l,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var t=e.prototype;return t.createDraft=function(o){Oe(o)||he(8),Fe(o)&&(o=Dc(o));var n=Hs(this),a=Tn(this,o,void 0);return a[U].C=!0,Rn(n),a},t.finishDraft=function(o,n){var a=o&&o[U],i=a.A;return On(i,n),Cn(void 0,i)},t.setAutoFreeze=function(o){this.D=o},t.setUseProxies=function(o){o&&!Gs&&he(20),this.O=o},t.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var l=Le("Patches").$;return Fe(o)?l(o,n):this.produce(o,function(c){return l(c,n)})},e}(),le=new Hc,Wc=le.produce,Lb=le.produceWithPatches.bind(le),_b=le.setAutoFreeze.bind(le),Ib=le.setUseProxies.bind(le),Pb=le.applyPatches.bind(le),kb=le.createDraft.bind(le),Db=le.finishDraft.bind(le),Qr=Wc;function bt(e){"@babel/helpers - typeof";return bt=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},bt(e)}function Xs(e,t){if(bt(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,t||"default");if(bt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Js(e){var t=Xs(e,"string");return bt(t)=="symbol"?t:t+""}function Qs(e,t,o){return(t=Js(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function el(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),o.push.apply(o,n)}return o}function Bn(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?el(Object(o),!0).forEach(function(n){Qs(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):el(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function Q(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 tl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Mn=function(){return Math.random().toString(36).substring(7).split("").join(".")},eo={INIT:"@@redux/INIT"+Mn(),REPLACE:"@@redux/REPLACE"+Mn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Mn()}};function zc(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 Un(e,t,o){var n;if(typeof t=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(Q(0));if(typeof t=="function"&&typeof o>"u"&&(o=t,t=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(Q(1));return o(Un)(e,t)}if(typeof e!="function")throw new Error(Q(2));var a=e,i=t,l=[],c=l,u=!1;function p(){c===l&&(c=l.slice())}function h(){if(u)throw new Error(Q(3));return i}function f(v){if(typeof v!="function")throw new Error(Q(4));if(u)throw new Error(Q(5));var E=!0;return p(),c.push(v),function(){if(E){if(u)throw new Error(Q(6));E=!1,p();var w=c.indexOf(v);c.splice(w,1),l=null}}}function y(v){if(!zc(v))throw new Error(Q(7));if(typeof v.type>"u")throw new Error(Q(8));if(u)throw new Error(Q(9));try{u=!0,i=a(i,v)}finally{u=!1}for(var E=l=c,A=0;A<E.length;A++){var w=E[A];w()}return v}function b(v){if(typeof v!="function")throw new Error(Q(10));a=v,y({type:eo.REPLACE})}function g(){var v,E=f;return v={subscribe:function(w){if(typeof w!="object"||w===null)throw new Error(Q(11));function L(){w.next&&w.next(h())}L();var I=E(L);return{unsubscribe:I}}},v[tl]=function(){return this},v}return y({type:eo.INIT}),n={dispatch:y,subscribe:f,getState:h,replaceReducer:b},n[tl]=g,n}function Fc(e){Object.keys(e).forEach(function(t){var o=e[t],n=o(void 0,{type:eo.INIT});if(typeof n>"u")throw new Error(Q(12));if(typeof o(void 0,{type:eo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Q(13))})}function rl(e){for(var t=Object.keys(e),o={},n=0;n<t.length;n++){var a=t[n];typeof e[a]=="function"&&(o[a]=e[a])}var i=Object.keys(o),l,c;try{Fc(o)}catch(u){c=u}return function(p,h){if(p===void 0&&(p={}),c)throw c;if(0)var f;for(var y=!1,b={},g=0;g<i.length;g++){var v=i[g],E=o[v],A=p[v],w=E(A,h);if(typeof w>"u"){var L=h&&h.type;throw new Error(Q(14))}b[v]=w,y=y||w!==A}return y=y||i.length!==Object.keys(p).length,y?b:p}}function Yt(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function ol(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(Q(15))},l={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},c=t.map(function(u){return u(l)});return i=Yt.apply(void 0,c)(a.dispatch),Bn(Bn({},a),{},{dispatch:i})}}}function nl(e){var t=function(n){var a=n.dispatch,i=n.getState;return function(l){return function(c){return typeof c=="function"?c(a,i,e):l(c)}}};return t}var al=nl();al.withExtraArgument=nl;var Hn=al;var dl=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(t,o)};return function(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(t,o);function n(){this.constructor=t}t.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),$c=function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=p[0]&2?a.return:p[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,p[1])).done)return i;switch(a=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){o.label=p[1];break}if(p[0]===6&&o.label<i[1]){o.label=i[1],i=p;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(p);break}i[2]&&o.ops.pop(),o.trys.pop();continue}p=t.call(e,o)}catch(h){p=[6,h],a=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Xt=function(e,t){for(var o=0,n=t.length,a=e.length;o<n;o++,a++)e[a]=t[o];return e},Gc=Object.defineProperty,jc=Object.defineProperties,Kc=Object.getOwnPropertyDescriptors,il=Object.getOwnPropertySymbols,Vc=Object.prototype.hasOwnProperty,Zc=Object.prototype.propertyIsEnumerable,sl=function(e,t,o){return t in e?Gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o},rt=function(e,t){for(var o in t||(t={}))Vc.call(t,o)&&sl(e,o,t[o]);if(il)for(var n=0,a=il(t);n<a.length;n++){var o=a[n];Zc.call(t,o)&&sl(e,o,t[o])}return e},Wn=function(e,t){return jc(e,Kc(t))},qc=function(e,t,o){return new Promise(function(n,a){var i=function(u){try{c(o.next(u))}catch(p){a(p)}},l=function(u){try{c(o.throw(u))}catch(p){a(p)}},c=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(i,l)};c((o=o.apply(e,t)).next())})};var Yc=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Yt:Yt.apply(null,arguments)},Qb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Xc(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var o=t;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return t===o}var Jc=function(e){dl(t,e);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,t.prototype),a}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},t.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(t.bind.apply(t,Xt([void 0],o[0].concat(this)))):new(t.bind.apply(t,Xt([void 0],o.concat(this))))},t}(Array),Qc=function(e){dl(t,e);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,t.prototype),a}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},t.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(t.bind.apply(t,Xt([void 0],o[0].concat(this)))):new(t.bind.apply(t,Xt([void 0],o.concat(this))))},t}(Array);function $n(e){return Oe(e)?Qr(e,function(){}):e}function ed(e){return typeof e=="boolean"}function td(){return function(t){return rd(t)}}function rd(e){e===void 0&&(e={});var t=e.thunk,o=t===void 0?!0:t,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,l=i===void 0?!0:i,c=new Jc;if(o&&(ed(o)?c.push(Hn):c.push(Hn.withExtraArgument(o.extraArgument))),0){if(a)var u;if(l)var p}return c}var zn=!0;function ul(e){var t=td(),o=e||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,l=i===void 0?t():i,c=o.devTools,u=c===void 0?!0:c,p=o.preloadedState,h=p===void 0?void 0:p,f=o.enhancers,y=f===void 0?void 0:f,b;if(typeof a=="function")b=a;else if(Xc(a))b=rl(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=l;if(typeof g=="function"&&(g=g(t),!zn&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!zn&&g.some(function(I){return typeof I!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=ol.apply(void 0,g),E=Yt;u&&(E=Yc(rt({trace:!zn},typeof u=="object"&&u)));var A=new Qc(v),w=A;Array.isArray(y)?w=Xt([v],y):typeof y=="function"&&(w=y(A));var L=E.apply(void 0,w);return Un(b,h,L)}function ot(e,t){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return rt(rt({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return o.toString=function(){return""+e},o.type=e,o.match=function(n){return n.type===e},o}function pl(e){var t={},o=[],n,a={addCase:function(i,l){var c=typeof i=="string"?i:i.type;if(c in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[c]=l,a},addMatcher:function(i,l){return o.push({matcher:i,reducer:l}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[t,o,n]}function od(e){return typeof e=="function"}function nd(e,t,o,n){o===void 0&&(o=[]);var a=typeof t=="function"?pl(t):[t,o,n],i=a[0],l=a[1],c=a[2],u;if(od(e))u=function(){return $n(e())};else{var p=$n(e);u=function(){return p}}function h(f,y){f===void 0&&(f=u());var b=Xt([i[y.type]],l.filter(function(g){var v=g.matcher;return v(y)}).map(function(g){var v=g.reducer;return v}));return b.filter(function(g){return!!g}).length===0&&(b=[c]),b.reduce(function(g,v){if(v)if(Fe(g)){var E=g,A=v(E,y);return A===void 0?g:A}else{if(Oe(g))return Qr(g,function(w){return v(w,y)});var A=v(g,y);if(A===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return A}return g},f)}return h.getInitialState=u,h}function ad(e,t){return e+"/"+t}function fl(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof e.initialState=="function"?e.initialState:$n(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},l={},c={};a.forEach(function(h){var f=n[h],y=ad(t,h),b,g;"reducer"in f?(b=f.reducer,g=f.prepare):b=f,i[h]=b,l[y]=b,c[h]=g?ot(y,g):ot(y)});function u(){var h=typeof e.extraReducers=="function"?pl(e.extraReducers):[e.extraReducers],f=h[0],y=f===void 0?{}:f,b=h[1],g=b===void 0?[]:b,v=h[2],E=v===void 0?void 0:v,A=rt(rt({},y),l);return nd(o,function(w){for(var L in A)w.addCase(L,A[L]);for(var I=0,k=g;I<k.length;I++){var re=k[I];w.addMatcher(re.matcher,re.reducer)}E&&w.addDefaultCase(E)})}var p;return{name:t,reducer:function(h,f){return p||(p=u()),p(h,f)},actions:c,caseReducers:i,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var id="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",sd=function(e){e===void 0&&(e=21);for(var t="",o=e;o--;)t+=id[Math.random()*64|0];return t},ld=["name","message","stack","code"],Fn=function(){function e(t,o){this.payload=t,this.meta=o}return e}(),ll=function(){function e(t,o){this.payload=t,this.meta=o}return e}(),cd=function(e){if(typeof e=="object"&&e!==null){for(var t={},o=0,n=ld;o<n.length;o++){var a=n[o];typeof e[a]=="string"&&(t[a]=e[a])}return t}return{message:String(e)}},ox=function(){function e(t,o,n){var a=ot(t+"/fulfilled",function(h,f,y,b){return{payload:h,meta:Wn(rt({},b||{}),{arg:y,requestId:f,requestStatus:"fulfilled"})}}),i=ot(t+"/pending",function(h,f,y){return{payload:void 0,meta:Wn(rt({},y||{}),{arg:f,requestId:h,requestStatus:"pending"})}}),l=ot(t+"/rejected",function(h,f,y,b,g){return{payload:b,error:(n&&n.serializeError||cd)(h||"Rejected"),meta:Wn(rt({},g||{}),{arg:y,requestId:f,rejectedWithValue:!!b,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),c=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(f,y,b){var g=n?.idGenerator?n.idGenerator(h):sd(),v=new u,E,A=!1;function w(I){E=I,v.abort()}var L=function(){return qc(this,null,function(){var I,k,re,Ae,te,we,V;return $c(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),Ae=(I=n?.condition)==null?void 0:I.call(n,h,{getState:y,extra:b}),ud(Ae)?[4,Ae]:[3,2];case 1:Ae=m.sent(),m.label=2;case 2:if(Ae===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return A=!0,te=new Promise(function(x,N){return v.signal.addEventListener("abort",function(){return N({name:"AbortError",message:E||"Aborted"})})}),f(i(g,h,(k=n?.getPendingMeta)==null?void 0:k.call(n,{requestId:g,arg:h},{getState:y,extra:b}))),[4,Promise.race([te,Promise.resolve(o(h,{dispatch:f,getState:y,extra:b,requestId:g,signal:v.signal,abort:w,rejectWithValue:function(x,N){return new Fn(x,N)},fulfillWithValue:function(x,N){return new ll(x,N)}})).then(function(x){if(x instanceof Fn)throw x;return x instanceof ll?a(x.payload,g,h,x.meta):a(x,g,h)})])];case 3:return re=m.sent(),[3,5];case 4:return we=m.sent(),re=we instanceof Fn?l(null,g,h,we.payload,we.meta):l(we,g,h),[3,5];case 5:return V=n&&!n.dispatchConditionRejection&&l.match(re)&&re.meta.condition,V||f(re),[2,re]}})})}();return Object.assign(L,{abort:w,requestId:g,arg:h,unwrap:function(){return L.then(dd)}})}}return Object.assign(p,{pending:i,rejected:l,fulfilled:a,typePrefix:t})}return e.withTypes=function(){return e},e}();function dd(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function ud(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var hl="listener",yl="completed",ml="cancelled",nx="task-"+ml,ax="task-"+yl,ix=hl+"-"+ml,sx=hl+"-"+yl;var Gn="listenerMiddleware";var lx=ot(Gn+"/add"),cx=ot(Gn+"/removeAll"),dx=ot(Gn+"/remove");var cl,ux=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(cl||(cl=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},pd=function(e){return function(t){setTimeout(t,e)}},px=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:pd(10);Zs();var fd=Gr(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}),to=class extends fd(Object){};window.ftReduxStores||(window.ftReduxStores={});var gl=class e extends to{static get(t){var o;let n=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[n];if(qr(i))return i;if(a==null)return;let l=fl({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),c=ul({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:l.reducer(u,p)});return window.ftReduxStores[a.name]=new e(l,c,a.eventBus)}constructor(t,o,n){super(),this.reduxSlice=t,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new jr;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,l,c)=>{let u=l,p=i[u];return p?(...h)=>{let f=p(...h.map(a));return this.reduxStore.dispatch(f),f}:h=>{this.setState({[u]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}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 ro=class{static format(t,o,n,a){return window.moment?window.moment(t).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(t,o,n,a)}static getMomentDateFormat(t,o){return t?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(t,o,n,a){let i=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(i);if(!a)return l;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(i);return`${l} ${c}`}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${t(Math.abs(o)/60)}:${t(Math.abs(o)%60)}`}};var bl=S(P()),oo=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Ux=(0,bl.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(R)}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(c=>c.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?c=>ro.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return oo([(0,jn.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),oo([(0,jn.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),oo([Sn({store:R.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),oo([Sn({store:R.name})],t.prototype,"uiLocale",void 0),t});var io=S(P());var no=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=3*60*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=R.getState().session;return!!t?.sessionAuthenticated}};var ao=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=R.getState().session;return!!t?.sessionAuthenticated}};var hd="ft-user-assets",yd={setAssetCount:(e,t)=>{let{userAssetType:o,count:n}=t.payload.assetCount;e.assetCounts.allAsset[o]=n},clearAssetCount:e=>{Object.values(fe).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let o=t.payload.mapId;e.assetCounts.bookmarkByMap[o]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:o,mapId:n,asset:a}=t.payload;Vn(e,o,[...Kn(e,o),a]),xl(e,o,1,n),vl(e,a)},editAsset:(e,t)=>{let{assetType:o,asset:n}=t.payload;Vn(e,o,Kn(e,o).map(a=>a.id===n.id?n:a)),vl(e,n)},removeAsset:(e,t)=>{let{assetType:o,mapId:n,assetId:a}=t.payload;Vn(e,o,Kn(e,o).filter(i=>i.id!==a)),xl(e,o,-1,n)}},Sl={[fe.SEARCHES]:"savedSearches",[fe.BOOKMARKS]:"bookmarks",[fe.BOOKS]:void 0,[fe.COLLECTIONS]:void 0},Kn=(e,t)=>{var o;let n=Sl[t];return n?(o=e[n])!==null&&o!==void 0?o:[]:[]},Vn=(e,t,o)=>{let n=Sl[t];n&&(e[n]=o)},xl=(e,t,o,n)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+o),t===fe.BOOKMARKS&&n)){let i=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},vl=(e,t)=>{let o=e.assetLabels.map(a=>a.title),n=t.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));e.assetLabels.push(...n)},ce=io.FtReduxStore.get({name:hd,reducers:yd,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(fe).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Zn=class{constructor(t=new no,o=new ao){this.assetCountsService=t,this.assetLabelsService=o,this.currentSession=R.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Mr,this.savedSearchesService=new zr,R.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:o}=R.getState();(0,io.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ce.actions.clearAssetCount(),ce.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ce.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ce.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ce.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ce.actions.assetLabels(t)}async loadAssetCount(t){let o=await this.assetCountsService.getUserAssetCount(t);o&&ce.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(t){let o=await this.assetCountsService.getUserBookmarkCountByMap(t);o&&ce.actions.setBookmarkCountByMap({count:o.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let o=Object.keys(ce.getState().assetCounts.bookmarkByMap).length!==0;t===fe.BOOKMARKS&&o&&ce.actions.clearBookmarkCountByMap(),ce.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 o=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ce.actions.bookmarks(o)}}},md=new Zn;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=md);(0,Ol.customElement)("ft-app-context")(M);var Cl=S(q());var qn=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[n,a]=t.split(".");return{context:n,key:a,custom:!0,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},Jt=new qn;var gd=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},vr=Symbol("i18nAttributes"),El=Symbol("i18nListAttributes"),Al=Symbol("i18nProperties"),so=Symbol("i18nContexts"),xr=Symbol("i18nUnsubs"),wl=(0,Qt.applyMixinOnce)(Symbol("withI18n"),function(e){var t,o;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?mn:pr}i18n(i){let{context:l,key:c,message:u}=i,{custom:p,args:h,argsProvider:f}=i;if(l&&c){this.hasI18nContext(l)||this.addI18nContext(l,void 0,p);let y=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(l,c,...y)}return u}async awaitI18n(i){let{context:l,custom:c}=i;return l&&await this.getI18nService(c).prepareContext(l),this.i18n(i)}customI18n(i,l){if(Jt.isI18nKey(i)){let[c,u]=i.split(".");return this.i18n({custom:!0,context:c,key:u,...l})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((l,c,u)=>i.has(c)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((l,c,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(l=>l.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var l,c;let u=this,p=(h,f,y)=>y?.context&&y.key&&i(h,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...h})}:y;(l=this[vr])===null||l===void 0||l.forEach((h,f)=>u[f]=p(h,f,u[f])),(c=this[El])===null||c===void 0||c.forEach((h,f)=>{var y;return u[f]=(y=u[f])===null||y===void 0?void 0:y.map(b=>p(h,f,b))})}updateI18nProperties(i){var l;(l=this[Al])===null||l===void 0||l.forEach((c,u)=>{i(c,u)&&(this[u]=this.i18n(c))})}addI18nMessages(i,l,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,l,c)}addI18nContext(i,l,c){let u=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[so].set(u,{isCustomContext:c}),this[xr].has(u)||this[xr].set(u,this.getI18nService(c).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(c).prepareContext(u,l)}hasI18nContext(i){return this[so].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[so].forEach((i,l)=>this.addI18nContext(l,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[xr].forEach(i=>i()),this[xr].clear()}}return t=so,o=xr,gd([(0,Cl.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),lo=class extends wl(Qt.FtLitElement){},co=class extends wl(Qt.FtLitElementRedux){};var Rl=S(P());var Yn=class{fromAttribute(t){if(!t)return[];try{let o=JSON.parse(t);return Array.isArray(o)?o.map(n=>typeof n=="string"?Jt.fromAttribute(n):n):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},bd=new Yn;var Tl=(e,t)=>(o,n)=>{var a;o.constructor.createProperty(n,{type:Object,hasChanged:Rl.hasChanged,converter:Jt,...t}),o[vr]=(a=o[vr])!==null&&a!==void 0?a:new Map,o[vr].set(n,e??{})};var _l=S(P());var uo=S(z()),po=S(q()),fo=S(P());var Nl=S(z());var Ll=Nl.css`
352
352
  `;var Sr=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(i=(a<3?l(i):a>3?l(t,o,i):l(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Ce=class extends co{constructor(){super(),this.editorMode=!1,this.addStore(R)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":uo.nothing:uo.html`