help-layer 1.0.1 → 1.2.0
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.
- package/README.ja.md +141 -8
- package/README.md +150 -8
- package/dist/help-layer.esm.js +7 -5
- package/dist/help-layer.esm.js.map +4 -4
- package/dist/help-layer.iife.js +6 -4
- package/dist/help-layer.iife.js.map +4 -4
- package/dist/types/aria-isolation.d.ts +10 -0
- package/dist/types/floating.d.ts +21 -1
- package/dist/types/markers.d.ts +4 -1
- package/package.json +11 -5
- package/src/aria-isolation.js +67 -0
- package/src/dom-builder.js +12 -3
- package/src/floating.js +89 -1
- package/src/markers.js +14 -2
- package/src/style.js +3 -1
- package/src/toggle.js +19 -1
package/dist/help-layer.iife.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var HelpLayer=(()=>{var wt=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var He=(t,e)=>{for(var n in e)wt(t,n,{get:e[n],enumerable:!0})},We=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fe(e))!Be.call(t,i)&&i!==n&&wt(t,i,{get:()=>e[i],enumerable:!(o=Ne(e,i))||o.enumerable});return t};var Ie=t=>We(wt({},"__esModule",{value:!0}),t);var En={};He(En,{initHelpLayer:()=>An});var _t="help-layer-popup-title";function Nt(){let t=document.createElement("div");return t.className="help-layer-blocking-layer",t}function Ft(t,e="?"){let n=document.createElement("button");return n.type="button",n.className="help-layer-marker",n.textContent=e,n.setAttribute("aria-label",`Help: ${t}`),n}function Bt(){let t=document.createElement("div");t.className="help-layer-popup",t.setAttribute("role","dialog"),t.setAttribute("aria-labelledby",_t),t.tabIndex=-1;let e=document.createElement("div");e.className="help-layer-popup__title",e.id=_t;let n=document.createElement("div");n.className="help-layer-popup__text";let o=document.createElement("button");return o.type="button",o.className="help-layer-popup__close",o.textContent="\xD7",o.setAttribute("aria-label","Close"),t.append(e,n,o),{root:t,titleEl:e,textEl:n,closeEl:o}}var U=Math.min,F=Math.max,et=Math.round,nt=Math.floor,P=t=>({x:t,y:t}),ze={left:"right",right:"left",bottom:"top",top:"bottom"};function vt(t,e,n){return F(t,U(e,n))}function ot(t,e){return typeof t=="function"?t(e):t}function z(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function bt(t){return t==="x"?"y":"x"}function At(t){return t==="y"?"height":"width"}function B(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function Et(t){return bt(B(t))}function It(t,e,n){n===void 0&&(n=!1);let o=it(t),i=Et(t),r=At(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=tt(s)),[s,tt(s)]}function zt(t){let e=tt(t);return[ut(t),e,ut(e)]}function ut(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Ht=["left","right"],Wt=["right","left"],Ve=["top","bottom"],je=["bottom","top"];function Ke(t,e,n){switch(t){case"top":case"bottom":return n?e?Wt:Ht:e?Ht:Wt;case"left":case"right":return e?Ve:je;default:return[]}}function Vt(t,e,n,o){let i=it(t),r=Ke(z(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(ut)))),r}function tt(t){let e=z(t);return ze[e]+t.slice(e.length)}function Xe(t){return{top:0,right:0,bottom:0,left:0,...t}}function jt(t){return typeof t!="number"?Xe(t):{top:t,right:t,bottom:t,left:t}}function V(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Kt(t,e,n){let{reference:o,floating:i}=t,r=B(e),s=Et(e),l=At(s),a=z(e),u=r==="y",p=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,g=o[l]/2-i[l]/2,c;switch(a){case"top":c={x:p,y:o.y-i.height};break;case"bottom":c={x:p,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:f};break;case"left":c={x:o.x-i.width,y:f};break;default:c={x:o.x,y:o.y}}switch(it(e)){case"start":c[s]-=g*(n&&u?-1:1);break;case"end":c[s]+=g*(n&&u?-1:1);break}return c}async function Xt(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:c=0}=ot(e,t),d=jt(c),h=l[g?f==="floating"?"reference":"floating":f],m=V(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(h)))==null||n?h:h.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:p,strategy:a})),x=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),v=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},A=V(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:a}):x);return{top:(m.top-A.top+d.top)/v.y,bottom:(A.bottom-m.bottom+d.bottom)/v.y,left:(m.left-A.left+d.left)/v.x,right:(A.right-m.right+d.right)/v.x}}var Ye=50,Yt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:Xt},a=await(s.isRTL==null?void 0:s.isRTL(e)),u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:f}=Kt(u,o,a),g=o,c=0,d={};for(let y=0;y<r.length;y++){let h=r[y];if(!h)continue;let{name:m,fn:x}=h,{x:w,y:v,data:A,reset:E}=await x({x:p,y:f,initialPlacement:o,placement:g,strategy:i,middlewareData:d,rects:u,platform:l,elements:{reference:t,floating:e}});p=w??p,f=v??f,d[m]={...d[m],...A},E&&c<Ye&&(c++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:p,y:f}=Kt(u,g,a)),y=-1)}return{x:p,y:f,placement:g,strategy:i,middlewareData:d}};var qt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:u}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:y=!0,...h}=ot(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let m=z(i),x=B(l),w=z(l)===l,v=await(a.isRTL==null?void 0:a.isRTL(u.floating)),A=g||(w||!y?[tt(l)]:zt(l)),E=d!=="none";!g&&E&&A.push(...Vt(l,y,d,v));let M=[l,...A],Q=await a.detectOverflow(e,h),q=[],W=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&q.push(Q[m]),f){let N=It(i,s,v);q.push(Q[N[0]],Q[N[1]])}if(W=[...W,{placement:i,overflows:q}],!q.every(N=>N<=0)){var $,L;let N=((($=r.flip)==null?void 0:$.index)||0)+1,ft=M[N];if(ft&&(!(f==="alignment"?x!==B(ft):!1)||W.every(S=>B(S.placement)===x?S.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:ft}};let b=(L=W.filter(O=>O.overflows[0]<=0).sort((O,S)=>O.overflows[1]-S.overflows[1])[0])==null?void 0:L.placement;if(!b)switch(c){case"bestFit":{var at;let O=(at=W.filter(S=>{if(E){let I=B(S.placement);return I===x||I==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(I=>I>0).reduce((I,_e)=>I+_e,0)]).sort((S,I)=>S[1]-I[1])[0])==null?void 0:at[0];O&&(b=O);break}case"initialPlacement":b=l;break}if(i!==b)return{reset:{placement:b}}}return{}}}};var qe=new Set(["left","top"]);async function Ue(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=z(n),l=it(n),a=B(n)==="y",u=qe.has(s)?-1:1,p=r&&a?-1:1,f=ot(e,t),{mainAxis:g,crossAxis:c,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof d=="number"&&(c=l==="end"?d*-1:d),a?{x:c*p,y:g*u}:{x:g*u,y:c*p}}var Ut=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await Ue(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Zt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:m=>{let{x,y:w}=m;return{x,y:w}}},...u}=ot(t,e),p={x:n,y:o},f=await r.detectOverflow(e,u),g=B(z(i)),c=bt(g),d=p[c],y=p[g];if(s){let m=c==="y"?"top":"left",x=c==="y"?"bottom":"right",w=d+f[m],v=d-f[x];d=vt(w,d,v)}if(l){let m=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=y+f[m],v=y-f[x];y=vt(w,y,v)}let h=a.fn({...e,[c]:d,[g]:y});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[c]:s,[g]:l}}}}}};function pt(){return typeof window<"u"}function K(t){return Jt(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function T(t){var e;return(e=(Jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Jt(t){return pt()?t instanceof Node||t instanceof k(t).Node:!1}function C(t){return pt()?t instanceof Element||t instanceof k(t).Element:!1}function _(t){return pt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function Gt(t){return!pt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function G(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Qt(t){return/^(table|td|th)$/.test(K(t))}function rt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Ze=/transform|translate|scale|rotate|perspective|filter/,Ge=/paint|layout|strict|content/,j=t=>!!t&&t!=="none",kt;function dt(t){let e=C(t)?R(t):t;return j(e.transform)||j(e.translate)||j(e.scale)||j(e.rotate)||j(e.perspective)||!mt()&&(j(e.backdropFilter)||j(e.filter))||Ze.test(e.willChange||"")||Ge.test(e.contain||"")}function te(t){let e=H(t);for(;_(e)&&!X(e);){if(dt(e))return e;if(rt(e))return null;e=H(e)}return null}function mt(){return kt==null&&(kt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kt}function X(t){return/^(html|body|#document)$/.test(K(t))}function R(t){return k(t).getComputedStyle(t)}function st(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function H(t){if(K(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Gt(t)&&t.host||T(t);return Gt(e)?e.host:e}function ee(t){let e=H(t);return X(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&G(e)?e:ee(e)}function Z(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=ee(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=k(i);if(r){let l=ht(s);return e.concat(s,s.visualViewport||[],G(i)?i:[],l&&n?Z(l):[])}else return e.concat(i,Z(i,[],n))}function ht(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function re(t){let e=R(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=_(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=et(n)!==r||et(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Ct(t){return C(t)?t:t.contextElement}function J(t){let e=Ct(t);if(!_(e))return P(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=re(e),s=(r?et(n.width):n.width)/o,l=(r?et(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Je=P(0);function se(t){let e=k(t);return!mt()||!e.visualViewport?Je:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Qe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==k(t)?!1:e}function Y(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Ct(t),s=P(1);e&&(o?C(o)&&(s=J(o)):s=J(t));let l=Qe(r,n,o)?se(r):P(0),a=(i.left+l.x)/s.x,u=(i.top+l.y)/s.y,p=i.width/s.x,f=i.height/s.y;if(r){let g=k(r),c=o&&C(o)?k(o):o,d=g,y=ht(d);for(;y&&o&&c!==d;){let h=J(y),m=y.getBoundingClientRect(),x=R(y),w=m.left+(y.clientLeft+parseFloat(x.paddingLeft))*h.x,v=m.top+(y.clientTop+parseFloat(x.paddingTop))*h.y;a*=h.x,u*=h.y,p*=h.x,f*=h.y,a+=w,u+=v,d=k(y),y=ht(d)}}return V({width:p,height:f,x:a,y:u})}function gt(t,e){let n=st(t).scrollLeft;return e?e.left+n:Y(T(t)).left+n}function le(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-gt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function tn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=T(o),l=e?rt(e.floating):!1;if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},u=P(1),p=P(0),f=_(o);if((f||!f&&!r)&&((K(o)!=="body"||G(s))&&(a=st(o)),f)){let c=Y(o);u=J(o),p.x=c.x+o.clientLeft,p.y=c.y+o.clientTop}let g=s&&!f&&!r?le(s,a):P(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+p.x+g.x,y:n.y*u.y-a.scrollTop*u.y+p.y+g.y}}function en(t){return Array.from(t.getClientRects())}function nn(t){let e=T(t),n=st(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+gt(t),l=-n.scrollTop;return R(o).direction==="rtl"&&(s+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}var ne=25;function on(t,e){let n=k(t),o=T(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let p=mt();(!p||p&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}let u=gt(o);if(u<=0){let p=o.ownerDocument,f=p.body,g=getComputedStyle(f),c=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,d=Math.abs(o.clientWidth-f.clientWidth-c);d<=ne&&(r-=d)}else u<=ne&&(r+=u);return{width:r,height:s,x:l,y:a}}function rn(t,e){let n=Y(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=_(t)?J(t):P(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,u=o*r.y;return{width:s,height:l,x:a,y:u}}function oe(t,e,n){let o;if(e==="viewport")o=on(t,n);else if(e==="document")o=nn(T(t));else if(C(e))o=rn(e,n);else{let i=se(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return V(o)}function ce(t,e){let n=H(t);return n===e||!C(n)||X(n)?!1:R(n).position==="fixed"||ce(n,e)}function sn(t,e){let n=e.get(t);if(n)return n;let o=Z(t,[],!1).filter(l=>C(l)&&K(l)!=="body"),i=null,r=R(t).position==="fixed",s=r?H(t):t;for(;C(s)&&!X(s);){let l=R(s),a=dt(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||G(s)&&!a&&ce(t,s))?o=o.filter(p=>p!==s):i=l,s=H(s)}return e.set(t,o),o}function ln(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?rt(e)?[]:sn(e,this._c):[].concat(n),o],l=oe(e,s[0],i),a=l.top,u=l.right,p=l.bottom,f=l.left;for(let g=1;g<s.length;g++){let c=oe(e,s[g],i);a=F(c.top,a),u=U(c.right,u),p=U(c.bottom,p),f=F(c.left,f)}return{width:u-f,height:p-a,x:f,y:a}}function cn(t){let{width:e,height:n}=re(t);return{width:e,height:n}}function an(t,e,n){let o=_(e),i=T(e),r=n==="fixed",s=Y(t,!0,r,e),l={scrollLeft:0,scrollTop:0},a=P(0);function u(){a.x=gt(i)}if(o||!o&&!r)if((K(e)!=="body"||G(i))&&(l=st(e)),o){let c=Y(e,!0,r,e);a.x=c.x+e.clientLeft,a.y=c.y+e.clientTop}else i&&u();r&&!o&&i&&u();let p=i&&!o&&!r?le(i,l):P(0),f=s.left+l.scrollLeft-a.x-p.x,g=s.top+l.scrollTop-a.y-p.y;return{x:f,y:g,width:s.width,height:s.height}}function Ot(t){return R(t).position==="static"}function ie(t,e){if(!_(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return T(t)===n&&(n=n.ownerDocument.body),n}function ae(t,e){let n=k(t);if(rt(t))return n;if(!_(t)){let i=H(t);for(;i&&!X(i);){if(C(i)&&!Ot(i))return i;i=H(i)}return n}let o=ie(t,e);for(;o&&Qt(o)&&Ot(o);)o=ie(o,e);return o&&X(o)&&Ot(o)&&!dt(o)?n:o||te(t)||n}var fn=async function(t){let e=this.getOffsetParent||ae,n=this.getDimensions,o=await n(t.floating);return{reference:an(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function un(t){return R(t).direction==="rtl"}var pn={convertOffsetParentRelativeRectToViewportRelativeRect:tn,getDocumentElement:T,getClippingRect:ln,getOffsetParent:ae,getElementRects:fn,getClientRects:en,getDimensions:cn,getScale:J,isElement:C,isRTL:un};function fe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function dn(t,e){let n=null,o,i=T(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();let u=t.getBoundingClientRect(),{left:p,top:f,width:g,height:c}=u;if(l||e(),!g||!c)return;let d=nt(f),y=nt(i.clientWidth-(p+g)),h=nt(i.clientHeight-(f+c)),m=nt(p),w={rootMargin:-d+"px "+-y+"px "+-h+"px "+-m+"px",threshold:F(0,U(1,a))||1},v=!0;function A(E){let M=E[0].intersectionRatio;if(M!==a){if(!v)return s();M?s(!1,M):o=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!fe(u,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(A,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return s(!0),r}function yt(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=Ct(t),p=i||r?[...u?Z(u):[],...e?Z(e):[]]:[];p.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),r&&m.addEventListener("resize",n)});let f=u&&l?dn(u,n):null,g=-1,c=null;s&&(c=new ResizeObserver(m=>{let[x]=m;x&&x.target===u&&c&&e&&(c.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=c)==null||w.observe(e)})),n()}),u&&!a&&c.observe(u),e&&c.observe(e));let d,y=a?Y(t):null;a&&h();function h(){let m=Y(t);y&&!fe(y,m)&&n(),y=m,d=requestAnimationFrame(h)}return n(),()=>{var m;p.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),f?.(),(m=c)==null||m.disconnect(),c=null,a&&cancelAnimationFrame(d)}}var Rt=Ut;var ue=Zt,pe=qt;var Lt=(t,e,n)=>{let o=new Map,i={platform:pn,...n},r={...i.platform,_c:o};return Yt(t,e,{...i,platform:r})};function de(t,e){let n=t.width||0,o=t.height||0,i=t.left-e.x,r=t.top-e.y;return{x:i,y:r,left:i,top:r,right:i+n,bottom:r+o,width:n,height:o}}function me(t){return{contextElement:document.body,getBoundingClientRect(){return de(t(),{x:window.scrollX,y:window.scrollY})}}}function he(t,e,n){t.style.left=`${e}px`,t.style.top=`${n}px`}var St=11;function mn(t){let e=t.endsWith("-start");return{mainAxis:-St,crossAxis:e?St:-St}}function ge(t,e,n,o="top-end"){return yt(t,e,()=>{Lt(t,e,{placement:o,middleware:[Rt(mn(o))]}).then(({x:r,y:s})=>{he(e,r,s),n&&n()}).catch(()=>{})},{animationFrame:!0})}function ye(t,e,n="bottom-start"){let o=()=>{Lt(t,e,{placement:n,middleware:[Rt(8),pe({padding:8}),ue({padding:8})]}).then(({x:r,y:s})=>{he(e,r,s)}).catch(()=>{})},i=yt(t,e,o,{animationFrame:!0});return{update:o,cleanup:i}}function xe(t,e,n){return yt(t,e,n)}function hn(t){let e=t.left,n=t.top,o=t.right,i=t.bottom;return`polygon(
|
|
1
|
+
var HelpLayer=(()=>{var wt=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var We=(t,e)=>{for(var n in e)wt(t,n,{get:e[n],enumerable:!0})},Ie=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Be(e))!He.call(t,i)&&i!==n&&wt(t,i,{get:()=>e[i],enumerable:!(o=Fe(e,i))||o.enumerable});return t};var Ve=t=>Ie(wt({},"__esModule",{value:!0}),t);var Rn={};We(Rn,{initHelpLayer:()=>On});function Nt(t,{toggleEl:e,isLibraryNode:n}){let o=new Set;function i(r){if(r.nodeType!==1)return;let l=r;n(l)||e&&(l===e||l.contains(e))||l.hasAttribute("inert")||(l.toggleAttribute("inert",!0),o.add(l))}for(let r of[...document.body.children])i(r);let s=new MutationObserver(r=>{for(let l of r)l.addedNodes.forEach(i)});s.observe(document.body,{childList:!0}),t.track(()=>{s.disconnect(),o.forEach(r=>r.removeAttribute("inert")),o.clear()})}var ze=0;function _t(){let t=document.createElement("div");return t.className="help-layer-blocking-layer",t}function Ft(t,e="?"){let n=document.createElement("button");return n.type="button",n.className="help-layer-marker",n.textContent=e,n.setAttribute("aria-label",`Help: ${t}`),n}function Bt(){let t=`help-layer-popup-title-${ze++}`,e=document.createElement("div");e.className="help-layer-popup",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-labelledby",t),e.tabIndex=-1;let n=document.createElement("div");n.className="help-layer-popup__title",n.id=t;let o=document.createElement("div");o.className="help-layer-popup__text";let i=document.createElement("button");return i.type="button",i.className="help-layer-popup__close",i.textContent="\xD7",i.setAttribute("aria-label","Close"),e.append(n,o,i),{root:e,titleEl:n,textEl:o,closeEl:i}}var U=Math.min,_=Math.max,et=Math.round,nt=Math.floor,S=t=>({x:t,y:t}),je={left:"right",right:"left",bottom:"top",top:"bottom"};function vt(t,e,n){return _(t,U(e,n))}function ot(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function bt(t){return t==="x"?"y":"x"}function At(t){return t==="y"?"height":"width"}function F(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function Et(t){return bt(F(t))}function It(t,e,n){n===void 0&&(n=!1);let o=it(t),i=Et(t),s=At(i),r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=tt(r)),[r,tt(r)]}function Vt(t){let e=tt(t);return[ut(t),e,ut(e)]}function ut(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Ht=["left","right"],Wt=["right","left"],Ke=["top","bottom"],Xe=["bottom","top"];function Ye(t,e,n){switch(t){case"top":case"bottom":return n?e?Wt:Ht:e?Ht:Wt;case"left":case"right":return e?Ke:Xe;default:return[]}}function zt(t,e,n,o){let i=it(t),s=Ye(I(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ut)))),s}function tt(t){let e=I(t);return je[e]+t.slice(e.length)}function qe(t){return{top:0,right:0,bottom:0,left:0,...t}}function jt(t){return typeof t!="number"?qe(t):{top:t,right:t,bottom:t,left:t}}function z(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Kt(t,e,n){let{reference:o,floating:i}=t,s=F(e),r=Et(e),l=At(r),c=I(e),f=s==="y",m=o.x+o.width/2-i.width/2,a=o.y+o.height/2-i.height/2,y=o[l]/2-i[l]/2,h;switch(c){case"top":h={x:m,y:o.y-i.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:a};break;case"left":h={x:o.x-i.width,y:a};break;default:h={x:o.x,y:o.y}}switch(it(e)){case"start":h[r]-=y*(n&&f?-1:1);break;case"end":h[r]+=y*(n&&f?-1:1);break}return h}async function Xt(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:s,rects:r,elements:l,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:a="floating",altBoundary:y=!1,padding:h=0}=ot(e,t),u=jt(h),g=l[y?a==="floating"?"reference":"floating":a],d=z(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:c})),x=a==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),b=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=z(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(d.top-E.top+u.top)/b.y,bottom:(E.bottom-d.bottom+u.bottom)/b.y,left:(d.left-E.left+u.left)/b.x,right:(E.right-d.right+u.right)/b.x}}var Ue=50,Yt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=r.detectOverflow?r:{...r,detectOverflow:Xt},c=await(r.isRTL==null?void 0:r.isRTL(e)),f=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:a}=Kt(f,o,c),y=o,h=0,u={};for(let p=0;p<s.length;p++){let g=s[p];if(!g)continue;let{name:d,fn:x}=g,{x:w,y:b,data:E,reset:A}=await x({x:m,y:a,initialPlacement:o,placement:y,strategy:i,middlewareData:u,rects:f,platform:l,elements:{reference:t,floating:e}});m=w??m,a=b??a,u[d]={...u[d],...E},A&&h<Ue&&(h++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(f=A.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:m,y:a}=Kt(f,y,c)),p=-1)}return{x:m,y:a,placement:y,strategy:i,middlewareData:u}};var qt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:c,elements:f}=e,{mainAxis:m=!0,crossAxis:a=!0,fallbackPlacements:y,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:p=!0,...g}=ot(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let d=I(i),x=F(l),w=I(l)===l,b=await(c.isRTL==null?void 0:c.isRTL(f.floating)),E=y||(w||!p?[tt(l)]:Vt(l)),A=u!=="none";!y&&A&&E.push(...zt(l,p,u,b));let D=[l,...E],Q=await c.detectOverflow(e,g),q=[],H=((o=s.flip)==null?void 0:o.overflows)||[];if(m&&q.push(Q[d]),a){let N=It(i,r,b);q.push(Q[N[0]],Q[N[1]])}if(H=[...H,{placement:i,overflows:q}],!q.every(N=>N<=0)){var M,L;let N=(((M=s.flip)==null?void 0:M.index)||0)+1,ft=D[N];if(ft&&(!(a==="alignment"?x!==F(ft):!1)||H.every(v=>F(v.placement)===x?v.overflows[0]>0:!0)))return{data:{index:N,overflows:H},reset:{placement:ft}};let V=(L=H.filter(W=>W.overflows[0]<=0).sort((W,v)=>W.overflows[1]-v.overflows[1])[0])==null?void 0:L.placement;if(!V)switch(h){case"bestFit":{var at;let W=(at=H.filter(v=>{if(A){let k=F(v.placement);return k===x||k==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(k=>k>0).reduce((k,_e)=>k+_e,0)]).sort((v,k)=>v[1]-k[1])[0])==null?void 0:at[0];W&&(V=W);break}case"initialPlacement":V=l;break}if(i!==V)return{reset:{placement:V}}}return{}}}};var Ze=new Set(["left","top"]);async function Ge(t,e){let{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=I(n),l=it(n),c=F(n)==="y",f=Ze.has(r)?-1:1,m=s&&c?-1:1,a=ot(e,t),{mainAxis:y,crossAxis:h,alignmentAxis:u}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return l&&typeof u=="number"&&(h=l==="end"?u*-1:u),c?{x:h*m,y:y*f}:{x:y*f,y:h*m}}var Ut=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:s,placement:r,middlewareData:l}=e,c=await Ge(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:r}}}}},Zt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:c={fn:d=>{let{x,y:w}=d;return{x,y:w}}},...f}=ot(t,e),m={x:n,y:o},a=await s.detectOverflow(e,f),y=F(I(i)),h=bt(y),u=m[h],p=m[y];if(r){let d=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=u+a[d],b=u-a[x];u=vt(w,u,b)}if(l){let d=y==="y"?"top":"left",x=y==="y"?"bottom":"right",w=p+a[d],b=p-a[x];p=vt(w,p,b)}let g=c.fn({...e,[h]:u,[y]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:r,[y]:l}}}}}};function pt(){return typeof window<"u"}function K(t){return Jt(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function P(t){var e;return(e=(Jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Jt(t){return pt()?t instanceof Node||t instanceof O(t).Node:!1}function R(t){return pt()?t instanceof Element||t instanceof O(t).Element:!1}function $(t){return pt()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function Gt(t){return!pt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function G(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Qt(t){return/^(table|td|th)$/.test(K(t))}function rt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Je=/transform|translate|scale|rotate|perspective|filter/,Qe=/paint|layout|strict|content/,j=t=>!!t&&t!=="none",kt;function dt(t){let e=R(t)?C(t):t;return j(e.transform)||j(e.translate)||j(e.scale)||j(e.rotate)||j(e.perspective)||!mt()&&(j(e.backdropFilter)||j(e.filter))||Je.test(e.willChange||"")||Qe.test(e.contain||"")}function te(t){let e=B(t);for(;$(e)&&!X(e);){if(dt(e))return e;if(rt(e))return null;e=B(e)}return null}function mt(){return kt==null&&(kt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kt}function X(t){return/^(html|body|#document)$/.test(K(t))}function C(t){return O(t).getComputedStyle(t)}function st(t){return R(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(K(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Gt(t)&&t.host||P(t);return Gt(e)?e.host:e}function ee(t){let e=B(t);return X(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&G(e)?e:ee(e)}function Z(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=ee(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(s){let l=ht(r);return e.concat(r,r.visualViewport||[],G(i)?i:[],l&&n?Z(l):[])}else return e.concat(i,Z(i,[],n))}function ht(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function re(t){let e=C(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=$(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,l=et(n)!==s||et(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function Rt(t){return R(t)?t:t.contextElement}function J(t){let e=Rt(t);if(!$(e))return S(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:s}=re(e),r=(s?et(n.width):n.width)/o,l=(s?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var tn=S(0);function se(t){let e=O(t);return!mt()||!e.visualViewport?tn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function en(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function Y(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),s=Rt(t),r=S(1);e&&(o?R(o)&&(r=J(o)):r=J(t));let l=en(s,n,o)?se(s):S(0),c=(i.left+l.x)/r.x,f=(i.top+l.y)/r.y,m=i.width/r.x,a=i.height/r.y;if(s){let y=O(s),h=o&&R(o)?O(o):o,u=y,p=ht(u);for(;p&&o&&h!==u;){let g=J(p),d=p.getBoundingClientRect(),x=C(p),w=d.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,b=d.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;c*=g.x,f*=g.y,m*=g.x,a*=g.y,c+=w,f+=b,u=O(p),p=ht(u)}}return z({width:m,height:a,x:c,y:f})}function gt(t,e){let n=st(t).scrollLeft;return e?e.left+n:Y(P(t)).left+n}function le(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-gt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function nn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,s=i==="fixed",r=P(o),l=e?rt(e.floating):!1;if(o===r||l&&s)return n;let c={scrollLeft:0,scrollTop:0},f=S(1),m=S(0),a=$(o);if((a||!a&&!s)&&((K(o)!=="body"||G(r))&&(c=st(o)),a)){let h=Y(o);f=J(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}let y=r&&!a&&!s?le(r,c):S(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+m.x+y.x,y:n.y*f.y-c.scrollTop*f.y+m.y+y.y}}function on(t){return Array.from(t.getClientRects())}function rn(t){let e=P(t),n=st(t),o=t.ownerDocument.body,i=_(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=_(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),r=-n.scrollLeft+gt(t),l=-n.scrollTop;return C(o).direction==="rtl"&&(r+=_(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}var ne=25;function sn(t,e){let n=O(t),o=P(t),i=n.visualViewport,s=o.clientWidth,r=o.clientHeight,l=0,c=0;if(i){s=i.width,r=i.height;let m=mt();(!m||m&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}let f=gt(o);if(f<=0){let m=o.ownerDocument,a=m.body,y=getComputedStyle(a),h=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,u=Math.abs(o.clientWidth-a.clientWidth-h);u<=ne&&(s-=u)}else f<=ne&&(s+=f);return{width:s,height:r,x:l,y:c}}function ln(t,e){let n=Y(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=$(t)?J(t):S(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,c=i*s.x,f=o*s.y;return{width:r,height:l,x:c,y:f}}function oe(t,e,n){let o;if(e==="viewport")o=sn(t,n);else if(e==="document")o=rn(P(t));else if(R(e))o=ln(e,n);else{let i=se(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return z(o)}function ce(t,e){let n=B(t);return n===e||!R(n)||X(n)?!1:C(n).position==="fixed"||ce(n,e)}function cn(t,e){let n=e.get(t);if(n)return n;let o=Z(t,[],!1).filter(l=>R(l)&&K(l)!=="body"),i=null,s=C(t).position==="fixed",r=s?B(t):t;for(;R(r)&&!X(r);){let l=C(r),c=dt(r);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||G(r)&&!c&&ce(t,r))?o=o.filter(m=>m!==r):i=l,r=B(r)}return e.set(t,o),o}function an(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,r=[...n==="clippingAncestors"?rt(e)?[]:cn(e,this._c):[].concat(n),o],l=oe(e,r[0],i),c=l.top,f=l.right,m=l.bottom,a=l.left;for(let y=1;y<r.length;y++){let h=oe(e,r[y],i);c=_(h.top,c),f=U(h.right,f),m=U(h.bottom,m),a=_(h.left,a)}return{width:f-a,height:m-c,x:a,y:c}}function fn(t){let{width:e,height:n}=re(t);return{width:e,height:n}}function un(t,e,n){let o=$(e),i=P(e),s=n==="fixed",r=Y(t,!0,s,e),l={scrollLeft:0,scrollTop:0},c=S(0);function f(){c.x=gt(i)}if(o||!o&&!s)if((K(e)!=="body"||G(i))&&(l=st(e)),o){let h=Y(e,!0,s,e);c.x=h.x+e.clientLeft,c.y=h.y+e.clientTop}else i&&f();s&&!o&&i&&f();let m=i&&!o&&!s?le(i,l):S(0),a=r.left+l.scrollLeft-c.x-m.x,y=r.top+l.scrollTop-c.y-m.y;return{x:a,y,width:r.width,height:r.height}}function Ot(t){return C(t).position==="static"}function ie(t,e){if(!$(t)||C(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return P(t)===n&&(n=n.ownerDocument.body),n}function ae(t,e){let n=O(t);if(rt(t))return n;if(!$(t)){let i=B(t);for(;i&&!X(i);){if(R(i)&&!Ot(i))return i;i=B(i)}return n}let o=ie(t,e);for(;o&&Qt(o)&&Ot(o);)o=ie(o,e);return o&&X(o)&&Ot(o)&&!dt(o)?n:o||te(t)||n}var pn=async function(t){let e=this.getOffsetParent||ae,n=this.getDimensions,o=await n(t.floating);return{reference:un(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function dn(t){return C(t).direction==="rtl"}var mn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:P,getClippingRect:an,getOffsetParent:ae,getElementRects:pn,getClientRects:on,getDimensions:fn,getScale:J,isElement:R,isRTL:dn};function fe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function hn(t,e){let n=null,o,i=P(t);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function r(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();let f=t.getBoundingClientRect(),{left:m,top:a,width:y,height:h}=f;if(l||e(),!y||!h)return;let u=nt(a),p=nt(i.clientWidth-(m+y)),g=nt(i.clientHeight-(a+h)),d=nt(m),w={rootMargin:-u+"px "+-p+"px "+-g+"px "+-d+"px",threshold:_(0,U(1,c))||1},b=!0;function E(A){let D=A[0].intersectionRatio;if(D!==c){if(!b)return r();D?r(!1,D):o=setTimeout(()=>{r(!1,1e-7)},1e3)}D===1&&!fe(f,t.getBoundingClientRect())&&r(),b=!1}try{n=new IntersectionObserver(E,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(t)}return r(!0),s}function yt(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=Rt(t),m=i||s?[...f?Z(f):[],...e?Z(e):[]]:[];m.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),s&&d.addEventListener("resize",n)});let a=f&&l?hn(f,n):null,y=-1,h=null;r&&(h=new ResizeObserver(d=>{let[x]=d;x&&x.target===f&&h&&e&&(h.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),f&&!c&&h.observe(f),e&&h.observe(e));let u,p=c?Y(t):null;c&&g();function g(){let d=Y(t);p&&!fe(p,d)&&n(),p=d,u=requestAnimationFrame(g)}return n(),()=>{var d;m.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),a?.(),(d=h)==null||d.disconnect(),h=null,c&&cancelAnimationFrame(u)}}var Ct=Ut;var ue=Zt,pe=qt;var Lt=(t,e,n)=>{let o=new Map,i={platform:mn,...n},s={...i.platform,_c:o};return Yt(t,e,{...i,platform:s})};function de(t,e){let n=t.width||0,o=t.height||0,i=t.left-e.x,s=t.top-e.y;return{x:i,y:s,left:i,top:s,right:i+n,bottom:s+o,width:n,height:o}}function me(t){return{contextElement:document.body,getBoundingClientRect(){return de(t(),{x:window.scrollX,y:window.scrollY})}}}function he(t,e,n){t.style.left=`${e}px`,t.style.top=`${n}px`}function ge(t){if(!(t instanceof Element))return!1;let e=t;for(;e;){if(getComputedStyle(e).position==="fixed")return!0;let n=e.parentElement;if(n)e=n;else{let o=e.getRootNode();e=o instanceof ShadowRoot?o.host:null}}return!1}function gn(t){if(!(t instanceof Element))return!1;if(typeof t.checkVisibility=="function")return!t.checkVisibility({visibilityProperty:!0,contentVisibilityAuto:!0});let e=t.getBoundingClientRect();return e.width===0&&e.height===0}var St=11;function yn(t){let e=t.endsWith("-start");return{mainAxis:-St,crossAxis:e?St:-St}}function ye(t,e,n,o="top-end",i){let s=ge(t)?"fixed":"absolute";s==="fixed"&&e.style.setProperty("position","fixed","important");let r=!1;return yt(t,e,()=>{if(gn(t)){e.style.setProperty("display","none","important"),!r&&i&&i(),r=!0,n&&n();return}r=!1,e.style.removeProperty("display"),Lt(t,e,{placement:o,strategy:s,middleware:[Ct(yn(o))]}).then(({x:c,y:f})=>{he(e,c,f),n&&n()}).catch(()=>{})},{animationFrame:!0})}function xe(t,e,n="bottom-start"){let o=ge(t)?"fixed":"absolute";e.style.setProperty("position",o,"important");let i=()=>{Lt(t,e,{placement:n,strategy:o,middleware:[Ct(8),pe({padding:8}),ue({padding:8})]}).then(({x:r,y:l})=>{he(e,r,l)}).catch(()=>{})},s=yt(t,e,i,{animationFrame:!0});return{update:i,cleanup:s}}function we(t,e,n){return yt(t,e,n)}function xn(t){let e=t.left,n=t.top,o=t.right,i=t.bottom;return`polygon(
|
|
2
2
|
0px 0px, 100% 0px, 100% 100%, 0px 100%, 0px 0px,
|
|
3
3
|
${e}px ${n}px, ${e}px ${i}px, ${o}px ${i}px, ${o}px ${n}px, ${e}px ${n}px
|
|
4
|
-
)`}function
|
|
4
|
+
)`}function ve(t,{toggleEl:e,onBackgroundClick:n,isLibraryElement:o,onEscape:i}){let s=_t();if(document.body.appendChild(s),t.track(()=>s.remove()),e){let y=we(e,s,()=>{s.style.clipPath=xn(e.getBoundingClientRect())});t.track(y)}n&&(s.addEventListener("click",n),t.track(()=>s.removeEventListener("click",n)));let r=document.activeElement;r instanceof HTMLElement&&r!==document.body&&r!==e&&r.blur();let l=a=>{o(a.target)||(a.stopPropagation(),e?e.focus({preventScroll:!0}):a.target instanceof HTMLElement&&a.target.blur())};document.addEventListener("focusin",l,!0),t.track(()=>document.removeEventListener("focusin",l,!0));let c=a=>{o(a.target)||(a.stopPropagation(),a.preventDefault())},f=a=>{if(a.key==="Escape"){a.stopPropagation(),a.preventDefault();return}c(a)},m=a=>{if(a.key==="Escape"){a.stopPropagation(),a.preventDefault(),i&&i();return}c(a)};return document.addEventListener("keydown",m,!0),document.addEventListener("keyup",f,!0),document.addEventListener("keypress",f,!0),t.track(()=>{document.removeEventListener("keydown",m,!0),document.removeEventListener("keyup",f,!0),document.removeEventListener("keypress",f,!0)}),s}function lt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function be(t){return lt(t)&&Number.isFinite(t.top)&&Number.isFinite(t.left)}function Pt(t){if(!lt(t))throw new Error("helpConfig must be a plain object");for(let[e,n]of Object.entries(t)){if(!lt(n))throw new Error(`helpConfig["${e}"] must be an object`);if(typeof n.title!="string"||n.title==="")throw new Error(`helpConfig["${e}"].title must be a non-empty string`);if(typeof n.text!="string"||n.text==="")throw new Error(`helpConfig["${e}"].text must be a non-empty string`);if(n.position!==void 0&&!be(n.position))throw new Error(`helpConfig["${e}"].position must be { top: finite number, left: finite number }`)}}function Ae(t){return Object.entries(t).map(([e,n])=>be(n.position)?{key:e,title:n.title,text:n.text,kind:"free",target:null,position:{top:n.position.top,left:n.position.left}}:{key:e,title:n.title,text:n.text,kind:"element",target:null,position:null})}function Ee(t,e={}){let n=e.minDistance??26,o=e.iterations??6,i=t.map(s=>({x:s.x,y:s.y}));for(let s=0;s<o;s++){let r=!1;for(let l=0;l<i.length;l++)for(let c=l+1;c<i.length;c++){let f=i[l],m=i[c],a=m.x-f.x,y=m.y-f.y,h=Math.hypot(a,y);if(h>=n)continue;h===0&&(a=1,y=0,h=1);let u=(n-h)/2,p=a/h,g=y/h;f.x-=p*u,f.y-=g*u,m.x+=p*u,m.y+=g*u,r=!0}if(!r)break}return i.map((s,r)=>({dx:s.x-t[r].x,dy:s.y-t[r].y}))}var ke="help-layer-target-highlight";function wn(t){return t.kind==="free"?me(()=>({top:t.position.top,left:t.position.left,width:0,height:0})):t.target}function Oe(t,{onMarkerClick:e,onOverlapResolved:n,onMarkerHidden:o,markerLabel:i="?",markerPlacement:s="top-end"}){let r=new Map,l=null,c=!1;function f(){l=null;let u=[...r.values()].filter(d=>d.el.style.display!=="none");if(u.length<=1){let d=u.length===1?u[0].el:null;d&&d.style.transform&&(d.style.transform="",n&&n());return}u.forEach(d=>{d.el.style.transform=""});let p=u.map(d=>{let x=d.el.getBoundingClientRect();return{x:x.left+x.width/2,y:x.top+x.height/2}}),g=Ee(p);u.forEach((d,x)=>{let{dx:w,dy:b}=g[x];d.el.style.transform=w||b?`translate(${w}px, ${b}px)`:""}),n&&n()}function m(){l!==null||c||(l=requestAnimationFrame(f))}function a(u){if(r.has(u.id))return;let p=Ft(u.title,i);document.body.appendChild(p);let g=()=>e(u,p);p.addEventListener("click",g);let d=ye(wn(u),p,m,s,()=>o&&o(u)),x=u.kind==="element"?u.target:null,w=()=>x&&x.classList.add(ke),b=()=>x&&x.classList.remove(ke);x&&(p.addEventListener("mouseenter",w),p.addEventListener("mouseleave",b),p.addEventListener("focus",w),p.addEventListener("blur",b));let E=!1,A=()=>{E||(E=!0,d(),p.removeEventListener("click",g),x&&(p.removeEventListener("mouseenter",w),p.removeEventListener("mouseleave",b),p.removeEventListener("focus",w),p.removeEventListener("blur",b),b()),p.remove(),r.delete(u.id),m())};r.set(u.id,{record:u,el:p,cleanup:A})}function y(u){let p=r.get(u);p&&p.cleanup()}function h(u){u.forEach(a)}return t.track(()=>{c=!0,l!==null&&(cancelAnimationFrame(l),l=null),[...r.values()].forEach(u=>u.cleanup())}),{mount:a,unmount:y,mountAll:h,has(u){return r.has(u)},findByKey(u){for(let p of r.values())if(p.record.key===u)return p;return null}}}function T(t,e,...n){if(e)try{return e(...n)}catch(o){console.error(`[help-layer] ${t} threw:`,o);return}}var vn=1;function ct(t,e,n,o){typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(i=>{n&&i.matches(e)&&n(i),i.shadowRoot&&(o&&o(i.shadowRoot),ct(i.shadowRoot,e,n,o))})}function Ce(t,e){let n=[];return ct(t,e,o=>n.push(o)),n}function bn(t){let e=[];return ct(t,"*",null,n=>e.push(n)),e}function Re(t,e){let n=[],o=[];if(t.nodeType!==vn)return{matches:n,shadowRoots:o};let i=t;return typeof i.matches=="function"&&i.matches(e)&&n.push(i),i.shadowRoot&&(o.push(i.shadowRoot),ct(i.shadowRoot,e,s=>n.push(s),s=>o.push(s))),ct(i,e,s=>n.push(s),s=>o.push(s)),{matches:n,shadowRoots:o}}function Le({root:t=document,selector:e,onAdded:n,onRemoved:o}){let i=new Set,s=c=>{for(let f of c)f.addedNodes.forEach(m=>{let{matches:a,shadowRoots:y}=Re(m,e);a.forEach(h=>T("observer onAdded",n,h)),y.forEach(l)}),f.removedNodes.forEach(m=>{Re(m,e).matches.forEach(a=>T("observer onRemoved",o,a))})},r=new MutationObserver(s);function l(c){i.has(c)||(i.add(c),r.observe(c,{childList:!0,subtree:!0}))}return l(t),bn(t).forEach(l),{disconnect(){r.disconnect(),i.clear()}}}var xt="data-help-title",Tt="data-help-text";function Dt(t="data-help-id"){return`[${t}], [${xt}]`}function Mt(t){let e=new Map;for(let n of t)n.kind==="element"&&e.set(n.key,n);return e}function Se(t){return t.filter(e=>e.kind==="free").map(e=>({id:e.key,kind:"free",key:e.key,title:e.title,text:e.text,position:e.position}))}function $t(t,e,n="data-help-id"){let o=t.getAttribute(n),i=o!=null?e.get(o):void 0,s=i?i.title:t.getAttribute(xt),r=i?i.text:t.getAttribute(Tt);return!s||!r?null:{id:t,kind:"element",key:o,title:s,text:r,target:t}}function Pe(t,e=document,{silent:n=!1,attribute:o="data-help-id"}={}){let i=Mt(t),s=[];return Ce(e,Dt(o)).forEach(r=>{let l=$t(r,i,o);if(!l){if(!n){let c=r.getAttribute(o);console.warn(c!=null?`[help-layer] element with ${o}="${c}" has no matching helpConfig entry or inline ${xt}/${Tt}`:`[help-layer] element needs both ${xt} and ${Tt} (or a ${o} matching helpConfig)`)}return}s.push(l)}),s}function Te(t,{onClose:e,render:n,popupPlacement:o="bottom-start"}={}){let{root:i,titleEl:s,textEl:r,closeEl:l}=Bt();i.style.setProperty("display","none","important"),document.body.appendChild(i),l.addEventListener("click",()=>p());let c=null,f=null,m=null;function a(){m&&(m.cleanup(),m=null)}function y(g,d){s.textContent=g.title;let x=T("render",n,g);r.textContent="",x?r.appendChild(x):r.textContent=g.text,i.style.setProperty("display","block","important"),c=g.id,f=d,a(),m=xe(d,i,o),i.focus({preventScroll:!0})}function h(){m&&m.update()}function u(){let g=c!==null;a(),c=null,f=null,i.style.setProperty("display","none","important"),g&&T("onClose",e)}function p(g){let d=g??f;u(),d&&d.isConnected&&typeof d.focus=="function"&&d.focus({preventScroll:!0})}return t.track(()=>{u(),i.remove()}),{root:i,isOpen(g){return c===g},getOpenId(){return c},open:y,close:p,reposition:h}}function De(){let t=[];return{track(e){t.push(e)},teardownAll(){for(;t.length>0;){let e=t.pop();try{e()}catch(n){console.error("[help-layer] teardown step threw:",n)}}}}}var An="data-help-layer-style",En=`
|
|
5
5
|
.help-layer-blocking-layer {
|
|
6
6
|
/* Structural properties !important so a host can't accidentally un-fix or restack the layer and
|
|
7
7
|
defeat the blocking guarantee. */
|
|
@@ -26,7 +26,9 @@ var HelpLayer=(()=>{var wt=Object.defineProperty;var Ne=Object.getOwnPropertyDes
|
|
|
26
26
|
border: none;
|
|
27
27
|
/* Structural properties are !important so a host's broad rules (e.g. button { display:none }) can't
|
|
28
28
|
hide or distort the marker. top/left stay non-important because place() writes them inline per
|
|
29
|
-
frame; !important there would override that and pin the marker to 0,0. Theme stays var()-driven.
|
|
29
|
+
frame; !important there would override that and pin the marker to 0,0. Theme stays var()-driven.
|
|
30
|
+
Note: for targets in a position:fixed subtree, floating.js overrides this with an inline
|
|
31
|
+
position:fixed !important (inline important beats this rule) so the marker doesn't jitter. */
|
|
30
32
|
position: absolute !important;
|
|
31
33
|
display: block !important;
|
|
32
34
|
visibility: visible !important;
|
|
@@ -154,5 +156,5 @@ var HelpLayer=(()=>{var wt=Object.defineProperty;var Ne=Object.getOwnPropertyDes
|
|
|
154
156
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
|
-
`;function
|
|
159
|
+
`;function Me(t){let e=document.createElement("style");return e.setAttribute(An,""),t&&e.setAttribute("nonce",t),e.textContent=En,document.head.appendChild(e),e}function $e(t){t.remove()}function kn(t){if(typeof t=="string"){let e=document.querySelector(t);if(!e)throw new Error(`help-layer: toggle element not found for selector "${t}"`);return e}if(t instanceof HTMLElement)return t;throw new Error("help-layer: toggle must be a CSS selector string or a DOM element")}function Ne(t){if(!lt(t))throw new Error("help-layer: initHelpLayer requires an options object");let{config:e,toggle:n,onEnable:o,onDisable:i,onOpen:s,onClose:r,silent:l=!1,attribute:c="data-help-id",render:f,markerLabel:m="?",markerPlacement:a="top-end",popupPlacement:y="bottom-start",nonce:h}=t,u=e;Pt(u);let p=n!=null?kn(n):null,g=null,d=null,x=null;function w(){if(g)return;g=De(),p&&g.track(()=>{p.isConnected&&typeof p.focus=="function"&&p.focus({preventScroll:!0})});let M=Me(h);g.track(()=>$e(M));let L=Ae(u),at=Mt(L);d=Te(g,{onClose:r,render:f,popupPlacement:y}),x=Oe(g,{markerLabel:m,markerPlacement:a,onMarkerClick:(v,k)=>{if(d.isOpen(v.id)){d.close();return}d.open(v,k),T("onOpen",s,v)},onOverlapResolved:()=>d.reposition(),onMarkerHidden:v=>{d.isOpen(v.id)&&d.close(p??void 0)}}),x.mountAll(Se(L)),x.mountAll(Pe(L,document,{silent:l,attribute:c}));let N=Le({selector:Dt(c),onAdded:v=>{let k=$t(v,at,c);k&&!x.has(k.id)&&x.mount(k)},onRemoved:v=>{d.isOpen(v)&&d.close(p??void 0),x.unmount(v)}});g.track(()=>N.disconnect());let V=ve(g,{toggleEl:p,onBackgroundClick:()=>d.close(),isLibraryElement:v=>!!v&&((p?p.contains(v):!1)||d.root.contains(v)||typeof v.closest=="function"&&!!v.closest(".help-layer-marker")),onEscape:()=>{d.getOpenId()!==null?d.close():A()}});Nt(g,{toggleEl:p,isLibraryNode:v=>v===V||v===d.root||!!v.classList&&v.classList.contains("help-layer-marker")})}function b(){g&&(g.teardownAll(),g=null,d=null,x=null)}function E(){g||(w(),T("onEnable",o))}function A(){g&&(b(),T("onDisable",i))}function D(){g?A():E()}function Q(M){if(g||E(),!x||!d)return;let L=x.findByKey(M);if(!L){l||console.warn(`[help-layer] open(): no help marker for key "${M}"`);return}d.open(L.record,L.el),T("onOpen",s,L.record)}function q(){d&&d.close()}function H(M){Pt(M),u=M,g&&(b(),w())}return p&&p.addEventListener("click",D),{enable:E,disable:A,toggle:D,isActive(){return g!==null},open:Q,close:q,update:H,destroy(){A(),p&&p.removeEventListener("click",D)}}}function On(t){return Ne(t)}return Ve(Rn);})();
|
|
158
160
|
//# sourceMappingURL=help-layer.iife.js.map
|