@fluid-topics/ftds-floating-menu 2.1.15 → 2.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -821,8 +821,8 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
821
821
  position: relative;
822
822
  word-break: break-word;
823
823
  }
824
- `;var ws=["top","right","bottom","left"],Rs=["start","end"],_o=ws.reduce((e,t)=>e.concat(t,t+"-"+Rs[0],t+"-"+Rs[1]),[]),Mr=Math.min,rt=Math.max,kr=Math.round;var _e=e=>({x:e,y:e}),F0={left:"right",right:"left",bottom:"top",top:"bottom"};function Ns(e,t,n){return rt(e,Mr(t,n))}function pn(e,t){return typeof e=="function"?e(t):e}function Ir(e){return e.split("-")[0]}function nt(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function Mo(e){return e==="y"?"height":"width"}function mn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ko(e){return zo(mn(e))}function _s(e,t,n){n===void 0&&(n=!1);let o=nt(e),a=ko(e),i=Mo(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=No(s)),[s,No(s)]}function zs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function No(e){let t=Ir(e);return F0[t]+e.slice(t.length)}function G0(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Ms(e){return typeof e!="number"?G0(e):{top:e,right:e,bottom:e,left:e}}function St(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function ks(e,t,n){let{reference:o,floating:a}=e,i=mn(t),s=ko(t),l=Mo(s),u=Ir(t),p=i==="y",h=o.x+o.width/2-a.width/2,g=o.y+o.height/2-a.height/2,y=o[l]/2-a[l]/2,v;switch(u){case"top":v={x:h,y:o.y-a.height};break;case"bottom":v={x:h,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:g};break;case"left":v={x:o.x-a.width,y:g};break;default:v={x:o.x,y:o.y}}let x=nt(t);return x&&(v[s]+=y*(x==="end"?1:-1)*(n&&p?-1:1)),v}async function Is(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:y=!1,padding:v=0}=pn(t,e),x=Ms(v),L=l[y?g==="floating"?"reference":"floating":g],O=St(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(L)))==null||n?L:L.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:p,rootBoundary:h,strategy:u})),N=g==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,z=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),I=await(i.isElement==null?void 0:i.isElement(z))&&await(i.getScale==null?void 0:i.getScale(z))||{x:1,y:1},U=St(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:N,offsetParent:z,strategy:u}):N);return{top:(O.top-U.top+x.top)/I.y,bottom:(U.bottom-O.bottom+x.bottom)/I.y,left:(O.left-U.left+x.left)/I.x,right:(U.right-O.right+x.right)/I.x}}var H0=50,Ts=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:Is},u=await(s.isRTL==null?void 0:s.isRTL(t)),p=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:g}=ks(p,o,u),y=o,v=0,x={};for(let S=0;S<i.length;S++){let L=i[S];if(!L)continue;let{name:O,fn:N}=L,{x:z,y:I,data:U,reset:$}=await N({x:h,y:g,initialPlacement:o,placement:y,strategy:a,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});h=z??h,g=I??g,x[O]={...x[O],...U},$&&v<H0&&(v++,typeof $=="object"&&($.placement&&(y=$.placement),$.rects&&(p=$.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):$.rects),{x:h,y:g}=ks(p,y,u)),S=-1)}return{x:h,y:g,placement:y,strategy:a,middlewareData:x}};function $0(e,t,n){return(e?[...n.filter(a=>nt(a)===e),...n.filter(a=>nt(a)!==e)]:n.filter(a=>Ir(a)===a)).filter(a=>e?nt(a)===e||(t?zs(a)!==a:!1):!0)}var Ps=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,a;let{rects:i,middlewareData:s,placement:l,platform:u,elements:p}=t,{crossAxis:h=!1,alignment:g,allowedPlacements:y=_o,autoAlignment:v=!0,...x}=pn(e,t),S=g!==void 0||y===_o?$0(g||null,v,y):y,L=((n=s.autoPlacement)==null?void 0:n.index)||0,O=S[L];if(O==null)return{};if(l!==O)return{reset:{placement:S[0]}};let N=await u.detectOverflow(t,x),z=_s(O,i,await(u.isRTL==null?void 0:u.isRTL(p.floating))),I=[N[Ir(O)],N[z[0]],N[z[1]]],U=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:O,overflows:I}],$=S[L+1];if($)return{data:{index:L+1,overflows:U},reset:{placement:$}};let Pe=U.map(de=>{let xe=nt(de.placement);return[de.placement,xe&&h?de.overflows.slice(0,2).reduce((ue,gt)=>ue+gt,0):de.overflows[0],de.overflows]}).sort((de,xe)=>de[1]-xe[1]),De=((a=Pe.filter(de=>de[2].slice(0,nt(de[0])?2:3).every(xe=>xe<=0))[0])==null?void 0:a[0])||Pe[0][0];return De!==l?{data:{index:L+1,overflows:U},reset:{placement:De}}:{}}}};var Ds=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:u={fn:N=>{let{x:z,y:I}=N;return{x:z,y:I}}},...p}=pn(e,t),h={x:n,y:o},g=await i.detectOverflow(t,p),y=mn(a),v=zo(y),x=h[v],S=h[y],L=(N,z)=>Ns(z+g[N==="y"?"top":"left"],z,z-g[N==="y"?"bottom":"right"]);s&&(x=L(v,x)),l&&(S=L(y,S));let O=u.fn({...t,[v]:x,[y]:S});return{...O,data:{x:O.x-n,y:O.y-o,enabled:{[v]:s,[y]:l}}}}}};function gn(){return typeof window<"u"}function Et(e){return Bs(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ue(e){var t;return(t=(Bs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bs(e){return gn()?e instanceof Node||e instanceof ce(e).Node:!1}function Ce(e){return gn()?e instanceof Element||e instanceof ce(e).Element:!1}function Be(e){return gn()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Us(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function er(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function Fs(e){return/^(table|td|th)$/.test(Et(e))}function Tr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var W0=/transform|translate|scale|rotate|perspective|filter/,j0=/paint|layout|strict|content/,Ct=e=>!!e&&e!=="none",Io;function tr(e){let t=Ce(e)?Ee(e):e;return Ct(t.transform)||Ct(t.translate)||Ct(t.scale)||Ct(t.rotate)||Ct(t.perspective)||!yn()&&(Ct(t.backdropFilter)||Ct(t.filter))||W0.test(t.willChange||"")||j0.test(t.contain||"")}function Gs(e){let t=Ve(e);for(;Be(t)&&!At(t);){if(tr(t))return t;if(Tr(t))return null;t=Ve(t)}return null}function yn(){return Io==null&&(Io=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Io}function At(e){return/^(html|body|#document)$/.test(Et(e))}function Ee(e){return ce(e).getComputedStyle(e)}function Pr(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ve(e){if(Et(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Us(e)&&e.host||Ue(e);return Us(t)?t.host:t}function Hs(e){let t=Ve(e);return At(t)?(e.ownerDocument||e).body:Be(t)&&er(t)?t:Hs(t)}function hn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=Hs(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=ce(a);if(i){let l=bn(s);return t.concat(s,s.visualViewport||[],er(a)?a:[],l&&n?hn(l):[])}else return t.concat(a,hn(a,[],n))}function bn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vs(e){let t=Ee(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Be(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=kr(n)!==i||kr(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Ks(e){return Ce(e)?e:e.contextElement}function rr(e){let t=Ks(e);if(!Be(t))return _e(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=Vs(t),s=(i?kr(n.width):n.width)/o,l=(i?kr(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var V0=_e(0);function qs(e){let t=ce(e);return!yn()||!t.visualViewport?V0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K0(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ce(e)?!1:t}function Dr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=Ks(e),s=_e(1);t&&(o?Ce(o)&&(s=rr(o)):s=rr(e));let l=K0(i,n,o)?qs(i):_e(0),u=(a.left+l.x)/s.x,p=(a.top+l.y)/s.y,h=a.width/s.x,g=a.height/s.y;if(i){let y=ce(i),v=o&&Ce(o)?ce(o):o,x=y,S=bn(x);for(;S&&o&&v!==x;){let L=rr(S),O=S.getBoundingClientRect(),N=Ee(S),z=O.left+(S.clientLeft+parseFloat(N.paddingLeft))*L.x,I=O.top+(S.clientTop+parseFloat(N.paddingTop))*L.y;u*=L.x,p*=L.y,h*=L.x,g*=L.y,u+=z,p+=I,x=ce(S),S=bn(x)}}return St({width:h,height:g,x:u,y:p})}function vn(e,t){let n=Pr(e).scrollLeft;return t?t.left+n:Dr(Ue(e)).left+n}function Zs(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-vn(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function q0(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,i=a==="fixed",s=Ue(o),l=t?Tr(t.floating):!1;if(o===s||l&&i)return n;let u={scrollLeft:0,scrollTop:0},p=_e(1),h=_e(0),g=Be(o);if((g||!g&&!i)&&((Et(o)!=="body"||er(s))&&(u=Pr(o)),g)){let v=Dr(o);p=rr(o),h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}let y=s&&!g&&!i?Zs(s,u):_e(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-u.scrollLeft*p.x+h.x+y.x,y:n.y*p.y-u.scrollTop*p.y+h.y+y.y}}function Z0(e){return Array.from(e.getClientRects())}function Y0(e){let t=Ue(e),n=Pr(e),o=e.ownerDocument.body,a=rt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=rt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+vn(e),l=-n.scrollTop;return Ee(o).direction==="rtl"&&(s+=rt(t.clientWidth,o.clientWidth)-a),{width:a,height:i,x:s,y:l}}var $s=25;function X0(e,t){let n=ce(e),o=Ue(e),a=n.visualViewport,i=o.clientWidth,s=o.clientHeight,l=0,u=0;if(a){i=a.width,s=a.height;let h=yn();(!h||h&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}let p=vn(o);if(p<=0){let h=o.ownerDocument,g=h.body,y=getComputedStyle(g),v=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(o.clientWidth-g.clientWidth-v);x<=$s&&(i-=x)}else p<=$s&&(i+=p);return{width:i,height:s,x:l,y:u}}function Q0(e,t){let n=Dr(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=Be(e)?rr(e):_e(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=a*i.x,p=o*i.y;return{width:s,height:l,x:u,y:p}}function Ws(e,t,n){let o;if(t==="viewport")o=X0(e,n);else if(t==="document")o=Y0(Ue(e));else if(Ce(t))o=Q0(t,n);else{let a=qs(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return St(o)}function Ys(e,t){let n=Ve(e);return n===t||!Ce(n)||At(n)?!1:Ee(n).position==="fixed"||Ys(n,t)}function J0(e,t){let n=t.get(e);if(n)return n;let o=hn(e,[],!1).filter(l=>Ce(l)&&Et(l)!=="body"),a=null,i=Ee(e).position==="fixed",s=i?Ve(e):e;for(;Ce(s)&&!At(s);){let l=Ee(s),u=tr(s);!u&&l.position==="fixed"&&(a=null),(i?!u&&!a:!u&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||er(s)&&!u&&Ys(e,s))?o=o.filter(h=>h!==s):a=l,s=Ve(s)}return t.set(e,o),o}function e4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?Tr(t)?[]:J0(t,this._c):[].concat(n),o],l=Ws(t,s[0],a),u=l.top,p=l.right,h=l.bottom,g=l.left;for(let y=1;y<s.length;y++){let v=Ws(t,s[y],a);u=rt(v.top,u),p=Mr(v.right,p),h=Mr(v.bottom,h),g=rt(v.left,g)}return{width:p-g,height:h-u,x:g,y:u}}function t4(e){let{width:t,height:n}=Vs(e);return{width:t,height:n}}function r4(e,t,n){let o=Be(t),a=Ue(t),i=n==="fixed",s=Dr(e,!0,i,t),l={scrollLeft:0,scrollTop:0},u=_e(0);function p(){u.x=vn(a)}if(o||!o&&!i)if((Et(t)!=="body"||er(a))&&(l=Pr(t)),o){let v=Dr(t,!0,i,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else a&&p();i&&!o&&a&&p();let h=a&&!o&&!i?Zs(a,l):_e(0),g=s.left+l.scrollLeft-u.x-h.x,y=s.top+l.scrollTop-u.y-h.y;return{x:g,y,width:s.width,height:s.height}}function To(e){return Ee(e).position==="static"}function js(e,t){if(!Be(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ue(e)===n&&(n=n.ownerDocument.body),n}function Xs(e,t){let n=ce(e);if(Tr(e))return n;if(!Be(e)){let a=Ve(e);for(;a&&!At(a);){if(Ce(a)&&!To(a))return a;a=Ve(a)}return n}let o=js(e,t);for(;o&&Fs(o)&&To(o);)o=js(o,t);return o&&At(o)&&To(o)&&!tr(o)?n:o||Gs(e)||n}var n4=async function(e){let t=this.getOffsetParent||Xs,n=this.getDimensions,o=await n(e.floating);return{reference:r4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function o4(e){return Ee(e).direction==="rtl"}var xn={convertOffsetParentRelativeRectToViewportRelativeRect:q0,getDocumentElement:Ue,getClippingRect:e4,getOffsetParent:Xs,getElementRects:n4,getClientRects:Z0,getDimensions:t4,getScale:rr,isElement:Ce,isRTL:o4};var Qs=Ps,Js=Ds;var ec=(e,t,n)=>{let o=new Map,a={platform:xn,...n},i={...a.platform,_c:o};return Ts(e,t,{...a,platform:i})};function tc(e){return a4(e)}function Po(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function a4(e){for(let t=e;t;t=Po(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Po(e);t;t=Po(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||tr(n)||t.tagName==="BODY"))return t}return null}async function Sn(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},ec(e,t,{strategy:o.strategy,platform:{...xn,getOffsetParent:a=>xn.getOffsetParent(a,tc)},middleware:[Js({crossAxis:!0}),Qs({allowedPlacements:[o.placement]})]})}var mr=A(T());var ca=A(ne());var rc=A(ne(),1);var Do=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function nc(e,t){return(0,rc.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return Ur(e);try{return JSON.parse(n)}catch{return Ur(e)}},toAttribute:n=>JSON.stringify(n)},hasChanged:Br,...t??{}})}function i4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Cn(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!Cn(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[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 a=s=>Object.keys(s).filter(l=>s[l]!=null),i=a(e);if(n=i.length,n!==a(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){let s=i[o];if(!Cn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Cn(e,t){try{return i4(e,t)}catch{return!1}}function Br(e,t){return!Cn(e,t)}function Ur(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function En(e,t){let n=o=>o[e]===!0;return o=>{if(n(o))return o;let a=t(o);return a[e]=!0,a}}var oc=A(ne(),1);var Uo=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:Br,attribute:!1,...t};(0,oc.property)(i)(n,o);let s=n.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(o,{selector:(a=t.selector)!==null&&a!==void 0?a:(l=>l[o]),store:t.store})}};var An=class{constructor(){this.queue=[]}add(t,n=!1){n&&this.clear(t.type),this.queue.push(t)}consume(t){let n=this.queue.find(o=>o.type===t);return n&&(this.queue=this.queue.filter(o=>o!==n)),n}clear(t){typeof t=="string"?this.queue=this.queue.filter(n=>n.type!==t):this.queue=this.queue.filter(n=>!t.test(n.type))}};var Lt=A(ne(),1);var Ln=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,n){return this.callbacks=[t],this.debounce(n)}queue(t,n){return this.callbacks.push(t),this.debounce(n)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((n,o)=>{this.resolvePromise=n,this.rejectPromise=o})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,n;let o=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(n=this.resolvePromise)!==null&&n!==void 0?n:(()=>null);this.clearPromise();for(let s of o)try{await s()}catch(l){a(l);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 ic=A(F(),1);var On=globalThis,s4=On.ShadowRoot&&(On.ShadyCSS===void 0||On.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var ac=(e,t)=>{if(s4)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let o=document.createElement("style"),a=On.litNonce;a!==void 0&&o.setAttribute("nonce",a),o.textContent=n.cssText,e.appendChild(o)}};var Rn=class extends ic.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let n={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(n);return ac(o,t.elementStyles),o}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([n,o])=>this.defineScopedElement(n,o))}static defineScopedElement(t,n){Do(t)(n),this.canDefineScopedElement(t)&&this.registry.define(t,n)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,n){this.scopedRegistryConstructor.defineScopedElement(t,n)}};function sc(e,t,...n){var o;let a=e.querySelector(t);for(let i of n)a=(o=a?.shadowRoot)===null||o===void 0?void 0:o.querySelector(i);return a}var or=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},uc,cc=Symbol("constructorPrototype"),lc=Symbol("constructorName"),fc=Symbol("exportpartsDebouncer"),dc=Symbol("dynamicDependenciesLoaded"),nr=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};nr.eventName="exportparts-updated";var Fe=class extends Rn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[uc]=new Ln(5),this.scheduleExportpartsUpdate=()=>{var t,n,o;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(o=(n=this.exportpartsPrefixes)===null||n===void 0?void 0:n.length)!==null&&o!==void 0&&o)&&this[fc].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[lc]=this.constructor.name,this[cc]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[lc]&&Object.setPrototypeOf(this,this[cc])}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(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let n=this.constructor;n[dc]||(n[dc]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(nr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(nr.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 nr)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:n,selector:o,shadowPath:a}=this.elementToFocus;if(o!=null){let i=[...a??[],o];n=sc(this.shadowRoot,...i)}n?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||n?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var n,o,a;if(((o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&o!==void 0?o:[]).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 n,o,a,i,s,l;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(o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&o!==void 0?o:[]){let v=(i=(a=y.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],x=(l=(s=y.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(L=>L.split(":")[1]))!==null&&l!==void 0?l:[],S=[...v,...x].filter(u).map(L=>L.trim());for(let L of S)h.add(L)}if(h.size===0){this.exportparts=void 0;return}let g=[...h.values()].flatMap(y=>p.map(v=>`${y}:${v}--${y}`));this.exportparts=[...this.part,...g].join(", ")}};uc=fc;or([(0,Lt.property)()],Fe.prototype,"exportpartsPrefix",void 0);or([nc([])],Fe.prototype,"exportpartsPrefixes",void 0);or([(0,Lt.property)({reflect:!0})],Fe.prototype,"exportparts",void 0);or([(0,Lt.property)()],Fe.prototype,"customStylesheet",void 0);or([(0,Lt.property)()],Fe.prototype,"elementToFocus",void 0);or([(0,Lt.state)()],Fe.prototype,"useAdoptedStyleSheets",void 0);function wn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Fr=Symbol("internalReduxEventsUnsubscribers"),ot=Symbol("internalStoresUnsubscribers"),Ot=Symbol("internalStores"),c4=En(Symbol("withRedux"),function(e){var t,n,o;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[n]=new Map,this[o]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[Ot].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ot].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Ot].get(s)}addStore(s,l){var u;l=(u=l??s.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(l),this[Ot].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Ot].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Ot].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let u=this.constructor.getPropertyOptions(l);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:l)){let p=this.getStore(s.store);p&&(s.store?this[ot].has(s.store):this[ot].size>0)&&(this[l]=s.selector(p.getState(),this))}})}subscribeToStore(s,l){var u;this[ot].set(s,l.subscribe(()=>this.updateFromStores())),this[Fr].set(s,[]),wn(l)&&l.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||l.name===p.store)){let g=y=>this[h](y);l.addEventListener(p.eventName,g),this[Fr].get(s).push(()=>l.removeEventListener(p.eventName,g))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[ot].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[ot].has(s)&&this[ot].get(s)(),this[ot].delete(s),(l=this[Fr].get(s))===null||l===void 0||l.forEach(u=>u()),this[Fr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=ot,n=Ot,o=Fr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),pc=class extends c4(Fe){};function Ae(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(s){return"'"+s+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ke(e){return!!e&&!!e[j]}function ze(e){var t;return!!e&&((function(n){if(!n||typeof n!="object")return!1;var o=Object.getPrototypeOf(n);if(o===null)return!0;var a=Object.hasOwnProperty.call(o,"constructor")&&o.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===g4})(e)||Array.isArray(e)||!!e[xc]||!!(!((t=e.constructor)===null||t===void 0)&&t[xc])||Ko(e)||qo(e))}function Rt(e,t,n){n===void 0&&(n=!1),sr(e)===0?(n?Object.keys:ir)(e).forEach((function(o){n&&typeof o=="symbol"||t(o,e[o],e)})):e.forEach((function(o,a){return t(a,o,e)}))}function sr(e){var t=e[j];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ko(e)?2:qo(e)?3:0}function ar(e,t){return sr(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l4(e,t){return sr(e)===2?e.get(t):e[t]}function Sc(e,t,n){var o=sr(e);o===2?e.set(t,n):o===3?e.add(n):e[t]=n}function Cc(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Ko(e){return m4&&e instanceof Map}function qo(e){return h4&&e instanceof Set}function at(e){return e.o||e.t}function Zo(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Lc(e);delete t[j];for(var n=ir(t),o=0;o<n.length;o++){var a=n[o],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 Yo(e,t){return t===void 0&&(t=!1),Xo(e)||Ke(e)||!ze(e)||(sr(e)>1&&(e.set=e.add=e.clear=e.delete=d4),Object.freeze(e),t&&Rt(e,(function(n,o){return Yo(o,!0)}),!0)),e}function d4(){Ae(2)}function Xo(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ge(e){var t=Vo[e];return t||Ae(18,e),t}function u4(e,t){Vo[e]||(Vo[e]=t)}function $o(){return Hr}function Bo(e,t){t&&(Ge("Patches"),e.u=[],e.s=[],e.v=t)}function Nn(e){Wo(e),e.p.forEach(f4),e.p=null}function Wo(e){e===Hr&&(Hr=e.l)}function mc(e){return Hr={p:[],l:Hr,h:e,m:!0,_:0}}function f4(e){var t=e[j];t.i===0||t.i===1?t.j():t.g=!0}function Fo(e,t){t._=t.p.length;var n=t.p[0],o=e!==void 0&&e!==n;return t.h.O||Ge("ES5").S(t,e,o),o?(n[j].P&&(Nn(t),Ae(4)),ze(e)&&(e=_n(t,e),t.l||zn(t,e)),t.u&&Ge("Patches").M(n[j].t,e,t.u,t.s)):e=_n(t,n,[]),Nn(t),t.u&&t.v(t.u,t.s),e!==Ac?e:void 0}function _n(e,t,n){if(Xo(t))return t;var o=t[j];if(!o)return Rt(t,(function(l,u){return hc(e,o,t,l,u,n)}),!0),t;if(o.A!==e)return t;if(!o.P)return zn(e,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var a=o.i===4||o.i===5?o.o=Zo(o.k):o.o,i=a,s=!1;o.i===3&&(i=new Set(a),a.clear(),s=!0),Rt(i,(function(l,u){return hc(e,o,a,l,u,n,s)})),zn(e,a,!1),n&&e.u&&Ge("Patches").N(o,n,e.u,e.s)}return o.o}function hc(e,t,n,o,a,i,s){if(Ke(a)){var l=_n(e,a,i&&t&&t.i!==3&&!ar(t.R,o)?i.concat(o):void 0);if(Sc(n,o,l),!Ke(l))return;e.m=!1}else s&&n.add(a);if(ze(a)&&!Xo(a)){if(!e.h.D&&e._<1)return;_n(e,a),t&&t.A.l||zn(e,a)}}function zn(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Yo(t,n)}function Go(e,t){var n=e[j];return(n?at(n):e)[t]}function gc(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Object.getPrototypeOf(n)}}function it(e){e.P||(e.P=!0,e.l&&it(e.l))}function Ho(e){e.o||(e.o=Zo(e.t))}function jo(e,t,n){var o=Ko(t)?Ge("MapSet").F(t,n):qo(t)?Ge("MapSet").T(t,n):e.O?(function(a,i){var s=Array.isArray(a),l={i:s?1:0,A:i?i.A:$o(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=l,p=$r;s&&(u=[l],p=Gr);var h=Proxy.revocable(u,p),g=h.revoke,y=h.proxy;return l.k=y,l.j=g,y})(t,n):Ge("ES5").J(t,n);return(n?n.A:$o()).p.push(o),o}function p4(e){return Ke(e)||Ae(22,e),(function t(n){if(!ze(n))return n;var o,a=n[j],i=sr(n);if(a){if(!a.P&&(a.i<4||!Ge("ES5").K(a)))return a.t;a.I=!0,o=yc(n,i),a.I=!1}else o=yc(n,i);return Rt(o,(function(s,l){a&&l4(a.t,s)===l||Sc(o,s,t(l))})),i===3?new Set(o):o})(e)}function yc(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Zo(e)}function Ec(){function e(s,l){var u=i[s];return u?u.enumerable=l:i[s]=u={configurable:!0,enumerable:l,get:function(){var p=this[j];return $r.get(p,s)},set:function(p){var h=this[j];$r.set(h,s,p)}},u}function t(s){for(var l=s.length-1;l>=0;l--){var u=s[l][j];if(!u.P)switch(u.i){case 5:o(u)&&it(u);break;case 4:n(u)&&it(u)}}}function n(s){for(var l=s.t,u=s.k,p=ir(u),h=p.length-1;h>=0;h--){var g=p[h];if(g!==j){var y=l[g];if(y===void 0&&!ar(l,g))return!0;var v=u[g],x=v&&v[j];if(x?x.t!==y:!Cc(v,y))return!0}}var S=!!l[j];return p.length!==ir(l).length+(S?0:1)}function o(s){var l=s.k;if(l.length!==s.t.length)return!0;var u=Object.getOwnPropertyDescriptor(l,l.length-1);if(u&&!u.get)return!0;for(var p=0;p<l.length;p++)if(!l.hasOwnProperty(p))return!0;return!1}function a(s){s.g&&Ae(3,JSON.stringify(at(s)))}var i={};u4("ES5",{J:function(s,l){var u=Array.isArray(s),p=(function(g,y){if(g){for(var v=Array(y.length),x=0;x<y.length;x++)Object.defineProperty(v,""+x,e(x,!0));return v}var S=Lc(y);delete S[j];for(var L=ir(S),O=0;O<L.length;O++){var N=L[O];S[N]=e(N,g||!!S[N].enumerable)}return Object.create(Object.getPrototypeOf(y),S)})(u,s),h={i:u?5:4,A:l?l.A:$o(),P:!1,I:!1,R:{},l,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,j,{value:h,writable:!0}),p},S:function(s,l,u){u?Ke(l)&&l[j].A===s&&t(s.p):(s.u&&(function p(h){if(h&&typeof h=="object"){var g=h[j];if(g){var y=g.t,v=g.k,x=g.R,S=g.i;if(S===4)Rt(v,(function(I){I!==j&&(y[I]!==void 0||ar(y,I)?x[I]||p(v[I]):(x[I]=!0,it(g)))})),Rt(y,(function(I){v[I]!==void 0||ar(v,I)||(x[I]=!1,it(g))}));else if(S===5){if(o(g)&&(it(g),x.length=!0),v.length<y.length)for(var L=v.length;L<y.length;L++)x[L]=!1;else for(var O=y.length;O<v.length;O++)x[O]=!0;for(var N=Math.min(v.length,y.length),z=0;z<N;z++)v.hasOwnProperty(z)||(x[z]=!0),x[z]===void 0&&p(v[z])}}}})(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):o(s)}})}var bc,Hr,Qo=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",m4=typeof Map<"u",h4=typeof Set<"u",vc=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ac=Qo?Symbol.for("immer-nothing"):((bc={})["immer-nothing"]=!0,bc),xc=Qo?Symbol.for("immer-draftable"):"__$immer_draftable",j=Qo?Symbol.for("immer-state"):"__$immer_state";var g4=""+Object.prototype.constructor,ir=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Lc=Object.getOwnPropertyDescriptors||function(e){var t={};return ir(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Vo={},$r={get:function(e,t){if(t===j)return e;var n=at(e);if(!ar(n,t))return(function(a,i,s){var l,u=gc(i,s);return u?"value"in u?u.value:(l=u.get)===null||l===void 0?void 0:l.call(a.k):void 0})(e,n,t);var o=n[t];return e.I||!ze(o)?o:o===Go(e.t,t)?(Ho(e),e.o[t]=jo(e.A.h,o,e)):o},has:function(e,t){return t in at(e)},ownKeys:function(e){return Reflect.ownKeys(at(e))},set:function(e,t,n){var o=gc(at(e),t);if(o?.set)return o.set.call(e.k,n),!0;if(!e.P){var a=Go(at(e),t),i=a?.[j];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Cc(n,a)&&(n!==void 0||ar(e.t,t)))return!0;Ho(e),it(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return Go(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Ho(e),it(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=at(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty:function(){Ae(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Ae(12)}},Gr={};Rt($r,(function(e,t){Gr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Gr.deleteProperty=function(e,t){return Gr.set.call(this,e,t,void 0)},Gr.set=function(e,t,n){return $r.set.call(this,e[0],t,n,e[0])};var y4=(function(){function e(n){var o=this;this.O=vc,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var l=i;i=a;var u=o;return function(S){var L=this;S===void 0&&(S=l);for(var O=arguments.length,N=Array(O>1?O-1:0),z=1;z<O;z++)N[z-1]=arguments[z];return u.produce(S,(function(I){var U;return(U=i).call.apply(U,[L,I].concat(N))}))}}var p;if(typeof i!="function"&&Ae(6),s!==void 0&&typeof s!="function"&&Ae(7),ze(a)){var h=mc(o),g=jo(o,a,void 0),y=!0;try{p=i(g),y=!1}finally{y?Nn(h):Wo(h)}return typeof Promise<"u"&&p instanceof Promise?p.then((function(S){return Bo(h,s),Fo(S,h)}),(function(S){throw Nn(h),S})):(Bo(h,s),Fo(p,h))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===Ac&&(p=void 0),o.D&&Yo(p,!0),s){var v=[],x=[];Ge("Patches").M(a,p,v,x),s(v,x)}return p}Ae(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var h=arguments.length,g=Array(h>1?h-1:0),y=1;y<h;y++)g[y-1]=arguments[y];return o.produceWithPatches(p,(function(v){return a.apply(void 0,[v].concat(g))}))};var s,l,u=o.produce(a,i,(function(p,h){s=p,l=h}));return typeof Promise<"u"&&u instanceof Promise?u.then((function(p){return[p,s,l]})):[u,s,l]},typeof n?.useProxies=="boolean"&&this.setUseProxies(n.useProxies),typeof n?.autoFreeze=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){ze(n)||Ae(8),Ke(n)&&(n=p4(n));var o=mc(this),a=jo(this,n,void 0);return a[j].C=!0,Wo(o),a},t.finishDraft=function(n,o){var a=n&&n[j],i=a.A;return Bo(i,o),Fo(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!vc&&Ae(20),this.O=n},t.applyPatches=function(n,o){var a;for(a=o.length-1;a>=0;a--){var i=o[a];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}a>-1&&(o=o.slice(a+1));var s=Ge("Patches").$;return Ke(n)?s(n,o):this.produce(n,(function(l){return s(l,o)}))},e})(),fe=new y4,b4=fe.produce,Mh=fe.produceWithPatches.bind(fe),kh=fe.setAutoFreeze.bind(fe),Ih=fe.setUseProxies.bind(fe),Th=fe.applyPatches.bind(fe),Ph=fe.createDraft.bind(fe),Dh=fe.finishDraft.bind(fe),Mn=b4;function wt(e){"@babel/helpers - typeof";return wt=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},wt(e)}function Oc(e,t){if(wt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(wt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rc(e){var t=Oc(e,"string");return wt(t)=="symbol"?t:t+""}function wc(e,t,n){return(t=Rc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,o)}return n}function Jo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nc(Object(n),!0).forEach(function(o){wc(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nc(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function oe(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 _c=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ea=function(){return Math.random().toString(36).substring(7).split("").join(".")},kn={INIT:"@@redux/INIT"+ea(),REPLACE:"@@redux/REPLACE"+ea(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ea()}};function v4(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 ta(e,t,n){var o;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(oe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(oe(1));return n(ta)(e,t)}if(typeof e!="function")throw new Error(oe(2));var a=e,i=t,s=[],l=s,u=!1;function p(){l===s&&(l=s.slice())}function h(){if(u)throw new Error(oe(3));return i}function g(S){if(typeof S!="function")throw new Error(oe(4));if(u)throw new Error(oe(5));var L=!0;return p(),l.push(S),function(){if(L){if(u)throw new Error(oe(6));L=!1,p();var N=l.indexOf(S);l.splice(N,1),s=null}}}function y(S){if(!v4(S))throw new Error(oe(7));if(typeof S.type>"u")throw new Error(oe(8));if(u)throw new Error(oe(9));try{u=!0,i=a(i,S)}finally{u=!1}for(var L=s=l,O=0;O<L.length;O++){var N=L[O];N()}return S}function v(S){if(typeof S!="function")throw new Error(oe(10));a=S,y({type:kn.REPLACE})}function x(){var S,L=g;return S={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(oe(11));function z(){N.next&&N.next(h())}z();var I=L(z);return{unsubscribe:I}}},S[_c]=function(){return this},S}return y({type:kn.INIT}),o={dispatch:y,subscribe:g,getState:h,replaceReducer:v},o[_c]=x,o}function x4(e){Object.keys(e).forEach(function(t){var n=e[t],o=n(void 0,{type:kn.INIT});if(typeof o>"u")throw new Error(oe(12));if(typeof n(void 0,{type:kn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(oe(13))})}function zc(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var a=t[o];typeof e[a]=="function"&&(n[a]=e[a])}var i=Object.keys(n),s,l;try{x4(n)}catch(u){l=u}return function(p,h){if(p===void 0&&(p={}),l)throw l;if(0)var g;for(var y=!1,v={},x=0;x<i.length;x++){var S=i[x],L=n[S],O=p[S],N=L(O,h);if(typeof N>"u"){var z=h&&h.type;throw new Error(oe(14))}v[S]=N,y=y||N!==O}return y=y||i.length!==Object.keys(p).length,y?v:p}}function cr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(o){return o}:t.length===1?t[0]:t.reduce(function(o,a){return function(){return o(a.apply(void 0,arguments))}})}function Mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(o){return function(){var a=o.apply(void 0,arguments),i=function(){throw new Error(oe(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=t.map(function(u){return u(s)});return i=cr.apply(void 0,l)(a.dispatch),Jo(Jo({},a),{},{dispatch:i})}}}function kc(e){var t=function(o){var a=o.dispatch,i=o.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,e):s(l)}}};return t}var Ic=kc();Ic.withExtraArgument=kc;var ra=Ic;var Bc=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(o[i]=a[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),S4=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(p){return function(h){return u([p,h])}}function u(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=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 n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(h){p=[6,h],a=0}finally{o=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},lr=function(e,t){for(var n=0,o=t.length,a=e.length;n<o;n++,a++)e[a]=t[n];return e},C4=Object.defineProperty,E4=Object.defineProperties,A4=Object.getOwnPropertyDescriptors,Tc=Object.getOwnPropertySymbols,L4=Object.prototype.hasOwnProperty,O4=Object.prototype.propertyIsEnumerable,Pc=function(e,t,n){return t in e?C4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},st=function(e,t){for(var n in t||(t={}))L4.call(t,n)&&Pc(e,n,t[n]);if(Tc)for(var o=0,a=Tc(t);o<a.length;o++){var n=a[o];O4.call(t,n)&&Pc(e,n,t[n])}return e},na=function(e,t){return E4(e,A4(t))},R4=function(e,t,n){return new Promise(function(o,a){var i=function(u){try{l(n.next(u))}catch(p){a(p)}},s=function(u){try{l(n.throw(u))}catch(p){a(p)}},l=function(u){return u.done?o(u.value):Promise.resolve(u.value).then(i,s)};l((n=n.apply(e,t)).next())})};var w4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?cr:cr.apply(null,arguments)},t7=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function N4(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function ct(e,t){function n(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(t){var i=t.apply(void 0,o);if(!i)throw new Error("prepareAction did not return an object");return st(st({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:o[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(o){return o.type===e},n}var _4=(function(e){Bc(t,e);function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=e.apply(this,n)||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 n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,lr([void 0],n[0].concat(this)))):new(t.bind.apply(t,lr([void 0],n.concat(this))))},t})(Array),z4=(function(e){Bc(t,e);function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=e.apply(this,n)||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 n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,lr([void 0],n[0].concat(this)))):new(t.bind.apply(t,lr([void 0],n.concat(this))))},t})(Array);function ia(e){return ze(e)?Mn(e,function(){}):e}function M4(e){return typeof e=="boolean"}function k4(){return function(t){return I4(t)}}function I4(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,o=e.immutableCheck,a=o===void 0?!0:o,i=e.serializableCheck,s=i===void 0?!0:i,l=e.actionCreatorCheck,u=l===void 0?!0:l,p=new _4;if(n&&(M4(n)?p.push(ra):p.push(ra.withExtraArgument(n.extraArgument))),0){if(a)var h;if(s)var g;if(u)var y}return p}var oa=!0;function Fc(e){var t=k4(),n=e||{},o=n.reducer,a=o===void 0?void 0:o,i=n.middleware,s=i===void 0?t():i,l=n.devTools,u=l===void 0?!0:l,p=n.preloadedState,h=p===void 0?void 0:p,g=n.enhancers,y=g===void 0?void 0:g,v;if(typeof a=="function")v=a;else if(N4(a))v=zc(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 x=s;if(typeof x=="function"&&(x=x(t),!oa&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!oa&&x.some(function(I){return typeof I!="function"}))throw new Error("each middleware provided to configureStore must be a function");var S=Mc.apply(void 0,x),L=cr;u&&(L=w4(st({trace:!oa},typeof u=="object"&&u)));var O=new z4(S),N=O;Array.isArray(y)?N=lr([S],y):typeof y=="function"&&(N=y(O));var z=L.apply(void 0,N);return ta(v,h,z)}function Gc(e){var t={},n=[],o,a={addCase:function(i,s){var l=typeof i=="string"?i:i.type;if(!l)throw new Error("`builder.addCase` cannot be called with an empty action type");if(l in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[l]=s,a},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return o=i,a}};return e(a),[t,n,o]}function T4(e){return typeof e=="function"}function P4(e,t,n,o){n===void 0&&(n=[]);var a=typeof t=="function"?Gc(t):[t,n,o],i=a[0],s=a[1],l=a[2],u;if(T4(e))u=function(){return ia(e())};else{var p=ia(e);u=function(){return p}}function h(g,y){g===void 0&&(g=u());var v=lr([i[y.type]],s.filter(function(x){var S=x.matcher;return S(y)}).map(function(x){var S=x.reducer;return S}));return v.filter(function(x){return!!x}).length===0&&(v=[l]),v.reduce(function(x,S){if(S)if(Ke(x)){var L=x,O=S(L,y);return O===void 0?x:O}else{if(ze(x))return Mn(x,function(N){return S(N,y)});var O=S(x,y);if(O===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return O}return x},g)}return h.getInitialState=u,h}function D4(e,t){return e+"/"+t}function Hc(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:ia(e.initialState),o=e.reducers||{},a=Object.keys(o),i={},s={},l={};a.forEach(function(h){var g=o[h],y=D4(t,h),v,x;"reducer"in g?(v=g.reducer,x=g.prepare):v=g,i[h]=v,s[y]=v,l[h]=x?ct(y,x):ct(y)});function u(){var h=typeof e.extraReducers=="function"?Gc(e.extraReducers):[e.extraReducers],g=h[0],y=g===void 0?{}:g,v=h[1],x=v===void 0?[]:v,S=h[2],L=S===void 0?void 0:S,O=st(st({},y),s);return P4(n,function(N){for(var z in O)N.addCase(z,O[z]);for(var I=0,U=x;I<U.length;I++){var $=U[I];N.addMatcher($.matcher,$.reducer)}L&&N.addDefaultCase(L)})}var p;return{name:t,reducer:function(h,g){return p||(p=u()),p(h,g)},actions:l,caseReducers:i,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var U4="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",B4=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=U4[Math.random()*64|0];return t},F4=["name","message","stack","code"],aa=(function(){function e(t,n){this.payload=t,this.meta=n}return e})(),Dc=(function(){function e(t,n){this.payload=t,this.meta=n}return e})(),G4=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,o=F4;n<o.length;n++){var a=o[n];typeof e[a]=="string"&&(t[a]=e[a])}return t}return{message:String(e)}},a7=(function(){function e(t,n,o){var a=ct(t+"/fulfilled",function(h,g,y,v){return{payload:h,meta:na(st({},v||{}),{arg:y,requestId:g,requestStatus:"fulfilled"})}}),i=ct(t+"/pending",function(h,g,y){return{payload:void 0,meta:na(st({},y||{}),{arg:g,requestId:h,requestStatus:"pending"})}}),s=ct(t+"/rejected",function(h,g,y,v,x){return{payload:v,error:(o&&o.serializeError||G4)(h||"Rejected"),meta:na(st({},x||{}),{arg:y,requestId:g,rejectedWithValue:!!v,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),l=!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(g,y,v){var x=o?.idGenerator?o.idGenerator(h):B4(),S=new u,L,O=!1;function N(I){L=I,S.abort()}var z=(function(){return R4(this,null,function(){var I,U,$,Pe,ht,De,de;return S4(this,function(xe){switch(xe.label){case 0:return xe.trys.push([0,4,,5]),Pe=(I=o?.condition)==null?void 0:I.call(o,h,{getState:y,extra:v}),$4(Pe)?[4,Pe]:[3,2];case 1:Pe=xe.sent(),xe.label=2;case 2:if(Pe===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return O=!0,ht=new Promise(function(ue,gt){return S.signal.addEventListener("abort",function(){return gt({name:"AbortError",message:L||"Aborted"})})}),g(i(x,h,(U=o?.getPendingMeta)==null?void 0:U.call(o,{requestId:x,arg:h},{getState:y,extra:v}))),[4,Promise.race([ht,Promise.resolve(n(h,{dispatch:g,getState:y,extra:v,requestId:x,signal:S.signal,abort:N,rejectWithValue:function(ue,gt){return new aa(ue,gt)},fulfillWithValue:function(ue,gt){return new Dc(ue,gt)}})).then(function(ue){if(ue instanceof aa)throw ue;return ue instanceof Dc?a(ue.payload,x,h,ue.meta):a(ue,x,h)})])];case 3:return $=xe.sent(),[3,5];case 4:return De=xe.sent(),$=De instanceof aa?s(null,x,h,De.payload,De.meta):s(De,x,h),[3,5];case 5:return de=o&&!o.dispatchConditionRejection&&s.match($)&&$.meta.condition,de||g($),[2,$]}})})})();return Object.assign(z,{abort:N,requestId:x,arg:h,unwrap:function(){return z.then(H4)}})}}return Object.assign(p,{pending:i,rejected:s,fulfilled:a,typePrefix:t})}return e.withTypes=function(){return e},e})();function H4(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function $4(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var $c="listener",Wc="completed",jc="cancelled",i7="task-"+jc,s7="task-"+Wc,c7=$c+"-"+jc,l7=$c+"-"+Wc;var sa="listenerMiddleware";var d7=ct(sa+"/add"),u7=ct(sa+"/removeAll"),f7=ct(sa+"/remove");var Uc,p7=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Uc||(Uc=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},W4=function(e){return function(t){setTimeout(t,e)}},m7=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:W4(10);Ec();var j4=En(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(n,o,a){this.eventBus.addEventListener(n,o,a)}dispatchEvent(n){return this.eventBus.dispatchEvent(n)}removeEventListener(n,o,a){this.eventBus.removeEventListener(n,o,a)}}}),In=class extends j4(Object){};window.ftReduxStores||(window.ftReduxStores={});var Vc=class e extends In{static get(t){var n;let o=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[o];if(wn(i))return i;if(a==null)return;let s=Hc({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=Fc({reducer:(u,p)=>{if(p.type==="CLEAR_FT_REDUX_STORE"){let h=Ur(s.getInitialState());for(let g of p.keeping)h[g]=(u??h)[g];return h}else if(typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...p.overwrites};return s.reducer(u,p)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus)}constructor(t,n,o){super(),this.reduxSlice=t,this.reduxStore=n,this.isFtReduxStore=!0,this.commands=new An;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let u=s,p=i[u];return p?(...h)=>{let g=p(...h.map(a));return this.reduxStore.dispatch(g),g}:h=>{this.setState({[u]:a(h)})}}}),this.eventBus=o??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Tn=class{static format(t,n,o,a,i){return window.moment?window.moment(t).locale(n).format(this.getMomentDateFormat(o,a,!!i)):this.getIntlDateTime(t,n,o,a,!!i)}static getMomentDateFormat(t,n,o){return o?"LT":t?n?"lll":"ll":n?"L LT":"L"}static getIntlDateTime(t,n,o,a,i){let s=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(n,{dateStyle:o?"medium":"short"}).format(s),u=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?u:a?`${l} ${u}`:l}static getTimezoneAsString(){let t=o=>String(Math.floor(o)).padStart(2,"0"),n=new Date().getTimezoneOffset();return`${n<0?"+":"-"}${t(Math.abs(n)/60)}:${t(Math.abs(n)%60)}`}};var Pn=A(T()),V4="ft-app-info",dr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};dr.eventName="authentication-change";var Wr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Wr.eventName="ui-locale-changed";var K4={session:(e,t)=>{(0,Pn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>P.dispatchEvent(new dr(t.payload)),0))}},P=Pn.FtReduxStore.get({name:V4,reducers:K4,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,searchLanguageSetsUiLanguage:!1,uiLanguageSetsSearchLanguage:!1,uiLanguageSetsReaderLanguage:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Kc=A(T()),Dn=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},H7=(0,Kc.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...o){super(o),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(P)}dateFormatOptionsChanged(o){return o.has("metadataDescriptors")||o.has("useLongDateFormat")||o.has("useDateTimeFormat")||o.has("uiLocale")}getDateFormatter(o){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>Tn.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Dn([(0,ca.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Dn([(0,ca.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Dn([Uo({store:P.name,selector:n=>{var o,a;return(a=(o=n.metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),Dn([Uo({store:P.name})],t.prototype,"uiLocale",void 0),t});var qc;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(qc||(qc={}));var Zc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Zc||(Zc={}));var Yc;(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"})(Yc||(Yc={}));var Xc;(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"})(Xc||(Xc={}));var Qc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Qc||(Qc={}));var Jc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Jc||(Jc={}));var el;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(el||(el={}));var tl;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(tl||(tl={}));var rl;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(rl||(rl={}));var nl;(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"})(nl||(nl={}));var ol;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(ol||(ol={}));var al;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(al||(al={}));var il;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(il||(il={}));var sl;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(sl||(sl={}));var cl;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(cl||(cl={}));var ll;(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"})(ll||(ll={}));var dl;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(dl||(dl={}));var ul;(function(e){e.ASC="ASC",e.DESC="DESC"})(ul||(ul={}));var fl;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(fl||(fl={}));var pl;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(pl||(pl={}));var ml;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ml||(ml={}));var hl;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(hl||(hl={}));var gl;(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"})(gl||(gl={}));var yl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(yl||(yl={}));var bl;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(bl||(bl={}));var vl;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(vl||(vl={}));var xl;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(xl||(xl={}));var Q;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(Q||(Q={}));var Le;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(Le||(Le={}));var Sl;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Sl||(Sl={}));var Cl;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Cl||(Cl={}));var El;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(El||(El={}));var Al;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Al||(Al={}));var Ll;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ll||(Ll={}));var Ol;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Ol||(Ol={}));var Rl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Rl||(Rl={}));var wl;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(wl||(wl={}));var Nl;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(Nl||(Nl={}));var _l;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(_l||(_l={}));var zl;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(zl||(zl={}));var Ml;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Ml||(Ml={}));var q4={[Q.PERSONAL_BOOK_SHARE_USER]:[Q.PERSONAL_BOOK_USER],[Q.HTML_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.PDF_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.KHUB_ADMIN]:[Q.CONTENT_PUBLISHER],[Q.ADMIN]:[Q.KHUB_ADMIN,Q.USERS_ADMIN,Q.PORTAL_ADMIN,Q.BEHAVIOR_DATA_USER],[Q.GENERATIVE_AI_EXPORT_USER]:[Q.GENERATIVE_AI_USER]};function kl(e,t){return e===t||(q4[e]??[]).some(n=>kl(n,t))}function Il(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(o=>kl(o,t))}var Hn=A(T());var la=A(T());var Nt=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=P.getState(),a=t??o;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let o=e.get(t);if(o)n(o);else{let a=P.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var ur=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Nt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Nt.await()}};var pe=class extends ur{constructor(t=!0,n){var o;super(n),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[u])=>l.localeCompare(u)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new la.CacheRegistry,this.cache=t?a.commonCache:new la.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,o)=>0|31*n+o.charCodeAt(0),0))}};var Un=class extends pe{async listMySearches(){let{session:t}=P.getState();return Il(t,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Bn=class extends pe{async listMyBookmarks(){let t=P.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Fn=class extends pe{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=P.getState().session;return!!t?.sessionAuthenticated}};var Gn=class extends pe{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=P.getState().session;return!!t?.sessionAuthenticated}};var Z4="ft-user-assets",Y4={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(Le).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let n=t.payload.mapId;e.assetCounts.bookmarkByMap[n]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:n,mapId:o,asset:a}=t.payload;ua(e,n,[...da(e,n),a]),Tl(e,n,1,o),Pl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ua(e,n,da(e,n).map(a=>a.id===o.id?o:a)),Pl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ua(e,n,da(e,n).filter(i=>i.id!==a)),Tl(e,n,-1,o)}},Dl={[Le.SEARCHES]:"savedSearches",[Le.BOOKMARKS]:"bookmarks",[Le.BOOKS]:void 0,[Le.COLLECTIONS]:void 0},da=(e,t)=>{var n;let o=Dl[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ua=(e,t,n)=>{let o=Dl[t];o&&(e[o]=n)},Tl=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===Le.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},Pl=(e,t)=>{let n=e.assetLabels.map(a=>a.title),o=t.labels.filter(a=>!n.includes(a)).map(a=>({title:a}));e.assetLabels.push(...o)},ie=Hn.FtReduxStore.get({name:Z4,reducers:Y4,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Le).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),fa=class{constructor(t=new Fn,n=new Gn){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=P.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Bn,this.savedSearchesService=new Un,P.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=P.getState();(0,Hn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,n?.profile)||(this.currentSession=n,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ie.actions.clearAssetCount(),ie.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ie.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ie.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ie.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ie.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&ie.getState().assetCounts.allAsset[t]!==n.count&&ie.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&ie.getState().assetCounts.bookmarkByMap[t]!==n.count&&ie.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(ie.getState().assetCounts.bookmarkByMap).length!==0;t===Le.BOOKMARKS&&n&&ie.actions.clearBookmarkCountByMap(),ie.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 n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ie.actions.bookmarks(n)}}},X4=new fa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=X4);var pa=class{addCommand(t,n=!1){P.commands.add(t,n)}consumeCommand(t){return P.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new pa;var Oe=A(T());var Ul,fr=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Q4=Symbol("clearAfterUnitTest"),$n=class extends(0,Oe.withEventBus)(pe){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ul]=()=>{this.defaultMessages={},this.cache=new Oe.CacheRegistry,this.listeners={}},this.currentUiLocale=P.getState().uiLocale,P.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=P.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var o;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(o=this.defaultMessages[t])!==null&&o!==void 0?o:{},...n};(0,Oe.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,o;return this.fetchContext(t),(o=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&o!==void 0?o:{}}resolveRawMessage(t,n){let o=t.toLowerCase();return this.resolveContext(o)[n]}resolveMessage(t,n,...o){var a;let i=t.toLowerCase(),s=this.resolveContext(i);return new Oe.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(n,...o)}async fetchContext(t){let n=!this.cache.has(t),o;try{o=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof Oe.CanceledPromiseError)&&n&&console.error(a)}return o}subscribe(t,n){var o;return t=t.toLowerCase(),this.listeners[t]=(o=this.listeners[t])!==null&&o!==void 0?o:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new fr({loadedContexts:t})),this.dispatchEvent(new fr({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new fr({loadedContexts:[t]})),this.dispatchEvent(new fr({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,Oe.delay)(0).then(()=>o()).catch(()=>null)))}};Ul=Q4;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends $n{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends $n{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var jr=window.FluidTopicsI18nService,ma=window.FluidTopicsCustomI18nService;var Bl=A(T()),ha=class{highlightHtml(t,n,o){(0,Bl.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ha;var Fl=A(T());var ga=class{isDate(t){var n,o,a,i;return(i=(a=((o=(n=P.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&o!==void 0?o:[]).find(l=>l.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return Fl.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:P.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(i=n?.withTime)!==null&&i!==void 0?i:!1,(s=n?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(t)} is not valid`,l),l}}};window.FluidTopicsDateService=new ga;var Gl=A(T());var Vr=class{static get(t,n){var o,a;let i=P.getState(),{lang:s,region:l}=(a=(o=i.defaultLocales)===null||o===void 0?void 0:o.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Gl.SearchPlaceConverter(i.baseUrl,t??20,i.searchInAllLanguagesAllowed,n??`${s}-${l}`)}};var ya=class{urlToSearchRequest(t){return Vr.get().parse(t)}searchRequestToUrl(t){return Vr.get().serialize(t)}};window.FluidTopicsUrlService=new ya;var qe=A(T());var _t=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};_t.eventName="change";var ba=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},Hl=new ba;var Wn=class e extends qe.WithEventBus{static build(){return new e(window.history,Hl,()=>window.location,!1)}constructor(t,n,o,a){var i,s;super(),this.history=t,this.historyStorage=n,this.windowLocation=o,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let o=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,o&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,qe.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new _t(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let u=n(),p={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:typeof l=="string"?l:(l??this.windowLocation()).href};o.apply(a,[p,s,l]),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 n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let o={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(o)}addHistoryChangeListener(t){this.addEventListener(_t.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(_t.eventName,t)}currentItem(){return(0,qe.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,qe.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,qe.deepCopy)(n.find(o=>t(o)))}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,qe.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 n;let o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!o)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,o);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var o;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,i=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Wn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});var $l=A(F());var Wl=$l.css`
825
- `;var Kl=A(F()),me=A(ne()),kt=A(T());var zt=A(T());function jl(e,t){let{authenticationRequired:n,session:o}=P.getState();return n&&!o?.sessionAuthenticated?Promise.resolve(t):e()}var jn=class extends ur{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var va=class e extends zt.FtStateManager{static build(t){return new e(P,t)}constructor(t,n){super(),this.store=t,this.cache=new zt.CacheRegistry,this.withManualResources=!0,this.localesConfiguration=null,this.userLocaleService=new jn,this.cleanSessionDebouncer=new zt.Debouncer,this.reloadDebouncer=new zt.Debouncer(500),this.apiProvider=n??(()=>Nt.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener(dr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let t=await this.cache.get("session",async()=>{let n=await this.apiProvider().getCurrentSession();return n.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},n.idleTimeoutInMillis),n});this.setSession(t)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var t;let n=await this.cache.get("availableContentLocales",()=>jl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=n.contentLocales)!==null&&t!==void 0?t:[])}reloadConfiguration(){var t;(t=this.cache)===null||t===void 0||t.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){var n,o,a,i,s;this.localesConfiguration=t,this.store.actions.defaultLocales(this.localesConfiguration.defaultLocales),this.store.actions.availableUiLocales((n=this.localesConfiguration.availableUiLocales)!==null&&n!==void 0?n:[]),this.store.actions.searchInAllLanguagesAllowed((o=this.localesConfiguration.allLanguagesAllowed)!==null&&o!==void 0?o:!1),this.store.actions.searchLanguageSetsUiLanguage((a=this.localesConfiguration.searchLanguageSetsUiLanguage)!==null&&a!==void 0?a:!1),this.store.actions.uiLanguageSetsSearchLanguage((i=this.localesConfiguration.uiLanguageSetsSearchLanguage)!==null&&i!==void 0?i:!1),this.store.actions.uiLanguageSetsReaderLanguage((s=this.localesConfiguration.uiLanguageSetsReaderLanguage)!==null&&s!==void 0?s:!1),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t){this.userLocaleService.updateUiLocale({uiLocale:t}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Wr(n)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}},Vl=va.build();var Mt=class extends Event{constructor(t,n,o,a){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=n,this.callback=o,this.subscribe=a??!1}};var Kr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let n=this.pendingContextRequests.get(t.context);if(n===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:o}=n;for(let{elementRef:a,callbackRef:i}of o){let s=a.deref(),l=i.deref();s===void 0||l===void 0||s.dispatchEvent(new Mt(t.context,s,l,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let n=t.contextTarget??t.composedPath()[0],o=t.callback,a=this.pendingContextRequests.get(t.context);a===void 0&&this.pendingContextRequests.set(t.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(n);i===void 0&&a.callbacks.set(n,i=new WeakSet),i.has(o)||(i.add(o),a.requests.push({elementRef:new WeakRef(n),callbackRef:new WeakRef(o)}))}}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var ae=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},q=class extends kt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Vl,this.contextRoot=new Kr}render(){return Kl.html`
824
+ `;var ws=["top","right","bottom","left"],Rs=["start","end"],_o=ws.reduce((e,t)=>e.concat(t,t+"-"+Rs[0],t+"-"+Rs[1]),[]),Mr=Math.min,rt=Math.max,kr=Math.round;var _e=e=>({x:e,y:e}),F0={left:"right",right:"left",bottom:"top",top:"bottom"};function Ns(e,t,n){return rt(e,Mr(t,n))}function pn(e,t){return typeof e=="function"?e(t):e}function Ir(e){return e.split("-")[0]}function nt(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function Mo(e){return e==="y"?"height":"width"}function mn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ko(e){return zo(mn(e))}function _s(e,t,n){n===void 0&&(n=!1);let o=nt(e),a=ko(e),i=Mo(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=No(s)),[s,No(s)]}function zs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function No(e){let t=Ir(e);return F0[t]+e.slice(t.length)}function G0(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Ms(e){return typeof e!="number"?G0(e):{top:e,right:e,bottom:e,left:e}}function St(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function ks(e,t,n){let{reference:o,floating:a}=e,i=mn(t),s=ko(t),l=Mo(s),u=Ir(t),p=i==="y",h=o.x+o.width/2-a.width/2,g=o.y+o.height/2-a.height/2,y=o[l]/2-a[l]/2,v;switch(u){case"top":v={x:h,y:o.y-a.height};break;case"bottom":v={x:h,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:g};break;case"left":v={x:o.x-a.width,y:g};break;default:v={x:o.x,y:o.y}}let x=nt(t);return x&&(v[s]+=y*(x==="end"?1:-1)*(n&&p?-1:1)),v}async function Is(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:y=!1,padding:v=0}=pn(t,e),x=Ms(v),L=l[y?g==="floating"?"reference":"floating":g],O=St(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(L)))==null||n?L:L.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:p,rootBoundary:h,strategy:u})),N=g==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,z=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),I=await(i.isElement==null?void 0:i.isElement(z))&&await(i.getScale==null?void 0:i.getScale(z))||{x:1,y:1},U=St(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:N,offsetParent:z,strategy:u}):N);return{top:(O.top-U.top+x.top)/I.y,bottom:(U.bottom-O.bottom+x.bottom)/I.y,left:(O.left-U.left+x.left)/I.x,right:(U.right-O.right+x.right)/I.x}}var H0=50,Ts=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:Is},u=await(s.isRTL==null?void 0:s.isRTL(t)),p=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:g}=ks(p,o,u),y=o,v=0,x={};for(let S=0;S<i.length;S++){let L=i[S];if(!L)continue;let{name:O,fn:N}=L,{x:z,y:I,data:U,reset:$}=await N({x:h,y:g,initialPlacement:o,placement:y,strategy:a,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});h=z??h,g=I??g,x[O]={...x[O],...U},$&&v<H0&&(v++,typeof $=="object"&&($.placement&&(y=$.placement),$.rects&&(p=$.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):$.rects),{x:h,y:g}=ks(p,y,u)),S=-1)}return{x:h,y:g,placement:y,strategy:a,middlewareData:x}};function $0(e,t,n){return(e?[...n.filter(a=>nt(a)===e),...n.filter(a=>nt(a)!==e)]:n.filter(a=>Ir(a)===a)).filter(a=>e?nt(a)===e||(t?zs(a)!==a:!1):!0)}var Ps=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,a;let{rects:i,middlewareData:s,placement:l,platform:u,elements:p}=t,{crossAxis:h=!1,alignment:g,allowedPlacements:y=_o,autoAlignment:v=!0,...x}=pn(e,t),S=g!==void 0||y===_o?$0(g||null,v,y):y,L=((n=s.autoPlacement)==null?void 0:n.index)||0,O=S[L];if(O==null)return{};if(l!==O)return{reset:{placement:S[0]}};let N=await u.detectOverflow(t,x),z=_s(O,i,await(u.isRTL==null?void 0:u.isRTL(p.floating))),I=[N[Ir(O)],N[z[0]],N[z[1]]],U=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:O,overflows:I}],$=S[L+1];if($)return{data:{index:L+1,overflows:U},reset:{placement:$}};let Pe=U.map(de=>{let xe=nt(de.placement);return[de.placement,xe&&h?de.overflows.slice(0,2).reduce((ue,gt)=>ue+gt,0):de.overflows[0],de.overflows]}).sort((de,xe)=>de[1]-xe[1]),De=((a=Pe.filter(de=>de[2].slice(0,nt(de[0])?2:3).every(xe=>xe<=0))[0])==null?void 0:a[0])||Pe[0][0];return De!==l?{data:{index:L+1,overflows:U},reset:{placement:De}}:{}}}};var Ds=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:u={fn:N=>{let{x:z,y:I}=N;return{x:z,y:I}}},...p}=pn(e,t),h={x:n,y:o},g=await i.detectOverflow(t,p),y=mn(a),v=zo(y),x=h[v],S=h[y],L=(N,z)=>Ns(z+g[N==="y"?"top":"left"],z,z-g[N==="y"?"bottom":"right"]);s&&(x=L(v,x)),l&&(S=L(y,S));let O=u.fn({...t,[v]:x,[y]:S});return{...O,data:{x:O.x-n,y:O.y-o,enabled:{[v]:s,[y]:l}}}}}};function gn(){return typeof window<"u"}function Et(e){return Bs(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ue(e){var t;return(t=(Bs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bs(e){return gn()?e instanceof Node||e instanceof ce(e).Node:!1}function Ce(e){return gn()?e instanceof Element||e instanceof ce(e).Element:!1}function Be(e){return gn()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Us(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function er(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function Fs(e){return/^(table|td|th)$/.test(Et(e))}function Tr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var W0=/transform|translate|scale|rotate|perspective|filter/,j0=/paint|layout|strict|content/,Ct=e=>!!e&&e!=="none",Io;function tr(e){let t=Ce(e)?Ee(e):e;return Ct(t.transform)||Ct(t.translate)||Ct(t.scale)||Ct(t.rotate)||Ct(t.perspective)||!yn()&&(Ct(t.backdropFilter)||Ct(t.filter))||W0.test(t.willChange||"")||j0.test(t.contain||"")}function Gs(e){let t=Ve(e);for(;Be(t)&&!At(t);){if(tr(t))return t;if(Tr(t))return null;t=Ve(t)}return null}function yn(){return Io==null&&(Io=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Io}function At(e){return/^(html|body|#document)$/.test(Et(e))}function Ee(e){return ce(e).getComputedStyle(e)}function Pr(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ve(e){if(Et(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Us(e)&&e.host||Ue(e);return Us(t)?t.host:t}function Hs(e){let t=Ve(e);return At(t)?(e.ownerDocument||e).body:Be(t)&&er(t)?t:Hs(t)}function hn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=Hs(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=ce(a);if(i){let l=bn(s);return t.concat(s,s.visualViewport||[],er(a)?a:[],l&&n?hn(l):[])}else return t.concat(a,hn(a,[],n))}function bn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vs(e){let t=Ee(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Be(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=kr(n)!==i||kr(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Ks(e){return Ce(e)?e:e.contextElement}function rr(e){let t=Ks(e);if(!Be(t))return _e(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=Vs(t),s=(i?kr(n.width):n.width)/o,l=(i?kr(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var V0=_e(0);function qs(e){let t=ce(e);return!yn()||!t.visualViewport?V0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K0(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ce(e)?!1:t}function Dr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=Ks(e),s=_e(1);t&&(o?Ce(o)&&(s=rr(o)):s=rr(e));let l=K0(i,n,o)?qs(i):_e(0),u=(a.left+l.x)/s.x,p=(a.top+l.y)/s.y,h=a.width/s.x,g=a.height/s.y;if(i){let y=ce(i),v=o&&Ce(o)?ce(o):o,x=y,S=bn(x);for(;S&&o&&v!==x;){let L=rr(S),O=S.getBoundingClientRect(),N=Ee(S),z=O.left+(S.clientLeft+parseFloat(N.paddingLeft))*L.x,I=O.top+(S.clientTop+parseFloat(N.paddingTop))*L.y;u*=L.x,p*=L.y,h*=L.x,g*=L.y,u+=z,p+=I,x=ce(S),S=bn(x)}}return St({width:h,height:g,x:u,y:p})}function vn(e,t){let n=Pr(e).scrollLeft;return t?t.left+n:Dr(Ue(e)).left+n}function Zs(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-vn(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function q0(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,i=a==="fixed",s=Ue(o),l=t?Tr(t.floating):!1;if(o===s||l&&i)return n;let u={scrollLeft:0,scrollTop:0},p=_e(1),h=_e(0),g=Be(o);if((g||!g&&!i)&&((Et(o)!=="body"||er(s))&&(u=Pr(o)),g)){let v=Dr(o);p=rr(o),h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}let y=s&&!g&&!i?Zs(s,u):_e(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-u.scrollLeft*p.x+h.x+y.x,y:n.y*p.y-u.scrollTop*p.y+h.y+y.y}}function Z0(e){return Array.from(e.getClientRects())}function Y0(e){let t=Ue(e),n=Pr(e),o=e.ownerDocument.body,a=rt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=rt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+vn(e),l=-n.scrollTop;return Ee(o).direction==="rtl"&&(s+=rt(t.clientWidth,o.clientWidth)-a),{width:a,height:i,x:s,y:l}}var $s=25;function X0(e,t){let n=ce(e),o=Ue(e),a=n.visualViewport,i=o.clientWidth,s=o.clientHeight,l=0,u=0;if(a){i=a.width,s=a.height;let h=yn();(!h||h&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}let p=vn(o);if(p<=0){let h=o.ownerDocument,g=h.body,y=getComputedStyle(g),v=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(o.clientWidth-g.clientWidth-v);x<=$s&&(i-=x)}else p<=$s&&(i+=p);return{width:i,height:s,x:l,y:u}}function Q0(e,t){let n=Dr(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=Be(e)?rr(e):_e(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=a*i.x,p=o*i.y;return{width:s,height:l,x:u,y:p}}function Ws(e,t,n){let o;if(t==="viewport")o=X0(e,n);else if(t==="document")o=Y0(Ue(e));else if(Ce(t))o=Q0(t,n);else{let a=qs(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return St(o)}function Ys(e,t){let n=Ve(e);return n===t||!Ce(n)||At(n)?!1:Ee(n).position==="fixed"||Ys(n,t)}function J0(e,t){let n=t.get(e);if(n)return n;let o=hn(e,[],!1).filter(l=>Ce(l)&&Et(l)!=="body"),a=null,i=Ee(e).position==="fixed",s=i?Ve(e):e;for(;Ce(s)&&!At(s);){let l=Ee(s),u=tr(s);!u&&l.position==="fixed"&&(a=null),(i?!u&&!a:!u&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||er(s)&&!u&&Ys(e,s))?o=o.filter(h=>h!==s):a=l,s=Ve(s)}return t.set(e,o),o}function e4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?Tr(t)?[]:J0(t,this._c):[].concat(n),o],l=Ws(t,s[0],a),u=l.top,p=l.right,h=l.bottom,g=l.left;for(let y=1;y<s.length;y++){let v=Ws(t,s[y],a);u=rt(v.top,u),p=Mr(v.right,p),h=Mr(v.bottom,h),g=rt(v.left,g)}return{width:p-g,height:h-u,x:g,y:u}}function t4(e){let{width:t,height:n}=Vs(e);return{width:t,height:n}}function r4(e,t,n){let o=Be(t),a=Ue(t),i=n==="fixed",s=Dr(e,!0,i,t),l={scrollLeft:0,scrollTop:0},u=_e(0);function p(){u.x=vn(a)}if(o||!o&&!i)if((Et(t)!=="body"||er(a))&&(l=Pr(t)),o){let v=Dr(t,!0,i,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else a&&p();i&&!o&&a&&p();let h=a&&!o&&!i?Zs(a,l):_e(0),g=s.left+l.scrollLeft-u.x-h.x,y=s.top+l.scrollTop-u.y-h.y;return{x:g,y,width:s.width,height:s.height}}function To(e){return Ee(e).position==="static"}function js(e,t){if(!Be(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ue(e)===n&&(n=n.ownerDocument.body),n}function Xs(e,t){let n=ce(e);if(Tr(e))return n;if(!Be(e)){let a=Ve(e);for(;a&&!At(a);){if(Ce(a)&&!To(a))return a;a=Ve(a)}return n}let o=js(e,t);for(;o&&Fs(o)&&To(o);)o=js(o,t);return o&&At(o)&&To(o)&&!tr(o)?n:o||Gs(e)||n}var n4=async function(e){let t=this.getOffsetParent||Xs,n=this.getDimensions,o=await n(e.floating);return{reference:r4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function o4(e){return Ee(e).direction==="rtl"}var xn={convertOffsetParentRelativeRectToViewportRelativeRect:q0,getDocumentElement:Ue,getClippingRect:e4,getOffsetParent:Xs,getElementRects:n4,getClientRects:Z0,getDimensions:t4,getScale:rr,isElement:Ce,isRTL:o4};var Qs=Ps,Js=Ds;var ec=(e,t,n)=>{let o=new Map,a={platform:xn,...n},i={...a.platform,_c:o};return Ts(e,t,{...a,platform:i})};function tc(e){return a4(e)}function Po(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function a4(e){for(let t=e;t;t=Po(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Po(e);t;t=Po(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||tr(n)||t.tagName==="BODY"))return t}return null}async function Sn(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},ec(e,t,{strategy:o.strategy,platform:{...xn,getOffsetParent:a=>xn.getOffsetParent(a,tc)},middleware:[Js({crossAxis:!0}),Qs({allowedPlacements:[o.placement]})]})}var mr=A(T());var ca=A(ne());var rc=A(ne(),1);var Do=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function nc(e,t){return(0,rc.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return Ur(e);try{return JSON.parse(n)}catch{return Ur(e)}},toAttribute:n=>JSON.stringify(n)},hasChanged:Br,...t??{}})}function i4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Cn(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!Cn(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[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 a=s=>Object.keys(s).filter(l=>s[l]!=null),i=a(e);if(n=i.length,n!==a(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){let s=i[o];if(!Cn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Cn(e,t){try{return i4(e,t)}catch{return!1}}function Br(e,t){return!Cn(e,t)}function Ur(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function En(e,t){let n=o=>o[e]===!0;return o=>{if(n(o))return o;let a=t(o);return a[e]=!0,a}}var oc=A(ne(),1);var Uo=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:Br,attribute:!1,...t};(0,oc.property)(i)(n,o);let s=n.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(o,{selector:(a=t.selector)!==null&&a!==void 0?a:(l=>l[o]),store:t.store})}};var An=class{constructor(){this.queue=[]}add(t,n=!1){n&&this.clear(t.type),this.queue.push(t)}consume(t){let n=this.queue.find(o=>o.type===t);return n&&(this.queue=this.queue.filter(o=>o!==n)),n}clear(t){typeof t=="string"?this.queue=this.queue.filter(n=>n.type!==t):this.queue=this.queue.filter(n=>!t.test(n.type))}};var Lt=A(ne(),1);var Ln=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,n){return this.callbacks=[t],this.debounce(n)}queue(t,n){return this.callbacks.push(t),this.debounce(n)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((n,o)=>{this.resolvePromise=n,this.rejectPromise=o})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,n;let o=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(n=this.resolvePromise)!==null&&n!==void 0?n:(()=>null);this.clearPromise();for(let s of o)try{await s()}catch(l){a(l);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 ic=A(F(),1);var On=globalThis,s4=On.ShadowRoot&&(On.ShadyCSS===void 0||On.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var ac=(e,t)=>{if(s4)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let o=document.createElement("style"),a=On.litNonce;a!==void 0&&o.setAttribute("nonce",a),o.textContent=n.cssText,e.appendChild(o)}};var Rn=class extends ic.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let n={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(n);return ac(o,t.elementStyles),o}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([n,o])=>this.defineScopedElement(n,o))}static defineScopedElement(t,n){Do(t)(n),this.canDefineScopedElement(t)&&this.registry.define(t,n)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,n){this.scopedRegistryConstructor.defineScopedElement(t,n)}};function sc(e,t,...n){var o;let a=e.querySelector(t);for(let i of n)a=(o=a?.shadowRoot)===null||o===void 0?void 0:o.querySelector(i);return a}var or=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},uc,cc=Symbol("constructorPrototype"),lc=Symbol("constructorName"),fc=Symbol("exportpartsDebouncer"),dc=Symbol("dynamicDependenciesLoaded"),nr=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};nr.eventName="exportparts-updated";var Fe=class extends Rn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[uc]=new Ln(5),this.scheduleExportpartsUpdate=()=>{var t,n,o;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(o=(n=this.exportpartsPrefixes)===null||n===void 0?void 0:n.length)!==null&&o!==void 0&&o)&&this[fc].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[lc]=this.constructor.name,this[cc]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[lc]&&Object.setPrototypeOf(this,this[cc])}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(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let n=this.constructor;n[dc]||(n[dc]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(nr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(nr.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 nr)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:n,selector:o,shadowPath:a}=this.elementToFocus;if(o!=null){let i=[...a??[],o];n=sc(this.shadowRoot,...i)}n?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||n?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var n,o,a;if(((o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&o!==void 0?o:[]).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 n,o,a,i,s,l;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(o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&o!==void 0?o:[]){let v=(i=(a=y.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],x=(l=(s=y.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(L=>L.split(":")[1]))!==null&&l!==void 0?l:[],S=[...v,...x].filter(u).map(L=>L.trim());for(let L of S)h.add(L)}if(h.size===0){this.exportparts=void 0;return}let g=[...h.values()].flatMap(y=>p.map(v=>`${y}:${v}--${y}`));this.exportparts=[...this.part,...g].join(", ")}};uc=fc;or([(0,Lt.property)()],Fe.prototype,"exportpartsPrefix",void 0);or([nc([])],Fe.prototype,"exportpartsPrefixes",void 0);or([(0,Lt.property)({reflect:!0})],Fe.prototype,"exportparts",void 0);or([(0,Lt.property)()],Fe.prototype,"customStylesheet",void 0);or([(0,Lt.property)()],Fe.prototype,"elementToFocus",void 0);or([(0,Lt.state)()],Fe.prototype,"useAdoptedStyleSheets",void 0);function wn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Fr=Symbol("internalReduxEventsUnsubscribers"),ot=Symbol("internalStoresUnsubscribers"),Ot=Symbol("internalStores"),c4=En(Symbol("withRedux"),function(e){var t,n,o;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[n]=new Map,this[o]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[Ot].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ot].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Ot].get(s)}addStore(s,l){var u;l=(u=l??s.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(l),this[Ot].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Ot].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Ot].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let u=this.constructor.getPropertyOptions(l);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:l)){let p=this.getStore(s.store);p&&(s.store?this[ot].has(s.store):this[ot].size>0)&&(this[l]=s.selector(p.getState(),this))}})}subscribeToStore(s,l){var u;this[ot].set(s,l.subscribe(()=>this.updateFromStores())),this[Fr].set(s,[]),wn(l)&&l.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||l.name===p.store)){let g=y=>this[h](y);l.addEventListener(p.eventName,g),this[Fr].get(s).push(()=>l.removeEventListener(p.eventName,g))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[ot].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[ot].has(s)&&this[ot].get(s)(),this[ot].delete(s),(l=this[Fr].get(s))===null||l===void 0||l.forEach(u=>u()),this[Fr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=ot,n=Ot,o=Fr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),pc=class extends c4(Fe){};function Ae(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(s){return"'"+s+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ke(e){return!!e&&!!e[j]}function ze(e){var t;return!!e&&((function(n){if(!n||typeof n!="object")return!1;var o=Object.getPrototypeOf(n);if(o===null)return!0;var a=Object.hasOwnProperty.call(o,"constructor")&&o.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===g4})(e)||Array.isArray(e)||!!e[xc]||!!(!((t=e.constructor)===null||t===void 0)&&t[xc])||Ko(e)||qo(e))}function Rt(e,t,n){n===void 0&&(n=!1),sr(e)===0?(n?Object.keys:ir)(e).forEach((function(o){n&&typeof o=="symbol"||t(o,e[o],e)})):e.forEach((function(o,a){return t(a,o,e)}))}function sr(e){var t=e[j];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ko(e)?2:qo(e)?3:0}function ar(e,t){return sr(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l4(e,t){return sr(e)===2?e.get(t):e[t]}function Sc(e,t,n){var o=sr(e);o===2?e.set(t,n):o===3?e.add(n):e[t]=n}function Cc(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Ko(e){return m4&&e instanceof Map}function qo(e){return h4&&e instanceof Set}function at(e){return e.o||e.t}function Zo(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Lc(e);delete t[j];for(var n=ir(t),o=0;o<n.length;o++){var a=n[o],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 Yo(e,t){return t===void 0&&(t=!1),Xo(e)||Ke(e)||!ze(e)||(sr(e)>1&&(e.set=e.add=e.clear=e.delete=d4),Object.freeze(e),t&&Rt(e,(function(n,o){return Yo(o,!0)}),!0)),e}function d4(){Ae(2)}function Xo(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ge(e){var t=Vo[e];return t||Ae(18,e),t}function u4(e,t){Vo[e]||(Vo[e]=t)}function $o(){return Hr}function Bo(e,t){t&&(Ge("Patches"),e.u=[],e.s=[],e.v=t)}function Nn(e){Wo(e),e.p.forEach(f4),e.p=null}function Wo(e){e===Hr&&(Hr=e.l)}function mc(e){return Hr={p:[],l:Hr,h:e,m:!0,_:0}}function f4(e){var t=e[j];t.i===0||t.i===1?t.j():t.g=!0}function Fo(e,t){t._=t.p.length;var n=t.p[0],o=e!==void 0&&e!==n;return t.h.O||Ge("ES5").S(t,e,o),o?(n[j].P&&(Nn(t),Ae(4)),ze(e)&&(e=_n(t,e),t.l||zn(t,e)),t.u&&Ge("Patches").M(n[j].t,e,t.u,t.s)):e=_n(t,n,[]),Nn(t),t.u&&t.v(t.u,t.s),e!==Ac?e:void 0}function _n(e,t,n){if(Xo(t))return t;var o=t[j];if(!o)return Rt(t,(function(l,u){return hc(e,o,t,l,u,n)}),!0),t;if(o.A!==e)return t;if(!o.P)return zn(e,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var a=o.i===4||o.i===5?o.o=Zo(o.k):o.o,i=a,s=!1;o.i===3&&(i=new Set(a),a.clear(),s=!0),Rt(i,(function(l,u){return hc(e,o,a,l,u,n,s)})),zn(e,a,!1),n&&e.u&&Ge("Patches").N(o,n,e.u,e.s)}return o.o}function hc(e,t,n,o,a,i,s){if(Ke(a)){var l=_n(e,a,i&&t&&t.i!==3&&!ar(t.R,o)?i.concat(o):void 0);if(Sc(n,o,l),!Ke(l))return;e.m=!1}else s&&n.add(a);if(ze(a)&&!Xo(a)){if(!e.h.D&&e._<1)return;_n(e,a),t&&t.A.l||zn(e,a)}}function zn(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Yo(t,n)}function Go(e,t){var n=e[j];return(n?at(n):e)[t]}function gc(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Object.getPrototypeOf(n)}}function it(e){e.P||(e.P=!0,e.l&&it(e.l))}function Ho(e){e.o||(e.o=Zo(e.t))}function jo(e,t,n){var o=Ko(t)?Ge("MapSet").F(t,n):qo(t)?Ge("MapSet").T(t,n):e.O?(function(a,i){var s=Array.isArray(a),l={i:s?1:0,A:i?i.A:$o(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=l,p=$r;s&&(u=[l],p=Gr);var h=Proxy.revocable(u,p),g=h.revoke,y=h.proxy;return l.k=y,l.j=g,y})(t,n):Ge("ES5").J(t,n);return(n?n.A:$o()).p.push(o),o}function p4(e){return Ke(e)||Ae(22,e),(function t(n){if(!ze(n))return n;var o,a=n[j],i=sr(n);if(a){if(!a.P&&(a.i<4||!Ge("ES5").K(a)))return a.t;a.I=!0,o=yc(n,i),a.I=!1}else o=yc(n,i);return Rt(o,(function(s,l){a&&l4(a.t,s)===l||Sc(o,s,t(l))})),i===3?new Set(o):o})(e)}function yc(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Zo(e)}function Ec(){function e(s,l){var u=i[s];return u?u.enumerable=l:i[s]=u={configurable:!0,enumerable:l,get:function(){var p=this[j];return $r.get(p,s)},set:function(p){var h=this[j];$r.set(h,s,p)}},u}function t(s){for(var l=s.length-1;l>=0;l--){var u=s[l][j];if(!u.P)switch(u.i){case 5:o(u)&&it(u);break;case 4:n(u)&&it(u)}}}function n(s){for(var l=s.t,u=s.k,p=ir(u),h=p.length-1;h>=0;h--){var g=p[h];if(g!==j){var y=l[g];if(y===void 0&&!ar(l,g))return!0;var v=u[g],x=v&&v[j];if(x?x.t!==y:!Cc(v,y))return!0}}var S=!!l[j];return p.length!==ir(l).length+(S?0:1)}function o(s){var l=s.k;if(l.length!==s.t.length)return!0;var u=Object.getOwnPropertyDescriptor(l,l.length-1);if(u&&!u.get)return!0;for(var p=0;p<l.length;p++)if(!l.hasOwnProperty(p))return!0;return!1}function a(s){s.g&&Ae(3,JSON.stringify(at(s)))}var i={};u4("ES5",{J:function(s,l){var u=Array.isArray(s),p=(function(g,y){if(g){for(var v=Array(y.length),x=0;x<y.length;x++)Object.defineProperty(v,""+x,e(x,!0));return v}var S=Lc(y);delete S[j];for(var L=ir(S),O=0;O<L.length;O++){var N=L[O];S[N]=e(N,g||!!S[N].enumerable)}return Object.create(Object.getPrototypeOf(y),S)})(u,s),h={i:u?5:4,A:l?l.A:$o(),P:!1,I:!1,R:{},l,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,j,{value:h,writable:!0}),p},S:function(s,l,u){u?Ke(l)&&l[j].A===s&&t(s.p):(s.u&&(function p(h){if(h&&typeof h=="object"){var g=h[j];if(g){var y=g.t,v=g.k,x=g.R,S=g.i;if(S===4)Rt(v,(function(I){I!==j&&(y[I]!==void 0||ar(y,I)?x[I]||p(v[I]):(x[I]=!0,it(g)))})),Rt(y,(function(I){v[I]!==void 0||ar(v,I)||(x[I]=!1,it(g))}));else if(S===5){if(o(g)&&(it(g),x.length=!0),v.length<y.length)for(var L=v.length;L<y.length;L++)x[L]=!1;else for(var O=y.length;O<v.length;O++)x[O]=!0;for(var N=Math.min(v.length,y.length),z=0;z<N;z++)v.hasOwnProperty(z)||(x[z]=!0),x[z]===void 0&&p(v[z])}}}})(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):o(s)}})}var bc,Hr,Qo=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",m4=typeof Map<"u",h4=typeof Set<"u",vc=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ac=Qo?Symbol.for("immer-nothing"):((bc={})["immer-nothing"]=!0,bc),xc=Qo?Symbol.for("immer-draftable"):"__$immer_draftable",j=Qo?Symbol.for("immer-state"):"__$immer_state";var g4=""+Object.prototype.constructor,ir=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Lc=Object.getOwnPropertyDescriptors||function(e){var t={};return ir(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Vo={},$r={get:function(e,t){if(t===j)return e;var n=at(e);if(!ar(n,t))return(function(a,i,s){var l,u=gc(i,s);return u?"value"in u?u.value:(l=u.get)===null||l===void 0?void 0:l.call(a.k):void 0})(e,n,t);var o=n[t];return e.I||!ze(o)?o:o===Go(e.t,t)?(Ho(e),e.o[t]=jo(e.A.h,o,e)):o},has:function(e,t){return t in at(e)},ownKeys:function(e){return Reflect.ownKeys(at(e))},set:function(e,t,n){var o=gc(at(e),t);if(o?.set)return o.set.call(e.k,n),!0;if(!e.P){var a=Go(at(e),t),i=a?.[j];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Cc(n,a)&&(n!==void 0||ar(e.t,t)))return!0;Ho(e),it(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return Go(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Ho(e),it(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=at(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty:function(){Ae(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Ae(12)}},Gr={};Rt($r,(function(e,t){Gr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Gr.deleteProperty=function(e,t){return Gr.set.call(this,e,t,void 0)},Gr.set=function(e,t,n){return $r.set.call(this,e[0],t,n,e[0])};var y4=(function(){function e(n){var o=this;this.O=vc,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var l=i;i=a;var u=o;return function(S){var L=this;S===void 0&&(S=l);for(var O=arguments.length,N=Array(O>1?O-1:0),z=1;z<O;z++)N[z-1]=arguments[z];return u.produce(S,(function(I){var U;return(U=i).call.apply(U,[L,I].concat(N))}))}}var p;if(typeof i!="function"&&Ae(6),s!==void 0&&typeof s!="function"&&Ae(7),ze(a)){var h=mc(o),g=jo(o,a,void 0),y=!0;try{p=i(g),y=!1}finally{y?Nn(h):Wo(h)}return typeof Promise<"u"&&p instanceof Promise?p.then((function(S){return Bo(h,s),Fo(S,h)}),(function(S){throw Nn(h),S})):(Bo(h,s),Fo(p,h))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===Ac&&(p=void 0),o.D&&Yo(p,!0),s){var v=[],x=[];Ge("Patches").M(a,p,v,x),s(v,x)}return p}Ae(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var h=arguments.length,g=Array(h>1?h-1:0),y=1;y<h;y++)g[y-1]=arguments[y];return o.produceWithPatches(p,(function(v){return a.apply(void 0,[v].concat(g))}))};var s,l,u=o.produce(a,i,(function(p,h){s=p,l=h}));return typeof Promise<"u"&&u instanceof Promise?u.then((function(p){return[p,s,l]})):[u,s,l]},typeof n?.useProxies=="boolean"&&this.setUseProxies(n.useProxies),typeof n?.autoFreeze=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){ze(n)||Ae(8),Ke(n)&&(n=p4(n));var o=mc(this),a=jo(this,n,void 0);return a[j].C=!0,Wo(o),a},t.finishDraft=function(n,o){var a=n&&n[j],i=a.A;return Bo(i,o),Fo(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!vc&&Ae(20),this.O=n},t.applyPatches=function(n,o){var a;for(a=o.length-1;a>=0;a--){var i=o[a];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}a>-1&&(o=o.slice(a+1));var s=Ge("Patches").$;return Ke(n)?s(n,o):this.produce(n,(function(l){return s(l,o)}))},e})(),fe=new y4,b4=fe.produce,Mh=fe.produceWithPatches.bind(fe),kh=fe.setAutoFreeze.bind(fe),Ih=fe.setUseProxies.bind(fe),Th=fe.applyPatches.bind(fe),Ph=fe.createDraft.bind(fe),Dh=fe.finishDraft.bind(fe),Mn=b4;function wt(e){"@babel/helpers - typeof";return wt=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},wt(e)}function Oc(e,t){if(wt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(wt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rc(e){var t=Oc(e,"string");return wt(t)=="symbol"?t:t+""}function wc(e,t,n){return(t=Rc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,o)}return n}function Jo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nc(Object(n),!0).forEach(function(o){wc(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nc(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function oe(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 _c=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ea=function(){return Math.random().toString(36).substring(7).split("").join(".")},kn={INIT:"@@redux/INIT"+ea(),REPLACE:"@@redux/REPLACE"+ea(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ea()}};function v4(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 ta(e,t,n){var o;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(oe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(oe(1));return n(ta)(e,t)}if(typeof e!="function")throw new Error(oe(2));var a=e,i=t,s=[],l=s,u=!1;function p(){l===s&&(l=s.slice())}function h(){if(u)throw new Error(oe(3));return i}function g(S){if(typeof S!="function")throw new Error(oe(4));if(u)throw new Error(oe(5));var L=!0;return p(),l.push(S),function(){if(L){if(u)throw new Error(oe(6));L=!1,p();var N=l.indexOf(S);l.splice(N,1),s=null}}}function y(S){if(!v4(S))throw new Error(oe(7));if(typeof S.type>"u")throw new Error(oe(8));if(u)throw new Error(oe(9));try{u=!0,i=a(i,S)}finally{u=!1}for(var L=s=l,O=0;O<L.length;O++){var N=L[O];N()}return S}function v(S){if(typeof S!="function")throw new Error(oe(10));a=S,y({type:kn.REPLACE})}function x(){var S,L=g;return S={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(oe(11));function z(){N.next&&N.next(h())}z();var I=L(z);return{unsubscribe:I}}},S[_c]=function(){return this},S}return y({type:kn.INIT}),o={dispatch:y,subscribe:g,getState:h,replaceReducer:v},o[_c]=x,o}function x4(e){Object.keys(e).forEach(function(t){var n=e[t],o=n(void 0,{type:kn.INIT});if(typeof o>"u")throw new Error(oe(12));if(typeof n(void 0,{type:kn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(oe(13))})}function zc(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var a=t[o];typeof e[a]=="function"&&(n[a]=e[a])}var i=Object.keys(n),s,l;try{x4(n)}catch(u){l=u}return function(p,h){if(p===void 0&&(p={}),l)throw l;if(0)var g;for(var y=!1,v={},x=0;x<i.length;x++){var S=i[x],L=n[S],O=p[S],N=L(O,h);if(typeof N>"u"){var z=h&&h.type;throw new Error(oe(14))}v[S]=N,y=y||N!==O}return y=y||i.length!==Object.keys(p).length,y?v:p}}function cr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(o){return o}:t.length===1?t[0]:t.reduce(function(o,a){return function(){return o(a.apply(void 0,arguments))}})}function Mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(o){return function(){var a=o.apply(void 0,arguments),i=function(){throw new Error(oe(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=t.map(function(u){return u(s)});return i=cr.apply(void 0,l)(a.dispatch),Jo(Jo({},a),{},{dispatch:i})}}}function kc(e){var t=function(o){var a=o.dispatch,i=o.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,e):s(l)}}};return t}var Ic=kc();Ic.withExtraArgument=kc;var ra=Ic;var Bc=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(o[i]=a[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),S4=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(p){return function(h){return u([p,h])}}function u(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=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 n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(h){p=[6,h],a=0}finally{o=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},lr=function(e,t){for(var n=0,o=t.length,a=e.length;n<o;n++,a++)e[a]=t[n];return e},C4=Object.defineProperty,E4=Object.defineProperties,A4=Object.getOwnPropertyDescriptors,Tc=Object.getOwnPropertySymbols,L4=Object.prototype.hasOwnProperty,O4=Object.prototype.propertyIsEnumerable,Pc=function(e,t,n){return t in e?C4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},st=function(e,t){for(var n in t||(t={}))L4.call(t,n)&&Pc(e,n,t[n]);if(Tc)for(var o=0,a=Tc(t);o<a.length;o++){var n=a[o];O4.call(t,n)&&Pc(e,n,t[n])}return e},na=function(e,t){return E4(e,A4(t))},R4=function(e,t,n){return new Promise(function(o,a){var i=function(u){try{l(n.next(u))}catch(p){a(p)}},s=function(u){try{l(n.throw(u))}catch(p){a(p)}},l=function(u){return u.done?o(u.value):Promise.resolve(u.value).then(i,s)};l((n=n.apply(e,t)).next())})};var w4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?cr:cr.apply(null,arguments)},t7=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function N4(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function ct(e,t){function n(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(t){var i=t.apply(void 0,o);if(!i)throw new Error("prepareAction did not return an object");return st(st({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:o[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(o){return o.type===e},n}var _4=(function(e){Bc(t,e);function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=e.apply(this,n)||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 n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,lr([void 0],n[0].concat(this)))):new(t.bind.apply(t,lr([void 0],n.concat(this))))},t})(Array),z4=(function(e){Bc(t,e);function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=e.apply(this,n)||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 n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,lr([void 0],n[0].concat(this)))):new(t.bind.apply(t,lr([void 0],n.concat(this))))},t})(Array);function ia(e){return ze(e)?Mn(e,function(){}):e}function M4(e){return typeof e=="boolean"}function k4(){return function(t){return I4(t)}}function I4(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,o=e.immutableCheck,a=o===void 0?!0:o,i=e.serializableCheck,s=i===void 0?!0:i,l=e.actionCreatorCheck,u=l===void 0?!0:l,p=new _4;if(n&&(M4(n)?p.push(ra):p.push(ra.withExtraArgument(n.extraArgument))),0){if(a)var h;if(s)var g;if(u)var y}return p}var oa=!0;function Fc(e){var t=k4(),n=e||{},o=n.reducer,a=o===void 0?void 0:o,i=n.middleware,s=i===void 0?t():i,l=n.devTools,u=l===void 0?!0:l,p=n.preloadedState,h=p===void 0?void 0:p,g=n.enhancers,y=g===void 0?void 0:g,v;if(typeof a=="function")v=a;else if(N4(a))v=zc(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 x=s;if(typeof x=="function"&&(x=x(t),!oa&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!oa&&x.some(function(I){return typeof I!="function"}))throw new Error("each middleware provided to configureStore must be a function");var S=Mc.apply(void 0,x),L=cr;u&&(L=w4(st({trace:!oa},typeof u=="object"&&u)));var O=new z4(S),N=O;Array.isArray(y)?N=lr([S],y):typeof y=="function"&&(N=y(O));var z=L.apply(void 0,N);return ta(v,h,z)}function Gc(e){var t={},n=[],o,a={addCase:function(i,s){var l=typeof i=="string"?i:i.type;if(!l)throw new Error("`builder.addCase` cannot be called with an empty action type");if(l in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[l]=s,a},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return o=i,a}};return e(a),[t,n,o]}function T4(e){return typeof e=="function"}function P4(e,t,n,o){n===void 0&&(n=[]);var a=typeof t=="function"?Gc(t):[t,n,o],i=a[0],s=a[1],l=a[2],u;if(T4(e))u=function(){return ia(e())};else{var p=ia(e);u=function(){return p}}function h(g,y){g===void 0&&(g=u());var v=lr([i[y.type]],s.filter(function(x){var S=x.matcher;return S(y)}).map(function(x){var S=x.reducer;return S}));return v.filter(function(x){return!!x}).length===0&&(v=[l]),v.reduce(function(x,S){if(S)if(Ke(x)){var L=x,O=S(L,y);return O===void 0?x:O}else{if(ze(x))return Mn(x,function(N){return S(N,y)});var O=S(x,y);if(O===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return O}return x},g)}return h.getInitialState=u,h}function D4(e,t){return e+"/"+t}function Hc(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:ia(e.initialState),o=e.reducers||{},a=Object.keys(o),i={},s={},l={};a.forEach(function(h){var g=o[h],y=D4(t,h),v,x;"reducer"in g?(v=g.reducer,x=g.prepare):v=g,i[h]=v,s[y]=v,l[h]=x?ct(y,x):ct(y)});function u(){var h=typeof e.extraReducers=="function"?Gc(e.extraReducers):[e.extraReducers],g=h[0],y=g===void 0?{}:g,v=h[1],x=v===void 0?[]:v,S=h[2],L=S===void 0?void 0:S,O=st(st({},y),s);return P4(n,function(N){for(var z in O)N.addCase(z,O[z]);for(var I=0,U=x;I<U.length;I++){var $=U[I];N.addMatcher($.matcher,$.reducer)}L&&N.addDefaultCase(L)})}var p;return{name:t,reducer:function(h,g){return p||(p=u()),p(h,g)},actions:l,caseReducers:i,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var U4="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",B4=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=U4[Math.random()*64|0];return t},F4=["name","message","stack","code"],aa=(function(){function e(t,n){this.payload=t,this.meta=n}return e})(),Dc=(function(){function e(t,n){this.payload=t,this.meta=n}return e})(),G4=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,o=F4;n<o.length;n++){var a=o[n];typeof e[a]=="string"&&(t[a]=e[a])}return t}return{message:String(e)}},a7=(function(){function e(t,n,o){var a=ct(t+"/fulfilled",function(h,g,y,v){return{payload:h,meta:na(st({},v||{}),{arg:y,requestId:g,requestStatus:"fulfilled"})}}),i=ct(t+"/pending",function(h,g,y){return{payload:void 0,meta:na(st({},y||{}),{arg:g,requestId:h,requestStatus:"pending"})}}),s=ct(t+"/rejected",function(h,g,y,v,x){return{payload:v,error:(o&&o.serializeError||G4)(h||"Rejected"),meta:na(st({},x||{}),{arg:y,requestId:g,rejectedWithValue:!!v,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),l=!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(g,y,v){var x=o?.idGenerator?o.idGenerator(h):B4(),S=new u,L,O=!1;function N(I){L=I,S.abort()}var z=(function(){return R4(this,null,function(){var I,U,$,Pe,ht,De,de;return S4(this,function(xe){switch(xe.label){case 0:return xe.trys.push([0,4,,5]),Pe=(I=o?.condition)==null?void 0:I.call(o,h,{getState:y,extra:v}),$4(Pe)?[4,Pe]:[3,2];case 1:Pe=xe.sent(),xe.label=2;case 2:if(Pe===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return O=!0,ht=new Promise(function(ue,gt){return S.signal.addEventListener("abort",function(){return gt({name:"AbortError",message:L||"Aborted"})})}),g(i(x,h,(U=o?.getPendingMeta)==null?void 0:U.call(o,{requestId:x,arg:h},{getState:y,extra:v}))),[4,Promise.race([ht,Promise.resolve(n(h,{dispatch:g,getState:y,extra:v,requestId:x,signal:S.signal,abort:N,rejectWithValue:function(ue,gt){return new aa(ue,gt)},fulfillWithValue:function(ue,gt){return new Dc(ue,gt)}})).then(function(ue){if(ue instanceof aa)throw ue;return ue instanceof Dc?a(ue.payload,x,h,ue.meta):a(ue,x,h)})])];case 3:return $=xe.sent(),[3,5];case 4:return De=xe.sent(),$=De instanceof aa?s(null,x,h,De.payload,De.meta):s(De,x,h),[3,5];case 5:return de=o&&!o.dispatchConditionRejection&&s.match($)&&$.meta.condition,de||g($),[2,$]}})})})();return Object.assign(z,{abort:N,requestId:x,arg:h,unwrap:function(){return z.then(H4)}})}}return Object.assign(p,{pending:i,rejected:s,fulfilled:a,typePrefix:t})}return e.withTypes=function(){return e},e})();function H4(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function $4(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var $c="listener",Wc="completed",jc="cancelled",i7="task-"+jc,s7="task-"+Wc,c7=$c+"-"+jc,l7=$c+"-"+Wc;var sa="listenerMiddleware";var d7=ct(sa+"/add"),u7=ct(sa+"/removeAll"),f7=ct(sa+"/remove");var Uc,p7=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Uc||(Uc=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},W4=function(e){return function(t){setTimeout(t,e)}},m7=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:W4(10);Ec();var j4=En(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(n,o,a){this.eventBus.addEventListener(n,o,a)}dispatchEvent(n){return this.eventBus.dispatchEvent(n)}removeEventListener(n,o,a){this.eventBus.removeEventListener(n,o,a)}}}),In=class extends j4(Object){};window.ftReduxStores||(window.ftReduxStores={});var Vc=class e extends In{static get(t){var n;let o=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[o];if(wn(i))return i;if(a==null)return;let s=Hc({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=Fc({reducer:(u,p)=>{if(p.type==="CLEAR_FT_REDUX_STORE"){let h=Ur(s.getInitialState());for(let g of p.keeping)h[g]=(u??h)[g];return h}else if(typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...p.overwrites};return s.reducer(u,p)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus)}constructor(t,n,o){super(),this.reduxSlice=t,this.reduxStore=n,this.isFtReduxStore=!0,this.commands=new An;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let u=s,p=i[u];return p?(...h)=>{let g=p(...h.map(a));return this.reduxStore.dispatch(g),g}:h=>{this.setState({[u]:a(h)})}}}),this.eventBus=o??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Tn=class{static format(t,n,o,a,i){return window.moment?window.moment(t).locale(n).format(this.getMomentDateFormat(o,a,!!i)):this.getIntlDateTime(t,n,o,a,!!i)}static getMomentDateFormat(t,n,o){return o?"LT":t?n?"lll":"ll":n?"L LT":"L"}static getIntlDateTime(t,n,o,a,i){let s=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(n,{dateStyle:o?"medium":"short"}).format(s),u=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?u:a?`${l} ${u}`:l}static getTimezoneAsString(){let t=o=>String(Math.floor(o)).padStart(2,"0"),n=new Date().getTimezoneOffset();return`${n<0?"+":"-"}${t(Math.abs(n)/60)}:${t(Math.abs(n)%60)}`}};var Pn=A(T()),V4="ft-app-info",dr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};dr.eventName="authentication-change";var Wr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Wr.eventName="ui-locale-changed";var K4={session:(e,t)=>{(0,Pn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>P.dispatchEvent(new dr(t.payload)),0))}},P=Pn.FtReduxStore.get({name:V4,reducers:K4,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Kc=A(T()),Dn=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},H7=(0,Kc.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...o){super(o),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(P)}dateFormatOptionsChanged(o){return o.has("metadataDescriptors")||o.has("useLongDateFormat")||o.has("useDateTimeFormat")||o.has("uiLocale")}getDateFormatter(o){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>Tn.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Dn([(0,ca.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Dn([(0,ca.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Dn([Uo({store:P.name,selector:n=>{var o,a;return(a=(o=n.metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),Dn([Uo({store:P.name})],t.prototype,"uiLocale",void 0),t});var qc;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(qc||(qc={}));var Zc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Zc||(Zc={}));var Yc;(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"})(Yc||(Yc={}));var Xc;(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"})(Xc||(Xc={}));var Qc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Qc||(Qc={}));var Jc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Jc||(Jc={}));var el;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(el||(el={}));var tl;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(tl||(tl={}));var rl;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(rl||(rl={}));var nl;(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"})(nl||(nl={}));var ol;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(ol||(ol={}));var al;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(al||(al={}));var il;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(il||(il={}));var sl;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(sl||(sl={}));var cl;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(cl||(cl={}));var ll;(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"})(ll||(ll={}));var dl;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(dl||(dl={}));var ul;(function(e){e.ASC="ASC",e.DESC="DESC"})(ul||(ul={}));var fl;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(fl||(fl={}));var pl;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(pl||(pl={}));var ml;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ml||(ml={}));var hl;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(hl||(hl={}));var gl;(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"})(gl||(gl={}));var yl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(yl||(yl={}));var bl;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(bl||(bl={}));var vl;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(vl||(vl={}));var xl;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(xl||(xl={}));var Q;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(Q||(Q={}));var Le;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(Le||(Le={}));var Sl;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Sl||(Sl={}));var Cl;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Cl||(Cl={}));var El;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(El||(El={}));var Al;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Al||(Al={}));var Ll;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ll||(Ll={}));var Ol;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Ol||(Ol={}));var Rl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Rl||(Rl={}));var wl;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(wl||(wl={}));var Nl;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(Nl||(Nl={}));var _l;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(_l||(_l={}));var zl;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(zl||(zl={}));var Ml;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Ml||(Ml={}));var q4={[Q.PERSONAL_BOOK_SHARE_USER]:[Q.PERSONAL_BOOK_USER],[Q.HTML_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.PDF_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.KHUB_ADMIN]:[Q.CONTENT_PUBLISHER],[Q.ADMIN]:[Q.KHUB_ADMIN,Q.USERS_ADMIN,Q.PORTAL_ADMIN,Q.BEHAVIOR_DATA_USER],[Q.GENERATIVE_AI_EXPORT_USER]:[Q.GENERATIVE_AI_USER]};function kl(e,t){return e===t||(q4[e]??[]).some(n=>kl(n,t))}function Il(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(o=>kl(o,t))}var Hn=A(T());var la=A(T());var Nt=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=P.getState(),a=t??o;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let o=e.get(t);if(o)n(o);else{let a=P.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var ur=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Nt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Nt.await()}};var pe=class extends ur{constructor(t=!0,n){var o;super(n),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[u])=>l.localeCompare(u)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new la.CacheRegistry,this.cache=t?a.commonCache:new la.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,o)=>0|31*n+o.charCodeAt(0),0))}};var Un=class extends pe{async listMySearches(){let{session:t}=P.getState();return Il(t,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Bn=class extends pe{async listMyBookmarks(){let t=P.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Fn=class extends pe{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=P.getState().session;return!!t?.sessionAuthenticated}};var Gn=class extends pe{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=P.getState().session;return!!t?.sessionAuthenticated}};var Z4="ft-user-assets",Y4={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(Le).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let n=t.payload.mapId;e.assetCounts.bookmarkByMap[n]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:n,mapId:o,asset:a}=t.payload;ua(e,n,[...da(e,n),a]),Tl(e,n,1,o),Pl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ua(e,n,da(e,n).map(a=>a.id===o.id?o:a)),Pl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ua(e,n,da(e,n).filter(i=>i.id!==a)),Tl(e,n,-1,o)}},Dl={[Le.SEARCHES]:"savedSearches",[Le.BOOKMARKS]:"bookmarks",[Le.BOOKS]:void 0,[Le.COLLECTIONS]:void 0},da=(e,t)=>{var n;let o=Dl[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ua=(e,t,n)=>{let o=Dl[t];o&&(e[o]=n)},Tl=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===Le.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},Pl=(e,t)=>{let n=e.assetLabels.map(a=>a.title),o=t.labels.filter(a=>!n.includes(a)).map(a=>({title:a}));e.assetLabels.push(...o)},ie=Hn.FtReduxStore.get({name:Z4,reducers:Y4,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Le).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),fa=class{constructor(t=new Fn,n=new Gn){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=P.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Bn,this.savedSearchesService=new Un,P.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=P.getState();(0,Hn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,n?.profile)||(this.currentSession=n,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ie.actions.clearAssetCount(),ie.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ie.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ie.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ie.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ie.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&ie.getState().assetCounts.allAsset[t]!==n.count&&ie.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&ie.getState().assetCounts.bookmarkByMap[t]!==n.count&&ie.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(ie.getState().assetCounts.bookmarkByMap).length!==0;t===Le.BOOKMARKS&&n&&ie.actions.clearBookmarkCountByMap(),ie.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 n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ie.actions.bookmarks(n)}}},X4=new fa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=X4);var pa=class{addCommand(t,n=!1){P.commands.add(t,n)}consumeCommand(t){return P.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new pa;var Oe=A(T());var Ul,fr=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Q4=Symbol("clearAfterUnitTest"),$n=class extends(0,Oe.withEventBus)(pe){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ul]=()=>{this.defaultMessages={},this.cache=new Oe.CacheRegistry,this.listeners={}},this.currentUiLocale=P.getState().uiLocale,P.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=P.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var o;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(o=this.defaultMessages[t])!==null&&o!==void 0?o:{},...n};(0,Oe.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,o;return this.fetchContext(t),(o=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&o!==void 0?o:{}}resolveRawMessage(t,n){let o=t.toLowerCase();return this.resolveContext(o)[n]}resolveMessage(t,n,...o){var a;let i=t.toLowerCase(),s=this.resolveContext(i);return new Oe.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(n,...o)}async fetchContext(t){let n=!this.cache.has(t),o;try{o=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof Oe.CanceledPromiseError)&&n&&console.error(a)}return o}subscribe(t,n){var o;return t=t.toLowerCase(),this.listeners[t]=(o=this.listeners[t])!==null&&o!==void 0?o:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new fr({loadedContexts:t})),this.dispatchEvent(new fr({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new fr({loadedContexts:[t]})),this.dispatchEvent(new fr({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,Oe.delay)(0).then(()=>o()).catch(()=>null)))}};Ul=Q4;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends $n{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends $n{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var jr=window.FluidTopicsI18nService,ma=window.FluidTopicsCustomI18nService;var Bl=A(T()),ha=class{highlightHtml(t,n,o){(0,Bl.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ha;var Fl=A(T());var ga=class{isDate(t){var n,o,a,i;return(i=(a=((o=(n=P.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&o!==void 0?o:[]).find(l=>l.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return Fl.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:P.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(i=n?.withTime)!==null&&i!==void 0?i:!1,(s=n?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(t)} is not valid`,l),l}}};window.FluidTopicsDateService=new ga;var Gl=A(T());var Vr=class{static get(t,n){var o,a,i,s;let l=P.getState(),{lang:u,region:p}=(i=(a=(o=l.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales)===null||a===void 0?void 0:a.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Gl.SearchPlaceConverter(l.baseUrl,t??20,(s=l.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,n??`${u}-${p}`)}};var ya=class{urlToSearchRequest(t){return Vr.get().parse(t)}searchRequestToUrl(t){return Vr.get().serialize(t)}};window.FluidTopicsUrlService=new ya;var qe=A(T());var _t=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};_t.eventName="change";var ba=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},Hl=new ba;var Wn=class e extends qe.WithEventBus{static build(){return new e(window.history,Hl,()=>window.location,!1)}constructor(t,n,o,a){var i,s;super(),this.history=t,this.historyStorage=n,this.windowLocation=o,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let o=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,o&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,qe.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new _t(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let u=n(),p={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:typeof l=="string"?l:(l??this.windowLocation()).href};o.apply(a,[p,s,l]),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 n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let o={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(o)}addHistoryChangeListener(t){this.addEventListener(_t.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(_t.eventName,t)}currentItem(){return(0,qe.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,qe.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,qe.deepCopy)(n.find(o=>t(o)))}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,qe.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 n;let o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!o)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,o);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var o;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,i=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Wn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});var $l=A(F());var Wl=$l.css`
825
+ `;var Kl=A(F()),me=A(ne()),kt=A(T());var zt=A(T());function jl(e,t){let{authenticationRequired:n,session:o}=P.getState();return n&&!o?.sessionAuthenticated?Promise.resolve(t):e()}var jn=class extends ur{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var va=class e extends zt.FtStateManager{static build(t){return new e(P,t)}constructor(t,n){super(),this.store=t,this.cache=new zt.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new jn,this.cleanSessionDebouncer=new zt.Debouncer,this.reloadDebouncer=new zt.Debouncer(500),this.apiProvider=n??(()=>Nt.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener(dr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let t=await this.cache.get("session",async()=>{let n=await this.apiProvider().getCurrentSession();return n.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},n.idleTimeoutInMillis),n});this.setSession(t)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var t;let n=await this.cache.get("availableContentLocales",()=>jl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=n.contentLocales)!==null&&t!==void 0?t:[])}reloadConfiguration(){var t;(t=this.cache)===null||t===void 0||t.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t){this.userLocaleService.updateUiLocale({uiLocale:t}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Wr(n)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}},Vl=va.build();var Mt=class extends Event{constructor(t,n,o,a){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=n,this.callback=o,this.subscribe=a??!1}};var Kr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let n=this.pendingContextRequests.get(t.context);if(n===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:o}=n;for(let{elementRef:a,callbackRef:i}of o){let s=a.deref(),l=i.deref();s===void 0||l===void 0||s.dispatchEvent(new Mt(t.context,s,l,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let n=t.contextTarget??t.composedPath()[0],o=t.callback,a=this.pendingContextRequests.get(t.context);a===void 0&&this.pendingContextRequests.set(t.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(n);i===void 0&&a.callbacks.set(n,i=new WeakSet),i.has(o)||(i.add(o),a.requests.push({elementRef:new WeakRef(n),callbackRef:new WeakRef(o)}))}}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var ae=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},q=class extends kt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Vl,this.contextRoot=new Kr}render(){return Kl.html`
826
826
  <slot></slot>
827
827
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(t){var n;super.update(t),t.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),t.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),t.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),t.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(o=>jr.addContext(o)),t.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),t.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),t.has("withManualResources")&&((n=this.stateManager)===null||n===void 0||n.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};q.elementDefinitions={};q.styles=Wl;ae([(0,me.property)()],q.prototype,"baseUrl",void 0);ae([(0,me.property)()],q.prototype,"apiIntegrationIdentifier",void 0);ae([(0,me.property)()],q.prototype,"apiIntegrationAppVersion",void 0);ae([(0,me.property)()],q.prototype,"uiLocale",void 0);ae([(0,kt.jsonProperty)(null)],q.prototype,"availableUiLocales",void 0);ae([(0,kt.jsonProperty)(null)],q.prototype,"metadataConfiguration",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"editorMode",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"noCustom",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"openExternalDocumentInNewTab",void 0);ae([(0,me.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],q.prototype,"noCustomComponent",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"withManualResources",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"navigatorOnline",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"forcedOffline",void 0);ae([(0,me.property)({type:Boolean})],q.prototype,"authenticationRequired",void 0);ae([(0,kt.jsonProperty)([])],q.prototype,"messageContexts",void 0);ae([(0,kt.jsonProperty)(void 0)],q.prototype,"session",void 0);var Zl=A(T());var ql={"ft-app-context":q};(0,Zl.customElements)(ql);var Yl=A(ne());var xa=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,o]=t.split(".");return{context:n,key:o,custom:n!=="officialContext",message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},pr=new xa;var td=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Zr=Symbol("i18nAttributes"),Xl=Symbol("i18nListAttributes"),Ql=Symbol("i18nProperties"),Vn=Symbol("i18nContexts"),qr=Symbol("i18nUnsubs"),Jl=(0,mr.applyMixinOnce)(Symbol("withI18n"),function(e){var t,n;class o extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[n]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?ma:jr}i18n(i){let{context:s,key:l,message:u}=i,{custom:p,args:h,argsProvider:g}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let y=h??(g?g(this):[]);return this.getI18nService(p).resolveMessage(s,l,...y)}return u}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(pr.isI18nKey(i)){let[l,u]=i.split(".");return this.i18n({custom:!0,context:l,key:u,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,u)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let u=this,p=(h,g,y)=>y?.context&&y.key&&i(h,g,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...h})}:y;(s=this[Zr])===null||s===void 0||s.forEach((h,g)=>u[g]=p(h,g,u[g])),(l=this[Xl])===null||l===void 0||l.forEach((h,g)=>{var y;return u[g]=(y=u[g])===null||y===void 0?void 0:y.map(v=>p(h,g,v))})}updateI18nProperties(i){var s;(s=this[Ql])===null||s===void 0||s.forEach((l,u)=>{i(l,u)&&(this[u]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let u=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[Vn].set(u,{isCustomContext:l}),this[qr].has(u)||this[qr].set(u,this.getI18nService(l).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(l).prepareContext(u,s)}hasI18nContext(i){return this[Vn].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Vn].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[qr].forEach(i=>i()),this[qr].clear()}}return t=Vn,n=qr,td([(0,Yl.property)({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}),Kn=class extends Jl(mr.FtLitElement){},qn=class extends Jl(mr.FtLitElementRedux){};var e1=A(T());var Sa=class{fromAttribute(t){if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.map(o=>typeof o=="string"?pr.fromAttribute(o):o):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},rd=new Sa;var t1=(e,t)=>(n,o)=>{var a;n.constructor.createProperty(o,{type:Object,hasChanged:e1.hasChanged,converter:pr,...t}),n[Zr]=(a=n[Zr])!==null&&a!==void 0?a:new Map,n[Zr].set(o,e??{})};var r1=A(F());var n1=r1.css`
828
828
  `;var Zn=A(F()),Yn=A(ne()),Xn=A(T());var Yr=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Me=class extends qn{constructor(){super(),this.editorMode=!1,this.addStore(P)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Zn.nothing:Zn.html`
@@ -901,8 +901,8 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
901
901
  position: relative;
902
902
  word-break: break-word;
903
903
  }
904
- `;var kf="ft-app-info",$r=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};$r.eventName="authentication-change";var On=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};On.eventName="ui-locale-changed";var zf={session:(t,e)=>{Ae(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>H.dispatchEvent(new $r(e.payload)),0))}},H=Vt.get({name:kf,reducers:zf,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,searchLanguageSetsUiLanguage:!1,uiLanguageSetsSearchLanguage:!1,uiLanguageSetsReaderLanguage:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var vo=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},zx=de(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(H)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var 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=>Kt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return vo([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),vo([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),vo([mr({store:H.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),vo([mr({store:H.name})],e.prototype,"uiLocale",void 0),e});var Xt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=H.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=H.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Br=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Xt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Xt.await()}};var Le=class extends Br{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new qe,this.cache=e?a.commonCache:new qe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var xo=class extends Le{async listMySearches(){let{session:e}=H.getState();return W1(e,ie.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var So=class extends Le{async listMyBookmarks(){let e=H.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Co=class extends Le{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=H.getState().session;return!!e?.sessionAuthenticated}};var Eo=class extends Le{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=H.getState().session;return!!e?.sessionAuthenticated}};var Pf="ft-user-assets",Df={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(De).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;bs(t,r,[...ys(t,r),a]),R2(t,r,1,n),w2(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;bs(t,r,ys(t,r).map(a=>a.id===n.id?n:a)),w2(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;bs(t,r,ys(t,r).filter(i=>i.id!==a)),R2(t,r,-1,n)}},_2={[De.SEARCHES]:"savedSearches",[De.BOOKMARKS]:"bookmarks",[De.BOOKS]:void 0,[De.COLLECTIONS]:void 0},ys=(t,e)=>{var r;let n=_2[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},bs=(t,e,r)=>{let n=_2[e];n&&(t[n]=r)},R2=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===De.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},w2=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},be=Vt.get({name:Pf,reducers:Df,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(De).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),vs=class{constructor(e=new Co,r=new Eo){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=H.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new So,this.savedSearchesService=new xo,H.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=H.getState();Ae((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),be.actions.clearAssetCount(),be.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),be.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),be.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();be.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();be.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&be.getState().assetCounts.allAsset[e]!==r.count&&be.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&be.getState().assetCounts.bookmarkByMap[e]!==r.count&&be.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(be.getState().assetCounts.bookmarkByMap).length!==0;e===De.BOOKMARKS&&r&&be.actions.clearBookmarkCountByMap(),be.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;be.actions.bookmarks(r)}}},Uf=new vs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Uf);var xs=class{addCommand(e,r=!1){H.commands.add(e,r)}consumeCommand(e){return H.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new xs;var N2,Hr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Ff=Symbol("clearAfterUnitTest"),Ao=class extends to(Le){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[N2]=()=>{this.defaultMessages={},this.cache=new qe,this.listeners={}},this.currentUiLocale=H.getState().uiLocale,H.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=H.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};Ae(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new gn((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof Mt)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Hr({loadedContexts:e})),this.dispatchEvent(new Hr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Hr({loadedContexts:[e]})),this.dispatchEvent(new Hr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Qn(0).then(()=>n()).catch(()=>null)))}};N2=Ff;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ao{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ao{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Ln=window.FluidTopicsI18nService,Ss=window.FluidTopicsCustomI18nService;var Cs=class{highlightHtml(e,r,n){yi(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Cs;var Es=class{isDate(e){var r,n,a,i;return(i=(a=((n=(r=H.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return Kt.format(e,(n=r?.locale)!==null&&n!==void 0?n:H.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(c){throw console.error(`Date ${JSON.stringify(e)} is not valid`,c),c}}};window.FluidTopicsDateService=new Es;var Rn=class{static get(e,r){var n,a;let i=H.getState(),{lang:s,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 Ar(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,r??`${s}-${c}`)}};var As=class{urlToSearchRequest(e){return Rn.get().parse(e)}searchRequestToUrl(e){return Rn.get().serialize(e)}};window.FluidTopicsUrlService=new As;var Jt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Jt.eventName="change";var Os=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},M2=new Os;var Oo=class t extends nt{static build(){return new t(window.history,M2,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Ae(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Jt(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,c])=>{let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[u,s,c]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Jt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Jt.eventName,e)}currentItem(){return Fe(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Fe(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Fe(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return Fe(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let a=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Oo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var T2=z`
905
- `;function I2(t,e){let{authenticationRequired:r,session:n}=H.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Lo=class extends Br{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Ls=class t extends Cn{static build(e){return new t(H,e)}constructor(e,r){super(),this.store=e,this.cache=new qe,this.withManualResources=!0,this.localesConfiguration=null,this.userLocaleService=new Lo,this.cleanSessionDebouncer=new ve,this.reloadDebouncer=new ve(500),this.apiProvider=r??(()=>Xt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener($r.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>I2(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){var r,n,a,i,s;this.localesConfiguration=e,this.store.actions.defaultLocales(this.localesConfiguration.defaultLocales),this.store.actions.availableUiLocales((r=this.localesConfiguration.availableUiLocales)!==null&&r!==void 0?r:[]),this.store.actions.searchInAllLanguagesAllowed((n=this.localesConfiguration.allLanguagesAllowed)!==null&&n!==void 0?n:!1),this.store.actions.searchLanguageSetsUiLanguage((a=this.localesConfiguration.searchLanguageSetsUiLanguage)!==null&&a!==void 0?a:!1),this.store.actions.uiLanguageSetsSearchLanguage((i=this.localesConfiguration.uiLanguageSetsSearchLanguage)!==null&&i!==void 0?i:!1),this.store.actions.uiLanguageSetsReaderLanguage((s=this.localesConfiguration.uiLanguageSetsReaderLanguage)!==null&&s!==void 0?s:!1),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new On(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},k2=Ls.build();var Qt=class extends Event{constructor(e,r,n,a){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=a??!1}};var wn=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:a,callbackRef:i}of n){let s=a.deref(),c=i.deref();s===void 0||c===void 0||s.dispatchEvent(new Qt(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,a=this.pendingContextRequests.get(e.context);a===void 0&&this.pendingContextRequests.set(e.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(r);i===void 0&&a.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),a.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var ge=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},ne=class extends Gt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=k2,this.contextRoot=new wn}render(){return V`
904
+ `;var kf="ft-app-info",$r=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};$r.eventName="authentication-change";var On=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};On.eventName="ui-locale-changed";var zf={session:(t,e)=>{Ae(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>H.dispatchEvent(new $r(e.payload)),0))}},H=Vt.get({name:kf,reducers:zf,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var vo=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},zx=de(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(H)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var 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=>Kt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return vo([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),vo([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),vo([mr({store:H.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),vo([mr({store:H.name})],e.prototype,"uiLocale",void 0),e});var Xt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=H.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=H.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Br=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Xt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Xt.await()}};var Le=class extends Br{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new qe,this.cache=e?a.commonCache:new qe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var xo=class extends Le{async listMySearches(){let{session:e}=H.getState();return W1(e,ie.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var So=class extends Le{async listMyBookmarks(){let e=H.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Co=class extends Le{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=H.getState().session;return!!e?.sessionAuthenticated}};var Eo=class extends Le{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=H.getState().session;return!!e?.sessionAuthenticated}};var Pf="ft-user-assets",Df={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(De).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;bs(t,r,[...ys(t,r),a]),R2(t,r,1,n),w2(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;bs(t,r,ys(t,r).map(a=>a.id===n.id?n:a)),w2(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;bs(t,r,ys(t,r).filter(i=>i.id!==a)),R2(t,r,-1,n)}},_2={[De.SEARCHES]:"savedSearches",[De.BOOKMARKS]:"bookmarks",[De.BOOKS]:void 0,[De.COLLECTIONS]:void 0},ys=(t,e)=>{var r;let n=_2[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},bs=(t,e,r)=>{let n=_2[e];n&&(t[n]=r)},R2=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===De.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},w2=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},be=Vt.get({name:Pf,reducers:Df,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(De).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),vs=class{constructor(e=new Co,r=new Eo){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=H.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new So,this.savedSearchesService=new xo,H.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=H.getState();Ae((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),be.actions.clearAssetCount(),be.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),be.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),be.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();be.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();be.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&be.getState().assetCounts.allAsset[e]!==r.count&&be.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&be.getState().assetCounts.bookmarkByMap[e]!==r.count&&be.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(be.getState().assetCounts.bookmarkByMap).length!==0;e===De.BOOKMARKS&&r&&be.actions.clearBookmarkCountByMap(),be.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;be.actions.bookmarks(r)}}},Uf=new vs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Uf);var xs=class{addCommand(e,r=!1){H.commands.add(e,r)}consumeCommand(e){return H.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new xs;var N2,Hr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Ff=Symbol("clearAfterUnitTest"),Ao=class extends to(Le){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[N2]=()=>{this.defaultMessages={},this.cache=new qe,this.listeners={}},this.currentUiLocale=H.getState().uiLocale,H.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=H.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};Ae(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new gn((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof Mt)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Hr({loadedContexts:e})),this.dispatchEvent(new Hr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Hr({loadedContexts:[e]})),this.dispatchEvent(new Hr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Qn(0).then(()=>n()).catch(()=>null)))}};N2=Ff;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ao{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ao{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Ln=window.FluidTopicsI18nService,Ss=window.FluidTopicsCustomI18nService;var Cs=class{highlightHtml(e,r,n){yi(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Cs;var Es=class{isDate(e){var r,n,a,i;return(i=(a=((n=(r=H.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return Kt.format(e,(n=r?.locale)!==null&&n!==void 0?n:H.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(c){throw console.error(`Date ${JSON.stringify(e)} is not valid`,c),c}}};window.FluidTopicsDateService=new Es;var Rn=class{static get(e,r){var n,a,i,s;let c=H.getState(),{lang:d,region:u}=(i=(a=(n=c.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||a===void 0?void 0:a.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Ar(c.baseUrl,e??20,(s=c.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${d}-${u}`)}};var As=class{urlToSearchRequest(e){return Rn.get().parse(e)}searchRequestToUrl(e){return Rn.get().serialize(e)}};window.FluidTopicsUrlService=new As;var Jt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Jt.eventName="change";var Os=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},M2=new Os;var Oo=class t extends nt{static build(){return new t(window.history,M2,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Ae(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Jt(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,c])=>{let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[u,s,c]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Jt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Jt.eventName,e)}currentItem(){return Fe(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Fe(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Fe(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return Fe(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let a=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Oo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var T2=z`
905
+ `;function I2(t,e){let{authenticationRequired:r,session:n}=H.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Lo=class extends Br{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Ls=class t extends Cn{static build(e){return new t(H,e)}constructor(e,r){super(),this.store=e,this.cache=new qe,this.withManualResources=!0,this.userLocaleService=new Lo,this.cleanSessionDebouncer=new ve,this.reloadDebouncer=new ve(500),this.apiProvider=r??(()=>Xt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener($r.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>I2(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new On(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},k2=Ls.build();var Qt=class extends Event{constructor(e,r,n,a){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=a??!1}};var wn=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:a,callbackRef:i}of n){let s=a.deref(),c=i.deref();s===void 0||c===void 0||s.dispatchEvent(new Qt(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,a=this.pendingContextRequests.get(e.context);a===void 0&&this.pendingContextRequests.set(e.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(r);i===void 0&&a.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),a.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var ge=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},ne=class extends Gt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=k2,this.contextRoot=new wn}render(){return V`
906
906
  <slot></slot>
907
907
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Ln.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};ne.elementDefinitions={};ne.styles=T2;ge([A()],ne.prototype,"baseUrl",void 0);ge([A()],ne.prototype,"apiIntegrationIdentifier",void 0);ge([A()],ne.prototype,"apiIntegrationAppVersion",void 0);ge([A()],ne.prototype,"uiLocale",void 0);ge([ye(null)],ne.prototype,"availableUiLocales",void 0);ge([ye(null)],ne.prototype,"metadataConfiguration",void 0);ge([A({type:Boolean})],ne.prototype,"editorMode",void 0);ge([A({type:Boolean})],ne.prototype,"noCustom",void 0);ge([A({type:Boolean})],ne.prototype,"openExternalDocumentInNewTab",void 0);ge([A({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],ne.prototype,"noCustomComponent",void 0);ge([A({type:Boolean})],ne.prototype,"withManualResources",void 0);ge([A({type:Boolean})],ne.prototype,"navigatorOnline",void 0);ge([A({type:Boolean})],ne.prototype,"forcedOffline",void 0);ge([A({type:Boolean})],ne.prototype,"authenticationRequired",void 0);ge([ye([])],ne.prototype,"messageContexts",void 0);ge([ye(void 0)],ne.prototype,"session",void 0);var z2={"ft-app-context":ne};oe(z2);var Rs=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[r,n]=e.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Gr=new Rs;var Hf=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Nn=Symbol("i18nAttributes"),P2=Symbol("i18nListAttributes"),D2=Symbol("i18nProperties"),Ro=Symbol("i18nContexts"),_n=Symbol("i18nUnsubs"),U2=de(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?Ss:Ln}i18n(i){let{context:s,key:c,message:d}=i,{custom:u,args:m,argsProvider:h}=i;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let y=m??(h?h(this):[]);return this.getI18nService(u).resolveMessage(s,c,...y)}return d}async awaitI18n(i){let{context:s,custom:c}=i;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(i)}customI18n(i,s){if(Gr.isI18nKey(i)){let[c,d]=i.split(".");return this.i18n({custom:!0,context:c,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,c,d)=>i.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,c,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let d=this,u=(m,h,y)=>y?.context&&y.key&&i(m,h,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...m})}:y;(s=this[Nn])===null||s===void 0||s.forEach((m,h)=>d[h]=u(m,h,d[h])),(c=this[P2])===null||c===void 0||c.forEach((m,h)=>{var y;return d[h]=(y=d[h])===null||y===void 0?void 0:y.map(b=>u(m,h,b))})}updateI18nProperties(i){var s;(s=this[D2])===null||s===void 0||s.forEach((c,d)=>{i(c,d)&&(this[d]=this.i18n(c))})}addI18nMessages(i,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,c)}addI18nContext(i,s,c){let d=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[Ro].set(d,{isCustomContext:c}),this[_n].has(d)||this[_n].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(i){return this[Ro].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ro].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[_n].forEach(i=>i()),this[_n].clear()}}return e=Ro,r=_n,Hf([A({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),wo=class extends U2(K){},_o=class extends U2(Gt){};var ws=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(n=>typeof n=="string"?Gr.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},Gf=new ws;var F2=(t,e)=>(r,n)=>{var a;r.constructor.createProperty(n,{type:Object,hasChanged:rt,converter:Gr,...e}),r[Nn]=(a=r[Nn])!==null&&a!==void 0?a:new Map,r[Nn].set(n,t??{})};var $2=z`
908
908
  `;var Mn=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},He=class extends _o{constructor(){super(),this.editorMode=!1,this.addStore(H)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Z:V`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ftds-floating-menu",
3
- "version": "2.1.15",
3
+ "version": "2.1.16",
4
4
  "description": "The design system floating menu component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -20,16 +20,16 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@floating-ui/dom": "1.7.6",
23
- "@fluid-topics/ft-ripple": "2.1.15",
24
- "@fluid-topics/ft-tooltip": "2.1.15",
25
- "@fluid-topics/ft-wc-utils": "2.1.15",
26
- "@fluid-topics/ftds-button": "2.1.15",
27
- "@fluid-topics/ftds-icon": "2.1.15",
28
- "@fluid-topics/ftds-typography": "2.1.15",
23
+ "@fluid-topics/ft-ripple": "2.1.16",
24
+ "@fluid-topics/ft-tooltip": "2.1.16",
25
+ "@fluid-topics/ft-wc-utils": "2.1.16",
26
+ "@fluid-topics/ftds-button": "2.1.16",
27
+ "@fluid-topics/ftds-icon": "2.1.16",
28
+ "@fluid-topics/ftds-typography": "2.1.16",
29
29
  "lit": "3.1.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@fluid-topics/ft-wc-test-utils": "2.1.15"
32
+ "@fluid-topics/ft-wc-test-utils": "2.1.16"
33
33
  },
34
- "gitHead": "d12bf72262e6788631943d88a02756661734c7d9"
34
+ "gitHead": "64057d048f5055bec9279a012204c826d10bc8fc"
35
35
  }