@fluid-topics/ft-reader-saved-bookmarks 2.1.14 → 2.1.15
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.
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
position: relative;
|
|
356
356
|
word-break: break-word;
|
|
357
357
|
}
|
|
358
|
-
`;var Oa=["top","right","bottom","left"],Ca=["start","end"],ti=Oa.reduce((e,t)=>e.concat(t,t+"-"+Ca[0],t+"-"+Ca[1]),[]),Zt=Math.min,Me=Math.max,er=Math.round;var de=e=>({x:e,y:e}),xc={left:"right",right:"left",bottom:"top",top:"bottom"};function Ta(e,t,r){return Me(e,Zt(t,r))}function Vr(e,t){return typeof e=="function"?e(t):e}function tr(e){return e.split("-")[0]}function Ie(e){return e.split("-")[1]}function ri(e){return e==="x"?"y":"x"}function ni(e){return e==="y"?"height":"width"}function Wr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ii(e){return ri(Wr(e))}function wa(e,t,r){r===void 0&&(r=!1);let n=Ie(e),i=ii(e),s=ni(i),o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ei(o)),[o,ei(o)]}function _a(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function ei(e){let t=tr(e);return xc[t]+e.slice(t.length)}function bc(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function Ra(e){return typeof e!="number"?bc(e):{top:e,right:e,bottom:e,left:e}}function Je(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function La(e,t,r){let{reference:n,floating:i}=e,s=Wr(t),o=ii(t),a=ni(o),l=tr(t),c=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[a]/2-i[a]/2,p;switch(l){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}let h=Ie(t);return h&&(p[o]+=f*(h==="end"?1:-1)*(r&&c?-1:1)),p}async function Na(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Vr(t,e),h=Ra(p),x=a[f?d==="floating"?"reference":"floating":d],b=Je(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),A=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))&&await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1},k=Je(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:S,strategy:l}):A);return{top:(b.top-k.top+h.top)/C.y,bottom:(k.bottom-b.bottom+h.bottom)/C.y,left:(b.left-k.left+h.left)/C.x,right:(k.right-b.right+h.right)/C.x}}var Ac=50,Pa=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:Na},l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=La(c,n,l),f=n,p=0,h={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:b,fn:A}=x,{x:S,y:C,data:k,reset:L}=await A({x:u,y:d,initialPlacement:n,placement:f,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=S??u,d=C??d,h[b]={...h[b],...k},L&&p<Ac&&(p++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(c=L.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:u,y:d}=La(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};function Ec(e,t,r){return(e?[...r.filter(i=>Ie(i)===e),...r.filter(i=>Ie(i)!==e)]:r.filter(i=>tr(i)===i)).filter(i=>e?Ie(i)===e||(t?_a(i)!==i:!1):!0)}var ka=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=ti,autoAlignment:p=!0,...h}=Vr(e,t),m=d!==void 0||f===ti?Ec(d||null,p,f):f,x=((r=o.autoPlacement)==null?void 0:r.index)||0,b=m[x];if(b==null)return{};if(a!==b)return{reset:{placement:m[0]}};let A=await l.detectOverflow(t,h),S=wa(b,s,await(l.isRTL==null?void 0:l.isRTL(c.floating))),C=[A[tr(b)],A[S[0]],A[S[1]]],k=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:b,overflows:C}],L=m[x+1];if(L)return{data:{index:x+1,overflows:k},reset:{placement:L}};let Se=k.map(K=>{let J=Ie(K.placement);return[K.placement,J&&u?K.overflows.slice(0,2).reduce((G,Ue)=>G+Ue,0):K.overflows[0],K.overflows]}).sort((K,J)=>K[1]-J[1]),Ce=((i=Se.filter(K=>K[2].slice(0,Ie(K[0])?2:3).every(J=>J<=0))[0])==null?void 0:i[0])||Se[0][0];return Ce!==a?{data:{index:x+1,overflows:k},reset:{placement:Ce}}:{}}}};var Da=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:A=>{let{x:S,y:C}=A;return{x:S,y:C}}},...c}=Vr(e,t),u={x:r,y:n},d=await s.detectOverflow(t,c),f=Wr(i),p=ri(f),h=u[p],m=u[f],x=(A,S)=>Ta(S+d[A==="y"?"top":"left"],S,S-d[A==="y"?"bottom":"right"]);o&&(h=x(p,h)),a&&(m=x(f,m));let b=l.fn({...t,[p]:h,[f]:m});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:o,[f]:a}}}}}};function Gr(){return typeof window<"u"}function Ze(e){return Ia(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function me(e){var t;return(t=(Ia(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ia(e){return Gr()?e instanceof Node||e instanceof W(e).Node:!1}function re(e){return Gr()?e instanceof Element||e instanceof W(e).Element:!1}function ye(e){return Gr()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Ma(e){return!Gr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function _t(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function Ua(e){return/^(table|td|th)$/.test(Ze(e))}function rr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Sc=/transform|translate|scale|rotate|perspective|filter/,Cc=/paint|layout|strict|content/,Qe=e=>!!e&&e!=="none",si;function Rt(e){let t=re(e)?ne(e):e;return Qe(t.transform)||Qe(t.translate)||Qe(t.scale)||Qe(t.rotate)||Qe(t.perspective)||!zr()&&(Qe(t.backdropFilter)||Qe(t.filter))||Sc.test(t.willChange||"")||Cc.test(t.contain||"")}function $a(e){let t=Ee(e);for(;ye(t)&&!et(t);){if(Rt(t))return t;if(rr(t))return null;t=Ee(t)}return null}function zr(){return si==null&&(si=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),si}function et(e){return/^(html|body|#document)$/.test(Ze(e))}function ne(e){return W(e).getComputedStyle(e)}function nr(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if(Ze(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ma(e)&&e.host||me(e);return Ma(t)?t.host:t}function Ba(e){let t=Ee(e);return et(t)?(e.ownerDocument||e).body:ye(t)&&_t(t)?t:Ba(t)}function Kr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Ba(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=W(i);if(s){let a=qr(o);return t.concat(o,o.visualViewport||[],_t(i)?i:[],a&&r?Kr(a):[])}else return t.concat(i,Kr(i,[],r))}function qr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Va(e){let t=ne(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=ye(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=er(r)!==s||er(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function Wa(e){return re(e)?e:e.contextElement}function Lt(e){let t=Wa(e);if(!ye(t))return de(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:s}=Va(t),o=(s?er(r.width):r.width)/n,a=(s?er(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var Oc=de(0);function Ka(e){let t=W(e);return!zr()||!t.visualViewport?Oc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tc(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==W(e)?!1:t}function ir(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),s=Wa(e),o=de(1);t&&(n?re(n)&&(o=Lt(n)):o=Lt(e));let a=Tc(s,r,n)?Ka(s):de(0),l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){let f=W(s),p=n&&re(n)?W(n):n,h=f,m=qr(h);for(;m&&n&&p!==h;){let x=Lt(m),b=m.getBoundingClientRect(),A=ne(m),S=b.left+(m.clientLeft+parseFloat(A.paddingLeft))*x.x,C=b.top+(m.clientTop+parseFloat(A.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,d*=x.y,l+=S,c+=C,h=W(m),m=qr(h)}}return Je({width:u,height:d,x:l,y:c})}function Yr(e,t){let r=nr(e).scrollLeft;return t?t.left+r:ir(me(e)).left+r}function Ga(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Yr(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function wc(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,s=i==="fixed",o=me(n),a=t?rr(t.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=de(1),u=de(0),d=ye(n);if((d||!d&&!s)&&((Ze(n)!=="body"||_t(o))&&(l=nr(n)),d)){let p=ir(n);c=Lt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}let f=o&&!d&&!s?Ga(o,l):de(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}}function _c(e){return Array.from(e.getClientRects())}function Rc(e){let t=me(e),r=nr(e),n=e.ownerDocument.body,i=Me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),o=-r.scrollLeft+Yr(e),a=-r.scrollTop;return ne(n).direction==="rtl"&&(o+=Me(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}var Ha=25;function Lc(e,t){let r=W(e),n=me(e),i=r.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;let u=zr();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}let c=Yr(n);if(c<=0){let u=n.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(n.clientWidth-d.clientWidth-p);h<=Ha&&(s-=h)}else c<=Ha&&(s+=c);return{width:s,height:o,x:a,y:l}}function Nc(e,t){let r=ir(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=ye(e)?Lt(e):de(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function ja(e,t,r){let n;if(t==="viewport")n=Lc(e,r);else if(t==="document")n=Rc(me(e));else if(re(t))n=Nc(t,r);else{let i=Ka(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Je(n)}function za(e,t){let r=Ee(e);return r===t||!re(r)||et(r)?!1:ne(r).position==="fixed"||za(r,t)}function Pc(e,t){let r=t.get(e);if(r)return r;let n=Kr(e,[],!1).filter(a=>re(a)&&Ze(a)!=="body"),i=null,s=ne(e).position==="fixed",o=s?Ee(e):e;for(;re(o)&&!et(o);){let a=ne(o),l=Rt(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||_t(o)&&!l&&za(e,o))?n=n.filter(u=>u!==o):i=a,o=Ee(o)}return t.set(e,n),n}function kc(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[...r==="clippingAncestors"?rr(t)?[]:Pc(t,this._c):[].concat(r),n],a=ja(t,o[0],i),l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<o.length;f++){let p=ja(t,o[f],i);l=Me(p.top,l),c=Zt(p.right,c),u=Zt(p.bottom,u),d=Me(p.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function Dc(e){let{width:t,height:r}=Va(e);return{width:t,height:r}}function Mc(e,t,r){let n=ye(t),i=me(t),s=r==="fixed",o=ir(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=de(0);function c(){l.x=Yr(i)}if(n||!n&&!s)if((Ze(t)!=="body"||_t(i))&&(a=nr(t)),n){let p=ir(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&c();s&&!n&&i&&c();let u=i&&!n&&!s?Ga(i,a):de(0),d=o.left+a.scrollLeft-l.x-u.x,f=o.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function oi(e){return ne(e).position==="static"}function Fa(e,t){if(!ye(e)||ne(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return me(e)===r&&(r=r.ownerDocument.body),r}function qa(e,t){let r=W(e);if(rr(e))return r;if(!ye(e)){let i=Ee(e);for(;i&&!et(i);){if(re(i)&&!oi(i))return i;i=Ee(i)}return r}let n=Fa(e,t);for(;n&&Ua(n)&&oi(n);)n=Fa(n,t);return n&&et(n)&&oi(n)&&!Rt(n)?r:n||$a(e)||r}var Ic=async function(e){let t=this.getOffsetParent||qa,r=this.getDimensions,n=await r(e.floating);return{reference:Mc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Uc(e){return ne(e).direction==="rtl"}var Xr={convertOffsetParentRelativeRectToViewportRelativeRect:wc,getDocumentElement:me,getClippingRect:kc,getOffsetParent:qa,getElementRects:Ic,getClientRects:_c,getDimensions:Dc,getScale:Lt,isElement:re,isRTL:Uc};var Ya=ka,Xa=Da;var Ja=(e,t,r)=>{let n=new Map,i={platform:Xr,...r},s={...i.platform,_c:n};return Pa(e,t,{...i,platform:s})};function Qa(e){return $c(e)}function ai(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function $c(e){for(let t=e;t;t=ai(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=ai(e);t;t=ai(t)){if(!(t instanceof Element))continue;let r=getComputedStyle(t);if(r.display!=="contents"&&(r.position!=="static"||Rt(r)||t.tagName==="BODY"))return t}return null}async function Za(e,t,r){let n;return typeof r=="object"?n=r:n={placement:r},Ja(e,t,{strategy:n.strategy,platform:{...Xr,getOffsetParent:i=>Xr.getOffsetParent(i,Qa)},middleware:[Xa({crossAxis:!0}),Ya({allowedPlacements:[n.placement]})]})}var el=v(T());var li=class{fromAttribute(t){if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.map(n=>typeof n=="string"?Tt.fromAttribute(n):n):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},Bc=new li;var tl=(e,t)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:el.hasChanged,converter:Tt,...t}),r[Yt]=(i=r[Yt])!==null&&i!==void 0?i:new Map,r[Yt].set(n,e??{})};var fe=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},D=class extends Ur{constructor(){super(...arguments),this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.ignoreMatchingElements=[],this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new ie.Debouncer,this.revealDebouncer=new ie.Debouncer,this.onTouch=t=>{this.isIgnored(t)||(this.show(),setTimeout(()=>window.addEventListener("touchstart",r=>{r.composedPath().includes(this.container)||this.onOut(r)},{once:!0}),100))},this.onHover=t=>{this.isIgnored(t)||this.show()},this.onFocusIn=t=>{!this.isIgnored(t)&&window.FluidTopicsA11yHints.isKeyboardNavigation&&window.FluidTopicsA11yHints.lastPressedKey==="Tab"&&this.show()},this.onOut=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())},this.onClick=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())}}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){var t,r;return rl.html`
|
|
358
|
+
`;var Oa=["top","right","bottom","left"],Ca=["start","end"],ti=Oa.reduce((e,t)=>e.concat(t,t+"-"+Ca[0],t+"-"+Ca[1]),[]),Zt=Math.min,Me=Math.max,er=Math.round;var de=e=>({x:e,y:e}),xc={left:"right",right:"left",bottom:"top",top:"bottom"};function Ta(e,t,r){return Me(e,Zt(t,r))}function Vr(e,t){return typeof e=="function"?e(t):e}function tr(e){return e.split("-")[0]}function Ie(e){return e.split("-")[1]}function ri(e){return e==="x"?"y":"x"}function ni(e){return e==="y"?"height":"width"}function Wr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ii(e){return ri(Wr(e))}function wa(e,t,r){r===void 0&&(r=!1);let n=Ie(e),i=ii(e),s=ni(i),o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ei(o)),[o,ei(o)]}function _a(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function ei(e){let t=tr(e);return xc[t]+e.slice(t.length)}function bc(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function Ra(e){return typeof e!="number"?bc(e):{top:e,right:e,bottom:e,left:e}}function Je(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function La(e,t,r){let{reference:n,floating:i}=e,s=Wr(t),o=ii(t),a=ni(o),l=tr(t),c=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[a]/2-i[a]/2,p;switch(l){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}let h=Ie(t);return h&&(p[o]+=f*(h==="end"?1:-1)*(r&&c?-1:1)),p}async function Na(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Vr(t,e),h=Ra(p),x=a[f?d==="floating"?"reference":"floating":d],b=Je(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),A=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))&&await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1},k=Je(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:S,strategy:l}):A);return{top:(b.top-k.top+h.top)/C.y,bottom:(k.bottom-b.bottom+h.bottom)/C.y,left:(b.left-k.left+h.left)/C.x,right:(k.right-b.right+h.right)/C.x}}var Ac=50,Pa=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:Na},l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=La(c,n,l),f=n,p=0,h={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:b,fn:A}=x,{x:S,y:C,data:k,reset:L}=await A({x:u,y:d,initialPlacement:n,placement:f,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=S??u,d=C??d,h[b]={...h[b],...k},L&&p<Ac&&(p++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(c=L.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:u,y:d}=La(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};function Ec(e,t,r){return(e?[...r.filter(i=>Ie(i)===e),...r.filter(i=>Ie(i)!==e)]:r.filter(i=>tr(i)===i)).filter(i=>e?Ie(i)===e||(t?_a(i)!==i:!1):!0)}var ka=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=ti,autoAlignment:p=!0,...h}=Vr(e,t),m=d!==void 0||f===ti?Ec(d||null,p,f):f,x=((r=o.autoPlacement)==null?void 0:r.index)||0,b=m[x];if(b==null)return{};if(a!==b)return{reset:{placement:m[0]}};let A=await l.detectOverflow(t,h),S=wa(b,s,await(l.isRTL==null?void 0:l.isRTL(c.floating))),C=[A[tr(b)],A[S[0]],A[S[1]]],k=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:b,overflows:C}],L=m[x+1];if(L)return{data:{index:x+1,overflows:k},reset:{placement:L}};let Se=k.map(K=>{let J=Ie(K.placement);return[K.placement,J&&u?K.overflows.slice(0,2).reduce((G,Ue)=>G+Ue,0):K.overflows[0],K.overflows]}).sort((K,J)=>K[1]-J[1]),Ce=((i=Se.filter(K=>K[2].slice(0,Ie(K[0])?2:3).every(J=>J<=0))[0])==null?void 0:i[0])||Se[0][0];return Ce!==a?{data:{index:x+1,overflows:k},reset:{placement:Ce}}:{}}}};var Da=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:A=>{let{x:S,y:C}=A;return{x:S,y:C}}},...c}=Vr(e,t),u={x:r,y:n},d=await s.detectOverflow(t,c),f=Wr(i),p=ri(f),h=u[p],m=u[f],x=(A,S)=>Ta(S+d[A==="y"?"top":"left"],S,S-d[A==="y"?"bottom":"right"]);o&&(h=x(p,h)),a&&(m=x(f,m));let b=l.fn({...t,[p]:h,[f]:m});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:o,[f]:a}}}}}};function Gr(){return typeof window<"u"}function Ze(e){return Ia(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function me(e){var t;return(t=(Ia(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ia(e){return Gr()?e instanceof Node||e instanceof W(e).Node:!1}function re(e){return Gr()?e instanceof Element||e instanceof W(e).Element:!1}function ye(e){return Gr()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Ma(e){return!Gr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function _t(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function Ua(e){return/^(table|td|th)$/.test(Ze(e))}function rr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Sc=/transform|translate|scale|rotate|perspective|filter/,Cc=/paint|layout|strict|content/,Qe=e=>!!e&&e!=="none",si;function Rt(e){let t=re(e)?ne(e):e;return Qe(t.transform)||Qe(t.translate)||Qe(t.scale)||Qe(t.rotate)||Qe(t.perspective)||!zr()&&(Qe(t.backdropFilter)||Qe(t.filter))||Sc.test(t.willChange||"")||Cc.test(t.contain||"")}function $a(e){let t=Ee(e);for(;ye(t)&&!et(t);){if(Rt(t))return t;if(rr(t))return null;t=Ee(t)}return null}function zr(){return si==null&&(si=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),si}function et(e){return/^(html|body|#document)$/.test(Ze(e))}function ne(e){return W(e).getComputedStyle(e)}function nr(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if(Ze(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ma(e)&&e.host||me(e);return Ma(t)?t.host:t}function Ba(e){let t=Ee(e);return et(t)?(e.ownerDocument||e).body:ye(t)&&_t(t)?t:Ba(t)}function Kr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Ba(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=W(i);if(s){let a=qr(o);return t.concat(o,o.visualViewport||[],_t(i)?i:[],a&&r?Kr(a):[])}else return t.concat(i,Kr(i,[],r))}function qr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Va(e){let t=ne(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=ye(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=er(r)!==s||er(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function Wa(e){return re(e)?e:e.contextElement}function Lt(e){let t=Wa(e);if(!ye(t))return de(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:s}=Va(t),o=(s?er(r.width):r.width)/n,a=(s?er(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var Oc=de(0);function Ka(e){let t=W(e);return!zr()||!t.visualViewport?Oc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tc(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==W(e)?!1:t}function ir(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),s=Wa(e),o=de(1);t&&(n?re(n)&&(o=Lt(n)):o=Lt(e));let a=Tc(s,r,n)?Ka(s):de(0),l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){let f=W(s),p=n&&re(n)?W(n):n,h=f,m=qr(h);for(;m&&n&&p!==h;){let x=Lt(m),b=m.getBoundingClientRect(),A=ne(m),S=b.left+(m.clientLeft+parseFloat(A.paddingLeft))*x.x,C=b.top+(m.clientTop+parseFloat(A.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,d*=x.y,l+=S,c+=C,h=W(m),m=qr(h)}}return Je({width:u,height:d,x:l,y:c})}function Yr(e,t){let r=nr(e).scrollLeft;return t?t.left+r:ir(me(e)).left+r}function Ga(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Yr(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function wc(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,s=i==="fixed",o=me(n),a=t?rr(t.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=de(1),u=de(0),d=ye(n);if((d||!d&&!s)&&((Ze(n)!=="body"||_t(o))&&(l=nr(n)),d)){let p=ir(n);c=Lt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}let f=o&&!d&&!s?Ga(o,l):de(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}}function _c(e){return Array.from(e.getClientRects())}function Rc(e){let t=me(e),r=nr(e),n=e.ownerDocument.body,i=Me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),o=-r.scrollLeft+Yr(e),a=-r.scrollTop;return ne(n).direction==="rtl"&&(o+=Me(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}var Ha=25;function Lc(e,t){let r=W(e),n=me(e),i=r.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;let u=zr();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}let c=Yr(n);if(c<=0){let u=n.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(n.clientWidth-d.clientWidth-p);h<=Ha&&(s-=h)}else c<=Ha&&(s+=c);return{width:s,height:o,x:a,y:l}}function Nc(e,t){let r=ir(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=ye(e)?Lt(e):de(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function ja(e,t,r){let n;if(t==="viewport")n=Lc(e,r);else if(t==="document")n=Rc(me(e));else if(re(t))n=Nc(t,r);else{let i=Ka(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Je(n)}function za(e,t){let r=Ee(e);return r===t||!re(r)||et(r)?!1:ne(r).position==="fixed"||za(r,t)}function Pc(e,t){let r=t.get(e);if(r)return r;let n=Kr(e,[],!1).filter(a=>re(a)&&Ze(a)!=="body"),i=null,s=ne(e).position==="fixed",o=s?Ee(e):e;for(;re(o)&&!et(o);){let a=ne(o),l=Rt(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||_t(o)&&!l&&za(e,o))?n=n.filter(u=>u!==o):i=a,o=Ee(o)}return t.set(e,n),n}function kc(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[...r==="clippingAncestors"?rr(t)?[]:Pc(t,this._c):[].concat(r),n],a=ja(t,o[0],i),l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<o.length;f++){let p=ja(t,o[f],i);l=Me(p.top,l),c=Zt(p.right,c),u=Zt(p.bottom,u),d=Me(p.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function Dc(e){let{width:t,height:r}=Va(e);return{width:t,height:r}}function Mc(e,t,r){let n=ye(t),i=me(t),s=r==="fixed",o=ir(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=de(0);function c(){l.x=Yr(i)}if(n||!n&&!s)if((Ze(t)!=="body"||_t(i))&&(a=nr(t)),n){let p=ir(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&c();s&&!n&&i&&c();let u=i&&!n&&!s?Ga(i,a):de(0),d=o.left+a.scrollLeft-l.x-u.x,f=o.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function oi(e){return ne(e).position==="static"}function Fa(e,t){if(!ye(e)||ne(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return me(e)===r&&(r=r.ownerDocument.body),r}function qa(e,t){let r=W(e);if(rr(e))return r;if(!ye(e)){let i=Ee(e);for(;i&&!et(i);){if(re(i)&&!oi(i))return i;i=Ee(i)}return r}let n=Fa(e,t);for(;n&&Ua(n)&&oi(n);)n=Fa(n,t);return n&&et(n)&&oi(n)&&!Rt(n)?r:n||$a(e)||r}var Ic=async function(e){let t=this.getOffsetParent||qa,r=this.getDimensions,n=await r(e.floating);return{reference:Mc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Uc(e){return ne(e).direction==="rtl"}var Xr={convertOffsetParentRelativeRectToViewportRelativeRect:wc,getDocumentElement:me,getClippingRect:kc,getOffsetParent:qa,getElementRects:Ic,getClientRects:_c,getDimensions:Dc,getScale:Lt,isElement:re,isRTL:Uc};var Ya=ka,Xa=Da;var Ja=(e,t,r)=>{let n=new Map,i={platform:Xr,...r},s={...i.platform,_c:n};return Pa(e,t,{...i,platform:s})};function Qa(e){return $c(e)}function ai(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function $c(e){for(let t=e;t;t=ai(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=ai(e);t;t=ai(t)){if(!(t instanceof Element))continue;let r=getComputedStyle(t);if(r.display!=="contents"&&(r.position!=="static"||Rt(r)||t.tagName==="BODY"))return t}return null}async function Za(e,t,r){let n;return typeof r=="object"?n=r:n={placement:r},Ja(e,t,{strategy:n.strategy,platform:{...Xr,getOffsetParent:i=>Xr.getOffsetParent(i,Qa)},middleware:[Xa({crossAxis:!0}),Ya({allowedPlacements:[n.placement]})]})}var el=v(T());var li=class{fromAttribute(t){if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.map(n=>typeof n=="string"?Tt.fromAttribute(n):n):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},Bc=new li;var tl=(e,t)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:el.hasChanged,converter:Tt,...t}),r[Yt]=(i=r[Yt])!==null&&i!==void 0?i:new Map,r[Yt].set(n,e??{})};var fe=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},D=class extends Ur{constructor(){super(...arguments),this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.ignoreMatchingElements=[],this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new ie.Debouncer,this.revealDebouncer=new ie.Debouncer,this.onTouch=t=>{this.isIgnored(t)||(this.show(),setTimeout(()=>window.addEventListener("touchstart",r=>{r.composedPath().includes(this.container)||this.onOut(r)},{once:!0}),100))},this.onHover=t=>{this.isIgnored(t)?this.matchesIgnored(t)&&this.hide():this.show()},this.onFocusIn=t=>{!this.isIgnored(t)&&window.FluidTopicsA11yHints.isKeyboardNavigation&&window.FluidTopicsA11yHints.lastPressedKey==="Tab"&&this.show()},this.onOut=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())},this.onClick=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())}}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){var t,r;return rl.html`
|
|
359
359
|
<div part="container"
|
|
360
360
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}">
|
|
361
361
|
<slot part="slot"></slot>
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
</div>
|
|
371
371
|
</div>
|
|
372
372
|
</div>
|
|
373
|
-
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("mouseover",this.onHover,{passive:!0}),this.eventsTarget.addEventListener("mouseleave",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("focusin",this.onFocusIn,{passive:!0}),this.eventsTarget.addEventListener("focusout",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("touchstart",this.onTouch,{passive:!0}),this.eventsTarget.addEventListener("click",this.onClick,{passive:!0}))}removeHandlers(){this.eventsTarget&&(this.eventsTarget.removeEventListener("mouseover",this.onHover),this.eventsTarget.removeEventListener("mouseleave",this.onOut),this.eventsTarget.removeEventListener("focusin",this.onFocusIn),this.eventsTarget.removeEventListener("focusout",this.onOut),this.eventsTarget.removeEventListener("touchstart",this.onTouch),this.eventsTarget.removeEventListener("click",this.onClick),this.eventsTarget=void 0)}defaultSetup(){this.container&&this.setupFor(this.container)}updated(t){var r,n;t.has("visible")&&(this.visible?(this.resetTooltipContent(),(r=this.tooltip)===null||r===void 0||r.showPopover()):(n=this.tooltip)===null||n===void 0||n.hidePopover()),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some(r=>t.has(r))&&this.visible&&this.positionTooltip()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.eventsTarget==null&&this.defaultSetup()})}disconnectedCallback(){super.disconnectedCallback(),this.removeHandlers()}async show(t){this.visible=!0,t!=null&&await this.hideDebounce.run(()=>{this.hide()},t)}async showTemporaryText(t,r){let n=this.manual;this.manual=!0;let i=this.text;this.text={message:t},await this.show(r),this.text=i,this.manual=n}hide(){this.visible=!1}toggle(){this.visible=!this.visible}isVisible(){return this.visible}get slottedElement(){var t;return((t=this.slotNodes)!==null&&t!==void 0?t:[]).filter(r=>r.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&Za(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:t,y:r})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${t}px,${r}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${ie.designSystemVariables.transitionDuration}, left ${ie.designSystemVariables.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}
|
|
373
|
+
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("mouseover",this.onHover,{passive:!0}),this.eventsTarget.addEventListener("mouseleave",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("focusin",this.onFocusIn,{passive:!0}),this.eventsTarget.addEventListener("focusout",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("touchstart",this.onTouch,{passive:!0}),this.eventsTarget.addEventListener("click",this.onClick,{passive:!0}))}removeHandlers(){this.eventsTarget&&(this.eventsTarget.removeEventListener("mouseover",this.onHover),this.eventsTarget.removeEventListener("mouseleave",this.onOut),this.eventsTarget.removeEventListener("focusin",this.onFocusIn),this.eventsTarget.removeEventListener("focusout",this.onOut),this.eventsTarget.removeEventListener("touchstart",this.onTouch),this.eventsTarget.removeEventListener("click",this.onClick),this.eventsTarget=void 0)}defaultSetup(){this.container&&this.setupFor(this.container)}updated(t){var r,n;t.has("visible")&&(this.visible?(this.resetTooltipContent(),(r=this.tooltip)===null||r===void 0||r.showPopover()):(n=this.tooltip)===null||n===void 0||n.hidePopover()),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some(r=>t.has(r))&&this.visible&&this.positionTooltip()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.eventsTarget==null&&this.defaultSetup()})}disconnectedCallback(){super.disconnectedCallback(),this.removeHandlers()}async show(t){this.visible=!0,t!=null&&await this.hideDebounce.run(()=>{this.hide()},t)}async showTemporaryText(t,r){let n=this.manual;this.manual=!0;let i=this.text;this.text={message:t},await this.show(r),this.text=i,this.manual=n}hide(){this.visible=!1}toggle(){this.visible=!this.visible}isVisible(){return this.visible}get slottedElement(){var t;return((t=this.slotNodes)!==null&&t!==void 0?t:[]).filter(r=>r.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&Za(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:t,y:r})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${t}px,${r}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${ie.designSystemVariables.transitionDuration}, left ${ie.designSystemVariables.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}matchesIgnored(t){return(0,ie.eventPathContainsMatchingElement)(t,this.ignoreMatchingElements,this.eventsTarget)}isIgnored(t){return this.manual||this.matchesIgnored(t)}};D.elementDefinitions={"ft-typography":ae};D.styles=Sa;fe([tl()],D.prototype,"text",void 0);fe([(0,se.property)({type:Boolean})],D.prototype,"manual",void 0);fe([(0,se.property)({type:Boolean})],D.prototype,"inline",void 0);fe([(0,ie.numberProperty)()],D.prototype,"delay",void 0);fe([(0,se.property)()],D.prototype,"position",void 0);fe([(0,ie.jsonProperty)([])],D.prototype,"ignoreMatchingElements",void 0);fe([(0,se.queryAssignedNodes)()],D.prototype,"slotNodes",void 0);fe([(0,se.query)(".ft-tooltip--container")],D.prototype,"container",void 0);fe([(0,se.query)(".ft-tooltip")],D.prototype,"tooltip",void 0);fe([(0,se.query)(".ft-tooltip--content")],D.prototype,"tooltipContent",void 0);fe([(0,se.state)()],D.prototype,"visible",void 0);var il=v(T());var nl={"ft-tooltip":D};(0,il.customElements)(nl);var Qr=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},oe=class e extends Br(sr){constructor(){super(),this.name="",this.bookmarks=[],this.remainingTocIdsInBookmarks=[],this.addStore(I),this.addI18nContext(Jt,Aa)}get bookmarksTocIds(){return this.bookmarks.map(t=>t.tocId)}static flattenTocNode(t){let r=[t.tocId];for(let n of t.children)r.push(...this.flattenTocNode(n));return r}static bookmarksFromMap(t,r){var n,i;return(i=(n=t.bookmarks)===null||n===void 0?void 0:n.filter(s=>s.mapId===r.mapId).sort((s,o)=>s.title.localeCompare(o.title)))!==null&&i!==void 0?i:[]}static filterRemainingTocIdsInBookmarks(t,r){var n;return(n=t.toc)===null||n===void 0?void 0:n.map(i=>e.flattenTocNode(i)).flat().filter(i=>r.bookmarksTocIds.indexOf(i)>=0)}render(){return Jr.html`
|
|
374
374
|
<div part="container" class="ft-reader-saved-bookmarks">
|
|
375
375
|
<span id="context" class="sr-only">${Jt.messages.bookmarks()}</span>
|
|
376
376
|
<span id="missing-context" class="sr-only">${Jt.messages.bookmarkMissingFromToc()}</span>
|