@fluid-topics/ftds-table 2.2.49 → 2.2.50
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.
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
position: relative;
|
|
346
346
|
word-break: break-word;
|
|
347
347
|
}
|
|
348
|
-
`;var ps=["top","right","bottom","left"],us=["start","end"],Do=ps.reduce((e,t)=>e.concat(t,t+"-"+us[0],t+"-"+us[1]),[]),Lr=Math.min,et=Math.max,Ar=Math.round;var ke=e=>({x:e,y:e}),$0={left:"right",right:"left",bottom:"top",top:"bottom"};function ms(e,t,n){return et(e,Lr(t,n))}function an(e,t){return typeof e=="function"?e(t):e}function Or(e){return e.split("-")[0]}function tt(e){return e.split("-")[1]}function Uo(e){return e==="x"?"y":"x"}function Fo(e){return e==="y"?"height":"width"}function sn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Bo(e){return Uo(sn(e))}function hs(e,t,n){n===void 0&&(n=!1);let o=tt(e),a=Bo(e),i=Fo(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Po(s)),[s,Po(s)]}function gs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function Po(e){let t=Or(e);return $0[t]+e.slice(t.length)}function H0(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 ys(e){return typeof e!="number"?H0(e):{top:e,right:e,bottom:e,left:e}}function Ot(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 bs(e,t,n){let{reference:o,floating:a}=e,i=sn(t),s=Bo(t),l=Fo(s),f=Or(t),m=i==="y",g=o.x+o.width/2-a.width/2,h=o.y+o.height/2-a.height/2,b=o[l]/2-a[l]/2,x;switch(f){case"top":x={x:g,y:o.y-a.height};break;case"bottom":x={x:g,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:h};break;case"left":x={x:o.x-a.width,y:h};break;default:x={x:o.x,y:o.y}}let A=tt(t);return A&&(x[s]+=b*(A==="end"?1:-1)*(n&&m?-1:1)),x}async function xs(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:h="floating",altBoundary:b=!1,padding:x=0}=an(t,e),A=ys(x),O=l[b?h==="floating"?"reference":"floating":h],M=Ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(O)))==null||n?O:O.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:m,rootBoundary:g,strategy:f})),I=h==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},D=Ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:I,offsetParent:_,strategy:f}):I);return{top:(M.top-D.top+A.top)/k.y,bottom:(D.bottom-M.bottom+A.bottom)/k.y,left:(M.left-D.left+A.left)/k.x,right:(D.right-M.right+A.right)/k.x}}var G0=50,vs=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:xs},f=await(s.isRTL==null?void 0:s.isRTL(t)),m=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:g,y:h}=bs(m,o,f),b=o,x=0,A={};for(let w=0;w<i.length;w++){let O=i[w];if(!O)continue;let{name:M,fn:I}=O,{x:_,y:k,data:D,reset:G}=await I({x:g,y:h,initialPlacement:o,placement:b,strategy:a,middlewareData:A,rects:m,platform:l,elements:{reference:e,floating:t}});g=_??g,h=k??h,A[M]={...A[M],...D},G&&x<G0&&(x++,typeof G=="object"&&(G.placement&&(b=G.placement),G.rects&&(m=G.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):G.rects),{x:g,y:h}=bs(m,b,f)),w=-1)}return{x:g,y:h,placement:b,strategy:a,middlewareData:A}};function W0(e,t,n){return(e?[...n.filter(a=>tt(a)===e),...n.filter(a=>tt(a)!==e)]:n.filter(a=>Or(a)===a)).filter(a=>e?tt(a)===e||(t?gs(a)!==a:!1):!0)}var Ss=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:f,elements:m}=t,{crossAxis:g=!1,alignment:h,allowedPlacements:b=Do,autoAlignment:x=!0,...A}=an(e,t),w=h!==void 0||b===Do?W0(h||null,x,b):b,O=((n=s.autoPlacement)==null?void 0:n.index)||0,M=w[O];if(M==null)return{};if(l!==M)return{reset:{placement:w[0]}};let I=await f.detectOverflow(t,A),_=hs(M,i,await(f.isRTL==null?void 0:f.isRTL(m.floating))),k=[I[Or(M)],I[_[0]],I[_[1]]],D=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:M,overflows:k}],G=w[O+1];if(G)return{data:{index:O+1,overflows:D},reset:{placement:G}};let ie=D.map(ye=>{let hr=tt(ye.placement);return[ye.placement,hr&&g?ye.overflows.slice(0,2).reduce((R0,_0)=>R0+_0,0):ye.overflows[0],ye.overflows]}).sort((ye,hr)=>ye[1]-hr[1]),$t=((a=ie.filter(ye=>ye[2].slice(0,tt(ye[0])?2:3).every(hr=>hr<=0))[0])==null?void 0:a[0])||ie[0][0];return $t!==l?{data:{index:O+1,overflows:D},reset:{placement:$t}}:{}}}};var Cs=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:f={fn:I=>{let{x:_,y:k}=I;return{x:_,y:k}}},...m}=an(e,t),g={x:n,y:o},h=await i.detectOverflow(t,m),b=sn(a),x=Uo(b),A=g[x],w=g[b],O=(I,_)=>ms(_+h[I==="y"?"top":"left"],_,_-h[I==="y"?"bottom":"right"]);s&&(A=O(x,A)),l&&(w=O(b,w));let M=f.fn({...t,[x]:A,[b]:w});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[x]:s,[b]:l}}}}}};function ln(){return typeof window<"u"}function Rt(e){return Ls(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(Ls(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ls(e){return ln()?e instanceof Node||e instanceof fe(e).Node:!1}function we(e){return ln()?e instanceof Element||e instanceof fe(e).Element:!1}function Ge(e){return ln()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function Es(e){return!ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}function wr(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Re(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function As(e){return/^(table|td|th)$/.test(Rt(e))}function Rr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var V0=/transform|translate|scale|rotate|perspective|filter/,j0=/paint|layout|strict|content/,wt=e=>!!e&&e!=="none",$o;function Kt(e){let t=we(e)?Re(e):e;return wt(t.transform)||wt(t.translate)||wt(t.scale)||wt(t.rotate)||wt(t.perspective)||!dn()&&(wt(t.backdropFilter)||wt(t.filter))||V0.test(t.willChange||"")||j0.test(t.contain||"")}function Os(e){let t=rt(e);for(;Ge(t)&&!Zt(t);){if(Kt(t))return t;if(Rr(t))return null;t=rt(t)}return null}function dn(){return $o==null&&($o=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$o}function Zt(e){return/^(html|body|#document)$/.test(Rt(e))}function Re(e){return fe(e).getComputedStyle(e)}function _r(e){return we(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rt(e){if(Rt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Es(e)&&e.host||He(e);return Es(t)?t.host:t}function ws(e){let t=rt(e);return Zt(t)?(e.ownerDocument||e).body:Ge(t)&&wr(t)?t:ws(t)}function cn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=ws(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=fe(a);if(i){let l=fn(s);return t.concat(s,s.visualViewport||[],wr(a)?a:[],l&&n?cn(l):[])}else return t.concat(a,cn(a,[],n))}function fn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ns(e){let t=Re(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Ge(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=Ar(n)!==i||Ar(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Ms(e){return we(e)?e:e.contextElement}function qt(e){let t=Ms(e);if(!Ge(t))return ke(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=Ns(t),s=(i?Ar(n.width):n.width)/o,l=(i?Ar(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var K0=ke(0);function zs(e){let t=fe(e);return!dn()||!t.visualViewport?K0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Z0(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fe(e)}function Nr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=Ms(e),s=ke(1);t&&(o?we(o)&&(s=qt(o)):s=qt(e));let l=Z0(i,n,o)?zs(i):ke(0),f=(a.left+l.x)/s.x,m=(a.top+l.y)/s.y,g=a.width/s.x,h=a.height/s.y;if(i&&o){let b=fe(i),x=we(o)?fe(o):o,A=b,w=fn(A);for(;w&&x!==A;){let O=qt(w),M=w.getBoundingClientRect(),I=Re(w),_=M.left+(w.clientLeft+parseFloat(I.paddingLeft))*O.x,k=M.top+(w.clientTop+parseFloat(I.paddingTop))*O.y;f*=O.x,m*=O.y,g*=O.x,h*=O.y,f+=_,m+=k,A=fe(w),w=fn(A)}}return Ot({width:g,height:h,x:f,y:m})}function un(e,t){let n=_r(e).scrollLeft;return t?t.left+n:Nr(He(e)).left+n}function ks(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-un(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=He(o),l=t?Rr(t.floating):!1;if(o===s||l&&i)return n;let f={scrollLeft:0,scrollTop:0},m=ke(1),g=ke(0),h=Ge(o);if((h||!i)&&((Rt(o)!=="body"||wr(s))&&(f=_r(o)),h)){let x=Nr(o);m=qt(o),g.x=x.x+o.clientLeft,g.y=x.y+o.clientTop}let b=s&&!h&&!i?ks(s,f):ke(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+g.x+b.x,y:n.y*m.y-f.scrollTop*m.y+g.y+b.y}}function Y0(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function X0(e){let t=_r(e),n=e.ownerDocument.body,o=et(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=et(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+un(e),s=-t.scrollTop;return Re(n).direction==="rtl"&&(i+=et(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var Q0=25;function J0(e,t,n){n===void 0&&(n="viewport");let o=n==="layoutViewport",a=fe(e),i=He(e),s=a.visualViewport,l=i.clientWidth,f=i.clientHeight,m=0,g=0;if(s){let b=!dn()||t==="fixed";o?b||(m=-s.offsetLeft,g=-s.offsetTop):(l=s.width,f=s.height,b&&(m=s.offsetLeft,g=s.offsetTop))}if(un(i)<=0){let b=i.ownerDocument,x=b.body,A=getComputedStyle(x),w=b.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,O=Math.abs(i.clientWidth-x.clientWidth-w),M=getComputedStyle(i).scrollbarGutter==="stable both-edges"?O/2:O;M<=Q0&&(l-=M)}return{width:l,height:f,x:m,y:g}}function e4(e,t){let n=Nr(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=qt(e),s=e.clientWidth*i.x,l=e.clientHeight*i.y,f=a*i.x,m=o*i.y;return{width:s,height:l,x:f,y:m}}function Rs(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=J0(e,n,t);else if(t==="document")o=X0(He(e));else if(we(t))o=e4(t,n);else{let a=zs(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ot(o)}function t4(e,t){let n=t.get(e);if(n)return n;let o=cn(e,[],!1).filter(l=>we(l)&&Rt(l)!=="body"),a=null,i=Re(e).position==="fixed",s=i?rt(e):e;for(;we(s)&&!Zt(s);){let l=Re(s),f=Kt(s),m=a?a.position:i?"fixed":"";!f&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(h=>h!==s):a=l,s=rt(s)}return t.set(e,o),o}function r4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?Rr(t)?[]:t4(t,this._c):[].concat(n),o],l=Rs(t,s[0],a),f=l.top,m=l.right,g=l.bottom,h=l.left;for(let b=1;b<s.length;b++){let x=Rs(t,s[b],a);f=et(x.top,f),m=Lr(x.right,m),g=Lr(x.bottom,g),h=et(x.left,h)}return{width:m-h,height:g-f,x:h,y:f}}function n4(e){let{width:t,height:n}=Ns(e);return{width:t,height:n}}function o4(e,t,n){let o=Ge(t),a=He(t),i=n==="fixed",s=Nr(e,!0,i,t),l={scrollLeft:0,scrollTop:0},f=ke(0);if((o||!i)&&((Rt(t)!=="body"||wr(a))&&(l=_r(t)),o)){let b=Nr(t,!0,i,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!o&&a&&(f.x=un(a));let m=a&&!o&&!i?ks(a,l):ke(0),g=s.left+l.scrollLeft-f.x-m.x,h=s.top+l.scrollTop-f.y-m.y;return{x:g,y:h,width:s.width,height:s.height}}function Ho(e){return Re(e).position==="static"}function _s(e,t){if(!Ge(e)||Re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function Is(e,t){let n=fe(e);if(Rr(e))return n;if(!Ge(e)){let a=rt(e);for(;a&&!Zt(a);){if(we(a)&&!Ho(a))return a;a=rt(a)}return n}let o=_s(e,t);for(;o&&As(o)&&Ho(o);)o=_s(o,t);return o&&Zt(o)&&Ho(o)&&!Kt(o)?n:o||Os(e)||n}var a4=async function(e){let t=this.getOffsetParent||Is,n=this.getDimensions,o=await n(e.floating);return{reference:o4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function i4(e){return Re(e).direction==="rtl"}var pn={convertOffsetParentRelativeRectToViewportRelativeRect:q0,getDocumentElement:He,getClippingRect:r4,getOffsetParent:Is,getElementRects:a4,getClientRects:Y0,getDimensions:n4,getScale:qt,isElement:we,isRTL:i4};var Ts=Ss,Ps=Cs;var Ds=(e,t,n)=>{let o=new Map,a=n??{},i={...pn,...a.platform,_c:o};return vs(e,t,{...a,platform:i})};function Us(e){return s4(e)}function Go(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function s4(e){for(let t=e;t;t=Go(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Go(e);t;t=Go(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||Kt(n)||t.tagName==="BODY"))return t}return null}async function Fs(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},Ds(e,t,{strategy:o.strategy,platform:{...pn,getOffsetParent:a=>pn.getOffsetParent(a,Us)},middleware:[Ps({crossAxis:!0}),Ts({allowedPlacements:[o.placement]})]})}var or=E(P());var da=E(se());var Bs=E(se(),1);var Wo=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)},c4=e=>({fromAttribute:t=>{if(t==null)return Mr(e);try{return JSON.parse(t)}catch{return Mr(e)}},toAttribute:t=>JSON.stringify(t)});function $s(e,t){return(0,Bs.property)({type:Object,converter:c4(e),hasChanged:zr,...t??{}})}function l4(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(!Yt(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(!Yt(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(!Yt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Yt(e,t){try{return l4(e,t)}catch{return!1}}function zr(e,t){return!Yt(e,t)}function Mr(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function mn(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 Hs=E(se(),1);var Vo=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:zr,attribute:!1,...t};(0,Hs.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 hn=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 _t=E(se(),1);var gn=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 bn=E(V(),1);var yn=class extends bn.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(0,bn.adoptStyles)(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){Wo(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 Gs(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 Qt=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},Ks,Ws=Symbol("constructorPrototype"),Vs=Symbol("constructorName"),Zs=Symbol("exportpartsDebouncer"),js=Symbol("dynamicDependenciesLoaded"),Xt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Xt.eventName="exportparts-updated";var Ie=class extends yn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ks]=new gn(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[Zs].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[Vs]=this.constructor.name,this[Ws]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Vs]&&Object.setPrototypeOf(this,this[Ws])}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[js]||(n[js]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Xt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Xt.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 Xt)})}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=Gs(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 f=b=>b!=null&&b.trim().length>0,m=t.filter(f).map(b=>b.trim());if(m.length===0){this.exportparts=void 0;return}let g=new Set;for(let b of(i=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let x=(s=(o=b.getAttribute("part"))===null||o===void 0?void 0:o.split(" "))!==null&&s!==void 0?s:[],A=(l=(a=b.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(O=>O.split(":")[1]))!==null&&l!==void 0?l:[],w=[...x,...A].filter(f).map(O=>O.trim());for(let O of w)g.add(O)}if(g.size===0){this.exportparts=void 0;return}let h=[...g.values()].flatMap(b=>m.map(x=>`${b}:${x}--${b}`));this.exportparts=[...this.part,...h].join(", ")}};Ks=Zs;Qt([(0,_t.property)()],Ie.prototype,"exportpartsPrefix",void 0);Qt([$s([])],Ie.prototype,"exportpartsPrefixes",void 0);Qt([(0,_t.property)({reflect:!0})],Ie.prototype,"exportparts",void 0);Qt([(0,_t.property)()],Ie.prototype,"customStylesheet",void 0);Qt([(0,_t.property)()],Ie.prototype,"elementToFocus",void 0);Qt([(0,_t.state)()],Ie.prototype,"useAdoptedStyleSheets",void 0);function xn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var kr=Symbol("internalReduxEventsUnsubscribers"),nt=Symbol("internalStoresUnsubscribers"),Nt=Symbol("internalStores"),d4=mn(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[Nt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Nt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Nt].get(s)}addStore(s,l){var f;l=(f=l??s.name)!==null&&f!==void 0?f:"default-store",this.unsubscribeFromStore(l),this[Nt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Nt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Nt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let f=this.constructor.getPropertyOptions(l);if(!f?.attribute||!this.hasAttribute(typeof f?.attribute=="string"?f.attribute:l)){let m=this.getStore(s.store);m&&(s.store?this[nt].has(s.store):this[nt].size>0)&&(this[l]=s.selector(m.getState(),this))}})}subscribeToStore(s,l){var f,m;this[nt].set(s,l.subscribe(()=>this.updateFromStores())),this[kr].set(s,[]),xn(l)&&(!((f=l.deprecatedKeys)===null||f===void 0)&&f.length&&this.reduxConstructor.reduxProperties.forEach((g,h)=>{this.getStore(g.store)===l&&l.deprecatedKeys.includes(h)&&console.warn("Element",this,"is subscribed to deprecated key",h,"in store",l.name)}),l.eventBus&&((m=this.reduxConstructor.reduxEventListeners)===null||m===void 0||m.forEach((g,h)=>{if(typeof this[h]=="function"&&(!g.store||l.name===g.store)){let b=x=>this[h](x);l.addEventListener(g.eventName,b),this[kr].get(s).push(()=>l.removeEventListener(g.eventName,b))}}))),this.onStoreAvailable(s)}unsubscribeFromStores(){this[nt].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[nt].has(s)&&this[nt].get(s)(),this[nt].delete(s),(l=this[kr].get(s))===null||l===void 0||l.forEach(f=>f()),this[kr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=nt,n=Nt,o=kr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),qs=class extends d4(Ie){};function ne(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 f4=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ys=f4,jo=()=>Math.random().toString(36).substring(7).split("").join("."),u4={INIT:`@@redux/INIT${jo()}`,REPLACE:`@@redux/REPLACE${jo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jo()}`},vn=u4;function Sn(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Ko(e,t,n){if(typeof e!="function")throw new Error(ne(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ne(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ne(1));return n(Ko)(e,t)}let o=e,a=t,i=new Map,s=i,l=0,f=!1;function m(){s===i&&(s=new Map,i.forEach((O,M)=>{s.set(M,O)}))}function g(){if(f)throw new Error(ne(3));return a}function h(O){if(typeof O!="function")throw new Error(ne(4));if(f)throw new Error(ne(5));let M=!0;m();let I=l++;return s.set(I,O),function(){if(M){if(f)throw new Error(ne(6));M=!1,m(),s.delete(I),i=null}}}function b(O){if(!Sn(O))throw new Error(ne(7));if(typeof O.type>"u")throw new Error(ne(8));if(typeof O.type!="string")throw new Error(ne(17));if(f)throw new Error(ne(9));try{f=!0,a=o(a,O)}finally{f=!1}return(i=s).forEach(I=>{I()}),O}function x(O){if(typeof O!="function")throw new Error(ne(10));o=O,b({type:vn.REPLACE})}function A(){let O=h;return{subscribe(M){if(typeof M!="object"||M===null)throw new Error(ne(11));function I(){let k=M;k.next&&k.next(g())}return I(),{unsubscribe:O(I)}},[Ys](){return this}}}return b({type:vn.INIT}),{dispatch:b,subscribe:h,getState:g,replaceReducer:x,[Ys]:A}}function p4(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:vn.INIT})>"u")throw new Error(ne(12));if(typeof n(void 0,{type:vn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ne(13))})}function Zo(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}let o=Object.keys(n),a,i;try{p4(n)}catch(s){i=s}return function(l={},f){if(i)throw i;let m=!1,g={};for(let h=0;h<o.length;h++){let b=o[h],x=n[b],A=l[b],w=x(A,f);if(typeof w>"u"){let O=f&&f.type;throw new Error(ne(14))}g[b]=w,m=m||w!==A}return m=m||o.length!==Object.keys(l).length,m?g:l}}function Ir(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Xs(...e){return t=>(n,o)=>{let a=t(n,o),i=()=>{throw new Error(ne(15))},s={getState:a.getState,dispatch:(f,...m)=>i(f,...m)},l=e.map(f=>f(s));return i=Ir(...l)(a.dispatch),{...a,dispatch:i}}}function Qs(e){return Sn(e)&&"type"in e&&typeof e.type=="string"}var sc=Symbol.for("immer-nothing"),Js=Symbol.for("immer-draftable"),ae=Symbol.for("immer-state");function _e(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ue=Object,er=ue.getPrototypeOf,An="constructor",Mn="prototype",Qo="configurable",On="enumerable",En="writable",Tr="value",Te=e=>!!e&&!!e[ae];function pe(e){return e?cc(e)||kn(e)||!!e[Js]||!!e[An]?.[Js]||In(e)||Fr(e):!1}var m4=ue[Mn][An].toString(),ec=new WeakMap;function cc(e){if(!e||!ia(e))return!1;let t=er(e);if(t===null||t===ue[Mn])return!0;let n=ue.hasOwnProperty.call(t,An)&&t[An];if(n===Object)return!0;if(!Jt(n))return!1;let o=ec.get(n);return o===void 0&&(o=Function.toString.call(n),ec.set(n,o)),o===m4}function zn(e,t,n=!0){Ur(e)===0?(n?Reflect.ownKeys(e):ue.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((o,a)=>t(a,o,e))}function Ur(e){let t=e[ae];return t?t.type_:kn(e)?1:In(e)?2:Fr(e)?3:0}var qo=(e,t,n=Ur(e))=>n===2?e.has(t):ue[Mn].hasOwnProperty.call(e,t),Jo=(e,t,n=Ur(e))=>n===2?e.get(t):e[t],wn=(e,t,n,o=Ur(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function h4(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var kn=Array.isArray,In=e=>e instanceof Map,Fr=e=>e instanceof Set,ia=e=>typeof e=="object",Jt=e=>typeof e=="function",Yo=e=>typeof e=="boolean";function g4(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var We=e=>e.copy_||e.base_;var sa=e=>e.modified_?e.copy_:e.base_;function ea(e,t){if(In(e))return new Map(e);if(Fr(e))return new Set(e);if(kn(e))return Array[Mn].slice.call(e);let n=cc(e);if(t===!0||t==="class_only"&&!n){let o=ue.getOwnPropertyDescriptors(e);delete o[ae];let a=Reflect.ownKeys(o);for(let i=0;i<a.length;i++){let s=a[i],l=o[s];l[En]===!1&&(l[En]=!0,l[Qo]=!0),(l.get||l.set)&&(o[s]={[Qo]:!0,[En]:!0,[On]:l[On],[Tr]:e[s]})}return ue.create(er(e),o)}else{let o=er(e);if(o!==null&&n)return{...e};let a=ue.create(o);return ue.assign(a,e)}}function Tn(e,t=!1){return Pn(e)||Te(e)||!pe(e)||(Ur(e)>1&&ue.defineProperties(e,{set:Cn,add:Cn,clear:Cn,delete:Cn}),ue.freeze(e),t&&zn(e,(n,o)=>{Tn(o,!0)},!1)),e}function y4(){_e(2)}var Cn={[Tr]:y4};function Pn(e){return e===null||!ia(e)?!0:ue.isFrozen(e)}var Rn="MapSet",ta="Patches",tc="ArrayMethods",lc={};function Mt(e){let t=lc[e];return t||_e(0,e),t}var rc=e=>!!lc[e];var Pr,dc=()=>Pr,b4=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:rc(Rn)?Mt(Rn):void 0,arrayMethodsPlugin_:rc(tc)?Mt(tc):void 0});function nc(e,t){t&&(e.patchPlugin_=Mt(ta),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ra(e){na(e),e.drafts_.forEach(x4),e.drafts_=null}function na(e){e===Pr&&(Pr=e.parent_)}var oc=e=>Pr=b4(Pr,e);function x4(e){let t=e[ae];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ac(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[ae].modified_&&(ra(t),_e(4)),pe(e)&&(e=ic(t,e));let{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[ae].base_,e,t)}else e=ic(t,n);return v4(t,e,!0),ra(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sc?e:void 0}function ic(e,t){if(Pn(t))return t;let n=t[ae];if(!n)return _n(t,e.handledSet_,e);if(!Dn(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);pc(n,e)}return n.copy_}function v4(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tn(t,n)}function fc(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Dn=(e,t)=>e.scope_===t,S4=[];function uc(e,t,n,o){let a=We(e),i=e.type_;if(o!==void 0&&Jo(a,o,i)===t){wn(a,o,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;zn(a,(f,m)=>{if(Te(m)){let g=l.get(m)||[];g.push(f),l.set(m,g)}})}let s=e.draftLocations_.get(t)??S4;for(let l of s)wn(a,l,n,i)}function C4(e,t,n){e.callbacks_.push(function(a){let i=t;if(!i||!Dn(i,a))return;a.mapSetPlugin_?.fixSetContents(i);let s=sa(i);uc(e,i.draft_??i,s,n),pc(i,a)})}function pc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:o}=t;if(o){let a=o.getPath(e);a&&o.generatePatches_(e,a,t)}fc(e)}}function E4(e,t,n){let{scope_:o}=e;if(Te(n)){let a=n[ae];Dn(a,o)&&a.callbacks_.push(function(){Ln(e);let s=sa(a);uc(e,n,s,t)})}else pe(n)&&e.callbacks_.push(function(){let i=We(e);e.type_===3?i.has(n)&&_n(n,o.handledSet_,o):Jo(i,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&_n(Jo(e.copy_,t,e.type_),o.handledSet_,o)})}function _n(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Te(e)||t.has(e)||!pe(e)||Pn(e)||(t.add(e),zn(e,(o,a)=>{if(Te(a)){let i=a[ae];if(Dn(i,n)){let s=sa(i);wn(e,o,s,e.type_),fc(i)}}else pe(a)&&_n(a,t,n)})),e}function L4(e,t){let n=kn(e),o={type_:n?1:0,scope_:t?t.scope_:dc(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=o,i=Nn;n&&(a=[o],i=Dr);let{revoke:s,proxy:l}=Proxy.revocable(a,i);return o.draft_=l,o.revoke_=s,[l,o]}var Nn={get(e,t){if(t===ae)return e;let n=e.scope_.arrayMethodsPlugin_,o=e.type_===1&&typeof t=="string";if(o&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=We(e);if(!qo(a,t,e.type_))return O4(e,a,t);let i=a[t];if(e.finalized_||!pe(i)||o&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&g4(t))return i;if(i===Xo(e.base_,t)||A4(e,t,i)){Ln(e);let s=e.type_===1?+t:t,l=aa(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in We(e)},ownKeys(e){return Reflect.ownKeys(We(e))},set(e,t,n){let o=mc(We(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){let a=Xo(We(e),t),i=a?.[ae];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(h4(n,a)&&(n!==void 0||qo(e.base_,t,e.type_)))return!0;Ln(e),oa(e)}return e.copy_[t]===n&&(n!==void 0||qo(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),E4(e,t,n)),!0},deleteProperty(e,t){return Ln(e),Xo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oa(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=We(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[En]:!0,[Qo]:e.type_!==1||t!=="length",[On]:o[On],[Tr]:n[t]}},defineProperty(){_e(11)},getPrototypeOf(e){return er(e.base_)},setPrototypeOf(){_e(12)}},Dr={};for(let e in Nn){let t=Nn[e];Dr[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Dr.deleteProperty=function(e,t){return Dr.set.call(this,e,t,void 0)};Dr.set=function(e,t,n){return Nn.set.call(this,e[0],t,n,e[0])};function Xo(e,t){let n=e[ae];return(n?We(n):e)[t]}function A4(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!pe(n)||n[ae]?!1:e.baseRefs_.has(n)}function O4(e,t,n){let o=mc(t,n);return o?Tr in o?o[Tr]:o.get?.call(e.draft_):void 0}function mc(e,t){if(!(t in e))return;let n=er(e);for(;n;){let o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=er(n)}}function oa(e){e.modified_||(e.modified_=!0,e.parent_&&oa(e.parent_))}function Ln(e){e.copy_||(e.assigned_=new Map,e.copy_=ea(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var w4=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(Jt(t)&&!Jt(n)){let i=n;n=t;let s=this;return function(f=i,...m){return s.produce(f,g=>n.call(this,g,...m))}}Jt(n)||_e(6),o!==void 0&&!Jt(o)&&_e(7);let a;if(pe(t)){let i=oc(this),s=aa(i,t,void 0),l=!0;try{a=n(s),l=!1}finally{l?ra(i):na(i)}return nc(i,o),ac(a,i)}else if(!t||!ia(t)){if(a=n(t),a===void 0&&(a=t),a===sc&&(a=void 0),this.autoFreeze_&&Tn(a,!0),o){let i=[],s=[];Mt(ta).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),o(i,s)}return a}else _e(1,t)},this.produceWithPatches=(t,n)=>{if(Jt(t))return(s,...l)=>this.produceWithPatches(s,f=>t(f,...l));let o,a;return[this.produce(t,n,(s,l)=>{o=s,a=l}),o,a]},Yo(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Yo(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Yo(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){pe(e)||_e(8),Te(e)&&(e=hc(e));let t=oc(this),n=aa(t,e,void 0);return n[ae].isManual_=!0,na(t),n}finishDraft(e,t){let n=e&&e[ae];(!n||!n.isManual_)&&_e(9);let{scope_:o}=n;return nc(o,t),ac(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));let o=Mt(ta).applyPatches_;return Te(e)?o(e,t):this.produce(e,a=>o(a,t))}};function aa(e,t,n,o){let[a,i]=In(t)?Mt(Rn).proxyMap_(t,n):Fr(t)?Mt(Rn).proxySet_(t,n):L4(t,n);return(n?.scope_??dc()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?C4(n,i,o):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),a}function hc(e){return Te(e)||_e(10,e),gc(e)}function gc(e){if(!pe(e)||Pn(e))return e;let t=e[ae],n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ea(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=ea(e,!0);let a=n;return Fr(n)&&(n=new Set),zn(a,(i,s)=>{wn(n,i,gc(s))},o),t&&(t.finalized_=!1),n}var R4=globalThis.Iterator,Ip=typeof R4?.from=="function";var _4=new w4,ca=_4.produce;function yc(e){return({dispatch:n,getState:o})=>a=>i=>typeof i=="function"?i(n,o,e):a(i)}var bc=yc(),xc=yc;var N4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ir:Ir.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function $r(e,t){function n(...o){if(t){let a=t(...o);if(!a)throw new Error(Pe(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:o[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=o=>o!=null&&o.type===e&&Qs(o),n}var Cc=class Br extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Br.prototype)}static get[Symbol.species](){return Br}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Br(...t[0].concat(this)):new Br(...t.concat(this))}};function vc(e){return pe(e)?ca(e,()=>{}):e}function Un(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function M4(e){return typeof e=="boolean"}var z4=()=>function(t){let{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{},s=new Cc;return n&&(M4(n)?s.push(bc):s.push(xc(n.extraArgument))),s},k4="RTK_autoBatch";var Sc=e=>t=>{setTimeout(t,e)},I4=(e,t,n)=>o=>{let a=!1,i,s,l=()=>{a||(a=!0,t?.(i),clearTimeout(s),o())};i=e(l),s=setTimeout(l,n)},T4=(e={type:"raf"})=>t=>(...n)=>{let o=t(...n),a=!0,i=!1,s=!1,l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?I4(window.requestAnimationFrame,window.cancelAnimationFrame,100):Sc(10):e.type==="callback"?e.queueNotification:Sc(e.timeout),m=()=>{s=!1,i&&(i=!1,l.forEach(g=>g()))};return Object.assign({},o,{subscribe(g){let h=()=>a&&g(),b=o.subscribe(h);return l.add(g),()=>{b(),l.delete(g)}},dispatch(g){try{return a=!g?.meta?.[k4],i=!a,i&&(s||(s=!0,f(m))),o.dispatch(g)}finally{a=!0}}})},P4=e=>function(n){let{autoBatch:o=!0}=n??{},a=new Cc(e);return o&&a.push(T4(typeof o=="object"?o:void 0)),a};function Ec(e){let t=z4(),{reducer:n=void 0,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{},f;if(typeof n=="function")f=n;else if(Sn(n))f=Zo(n);else throw new Error(Pe(1));let m;typeof o=="function"?m=o(t):m=t();let g=Ir;a&&(g=N4({trace:!1,...typeof a=="object"&&a}));let h=Xs(...m),b=P4(h),x=typeof l=="function"?l(b):b(),A=g(...x);return Ko(f,s,A)}function Lc(e){let t={},n=[],o,a={addCase(i,s){let l=typeof i=="string"?i:i.type;if(!l)throw new Error(Pe(28));if(l in t)throw new Error(Pe(29));return t[l]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return o=i,a}};return e(a),[t,n,o]}function D4(e){return typeof e=="function"}function U4(e,t){let[n,o,a]=Lc(t),i;if(D4(e))i=()=>vc(e());else{let f=vc(e);i=()=>f}function s(f,m,g){if(Te(f)){let h=m(f,g);return h===void 0?f:h}else{if(pe(f))return ca(f,h=>m(h,g));{let h=m(f,g);if(h===void 0){if(f===null)return f;throw new Error(Pe(9))}return h}}}function l(f=i(),m){let g=n[m.type],h;for(let{matcher:b,reducer:x}of o)b(m)&&x&&(h??=[]).push(x);if(!g&&!h)return a?s(f,a,m):f;if(g&&(f=s(f,g,m)),h)for(let b of h)f=s(f,b,m);return f}return l.getInitialState=i,l}var F4=Symbol.for("rtk-slice-createasyncthunk");function B4(e,t){return`${e}/${t}`}function $4({creators:e}={}){let t=e?.asyncThunk?.[F4];return function(o){let{name:a,reducerPath:i=a}=o;if(!a)throw new Error(Pe(11));typeof process<"u";let s=(typeof o.reducers=="function"?o.reducers(G4()):o.reducers)||{},l=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(_,k){let D=typeof _=="string"?_:_.type;if(!D)throw new Error(Pe(12));if(D in f.sliceCaseReducersByType)throw new Error(Pe(13));return f.sliceCaseReducersByType[D]=k,m},addMatcher(_,k){return f.sliceMatchers.push({matcher:_,reducer:k}),m},exposeAction(_,k){return f.actionCreators[_]=k,m},exposeCaseReducer(_,k){return f.sliceCaseReducersByName[_]=k,m}};l.forEach(_=>{let k=s[_],D={reducerName:_,type:B4(a,_),createNotation:typeof o.reducers=="function"};V4(k)?K4(D,k,m,t):W4(D,k,m)});function g(){let[_={},k=[],D=void 0]=typeof o.extraReducers=="function"?Lc(o.extraReducers):[o.extraReducers],G={..._,...f.sliceCaseReducersByType};return U4(o.initialState,ie=>{for(let q in G)ie.addCase(q,G[q]);for(let q of f.sliceMatchers)ie.addMatcher(q.matcher,q.reducer);for(let q of k)ie.addMatcher(q.matcher,q.reducer);D&&ie.addDefaultCase(D)})}let h=_=>_,b=new Map,x=new WeakMap,A;function w(_,k){return A||(A=g()),A(_,k)}function O(){return A||(A=g()),A.getInitialState()}function M(_,k=!1){function D(ie){let q=ie[_];return typeof q>"u"&&k&&(q=Un(x,D,O)),q}function G(ie=h){return Un(Un(b,k,()=>new WeakMap),ie,()=>{let q={};for(let[$t,ye]of Object.entries(o.selectors??{}))q[$t]=H4(ye,ie,()=>Un(x,ie,O),k);return q})}return{reducerPath:_,getSelectors:G,get selectors(){return G(D)},selectSlice:D}}let I={name:a,reducer:w,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:O,...M(i),injectInto(_,{reducerPath:k,...D}={}){let G=k??i;return _.inject({reducerPath:G,reducer:w},D),{...I,...M(G,!0)}}};return I}}function H4(e,t,n,o){function a(i,...s){let l=t(i);return typeof l>"u"&&o&&(l=n()),e(l,...s)}return a.unwrapped=e,a}var Ac=$4();function G4(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function W4({type:e,reducerName:t,createNotation:n},o,a){let i,s;if("reducer"in o){if(n&&!j4(o))throw new Error(Pe(17));i=o.reducer,s=o.prepare}else i=o;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?$r(e,s):$r(e))}function V4(e){return e._reducerDefinitionType==="asyncThunk"}function j4(e){return e._reducerDefinitionType==="reducerWithPrepare"}function K4({type:e,reducerName:t},n,o,a){if(!a)throw new Error(Pe(18));let{payloadCreator:i,fulfilled:s,pending:l,rejected:f,settled:m,options:g}=n,h=a(e,i,g);o.exposeAction(t,h),s&&o.addCase(h.fulfilled,s),l&&o.addCase(h.pending,l),f&&o.addCase(h.rejected,f),m&&o.addMatcher(h.settled,m),o.exposeCaseReducer(t,{fulfilled:s||Fn,pending:l||Fn,rejected:f||Fn,settled:m||Fn})}function Fn(){}var Oc="listener",wc="completed",Rc="cancelled",Hp=`task-${Rc}`,Gp=`task-${wc}`,Wp=`${Oc}-${Rc}`,Vp=`${Oc}-${wc}`;var{assign:_c}=Object;var la="listenerMiddleware";var Z4=_c($r(`${la}/add`),{withTypes:()=>Z4}),jp=$r(`${la}/removeAll`),q4=_c($r(`${la}/remove`),{withTypes:()=>q4});function Pe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Y4=mn(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)}}}),Bn=class extends Y4(Object){};window.ftReduxStores||(window.ftReduxStores={});var Nc=class e extends Bn{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(xn(i))return i;if(a==null)return;let s=Ac({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=Ec({reducer:(f,m)=>{if(m.type==="CLEAR_FT_REDUX_STORE"){let g=Mr(s.getInitialState());for(let h of m.keeping)g[h]=(f??g)[h];return g}else if(typeof m.type=="string"&&m.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...f,...m.overwrites};return s.reducer(f,m)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus,a.deprecatedKeys)}constructor(t,n,o,a){super(),this.reduxSlice=t,this.reduxStore=n,this.deprecatedKeys=a,this.isFtReduxStore=!0,this.commands=new hn,this.injectInto=(s,l)=>this.reduxSlice.injectInto(s,l),this.selectSlice=s=>this.reduxSlice.selectSlice(s);let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,f)=>{let m=l,g=s[m];return g?(...h)=>{let b=g(...h.map(i));return this.reduxStore.dispatch(b),b}:h=>{let b=m,x=this.getState()[b];Yt(x,h)||this.setState({[b]:i(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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var $n=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),f=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?f:a?`${l} ${f}`: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 Hn=E(P()),X4="ft-app-info",zt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};zt.eventName="authentication-change";var Hr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Hr.eventName="ui-locale-changed";var Q4={session:(e,t)=>{(0,Hn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>T.dispatchEvent(new zt(t.payload)),0))}},T=Hn.FtReduxStore.get({name:X4,reducers:Q4,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Mc=E(P()),Gn=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},v8=(0,Mc.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(T)}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=>$n.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Gn([(0,da.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Gn([(0,da.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Gn([Vo({store:T.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),Gn([Vo({store:T.name})],t.prototype,"uiLocale",void 0),t});var zc;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(zc||(zc={}));var kc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(kc||(kc={}));var Ic;(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"})(Ic||(Ic={}));var Tc;(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"})(Tc||(Tc={}));var Pc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Pc||(Pc={}));var Dc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Dc||(Dc={}));var Uc;(function(e){e.PUBLISHED="PUBLISHED",e.AI="AI"})(Uc||(Uc={}));var Fc;(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"})(Fc||(Fc={}));var Bc;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Bc||(Bc={}));var $c;(function(e){e.METADATA_FILTER="METADATA_FILTER",e.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})($c||($c={}));var Hc;(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",e.DOC_DIFF="DOC_DIFF"})(Hc||(Hc={}));var Gc;(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"})(Gc||(Gc={}));var Wc;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Wc||(Wc={}));var Vc;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Vc||(Vc={}));var jc;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(jc||(jc={}));var Kc;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Kc||(Kc={}));var Zc;(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"})(Zc||(Zc={}));var qc;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(qc||(qc={}));var Yc;(function(e){e.ASC="ASC",e.DESC="DESC"})(Yc||(Yc={}));var Xc;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Xc||(Xc={}));var Qc;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Qc||(Qc={}));var Jc;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Jc||(Jc={}));var el;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(el||(el={}));var tl;(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"})(tl||(tl={}));var rl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(rl||(rl={}));var nl;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(nl||(nl={}));var ol;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ol||(ol={}));var al;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(al||(al={}));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 xe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(xe||(xe={}));var il;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(il||(il={}));var sl;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(sl||(sl={}));var cl;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(cl||(cl={}));var ll;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(ll||(ll={}));var dl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(dl||(dl={}));var fl;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(fl||(fl={}));var ul;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(ul||(ul={}));var pl;(function(e){e.CHAT="CHAT",e.COMPLETION="COMPLETION",e.RAG="RAG",e.AGENT="AGENT"})(pl||(pl={}));var ml;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(ml||(ml={}));var hl;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(hl||(hl={}));var gl;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(gl||(gl={}));var yl;(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"})(yl||(yl={}));var bl;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(bl||(bl={}));var J4={[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 xl(e,t){return e===t||(J4[e]??[]).some(n=>xl(n,t))}function fa(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=>xl(o,t))}function vl(e,...t){return e==null?!1:t.some(n=>fa(e,n))}var Zn=E(P());var ua=E(P());var kt=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=T.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=T.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var tr=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:kt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):kt.await()}};var me=class extends tr{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],[f])=>l.localeCompare(f)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new ua.CacheRegistry,this.cache=t?a.commonCache:new ua.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 Wn=class extends me{async listMySearches(){let{session:t}=T.getState();return fa(t,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Vn=class extends me{async listMyBookmarks(){let t=T.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var jn=class extends me{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(`/api/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(`/api/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var Kn=class extends me{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/api/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var ed="ft-user-assets",td={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(xe).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;ma(e,n,[...pa(e,n),a]),Sl(e,n,1,o),Cl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ma(e,n,pa(e,n).map(a=>a.id===o.id?o:a)),Cl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ma(e,n,pa(e,n).filter(i=>i.id!==a)),Sl(e,n,-1,o)}},El={[xe.SEARCHES]:"savedSearches",[xe.BOOKMARKS]:"bookmarks",[xe.BOOKS]:void 0,[xe.COLLECTIONS]:void 0},pa=(e,t)=>{var n;let o=El[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ma=(e,t,n)=>{let o=El[t];o&&(e[o]=n)},Sl=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===xe.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},Cl=(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)},ce=Zn.FtReduxStore.get({name:ed,reducers:td,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(xe).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ha=class{constructor(t=new jn,n=new Kn){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Vn,this.savedSearchesService=new Wn,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=T.getState();(0,Zn.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(),ce.actions.clearAssetCount(),ce.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ce.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ce.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ce.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ce.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&ce.getState().assetCounts.allAsset[t]!==n.count&&ce.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&ce.getState().assetCounts.bookmarkByMap[t]!==n.count&&ce.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(ce.getState().assetCounts.bookmarkByMap).length!==0;t===xe.BOOKMARKS&&n&&ce.actions.clearBookmarkCountByMap(),ce.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ce.actions.bookmarks(n)}}},rd=new ha;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=rd);var ga=class{addCommand(t,n=!1){T.commands.add(t,n)}consumeCommand(t){return T.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new ga;var ve=E(P());var Ll,rr=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},nd=Symbol("clearAfterUnitTest"),qn=class extends(0,ve.withEventBus)(me){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ll]=()=>{this.defaultMessages={},this.cache=new ve.CacheRegistry,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=T.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,ve.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 ve.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 ve.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 rr({loadedContexts:t})),this.dispatchEvent(new rr({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new rr({loadedContexts:[t]})),this.dispatchEvent(new rr({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,ve.delay)(0).then(()=>o()).catch(()=>null)))}};Ll=nd;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends qn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends qn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Gr=window.FluidTopicsI18nService,ya=window.FluidTopicsCustomI18nService;var Al=E(P()),ba=class{highlightHtml(t,n,o){(0,Al.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ba;var Ol=E(P());var xa=class{isDate(t){var n,o,a,i;return(i=(o=((a=(n=T.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]).find(l=>l.key===t))===null||o===void 0?void 0:o.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return Ol.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:T.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 xa;var wl=E(P());var Wr=class{static get(t,n,{baseUrl:o,localesConfiguration:a,availableContentLocales:i}=T.getState()){var s;if(n==="all"&&a?.allLanguagesAllowed)n=void 0;else if(!n||i.length>0&&!i.some(l=>l.lang===n)){let l=a?.defaultLocales.defaultContentLocale;n=l?`${l.lang}-${l.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new wl.SearchPlaceConverter(o,t??20,a?.allLanguagesAllowed,n,i)}};var va=class{urlToSearchRequest(t){return Wr.get().parse(t)}searchRequestToUrl(t){return Wr.get().serialize(t)}};window.FluidTopicsUrlService=new va;var Ve=E(P());var It=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};It.eventName="before-location-change";var Tt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Tt.eventName="change";var Sa=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))}},Rl=new Sa;var Yn=class e extends Ve.WithEventBus{static build(){return new e(window.history,Rl,()=>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,Ve.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Tt(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let f=new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),m=new It(f);this.dispatchEvent(m);let g=n(),h={...g===this.currentIndex?this.currentState:void 0,...i,index:g,href:m.detail.nextLocation.href};o.apply(a,[h,s,h.href]),this.setCurrentState(h,!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)}addBeforeLocationChangeListener(t){this.addEventListener(It.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(It.eventName,t)}addHistoryChangeListener(t){this.addEventListener(Tt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Tt.eventName,t)}currentItem(){return(0,Ve.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,Ve.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,Ve.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,Ve.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=Yn.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),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var _l=E(V());var Nl=_l.css`
|
|
348
|
+
`;var ps=["top","right","bottom","left"],us=["start","end"],Do=ps.reduce((e,t)=>e.concat(t,t+"-"+us[0],t+"-"+us[1]),[]),Lr=Math.min,et=Math.max,Ar=Math.round;var ke=e=>({x:e,y:e}),$0={left:"right",right:"left",bottom:"top",top:"bottom"};function ms(e,t,n){return et(e,Lr(t,n))}function an(e,t){return typeof e=="function"?e(t):e}function Or(e){return e.split("-")[0]}function tt(e){return e.split("-")[1]}function Uo(e){return e==="x"?"y":"x"}function Fo(e){return e==="y"?"height":"width"}function sn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Bo(e){return Uo(sn(e))}function hs(e,t,n){n===void 0&&(n=!1);let o=tt(e),a=Bo(e),i=Fo(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Po(s)),[s,Po(s)]}function gs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function Po(e){let t=Or(e);return $0[t]+e.slice(t.length)}function H0(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 ys(e){return typeof e!="number"?H0(e):{top:e,right:e,bottom:e,left:e}}function Ot(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 bs(e,t,n){let{reference:o,floating:a}=e,i=sn(t),s=Bo(t),l=Fo(s),f=Or(t),m=i==="y",g=o.x+o.width/2-a.width/2,h=o.y+o.height/2-a.height/2,b=o[l]/2-a[l]/2,x;switch(f){case"top":x={x:g,y:o.y-a.height};break;case"bottom":x={x:g,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:h};break;case"left":x={x:o.x-a.width,y:h};break;default:x={x:o.x,y:o.y}}let A=tt(t);return A&&(x[s]+=b*(A==="end"?1:-1)*(n&&m?-1:1)),x}async function xs(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:h="floating",altBoundary:b=!1,padding:x=0}=an(t,e),A=ys(x),O=l[b?h==="floating"?"reference":"floating":h],M=Ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(O)))==null||n?O:O.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:m,rootBoundary:g,strategy:f})),I=h==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},D=Ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:I,offsetParent:_,strategy:f}):I);return{top:(M.top-D.top+A.top)/k.y,bottom:(D.bottom-M.bottom+A.bottom)/k.y,left:(M.left-D.left+A.left)/k.x,right:(D.right-M.right+A.right)/k.x}}var G0=50,vs=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:xs},f=await(s.isRTL==null?void 0:s.isRTL(t)),m=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:g,y:h}=bs(m,o,f),b=o,x=0,A={};for(let w=0;w<i.length;w++){let O=i[w];if(!O)continue;let{name:M,fn:I}=O,{x:_,y:k,data:D,reset:G}=await I({x:g,y:h,initialPlacement:o,placement:b,strategy:a,middlewareData:A,rects:m,platform:l,elements:{reference:e,floating:t}});g=_??g,h=k??h,A[M]={...A[M],...D},G&&x<G0&&(x++,typeof G=="object"&&(G.placement&&(b=G.placement),G.rects&&(m=G.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):G.rects),{x:g,y:h}=bs(m,b,f)),w=-1)}return{x:g,y:h,placement:b,strategy:a,middlewareData:A}};function W0(e,t,n){return(e?[...n.filter(a=>tt(a)===e),...n.filter(a=>tt(a)!==e)]:n.filter(a=>Or(a)===a)).filter(a=>e?tt(a)===e||(t?gs(a)!==a:!1):!0)}var Ss=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:f,elements:m}=t,{crossAxis:g=!1,alignment:h,allowedPlacements:b=Do,autoAlignment:x=!0,...A}=an(e,t),w=h!==void 0||b===Do?W0(h||null,x,b):b,O=((n=s.autoPlacement)==null?void 0:n.index)||0,M=w[O];if(M==null)return{};if(l!==M)return{reset:{placement:w[0]}};let I=await f.detectOverflow(t,A),_=hs(M,i,await(f.isRTL==null?void 0:f.isRTL(m.floating))),k=[I[Or(M)],I[_[0]],I[_[1]]],D=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:M,overflows:k}],G=w[O+1];if(G)return{data:{index:O+1,overflows:D},reset:{placement:G}};let ie=D.map(ye=>{let hr=tt(ye.placement);return[ye.placement,hr&&g?ye.overflows.slice(0,2).reduce((R0,_0)=>R0+_0,0):ye.overflows[0],ye.overflows]}).sort((ye,hr)=>ye[1]-hr[1]),$t=((a=ie.filter(ye=>ye[2].slice(0,tt(ye[0])?2:3).every(hr=>hr<=0))[0])==null?void 0:a[0])||ie[0][0];return $t!==l?{data:{index:O+1,overflows:D},reset:{placement:$t}}:{}}}};var Cs=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:f={fn:I=>{let{x:_,y:k}=I;return{x:_,y:k}}},...m}=an(e,t),g={x:n,y:o},h=await i.detectOverflow(t,m),b=sn(a),x=Uo(b),A=g[x],w=g[b],O=(I,_)=>ms(_+h[I==="y"?"top":"left"],_,_-h[I==="y"?"bottom":"right"]);s&&(A=O(x,A)),l&&(w=O(b,w));let M=f.fn({...t,[x]:A,[b]:w});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[x]:s,[b]:l}}}}}};function ln(){return typeof window<"u"}function Rt(e){return Ls(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(Ls(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ls(e){return ln()?e instanceof Node||e instanceof fe(e).Node:!1}function we(e){return ln()?e instanceof Element||e instanceof fe(e).Element:!1}function Ge(e){return ln()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function Es(e){return!ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}function wr(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Re(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function As(e){return/^(table|td|th)$/.test(Rt(e))}function Rr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var V0=/transform|translate|scale|rotate|perspective|filter/,j0=/paint|layout|strict|content/,wt=e=>!!e&&e!=="none",$o;function Kt(e){let t=we(e)?Re(e):e;return wt(t.transform)||wt(t.translate)||wt(t.scale)||wt(t.rotate)||wt(t.perspective)||!dn()&&(wt(t.backdropFilter)||wt(t.filter))||V0.test(t.willChange||"")||j0.test(t.contain||"")}function Os(e){let t=rt(e);for(;Ge(t)&&!Zt(t);){if(Kt(t))return t;if(Rr(t))return null;t=rt(t)}return null}function dn(){return $o==null&&($o=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$o}function Zt(e){return/^(html|body|#document)$/.test(Rt(e))}function Re(e){return fe(e).getComputedStyle(e)}function _r(e){return we(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rt(e){if(Rt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Es(e)&&e.host||He(e);return Es(t)?t.host:t}function ws(e){let t=rt(e);return Zt(t)?(e.ownerDocument||e).body:Ge(t)&&wr(t)?t:ws(t)}function cn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=ws(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=fe(a);if(i){let l=fn(s);return t.concat(s,s.visualViewport||[],wr(a)?a:[],l&&n?cn(l):[])}else return t.concat(a,cn(a,[],n))}function fn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ns(e){let t=Re(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Ge(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=Ar(n)!==i||Ar(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Ms(e){return we(e)?e:e.contextElement}function qt(e){let t=Ms(e);if(!Ge(t))return ke(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=Ns(t),s=(i?Ar(n.width):n.width)/o,l=(i?Ar(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var K0=ke(0);function zs(e){let t=fe(e);return!dn()||!t.visualViewport?K0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Z0(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fe(e)}function Nr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=Ms(e),s=ke(1);t&&(o?we(o)&&(s=qt(o)):s=qt(e));let l=Z0(i,n,o)?zs(i):ke(0),f=(a.left+l.x)/s.x,m=(a.top+l.y)/s.y,g=a.width/s.x,h=a.height/s.y;if(i&&o){let b=fe(i),x=we(o)?fe(o):o,A=b,w=fn(A);for(;w&&x!==A;){let O=qt(w),M=w.getBoundingClientRect(),I=Re(w),_=M.left+(w.clientLeft+parseFloat(I.paddingLeft))*O.x,k=M.top+(w.clientTop+parseFloat(I.paddingTop))*O.y;f*=O.x,m*=O.y,g*=O.x,h*=O.y,f+=_,m+=k,A=fe(w),w=fn(A)}}return Ot({width:g,height:h,x:f,y:m})}function un(e,t){let n=_r(e).scrollLeft;return t?t.left+n:Nr(He(e)).left+n}function ks(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-un(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=He(o),l=t?Rr(t.floating):!1;if(o===s||l&&i)return n;let f={scrollLeft:0,scrollTop:0},m=ke(1),g=ke(0),h=Ge(o);if((h||!i)&&((Rt(o)!=="body"||wr(s))&&(f=_r(o)),h)){let x=Nr(o);m=qt(o),g.x=x.x+o.clientLeft,g.y=x.y+o.clientTop}let b=s&&!h&&!i?ks(s,f):ke(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+g.x+b.x,y:n.y*m.y-f.scrollTop*m.y+g.y+b.y}}function Y0(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function X0(e){let t=_r(e),n=e.ownerDocument.body,o=et(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=et(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+un(e),s=-t.scrollTop;return Re(n).direction==="rtl"&&(i+=et(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var Q0=25;function J0(e,t,n){n===void 0&&(n="viewport");let o=n==="layoutViewport",a=fe(e),i=He(e),s=a.visualViewport,l=i.clientWidth,f=i.clientHeight,m=0,g=0;if(s){let b=!dn()||t==="fixed";o?b||(m=-s.offsetLeft,g=-s.offsetTop):(l=s.width,f=s.height,b&&(m=s.offsetLeft,g=s.offsetTop))}if(un(i)<=0){let b=i.ownerDocument,x=b.body,A=getComputedStyle(x),w=b.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,O=Math.abs(i.clientWidth-x.clientWidth-w),M=getComputedStyle(i).scrollbarGutter==="stable both-edges"?O/2:O;M<=Q0&&(l-=M)}return{width:l,height:f,x:m,y:g}}function e4(e,t){let n=Nr(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=qt(e),s=e.clientWidth*i.x,l=e.clientHeight*i.y,f=a*i.x,m=o*i.y;return{width:s,height:l,x:f,y:m}}function Rs(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=J0(e,n,t);else if(t==="document")o=X0(He(e));else if(we(t))o=e4(t,n);else{let a=zs(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ot(o)}function t4(e,t){let n=t.get(e);if(n)return n;let o=cn(e,[],!1).filter(l=>we(l)&&Rt(l)!=="body"),a=null,i=Re(e).position==="fixed",s=i?rt(e):e;for(;we(s)&&!Zt(s);){let l=Re(s),f=Kt(s),m=a?a.position:i?"fixed":"";!f&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(h=>h!==s):a=l,s=rt(s)}return t.set(e,o),o}function r4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?Rr(t)?[]:t4(t,this._c):[].concat(n),o],l=Rs(t,s[0],a),f=l.top,m=l.right,g=l.bottom,h=l.left;for(let b=1;b<s.length;b++){let x=Rs(t,s[b],a);f=et(x.top,f),m=Lr(x.right,m),g=Lr(x.bottom,g),h=et(x.left,h)}return{width:m-h,height:g-f,x:h,y:f}}function n4(e){let{width:t,height:n}=Ns(e);return{width:t,height:n}}function o4(e,t,n){let o=Ge(t),a=He(t),i=n==="fixed",s=Nr(e,!0,i,t),l={scrollLeft:0,scrollTop:0},f=ke(0);if((o||!i)&&((Rt(t)!=="body"||wr(a))&&(l=_r(t)),o)){let b=Nr(t,!0,i,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!o&&a&&(f.x=un(a));let m=a&&!o&&!i?ks(a,l):ke(0),g=s.left+l.scrollLeft-f.x-m.x,h=s.top+l.scrollTop-f.y-m.y;return{x:g,y:h,width:s.width,height:s.height}}function Ho(e){return Re(e).position==="static"}function _s(e,t){if(!Ge(e)||Re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function Is(e,t){let n=fe(e);if(Rr(e))return n;if(!Ge(e)){let a=rt(e);for(;a&&!Zt(a);){if(we(a)&&!Ho(a))return a;a=rt(a)}return n}let o=_s(e,t);for(;o&&As(o)&&Ho(o);)o=_s(o,t);return o&&Zt(o)&&Ho(o)&&!Kt(o)?n:o||Os(e)||n}var a4=async function(e){let t=this.getOffsetParent||Is,n=this.getDimensions,o=await n(e.floating);return{reference:o4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function i4(e){return Re(e).direction==="rtl"}var pn={convertOffsetParentRelativeRectToViewportRelativeRect:q0,getDocumentElement:He,getClippingRect:r4,getOffsetParent:Is,getElementRects:a4,getClientRects:Y0,getDimensions:n4,getScale:qt,isElement:we,isRTL:i4};var Ts=Ss,Ps=Cs;var Ds=(e,t,n)=>{let o=new Map,a=n??{},i={...pn,...a.platform,_c:o};return vs(e,t,{...a,platform:i})};function Us(e){return s4(e)}function Go(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function s4(e){for(let t=e;t;t=Go(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Go(e);t;t=Go(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||Kt(n)||t.tagName==="BODY"))return t}return null}async function Fs(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},Ds(e,t,{strategy:o.strategy,platform:{...pn,getOffsetParent:a=>pn.getOffsetParent(a,Us)},middleware:[Ps({crossAxis:!0}),Ts({allowedPlacements:[o.placement]})]})}var or=E(P());var da=E(se());var Bs=E(se(),1);var Wo=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)},c4=e=>({fromAttribute:t=>{if(t==null)return Mr(e);try{return JSON.parse(t)}catch{return Mr(e)}},toAttribute:t=>JSON.stringify(t)});function $s(e,t){return(0,Bs.property)({type:Object,converter:c4(e),hasChanged:zr,...t??{}})}function l4(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(!Yt(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(!Yt(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(!Yt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Yt(e,t){try{return l4(e,t)}catch{return!1}}function zr(e,t){return!Yt(e,t)}function Mr(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function mn(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 Hs=E(se(),1);var Vo=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:zr,attribute:!1,...t};(0,Hs.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 hn=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 _t=E(se(),1);var gn=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 bn=E(V(),1);var yn=class extends bn.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(0,bn.adoptStyles)(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){Wo(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 Gs(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 Qt=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},Ks,Ws=Symbol("constructorPrototype"),Vs=Symbol("constructorName"),Zs=Symbol("exportpartsDebouncer"),js=Symbol("dynamicDependenciesLoaded"),Xt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Xt.eventName="exportparts-updated";var Ie=class extends yn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ks]=new gn(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[Zs].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[Vs]=this.constructor.name,this[Ws]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Vs]&&Object.setPrototypeOf(this,this[Ws])}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[js]||(n[js]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Xt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Xt.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 Xt)})}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=Gs(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 f=b=>b!=null&&b.trim().length>0,m=t.filter(f).map(b=>b.trim());if(m.length===0){this.exportparts=void 0;return}let g=new Set;for(let b of(i=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let x=(s=(o=b.getAttribute("part"))===null||o===void 0?void 0:o.split(" "))!==null&&s!==void 0?s:[],A=(l=(a=b.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(O=>O.split(":")[1]))!==null&&l!==void 0?l:[],w=[...x,...A].filter(f).map(O=>O.trim());for(let O of w)g.add(O)}if(g.size===0){this.exportparts=void 0;return}let h=[...g.values()].flatMap(b=>m.map(x=>`${b}:${x}--${b}`));this.exportparts=[...this.part,...h].join(", ")}};Ks=Zs;Qt([(0,_t.property)()],Ie.prototype,"exportpartsPrefix",void 0);Qt([$s([])],Ie.prototype,"exportpartsPrefixes",void 0);Qt([(0,_t.property)({reflect:!0})],Ie.prototype,"exportparts",void 0);Qt([(0,_t.property)()],Ie.prototype,"customStylesheet",void 0);Qt([(0,_t.property)()],Ie.prototype,"elementToFocus",void 0);Qt([(0,_t.state)()],Ie.prototype,"useAdoptedStyleSheets",void 0);function xn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var kr=Symbol("internalReduxEventsUnsubscribers"),nt=Symbol("internalStoresUnsubscribers"),Nt=Symbol("internalStores"),d4=mn(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[Nt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Nt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Nt].get(s)}addStore(s,l){var f;l=(f=l??s.name)!==null&&f!==void 0?f:"default-store",this.unsubscribeFromStore(l),this[Nt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Nt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Nt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let f=this.constructor.getPropertyOptions(l);if(!f?.attribute||!this.hasAttribute(typeof f?.attribute=="string"?f.attribute:l)){let m=this.getStore(s.store);m&&(s.store?this[nt].has(s.store):this[nt].size>0)&&(this[l]=s.selector(m.getState(),this))}})}subscribeToStore(s,l){var f,m;this[nt].set(s,l.subscribe(()=>this.updateFromStores())),this[kr].set(s,[]),xn(l)&&(!((f=l.deprecatedKeys)===null||f===void 0)&&f.length&&this.reduxConstructor.reduxProperties.forEach((g,h)=>{this.getStore(g.store)===l&&l.deprecatedKeys.includes(h)&&console.warn("Element",this,"is subscribed to deprecated key",h,"in store",l.name)}),l.eventBus&&((m=this.reduxConstructor.reduxEventListeners)===null||m===void 0||m.forEach((g,h)=>{if(typeof this[h]=="function"&&(!g.store||l.name===g.store)){let b=x=>this[h](x);l.addEventListener(g.eventName,b),this[kr].get(s).push(()=>l.removeEventListener(g.eventName,b))}}))),this.onStoreAvailable(s)}unsubscribeFromStores(){this[nt].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[nt].has(s)&&this[nt].get(s)(),this[nt].delete(s),(l=this[kr].get(s))===null||l===void 0||l.forEach(f=>f()),this[kr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=nt,n=Nt,o=kr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),qs=class extends d4(Ie){};function ne(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 f4=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ys=f4,jo=()=>Math.random().toString(36).substring(7).split("").join("."),u4={INIT:`@@redux/INIT${jo()}`,REPLACE:`@@redux/REPLACE${jo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jo()}`},vn=u4;function Sn(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Ko(e,t,n){if(typeof e!="function")throw new Error(ne(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ne(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ne(1));return n(Ko)(e,t)}let o=e,a=t,i=new Map,s=i,l=0,f=!1;function m(){s===i&&(s=new Map,i.forEach((O,M)=>{s.set(M,O)}))}function g(){if(f)throw new Error(ne(3));return a}function h(O){if(typeof O!="function")throw new Error(ne(4));if(f)throw new Error(ne(5));let M=!0;m();let I=l++;return s.set(I,O),function(){if(M){if(f)throw new Error(ne(6));M=!1,m(),s.delete(I),i=null}}}function b(O){if(!Sn(O))throw new Error(ne(7));if(typeof O.type>"u")throw new Error(ne(8));if(typeof O.type!="string")throw new Error(ne(17));if(f)throw new Error(ne(9));try{f=!0,a=o(a,O)}finally{f=!1}return(i=s).forEach(I=>{I()}),O}function x(O){if(typeof O!="function")throw new Error(ne(10));o=O,b({type:vn.REPLACE})}function A(){let O=h;return{subscribe(M){if(typeof M!="object"||M===null)throw new Error(ne(11));function I(){let k=M;k.next&&k.next(g())}return I(),{unsubscribe:O(I)}},[Ys](){return this}}}return b({type:vn.INIT}),{dispatch:b,subscribe:h,getState:g,replaceReducer:x,[Ys]:A}}function p4(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:vn.INIT})>"u")throw new Error(ne(12));if(typeof n(void 0,{type:vn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ne(13))})}function Zo(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}let o=Object.keys(n),a,i;try{p4(n)}catch(s){i=s}return function(l={},f){if(i)throw i;let m=!1,g={};for(let h=0;h<o.length;h++){let b=o[h],x=n[b],A=l[b],w=x(A,f);if(typeof w>"u"){let O=f&&f.type;throw new Error(ne(14))}g[b]=w,m=m||w!==A}return m=m||o.length!==Object.keys(l).length,m?g:l}}function Ir(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Xs(...e){return t=>(n,o)=>{let a=t(n,o),i=()=>{throw new Error(ne(15))},s={getState:a.getState,dispatch:(f,...m)=>i(f,...m)},l=e.map(f=>f(s));return i=Ir(...l)(a.dispatch),{...a,dispatch:i}}}function Qs(e){return Sn(e)&&"type"in e&&typeof e.type=="string"}var sc=Symbol.for("immer-nothing"),Js=Symbol.for("immer-draftable"),ae=Symbol.for("immer-state");function _e(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ue=Object,er=ue.getPrototypeOf,An="constructor",Mn="prototype",Qo="configurable",On="enumerable",En="writable",Tr="value",Te=e=>!!e&&!!e[ae];function pe(e){return e?cc(e)||kn(e)||!!e[Js]||!!e[An]?.[Js]||In(e)||Fr(e):!1}var m4=ue[Mn][An].toString(),ec=new WeakMap;function cc(e){if(!e||!ia(e))return!1;let t=er(e);if(t===null||t===ue[Mn])return!0;let n=ue.hasOwnProperty.call(t,An)&&t[An];if(n===Object)return!0;if(!Jt(n))return!1;let o=ec.get(n);return o===void 0&&(o=Function.toString.call(n),ec.set(n,o)),o===m4}function zn(e,t,n=!0){Ur(e)===0?(n?Reflect.ownKeys(e):ue.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((o,a)=>t(a,o,e))}function Ur(e){let t=e[ae];return t?t.type_:kn(e)?1:In(e)?2:Fr(e)?3:0}var qo=(e,t,n=Ur(e))=>n===2?e.has(t):ue[Mn].hasOwnProperty.call(e,t),Jo=(e,t,n=Ur(e))=>n===2?e.get(t):e[t],wn=(e,t,n,o=Ur(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function h4(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var kn=Array.isArray,In=e=>e instanceof Map,Fr=e=>e instanceof Set,ia=e=>typeof e=="object",Jt=e=>typeof e=="function",Yo=e=>typeof e=="boolean";function g4(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var We=e=>e.copy_||e.base_;var sa=e=>e.modified_?e.copy_:e.base_;function ea(e,t){if(In(e))return new Map(e);if(Fr(e))return new Set(e);if(kn(e))return Array[Mn].slice.call(e);let n=cc(e);if(t===!0||t==="class_only"&&!n){let o=ue.getOwnPropertyDescriptors(e);delete o[ae];let a=Reflect.ownKeys(o);for(let i=0;i<a.length;i++){let s=a[i],l=o[s];l[En]===!1&&(l[En]=!0,l[Qo]=!0),(l.get||l.set)&&(o[s]={[Qo]:!0,[En]:!0,[On]:l[On],[Tr]:e[s]})}return ue.create(er(e),o)}else{let o=er(e);if(o!==null&&n)return{...e};let a=ue.create(o);return ue.assign(a,e)}}function Tn(e,t=!1){return Pn(e)||Te(e)||!pe(e)||(Ur(e)>1&&ue.defineProperties(e,{set:Cn,add:Cn,clear:Cn,delete:Cn}),ue.freeze(e),t&&zn(e,(n,o)=>{Tn(o,!0)},!1)),e}function y4(){_e(2)}var Cn={[Tr]:y4};function Pn(e){return e===null||!ia(e)?!0:ue.isFrozen(e)}var Rn="MapSet",ta="Patches",tc="ArrayMethods",lc={};function Mt(e){let t=lc[e];return t||_e(0,e),t}var rc=e=>!!lc[e];var Pr,dc=()=>Pr,b4=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:rc(Rn)?Mt(Rn):void 0,arrayMethodsPlugin_:rc(tc)?Mt(tc):void 0});function nc(e,t){t&&(e.patchPlugin_=Mt(ta),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ra(e){na(e),e.drafts_.forEach(x4),e.drafts_=null}function na(e){e===Pr&&(Pr=e.parent_)}var oc=e=>Pr=b4(Pr,e);function x4(e){let t=e[ae];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ac(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[ae].modified_&&(ra(t),_e(4)),pe(e)&&(e=ic(t,e));let{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[ae].base_,e,t)}else e=ic(t,n);return v4(t,e,!0),ra(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sc?e:void 0}function ic(e,t){if(Pn(t))return t;let n=t[ae];if(!n)return _n(t,e.handledSet_,e);if(!Dn(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);pc(n,e)}return n.copy_}function v4(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tn(t,n)}function fc(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Dn=(e,t)=>e.scope_===t,S4=[];function uc(e,t,n,o){let a=We(e),i=e.type_;if(o!==void 0&&Jo(a,o,i)===t){wn(a,o,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;zn(a,(f,m)=>{if(Te(m)){let g=l.get(m)||[];g.push(f),l.set(m,g)}})}let s=e.draftLocations_.get(t)??S4;for(let l of s)wn(a,l,n,i)}function C4(e,t,n){e.callbacks_.push(function(a){let i=t;if(!i||!Dn(i,a))return;a.mapSetPlugin_?.fixSetContents(i);let s=sa(i);uc(e,i.draft_??i,s,n),pc(i,a)})}function pc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:o}=t;if(o){let a=o.getPath(e);a&&o.generatePatches_(e,a,t)}fc(e)}}function E4(e,t,n){let{scope_:o}=e;if(Te(n)){let a=n[ae];Dn(a,o)&&a.callbacks_.push(function(){Ln(e);let s=sa(a);uc(e,n,s,t)})}else pe(n)&&e.callbacks_.push(function(){let i=We(e);e.type_===3?i.has(n)&&_n(n,o.handledSet_,o):Jo(i,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&_n(Jo(e.copy_,t,e.type_),o.handledSet_,o)})}function _n(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Te(e)||t.has(e)||!pe(e)||Pn(e)||(t.add(e),zn(e,(o,a)=>{if(Te(a)){let i=a[ae];if(Dn(i,n)){let s=sa(i);wn(e,o,s,e.type_),fc(i)}}else pe(a)&&_n(a,t,n)})),e}function L4(e,t){let n=kn(e),o={type_:n?1:0,scope_:t?t.scope_:dc(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=o,i=Nn;n&&(a=[o],i=Dr);let{revoke:s,proxy:l}=Proxy.revocable(a,i);return o.draft_=l,o.revoke_=s,[l,o]}var Nn={get(e,t){if(t===ae)return e;let n=e.scope_.arrayMethodsPlugin_,o=e.type_===1&&typeof t=="string";if(o&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=We(e);if(!qo(a,t,e.type_))return O4(e,a,t);let i=a[t];if(e.finalized_||!pe(i)||o&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&g4(t))return i;if(i===Xo(e.base_,t)||A4(e,t,i)){Ln(e);let s=e.type_===1?+t:t,l=aa(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in We(e)},ownKeys(e){return Reflect.ownKeys(We(e))},set(e,t,n){let o=mc(We(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){let a=Xo(We(e),t),i=a?.[ae];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(h4(n,a)&&(n!==void 0||qo(e.base_,t,e.type_)))return!0;Ln(e),oa(e)}return e.copy_[t]===n&&(n!==void 0||qo(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),E4(e,t,n)),!0},deleteProperty(e,t){return Ln(e),Xo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oa(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=We(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[En]:!0,[Qo]:e.type_!==1||t!=="length",[On]:o[On],[Tr]:n[t]}},defineProperty(){_e(11)},getPrototypeOf(e){return er(e.base_)},setPrototypeOf(){_e(12)}},Dr={};for(let e in Nn){let t=Nn[e];Dr[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Dr.deleteProperty=function(e,t){return Dr.set.call(this,e,t,void 0)};Dr.set=function(e,t,n){return Nn.set.call(this,e[0],t,n,e[0])};function Xo(e,t){let n=e[ae];return(n?We(n):e)[t]}function A4(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!pe(n)||n[ae]?!1:e.baseRefs_.has(n)}function O4(e,t,n){let o=mc(t,n);return o?Tr in o?o[Tr]:o.get?.call(e.draft_):void 0}function mc(e,t){if(!(t in e))return;let n=er(e);for(;n;){let o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=er(n)}}function oa(e){e.modified_||(e.modified_=!0,e.parent_&&oa(e.parent_))}function Ln(e){e.copy_||(e.assigned_=new Map,e.copy_=ea(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var w4=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(Jt(t)&&!Jt(n)){let i=n;n=t;let s=this;return function(f=i,...m){return s.produce(f,g=>n.call(this,g,...m))}}Jt(n)||_e(6),o!==void 0&&!Jt(o)&&_e(7);let a;if(pe(t)){let i=oc(this),s=aa(i,t,void 0),l=!0;try{a=n(s),l=!1}finally{l?ra(i):na(i)}return nc(i,o),ac(a,i)}else if(!t||!ia(t)){if(a=n(t),a===void 0&&(a=t),a===sc&&(a=void 0),this.autoFreeze_&&Tn(a,!0),o){let i=[],s=[];Mt(ta).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),o(i,s)}return a}else _e(1,t)},this.produceWithPatches=(t,n)=>{if(Jt(t))return(s,...l)=>this.produceWithPatches(s,f=>t(f,...l));let o,a;return[this.produce(t,n,(s,l)=>{o=s,a=l}),o,a]},Yo(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Yo(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Yo(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){pe(e)||_e(8),Te(e)&&(e=hc(e));let t=oc(this),n=aa(t,e,void 0);return n[ae].isManual_=!0,na(t),n}finishDraft(e,t){let n=e&&e[ae];(!n||!n.isManual_)&&_e(9);let{scope_:o}=n;return nc(o,t),ac(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));let o=Mt(ta).applyPatches_;return Te(e)?o(e,t):this.produce(e,a=>o(a,t))}};function aa(e,t,n,o){let[a,i]=In(t)?Mt(Rn).proxyMap_(t,n):Fr(t)?Mt(Rn).proxySet_(t,n):L4(t,n);return(n?.scope_??dc()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?C4(n,i,o):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),a}function hc(e){return Te(e)||_e(10,e),gc(e)}function gc(e){if(!pe(e)||Pn(e))return e;let t=e[ae],n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ea(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=ea(e,!0);let a=n;return Fr(n)&&(n=new Set),zn(a,(i,s)=>{wn(n,i,gc(s))},o),t&&(t.finalized_=!1),n}var R4=globalThis.Iterator,Ip=typeof R4?.from=="function";var _4=new w4,ca=_4.produce;function yc(e){return({dispatch:n,getState:o})=>a=>i=>typeof i=="function"?i(n,o,e):a(i)}var bc=yc(),xc=yc;var N4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ir:Ir.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function $r(e,t){function n(...o){if(t){let a=t(...o);if(!a)throw new Error(Pe(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:o[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=o=>o!=null&&o.type===e&&Qs(o),n}var Cc=class Br extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Br.prototype)}static get[Symbol.species](){return Br}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Br(...t[0].concat(this)):new Br(...t.concat(this))}};function vc(e){return pe(e)?ca(e,()=>{}):e}function Un(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function M4(e){return typeof e=="boolean"}var z4=()=>function(t){let{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{},s=new Cc;return n&&(M4(n)?s.push(bc):s.push(xc(n.extraArgument))),s},k4="RTK_autoBatch";var Sc=e=>t=>{setTimeout(t,e)},I4=(e,t,n)=>o=>{let a=!1,i,s,l=()=>{a||(a=!0,t?.(i),clearTimeout(s),o())};i=e(l),s=setTimeout(l,n)},T4=(e={type:"raf"})=>t=>(...n)=>{let o=t(...n),a=!0,i=!1,s=!1,l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?I4(window.requestAnimationFrame,window.cancelAnimationFrame,100):Sc(10):e.type==="callback"?e.queueNotification:Sc(e.timeout),m=()=>{s=!1,i&&(i=!1,l.forEach(g=>g()))};return Object.assign({},o,{subscribe(g){let h=()=>a&&g(),b=o.subscribe(h);return l.add(g),()=>{b(),l.delete(g)}},dispatch(g){try{return a=!g?.meta?.[k4],i=!a,i&&(s||(s=!0,f(m))),o.dispatch(g)}finally{a=!0}}})},P4=e=>function(n){let{autoBatch:o=!0}=n??{},a=new Cc(e);return o&&a.push(T4(typeof o=="object"?o:void 0)),a};function Ec(e){let t=z4(),{reducer:n=void 0,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{},f;if(typeof n=="function")f=n;else if(Sn(n))f=Zo(n);else throw new Error(Pe(1));let m;typeof o=="function"?m=o(t):m=t();let g=Ir;a&&(g=N4({trace:!1,...typeof a=="object"&&a}));let h=Xs(...m),b=P4(h),x=typeof l=="function"?l(b):b(),A=g(...x);return Ko(f,s,A)}function Lc(e){let t={},n=[],o,a={addCase(i,s){let l=typeof i=="string"?i:i.type;if(!l)throw new Error(Pe(28));if(l in t)throw new Error(Pe(29));return t[l]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return o=i,a}};return e(a),[t,n,o]}function D4(e){return typeof e=="function"}function U4(e,t){let[n,o,a]=Lc(t),i;if(D4(e))i=()=>vc(e());else{let f=vc(e);i=()=>f}function s(f,m,g){if(Te(f)){let h=m(f,g);return h===void 0?f:h}else{if(pe(f))return ca(f,h=>m(h,g));{let h=m(f,g);if(h===void 0){if(f===null)return f;throw new Error(Pe(9))}return h}}}function l(f=i(),m){let g=n[m.type],h;for(let{matcher:b,reducer:x}of o)b(m)&&x&&(h??=[]).push(x);if(!g&&!h)return a?s(f,a,m):f;if(g&&(f=s(f,g,m)),h)for(let b of h)f=s(f,b,m);return f}return l.getInitialState=i,l}var F4=Symbol.for("rtk-slice-createasyncthunk");function B4(e,t){return`${e}/${t}`}function $4({creators:e}={}){let t=e?.asyncThunk?.[F4];return function(o){let{name:a,reducerPath:i=a}=o;if(!a)throw new Error(Pe(11));typeof process<"u";let s=(typeof o.reducers=="function"?o.reducers(G4()):o.reducers)||{},l=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(_,k){let D=typeof _=="string"?_:_.type;if(!D)throw new Error(Pe(12));if(D in f.sliceCaseReducersByType)throw new Error(Pe(13));return f.sliceCaseReducersByType[D]=k,m},addMatcher(_,k){return f.sliceMatchers.push({matcher:_,reducer:k}),m},exposeAction(_,k){return f.actionCreators[_]=k,m},exposeCaseReducer(_,k){return f.sliceCaseReducersByName[_]=k,m}};l.forEach(_=>{let k=s[_],D={reducerName:_,type:B4(a,_),createNotation:typeof o.reducers=="function"};V4(k)?K4(D,k,m,t):W4(D,k,m)});function g(){let[_={},k=[],D=void 0]=typeof o.extraReducers=="function"?Lc(o.extraReducers):[o.extraReducers],G={..._,...f.sliceCaseReducersByType};return U4(o.initialState,ie=>{for(let q in G)ie.addCase(q,G[q]);for(let q of f.sliceMatchers)ie.addMatcher(q.matcher,q.reducer);for(let q of k)ie.addMatcher(q.matcher,q.reducer);D&&ie.addDefaultCase(D)})}let h=_=>_,b=new Map,x=new WeakMap,A;function w(_,k){return A||(A=g()),A(_,k)}function O(){return A||(A=g()),A.getInitialState()}function M(_,k=!1){function D(ie){let q=ie[_];return typeof q>"u"&&k&&(q=Un(x,D,O)),q}function G(ie=h){return Un(Un(b,k,()=>new WeakMap),ie,()=>{let q={};for(let[$t,ye]of Object.entries(o.selectors??{}))q[$t]=H4(ye,ie,()=>Un(x,ie,O),k);return q})}return{reducerPath:_,getSelectors:G,get selectors(){return G(D)},selectSlice:D}}let I={name:a,reducer:w,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:O,...M(i),injectInto(_,{reducerPath:k,...D}={}){let G=k??i;return _.inject({reducerPath:G,reducer:w},D),{...I,...M(G,!0)}}};return I}}function H4(e,t,n,o){function a(i,...s){let l=t(i);return typeof l>"u"&&o&&(l=n()),e(l,...s)}return a.unwrapped=e,a}var Ac=$4();function G4(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function W4({type:e,reducerName:t,createNotation:n},o,a){let i,s;if("reducer"in o){if(n&&!j4(o))throw new Error(Pe(17));i=o.reducer,s=o.prepare}else i=o;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?$r(e,s):$r(e))}function V4(e){return e._reducerDefinitionType==="asyncThunk"}function j4(e){return e._reducerDefinitionType==="reducerWithPrepare"}function K4({type:e,reducerName:t},n,o,a){if(!a)throw new Error(Pe(18));let{payloadCreator:i,fulfilled:s,pending:l,rejected:f,settled:m,options:g}=n,h=a(e,i,g);o.exposeAction(t,h),s&&o.addCase(h.fulfilled,s),l&&o.addCase(h.pending,l),f&&o.addCase(h.rejected,f),m&&o.addMatcher(h.settled,m),o.exposeCaseReducer(t,{fulfilled:s||Fn,pending:l||Fn,rejected:f||Fn,settled:m||Fn})}function Fn(){}var Oc="listener",wc="completed",Rc="cancelled",Hp=`task-${Rc}`,Gp=`task-${wc}`,Wp=`${Oc}-${Rc}`,Vp=`${Oc}-${wc}`;var{assign:_c}=Object;var la="listenerMiddleware";var Z4=_c($r(`${la}/add`),{withTypes:()=>Z4}),jp=$r(`${la}/removeAll`),q4=_c($r(`${la}/remove`),{withTypes:()=>q4});function Pe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Y4=mn(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)}}}),Bn=class extends Y4(Object){};window.ftReduxStores||(window.ftReduxStores={});var Nc=class e extends Bn{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(xn(i))return i;if(a==null)return;let s=Ac({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=Ec({reducer:(f,m)=>{if(m.type==="CLEAR_FT_REDUX_STORE"){let g=Mr(s.getInitialState());for(let h of m.keeping)g[h]=(f??g)[h];return g}else if(typeof m.type=="string"&&m.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...f,...m.overwrites};return s.reducer(f,m)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus,a.deprecatedKeys)}constructor(t,n,o,a){super(),this.reduxSlice=t,this.reduxStore=n,this.deprecatedKeys=a,this.isFtReduxStore=!0,this.commands=new hn,this.injectInto=(s,l)=>this.reduxSlice.injectInto(s,l),this.selectSlice=s=>this.reduxSlice.selectSlice(s);let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,f)=>{let m=l,g=s[m];return g?(...h)=>{let b=g(...h.map(i));return this.reduxStore.dispatch(b),b}:h=>{let b=m,x=this.getState()[b];Yt(x,h)||this.setState({[b]:i(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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var $n=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),f=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?f:a?`${l} ${f}`: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 Hn=E(P()),X4="ft-app-info",zt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};zt.eventName="authentication-change";var Hr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Hr.eventName="ui-locale-changed";var Q4={session:(e,t)=>{(0,Hn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>T.dispatchEvent(new zt(t.payload)),0))}},T=Hn.FtReduxStore.get({name:X4,reducers:Q4,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Mc=E(P()),Gn=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},v8=(0,Mc.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(T)}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=>$n.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Gn([(0,da.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Gn([(0,da.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Gn([Vo({store:T.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),Gn([Vo({store:T.name})],t.prototype,"uiLocale",void 0),t});var zc;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(zc||(zc={}));var kc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(kc||(kc={}));var Ic;(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"})(Ic||(Ic={}));var Tc;(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"})(Tc||(Tc={}));var Pc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Pc||(Pc={}));var Dc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Dc||(Dc={}));var Uc;(function(e){e.PUBLISHED="PUBLISHED",e.AI="AI"})(Uc||(Uc={}));var Fc;(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"})(Fc||(Fc={}));var Bc;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Bc||(Bc={}));var $c;(function(e){e.METADATA_FILTER="METADATA_FILTER",e.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})($c||($c={}));var Hc;(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",e.DOC_DIFF="DOC_DIFF"})(Hc||(Hc={}));var Gc;(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"})(Gc||(Gc={}));var Wc;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Wc||(Wc={}));var Vc;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Vc||(Vc={}));var jc;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(jc||(jc={}));var Kc;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Kc||(Kc={}));var Zc;(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"})(Zc||(Zc={}));var qc;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(qc||(qc={}));var Yc;(function(e){e.ASC="ASC",e.DESC="DESC"})(Yc||(Yc={}));var Xc;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Xc||(Xc={}));var Qc;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Qc||(Qc={}));var Jc;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Jc||(Jc={}));var el;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(el||(el={}));var tl;(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"})(tl||(tl={}));var rl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(rl||(rl={}));var nl;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(nl||(nl={}));var ol;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ol||(ol={}));var al;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(al||(al={}));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 xe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(xe||(xe={}));var il;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(il||(il={}));var sl;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(sl||(sl={}));var cl;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(cl||(cl={}));var ll;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(ll||(ll={}));var dl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(dl||(dl={}));var fl;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(fl||(fl={}));var ul;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(ul||(ul={}));var pl;(function(e){e.CHAT="CHAT",e.COMPLETION="COMPLETION",e.RAG="RAG",e.AGENT="AGENT"})(pl||(pl={}));var ml;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(ml||(ml={}));var hl;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(hl||(hl={}));var gl;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(gl||(gl={}));var yl;(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"})(yl||(yl={}));var bl;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(bl||(bl={}));var J4={[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 xl(e,t){return e===t||(J4[e]??[]).some(n=>xl(n,t))}function fa(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=>xl(o,t))}function vl(e,...t){return e==null?!1:t.some(n=>fa(e,n))}var Zn=E(P());var ua=E(P());var kt=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=T.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=T.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var tr=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:kt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):kt.await()}};var me=class extends tr{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],[f])=>l.localeCompare(f)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new ua.CacheRegistry,this.cache=t?a.commonCache:new ua.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 Wn=class extends me{async listMySearches(){let{session:t}=T.getState();return fa(t,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Vn=class extends me{async listMyBookmarks(){let t=T.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var jn=class extends me{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(`/api/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(`/api/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var Kn=class extends me{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var ed="ft-user-assets",td={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(xe).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;ma(e,n,[...pa(e,n),a]),Sl(e,n,1,o),Cl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ma(e,n,pa(e,n).map(a=>a.id===o.id?o:a)),Cl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ma(e,n,pa(e,n).filter(i=>i.id!==a)),Sl(e,n,-1,o)}},El={[xe.SEARCHES]:"savedSearches",[xe.BOOKMARKS]:"bookmarks",[xe.BOOKS]:void 0,[xe.COLLECTIONS]:void 0},pa=(e,t)=>{var n;let o=El[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ma=(e,t,n)=>{let o=El[t];o&&(e[o]=n)},Sl=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===xe.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},Cl=(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)},ce=Zn.FtReduxStore.get({name:ed,reducers:td,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(xe).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ha=class{constructor(t=new jn,n=new Kn){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Vn,this.savedSearchesService=new Wn,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=T.getState();(0,Zn.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(),ce.actions.clearAssetCount(),ce.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ce.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ce.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ce.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ce.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&ce.getState().assetCounts.allAsset[t]!==n.count&&ce.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&ce.getState().assetCounts.bookmarkByMap[t]!==n.count&&ce.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(ce.getState().assetCounts.bookmarkByMap).length!==0;t===xe.BOOKMARKS&&n&&ce.actions.clearBookmarkCountByMap(),ce.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ce.actions.bookmarks(n)}}},rd=new ha;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=rd);var ga=class{addCommand(t,n=!1){T.commands.add(t,n)}consumeCommand(t){return T.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new ga;var ve=E(P());var Ll,rr=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},nd=Symbol("clearAfterUnitTest"),qn=class extends(0,ve.withEventBus)(me){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ll]=()=>{this.defaultMessages={},this.cache=new ve.CacheRegistry,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=T.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,ve.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 ve.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 ve.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 rr({loadedContexts:t})),this.dispatchEvent(new rr({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new rr({loadedContexts:[t]})),this.dispatchEvent(new rr({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,ve.delay)(0).then(()=>o()).catch(()=>null)))}};Ll=nd;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends qn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends qn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Gr=window.FluidTopicsI18nService,ya=window.FluidTopicsCustomI18nService;var Al=E(P()),ba=class{highlightHtml(t,n,o){(0,Al.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ba;var Ol=E(P());var xa=class{isDate(t){var n,o,a,i;return(i=(o=((a=(n=T.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]).find(l=>l.key===t))===null||o===void 0?void 0:o.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return Ol.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:T.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 xa;var wl=E(P());var Wr=class{static get(t,n,{baseUrl:o,localesConfiguration:a,availableContentLocales:i}=T.getState()){var s;if(n==="all"&&a?.allLanguagesAllowed)n=void 0;else if(!n||i.length>0&&!i.some(l=>l.lang===n)){let l=a?.defaultLocales.defaultContentLocale;n=l?`${l.lang}-${l.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new wl.SearchPlaceConverter(o,t??20,a?.allLanguagesAllowed,n,i)}};var va=class{urlToSearchRequest(t){return Wr.get().parse(t)}searchRequestToUrl(t){return Wr.get().serialize(t)}};window.FluidTopicsUrlService=new va;var Ve=E(P());var It=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};It.eventName="before-location-change";var Tt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Tt.eventName="change";var Sa=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))}},Rl=new Sa;var Yn=class e extends Ve.WithEventBus{static build(){return new e(window.history,Rl,()=>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,Ve.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Tt(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let f=new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),m=new It(f);this.dispatchEvent(m);let g=n(),h={...g===this.currentIndex?this.currentState:void 0,...i,index:g,href:m.detail.nextLocation.href};o.apply(a,[h,s,h.href]),this.setCurrentState(h,!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)}addBeforeLocationChangeListener(t){this.addEventListener(It.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(It.eventName,t)}addHistoryChangeListener(t){this.addEventListener(Tt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Tt.eventName,t)}currentItem(){return(0,Ve.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,Ve.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,Ve.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,Ve.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=Yn.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),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var _l=E(V());var Nl=_l.css`
|
|
349
349
|
`;var kl=E(V()),le=E(se()),Dt=E(P());var De=E(P());function Ml(e,t){let{authenticationRequired:n,session:o}=T.getState();return n&&!o?.sessionAuthenticated?Promise.resolve(t):e()}var Xn=class extends tr{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var Ca=class e extends De.FtStateManager{static build(t){return new e(T,t)}constructor(t,n){super(),this.store=t,this.cache=new De.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Xn,this.knownContexts=new De.AbstractRegistry,this.knownCustomComponents=new De.AbstractRegistry,this.cleanSessionDebouncer=new De.Debouncer,this.reloadConfiguration=()=>{var o;(o=this.cache)===null||o===void 0||o.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new De.Debouncer(500),this.apiProvider=n??(()=>kt.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}addListeners(){this.store.addEventListener(zt.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(zt.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",()=>Ml(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=n.contentLocales)!==null&&t!==void 0?t:[])}setStickyFilters(t){this.store.actions.stickyFilters(t)}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setTenantId(t){this.store.actions.tenantId(t)}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t,n){this.userLocaleService.updateUiLocale({uiLocale:t,contentLocale:n}).then(o=>{o.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Hr(o)))}).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)}setNoCustomCode(t){this.store.actions.noCustomCode(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)}userHasAnyRole(...t){return vl(T.getState().session,...t)}},zl=Ca.build();var Pt=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 Vr=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 Pt(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 te=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},H=class extends Dt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=zl,this.contextRoot=new Vr}render(){return kl.html`
|
|
350
350
|
<slot></slot>
|
|
351
351
|
`}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(t){var n;super.update(t),t.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),t.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),t.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),t.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),t.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),t.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(o=>Gr.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())}};H.elementDefinitions={};H.styles=Nl;te([(0,le.property)()],H.prototype,"baseUrl",void 0);te([(0,le.property)()],H.prototype,"tenantId",void 0);te([(0,le.property)()],H.prototype,"apiIntegrationIdentifier",void 0);te([(0,le.property)()],H.prototype,"apiIntegrationAppVersion",void 0);te([(0,le.property)()],H.prototype,"uiLocale",void 0);te([(0,Dt.jsonProperty)(null)],H.prototype,"availableUiLocales",void 0);te([(0,Dt.jsonProperty)(null)],H.prototype,"metadataConfiguration",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"editorMode",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"noCustom",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"openExternalDocumentInNewTab",void 0);te([(0,le.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],H.prototype,"noCustomComponent",void 0);te([(0,le.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],H.prototype,"noCustomCode",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"withManualResources",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"navigatorOnline",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"forcedOffline",void 0);te([(0,le.property)({type:Boolean})],H.prototype,"authenticationRequired",void 0);te([(0,Dt.jsonProperty)([])],H.prototype,"messageContexts",void 0);te([(0,Dt.jsonProperty)(void 0)],H.prototype,"session",void 0);var Tl=E(P());var Il={"ft-app-context":H};(0,Tl.customElements)(Il);var Pl=E(se());var Ea=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-]+$/)}},nr=new Ea;var id=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},Kr=Symbol("i18nAttributes"),Dl=Symbol("i18nListAttributes"),Ul=Symbol("i18nProperties"),Qn=Symbol("i18nContexts"),jr=Symbol("i18nUnsubs"),Fl=(0,or.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?ya:Gr}i18n(i){let{context:s,key:l,message:f}=i,{custom:m,args:g,argsProvider:h}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,m);let b=g??(h?h(this):[]);return this.getI18nService(m).resolveMessage(s,l,...b)}return f}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(nr.isI18nKey(i)){let[l,f]=i.split(".");return this.i18n({custom:!0,context:l,key:f,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,f)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,f)=>{var m;return((m=f?.context)===null||m===void 0?void 0:m.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let f=this,m=(g,h,b)=>b?.context&&b.key&&i(g,h,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...g})}:b;(s=this[Kr])===null||s===void 0||s.forEach((g,h)=>f[h]=m(g,h,f[h])),(l=this[Dl])===null||l===void 0||l.forEach((g,h)=>{var b;return f[h]=(b=f[h])===null||b===void 0?void 0:b.map(x=>m(g,h,x))})}updateI18nProperties(i){var s;(s=this[Ul])===null||s===void 0||s.forEach((l,f)=>{i(l,f)&&(this[f]=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 f=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[Qn].set(f,{isCustomContext:l}),this[jr].has(f)||this[jr].set(f,this.getI18nService(l).subscribe(f,()=>this.onI18nUpdate(f))),this.getI18nService(l).prepareContext(f,s)}hasI18nContext(i){return this[Qn].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Qn].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[jr].forEach(i=>i()),this[jr].clear()}}return t=Qn,n=jr,id([(0,Pl.property)({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}),Jn=class extends Fl(or.FtLitElement){},eo=class extends Fl(or.FtLitElementRedux){};var Bl=E(P());var La=class{fromAttribute(t){if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.map(o=>typeof o=="string"?nr.fromAttribute(o):o):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},sd=new La;var $l=(e,t)=>(n,o)=>{var a;n.constructor.createProperty(o,{type:Object,hasChanged:Bl.hasChanged,converter:nr,...t}),n[Kr]=(a=n[Kr])!==null&&a!==void 0?a:new Map,n[Kr].set(o,e??{})};var Hl=E(V());var Gl=Hl.css`
|
package/build/ftds-table.min.js
CHANGED
|
@@ -426,7 +426,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
426
426
|
position: relative;
|
|
427
427
|
word-break: break-word;
|
|
428
428
|
}
|
|
429
|
-
`;var fp="ft-app-info",ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ir.eventName="authentication-change";var Rn=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Rn.eventName="ui-locale-changed";var pp={session:(t,e)=>{ge(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>$.dispatchEvent(new ir(e.payload)),0))}},$=Wt.get({name:fp,reducers:pp,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var ko=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},pS=fe(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($)}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=>jt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ko([L({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ko([L({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ko([_r({store:$.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),ko([_r({store:$.name})],e.prototype,"uiLocale",void 0),e});var sr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=$.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=$.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Fr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:sr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):sr.await()}};var Ae=class extends Fr{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 je,this.cache=e?a.commonCache:new je}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 zo=class extends Ae{async listMySearches(){let{session:e}=$.getState();return Va(e,ne.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Po=class extends Ae{async listMyBookmarks(){let e=$.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Do=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var Fo=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/api/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var hp="ft-user-assets",mp={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(Me).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;$s(t,r,[...Us(t,r),a]),K2(t,r,1,n),Z2(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;$s(t,r,Us(t,r).map(a=>a.id===n.id?n:a)),Z2(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;$s(t,r,Us(t,r).filter(i=>i.id!==a)),K2(t,r,-1,n)}},q2={[Me.SEARCHES]:"savedSearches",[Me.BOOKMARKS]:"bookmarks",[Me.BOOKS]:void 0,[Me.COLLECTIONS]:void 0},Us=(t,e)=>{var r;let n=q2[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},$s=(t,e,r)=>{let n=q2[e];n&&(t[n]=r)},K2=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===Me.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Z2=(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)},ye=Wt.get({name:hp,reducers:mp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Me).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Bs=class{constructor(e=new Do,r=new Fo){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=$.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Po,this.savedSearchesService=new zo,$.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=$.getState();ge((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(),ye.actions.clearAssetCount(),ye.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ye.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ye.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ye.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ye.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ye.getState().assetCounts.allAsset[e]!==r.count&&ye.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ye.getState().assetCounts.bookmarkByMap[e]!==r.count&&ye.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ye.getState().assetCounts.bookmarkByMap).length!==0;e===Me.BOOKMARKS&&r&&ye.actions.clearBookmarkCountByMap(),ye.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;ye.actions.bookmarks(r)}}},gp=new Bs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gp);var Hs=class{addCommand(e,r=!1){$.commands.add(e,r)}consumeCommand(e){return $.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Hs;var Y2,Ur=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},yp=Symbol("clearAfterUnitTest"),Uo=class extends eo(Ae){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Y2]=()=>{this.defaultMessages={},this.cache=new je,this.listeners={}},this.currentUiLocale=$.getState().uiLocale,$.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=$.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};ge(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 pn((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof Tt)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ur({loadedContexts:e})),this.dispatchEvent(new Ur({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ur({loadedContexts:[e]})),this.dispatchEvent(new Ur({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Jn(0).then(()=>n()).catch(()=>null)))}};Y2=yp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Uo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Uo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var _n=window.FluidTopicsI18nService,Gs=window.FluidTopicsCustomI18nService;var Vs=class{highlightHtml(e,r,n){$i(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Vs;var Ws=class{isDate(e){var r,n,a,i;return(i=(n=((a=(r=$.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&a!==void 0?a:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return jt.format(e,(n=r?.locale)!==null&&n!==void 0?n:$.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 Ws;var Nn=class{static get(e,r,{baseUrl:n,localesConfiguration:a,availableContentLocales:i}=$.getState()){var s;if(r==="all"&&a?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(c=>c.lang===r)){let c=a?.defaultLocales.defaultContentLocale;r=c?`${c.lang}-${c.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new rt(n,e??20,a?.allLanguagesAllowed,r,i)}};var js=class{urlToSearchRequest(e){return Nn.get().parse(e)}searchRequestToUrl(e){return Nn.get().serialize(e)}};window.FluidTopicsUrlService=new js;var cr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};cr.eventName="before-location-change";var lr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};lr.eventName="change";var Ks=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))}},X2=new Ks;var $o=class t extends tt{static build(){return new t(window.history,X2,()=>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),ge(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new lr(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,c])=>{let d=new URL(typeof c=="string"?c:(c??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),f=new cr(d);this.dispatchEvent(f);let g=r(),m={...g===this.currentIndex?this.currentState:void 0,...i,index:g,href:f.detail.nextLocation.href};n.apply(a,[m,s,m.href]),this.setCurrentState(m,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(cr.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(cr.eventName,e)}addHistoryChangeListener(e){this.addEventListener(lr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(lr.eventName,e)}currentItem(){return Pe(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 Pe(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Pe(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 Pe(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=$o.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var J2=P`
|
|
429
|
+
`;var fp="ft-app-info",ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ir.eventName="authentication-change";var Rn=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Rn.eventName="ui-locale-changed";var pp={session:(t,e)=>{ge(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>$.dispatchEvent(new ir(e.payload)),0))}},$=Wt.get({name:fp,reducers:pp,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var ko=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},pS=fe(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($)}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=>jt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ko([L({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ko([L({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ko([_r({store:$.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),ko([_r({store:$.name})],e.prototype,"uiLocale",void 0),e});var sr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=$.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=$.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Fr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:sr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):sr.await()}};var Ae=class extends Fr{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 je,this.cache=e?a.commonCache:new je}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 zo=class extends Ae{async listMySearches(){let{session:e}=$.getState();return Va(e,ne.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Po=class extends Ae{async listMyBookmarks(){let e=$.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Do=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var Fo=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var hp="ft-user-assets",mp={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(Me).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;$s(t,r,[...Us(t,r),a]),K2(t,r,1,n),Z2(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;$s(t,r,Us(t,r).map(a=>a.id===n.id?n:a)),Z2(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;$s(t,r,Us(t,r).filter(i=>i.id!==a)),K2(t,r,-1,n)}},q2={[Me.SEARCHES]:"savedSearches",[Me.BOOKMARKS]:"bookmarks",[Me.BOOKS]:void 0,[Me.COLLECTIONS]:void 0},Us=(t,e)=>{var r;let n=q2[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},$s=(t,e,r)=>{let n=q2[e];n&&(t[n]=r)},K2=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===Me.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Z2=(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)},ye=Wt.get({name:hp,reducers:mp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Me).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Bs=class{constructor(e=new Do,r=new Fo){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=$.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Po,this.savedSearchesService=new zo,$.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=$.getState();ge((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(),ye.actions.clearAssetCount(),ye.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ye.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ye.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ye.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ye.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ye.getState().assetCounts.allAsset[e]!==r.count&&ye.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ye.getState().assetCounts.bookmarkByMap[e]!==r.count&&ye.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ye.getState().assetCounts.bookmarkByMap).length!==0;e===Me.BOOKMARKS&&r&&ye.actions.clearBookmarkCountByMap(),ye.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;ye.actions.bookmarks(r)}}},gp=new Bs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gp);var Hs=class{addCommand(e,r=!1){$.commands.add(e,r)}consumeCommand(e){return $.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Hs;var Y2,Ur=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},yp=Symbol("clearAfterUnitTest"),Uo=class extends eo(Ae){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Y2]=()=>{this.defaultMessages={},this.cache=new je,this.listeners={}},this.currentUiLocale=$.getState().uiLocale,$.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=$.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};ge(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 pn((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof Tt)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ur({loadedContexts:e})),this.dispatchEvent(new Ur({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ur({loadedContexts:[e]})),this.dispatchEvent(new Ur({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Jn(0).then(()=>n()).catch(()=>null)))}};Y2=yp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Uo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Uo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var _n=window.FluidTopicsI18nService,Gs=window.FluidTopicsCustomI18nService;var Vs=class{highlightHtml(e,r,n){$i(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Vs;var Ws=class{isDate(e){var r,n,a,i;return(i=(n=((a=(r=$.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&a!==void 0?a:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return jt.format(e,(n=r?.locale)!==null&&n!==void 0?n:$.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 Ws;var Nn=class{static get(e,r,{baseUrl:n,localesConfiguration:a,availableContentLocales:i}=$.getState()){var s;if(r==="all"&&a?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(c=>c.lang===r)){let c=a?.defaultLocales.defaultContentLocale;r=c?`${c.lang}-${c.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new rt(n,e??20,a?.allLanguagesAllowed,r,i)}};var js=class{urlToSearchRequest(e){return Nn.get().parse(e)}searchRequestToUrl(e){return Nn.get().serialize(e)}};window.FluidTopicsUrlService=new js;var cr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};cr.eventName="before-location-change";var lr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};lr.eventName="change";var Ks=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))}},X2=new Ks;var $o=class t extends tt{static build(){return new t(window.history,X2,()=>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),ge(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new lr(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,c])=>{let d=new URL(typeof c=="string"?c:(c??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),f=new cr(d);this.dispatchEvent(f);let g=r(),m={...g===this.currentIndex?this.currentState:void 0,...i,index:g,href:f.detail.nextLocation.href};n.apply(a,[m,s,m.href]),this.setCurrentState(m,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(cr.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(cr.eventName,e)}addHistoryChangeListener(e){this.addEventListener(lr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(lr.eventName,e)}currentItem(){return Pe(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 Pe(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Pe(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 Pe(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=$o.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var J2=P`
|
|
430
430
|
`;function Q2(t,e){let{authenticationRequired:r,session:n}=$.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Bo=class extends Fr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Zs=class t extends Ln{static build(e){return new t($,e)}constructor(e,r){super(),this.store=e,this.cache=new je,this.withManualResources=!0,this.userLocaleService=new Bo,this.knownContexts=new vr,this.knownCustomComponents=new vr,this.cleanSessionDebouncer=new ve,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new ve(500),this.apiProvider=r??(()=>sr.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(ir.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(ir.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",()=>Q2(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Rn(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return Kl($.getState().session,...e)}},e0=Zs.build();var dr=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 Mn=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 dr(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 ue=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},J=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.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=e0,this.contextRoot=new Mn}render(){return F`
|
|
431
431
|
<slot></slot>
|
|
432
432
|
`}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>_n.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())}};J.elementDefinitions={};J.styles=J2;ue([L()],J.prototype,"baseUrl",void 0);ue([L()],J.prototype,"tenantId",void 0);ue([L()],J.prototype,"apiIntegrationIdentifier",void 0);ue([L()],J.prototype,"apiIntegrationAppVersion",void 0);ue([L()],J.prototype,"uiLocale",void 0);ue([le(null)],J.prototype,"availableUiLocales",void 0);ue([le(null)],J.prototype,"metadataConfiguration",void 0);ue([L({type:Boolean})],J.prototype,"editorMode",void 0);ue([L({type:Boolean})],J.prototype,"noCustom",void 0);ue([L({type:Boolean})],J.prototype,"openExternalDocumentInNewTab",void 0);ue([L({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],J.prototype,"noCustomComponent",void 0);ue([L({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],J.prototype,"noCustomCode",void 0);ue([L({type:Boolean})],J.prototype,"withManualResources",void 0);ue([L({type:Boolean})],J.prototype,"navigatorOnline",void 0);ue([L({type:Boolean})],J.prototype,"forcedOffline",void 0);ue([L({type:Boolean})],J.prototype,"authenticationRequired",void 0);ue([le([])],J.prototype,"messageContexts",void 0);ue([le(void 0)],J.prototype,"session",void 0);var t0={"ft-app-context":J};te(t0);var qs=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-]+$/)}},$r=new qs;var xp=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},In=Symbol("i18nAttributes"),r0=Symbol("i18nListAttributes"),n0=Symbol("i18nProperties"),Ho=Symbol("i18nContexts"),Tn=Symbol("i18nUnsubs"),o0=fe(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?Gs:_n}i18n(i){let{context:s,key:c,message:d}=i,{custom:f,args:g,argsProvider:m}=i;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,f);let y=g??(m?m(this):[]);return this.getI18nService(f).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($r.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 f;return((f=d?.context)===null||f===void 0?void 0:f.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let d=this,f=(g,m,y)=>y?.context&&y.key&&i(g,m,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...g})}:y;(s=this[In])===null||s===void 0||s.forEach((g,m)=>d[m]=f(g,m,d[m])),(c=this[r0])===null||c===void 0||c.forEach((g,m)=>{var y;return d[m]=(y=d[m])===null||y===void 0?void 0:y.map(v=>f(g,m,v))})}updateI18nProperties(i){var s;(s=this[n0])===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[Ho].set(d,{isCustomContext:c}),this[Tn].has(d)||this[Tn].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(i){return this[Ho].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ho].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Tn].forEach(i=>i()),this[Tn].clear()}}return e=Ho,r=Tn,xp([L({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Go=class extends o0(K){},Vo=class extends o0(Gt){};var Ys=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(n=>typeof n=="string"?$r.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},Sp=new Ys;var a0=(t,e)=>(r,n)=>{var a;r.constructor.createProperty(n,{type:Object,hasChanged:We,converter:$r,...e}),r[In]=(a=r[In])!==null&&a!==void 0?a:new Map,r[In].set(n,t??{})};var i0=P`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ftds-table",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.50",
|
|
4
4
|
"description": "The design system table component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@fluid-topics/design-system-variables": "3.18.0",
|
|
23
|
-
"@fluid-topics/ft-assets": "2.2.
|
|
24
|
-
"@fluid-topics/ft-wc-utils": "2.2.
|
|
25
|
-
"@fluid-topics/ftds-button": "2.2.
|
|
26
|
-
"@fluid-topics/ftds-icon": "2.2.
|
|
27
|
-
"@fluid-topics/ftds-typography": "2.2.
|
|
23
|
+
"@fluid-topics/ft-assets": "2.2.50",
|
|
24
|
+
"@fluid-topics/ft-wc-utils": "2.2.50",
|
|
25
|
+
"@fluid-topics/ftds-button": "2.2.50",
|
|
26
|
+
"@fluid-topics/ftds-icon": "2.2.50",
|
|
27
|
+
"@fluid-topics/ftds-typography": "2.2.50",
|
|
28
28
|
"lit": "3.3.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@fluid-topics/ft-wc-test-utils": "2.2.
|
|
31
|
+
"@fluid-topics/ft-wc-test-utils": "2.2.50"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "827b5f0b91f05b76d24e8c231411908394c47b4e"
|
|
34
34
|
}
|