@m3e/web 2.5.13 → 2.5.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.
- package/dist/all.js +410 -168
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +64 -64
- package/dist/all.min.js.map +1 -1
- package/dist/avatar.js +1 -1
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.min.js +1 -1
- package/dist/avatar.min.js.map +1 -1
- package/dist/badge.js +29 -8
- package/dist/badge.js.map +1 -1
- package/dist/badge.min.js +1 -1
- package/dist/badge.min.js.map +1 -1
- package/dist/bottom-sheet.js +1 -1
- package/dist/bottom-sheet.js.map +1 -1
- package/dist/bottom-sheet.min.js +1 -1
- package/dist/bottom-sheet.min.js.map +1 -1
- package/dist/calendar.js +1 -1
- package/dist/calendar.js.map +1 -1
- package/dist/calendar.min.js +1 -1
- package/dist/calendar.min.js.map +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.min.js +1 -1
- package/dist/checkbox.min.js.map +1 -1
- package/dist/core-anchoring.js +40 -10
- package/dist/core-anchoring.js.map +1 -1
- package/dist/core-anchoring.min.js +1 -1
- package/dist/core-anchoring.min.js.map +1 -1
- package/dist/core.js +56 -17
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/core.min.js.map +1 -1
- package/dist/css-custom-data.json +20 -0
- package/dist/custom-elements.json +290 -46
- package/dist/datepicker.js +23 -10
- package/dist/datepicker.js.map +1 -1
- package/dist/datepicker.min.js +1 -1
- package/dist/datepicker.min.js.map +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.min.js +1 -1
- package/dist/dialog.min.js.map +1 -1
- package/dist/divider.js +1 -1
- package/dist/divider.js.map +1 -1
- package/dist/divider.min.js +1 -1
- package/dist/divider.min.js.map +1 -1
- package/dist/drawer-container.js +2 -2
- package/dist/drawer-container.js.map +1 -1
- package/dist/drawer-container.min.js +1 -1
- package/dist/drawer-container.min.js.map +1 -1
- package/dist/expansion-panel.js +6 -3
- package/dist/expansion-panel.js.map +1 -1
- package/dist/expansion-panel.min.js +1 -1
- package/dist/expansion-panel.min.js.map +1 -1
- package/dist/fab-menu.js +1 -1
- package/dist/fab-menu.js.map +1 -1
- package/dist/fab-menu.min.js +1 -1
- package/dist/fab-menu.min.js.map +1 -1
- package/dist/form-field.js +1 -1
- package/dist/form-field.js.map +1 -1
- package/dist/form-field.min.js +1 -1
- package/dist/form-field.min.js.map +1 -1
- package/dist/html-custom-data.json +3 -3
- package/dist/icon.js +7 -8
- package/dist/icon.js.map +1 -1
- package/dist/icon.min.js +1 -1
- package/dist/icon.min.js.map +1 -1
- package/dist/menu.js +20 -7
- package/dist/menu.js.map +1 -1
- package/dist/menu.min.js +1 -1
- package/dist/menu.min.js.map +1 -1
- package/dist/nav-bar.js +4 -2
- package/dist/nav-bar.js.map +1 -1
- package/dist/nav-bar.min.js +1 -1
- package/dist/nav-bar.min.js.map +1 -1
- package/dist/nav-menu.js +2 -2
- package/dist/nav-menu.js.map +1 -1
- package/dist/nav-menu.min.js +1 -1
- package/dist/nav-menu.min.js.map +1 -1
- package/dist/nav-rail.js +1 -1
- package/dist/nav-rail.js.map +1 -1
- package/dist/nav-rail.min.js +1 -1
- package/dist/nav-rail.min.js.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.min.js +1 -1
- package/dist/radio-group.min.js.map +1 -1
- package/dist/search.js +31 -11
- package/dist/search.js.map +1 -1
- package/dist/search.min.js +1 -1
- package/dist/search.min.js.map +1 -1
- package/dist/skeleton.js +106 -45
- package/dist/skeleton.js.map +1 -1
- package/dist/skeleton.min.js +1 -1
- package/dist/skeleton.min.js.map +1 -1
- package/dist/slide-group.js +1 -1
- package/dist/slide-group.js.map +1 -1
- package/dist/slide-group.min.js +1 -1
- package/dist/slide-group.min.js.map +1 -1
- package/dist/slider.js +3 -2
- package/dist/slider.js.map +1 -1
- package/dist/slider.min.js +1 -1
- package/dist/slider.min.js.map +1 -1
- package/dist/snackbar.js +1 -1
- package/dist/snackbar.js.map +1 -1
- package/dist/snackbar.min.js +1 -1
- package/dist/snackbar.min.js.map +1 -1
- package/dist/split-pane.js +1 -1
- package/dist/split-pane.js.map +1 -1
- package/dist/split-pane.min.js +1 -1
- package/dist/split-pane.min.js.map +1 -1
- package/dist/src/avatar/AvatarElement.d.ts.map +1 -1
- package/dist/src/badge/BadgeElement.d.ts +1 -0
- package/dist/src/badge/BadgeElement.d.ts.map +1 -1
- package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
- package/dist/src/calendar/CalendarElement.d.ts.map +1 -1
- package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
- package/dist/src/core/anchoring/FloatingPanelElement.d.ts.map +1 -1
- package/dist/src/core/anchoring/positionAnchor.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/AttachInternals.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/CollapsibleElement.d.ts +1 -1
- package/dist/src/core/shared/primitives/CollapsibleElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/CollapsibleOrientation.d.ts +1 -1
- package/dist/src/core/shared/primitives/CollapsibleOrientation.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/FocusRingElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/PseudoCheckboxElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/PseudoRadioElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/RippleElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/StateLayerElement.d.ts.map +1 -1
- package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -1
- package/dist/src/dialog/DialogElement.d.ts.map +1 -1
- package/dist/src/divider/DividerElement.d.ts.map +1 -1
- package/dist/src/drawer-container/styles/DrawerContainerStyle.d.ts.map +1 -1
- package/dist/src/expansion-panel/ExpansionPanelElement.d.ts.map +1 -1
- package/dist/src/expansion-panel/styles/ExpansionHeaderStyle.d.ts.map +1 -1
- package/dist/src/expansion-panel/styles/ExpansionPanelStyle.d.ts.map +1 -1
- package/dist/src/fab-menu/FabMenuElement.d.ts.map +1 -1
- package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
- package/dist/src/menu/MenuElement.d.ts.map +1 -1
- package/dist/src/nav-bar/NavBarElement.d.ts +2 -0
- package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
- package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
- package/dist/src/nav-menu/NavMenuElement.d.ts.map +1 -1
- package/dist/src/nav-menu/NavMenuItemElement.d.ts.map +1 -1
- package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
- package/dist/src/radio-group/RadioElement.d.ts.map +1 -1
- package/dist/src/search/SearchViewElement.d.ts.map +1 -1
- package/dist/src/search/styles/SearchBarStyle.d.ts.map +1 -1
- package/dist/src/search/styles/SearchViewStyle.d.ts.map +1 -1
- package/dist/src/skeleton/SkeletonElement.d.ts +17 -1
- package/dist/src/skeleton/SkeletonElement.d.ts.map +1 -1
- package/dist/src/slide-group/SlideGroupElement.d.ts.map +1 -1
- package/dist/src/slider/SliderElement.d.ts.map +1 -1
- package/dist/src/slider/SliderThumbElement.d.ts.map +1 -1
- package/dist/src/snackbar/SnackbarElement.d.ts.map +1 -1
- package/dist/src/split-pane/SplitPaneElement.d.ts.map +1 -1
- package/dist/src/stepper/StepElement.d.ts.map +1 -1
- package/dist/src/stepper/StepPanelElement.d.ts.map +1 -1
- package/dist/src/stepper/StepperElement.d.ts.map +1 -1
- package/dist/src/switch/styles/SwitchStyle.d.ts.map +1 -1
- package/dist/src/switch/styles/SwitchTrackStyle.d.ts.map +1 -1
- package/dist/src/tabs/TabElement.d.ts.map +1 -1
- package/dist/src/tabs/TabPanelElement.d.ts.map +1 -1
- package/dist/src/tabs/TabsElement.d.ts.map +1 -1
- package/dist/src/toc/TocElement.d.ts.map +1 -1
- package/dist/src/toc/TocItemElement.d.ts.map +1 -1
- package/dist/src/tooltip/RichTooltipElement.d.ts +2 -0
- package/dist/src/tooltip/RichTooltipElement.d.ts.map +1 -1
- package/dist/src/tooltip/TooltipElement.d.ts +4 -0
- package/dist/src/tooltip/TooltipElement.d.ts.map +1 -1
- package/dist/src/tree/TreeElement.d.ts.map +1 -1
- package/dist/src/tree/TreeItemElement.d.ts.map +1 -1
- package/dist/stepper.js +3 -3
- package/dist/stepper.js.map +1 -1
- package/dist/stepper.min.js +1 -1
- package/dist/stepper.min.js.map +1 -1
- package/dist/switch.js +2 -2
- package/dist/switch.js.map +1 -1
- package/dist/switch.min.js +1 -1
- package/dist/switch.min.js.map +1 -1
- package/dist/tabs.js +3 -3
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.min.js +1 -1
- package/dist/tabs.min.js.map +1 -1
- package/dist/toc.js +2 -2
- package/dist/toc.js.map +1 -1
- package/dist/toc.min.js +1 -1
- package/dist/toc.min.js.map +1 -1
- package/dist/tooltip.js +58 -18
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.min.js +1 -1
- package/dist/tooltip.min.js.map +1 -1
- package/dist/tree.js +2 -2
- package/dist/tree.js.map +1 -1
- package/dist/tree.min.js +1 -1
- package/dist/tree.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright (c) 2025–2026 matraic
|
|
4
4
|
* See LICENSE file in the project root for full license text.
|
|
5
5
|
*/
|
|
6
|
-
import{__classPrivateFieldGet as t,__classPrivateFieldSet as e,__decorate as n}from"tslib";import{LitElement as o,html as i,unsafeCSS as r,css as s}from"lit";import{property as l}from"lit/decorators.js";import{SuppressInitialAnimation as a,AttachInternals as c,ClickOutsideController as f,ScrollController as h,ResizeController as u,DesignToken as d,customElement as p,setCustomState as m}from"@m3e/web/core";import{M3eDirectionality as g}from"@m3e/web/core/bidi";const y=Math.min,w=Math.max,x=Math.round,v=Math.floor,b=t=>({x:t,y:t}),A={left:"right",right:"left",bottom:"top",top:"bottom"};function R(t,e,n){return w(t,y(e,n))}function k(t,e){return"function"==typeof t?t(e):t}function L(t){return t.split("-")[0]}function E(t){return t.split("-")[1]}function T(t){return"x"===t?"y":"x"}function S(t){return"y"===t?"height":"width"}function W(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function C(t){return T(W(t))}function O(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const $=["left","right"],D=["right","left"],M=["top","bottom"],P=["bottom","top"];function F(t,e,n,o){const i=E(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?D:$:e?$:D;case"left":case"right":return e?M:P;default:return[]}}(L(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function B(t){const e=L(t);return A[e]+t.slice(e.length)}function N(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function H(t){const{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 V(t,e,n){let{reference:o,floating:i}=t;const r=W(e),s=C(e),l=S(s),a=L(e),c="y"===r,f=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,u=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:h};break;case"left":d={x:o.x-i.width,y:h};break;default:d={x:o.x,y:o.y}}switch(E(e)){case"start":d[s]-=u*(n&&c?-1:1);break;case"end":d[s]+=u*(n&&c?-1:1)}return d}async function z(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:u=!1,padding:d=0}=k(e,t),p=N(d),m=l[u?"floating"===h?"reference":"floating":h],g=H(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),y="floating"===h?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),x=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=H(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-v.top+p.top)/x.y,bottom:(v.bottom-g.bottom+p.bottom)/x.y,left:(g.left-v.left+p.left)/x.x,right:(v.right-g.right+p.right)/x.x}}function Y(t){const e=y(...t.map(t=>t.left)),n=y(...t.map(t=>t.top));return{x:e,y:n,width:w(...t.map(t=>t.right))-e,height:w(...t.map(t=>t.bottom))-n}}const j=new Set(["left","top"]);function I(){return"undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function X(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function _(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return!!I()&&(t instanceof Node||t instanceof X(t).Node)}function J(t){return!!I()&&(t instanceof Element||t instanceof X(t).Element)}function K(t){return!!I()&&(t instanceof HTMLElement||t instanceof X(t).HTMLElement)}function Q(t){return!(!I()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof X(t).ShadowRoot)}function U(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=at(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function Z(t){return/^(table|td|th)$/.test(q(t))}function tt(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const et=/transform|translate|scale|rotate|perspective|filter/,nt=/paint|layout|strict|content/,ot=t=>!!t&&"none"!==t;let it;function rt(t){const e=J(t)?at(t):t;return ot(e.transform)||ot(e.translate)||ot(e.scale)||ot(e.rotate)||ot(e.perspective)||!st()&&(ot(e.backdropFilter)||ot(e.filter))||et.test(e.willChange||"")||nt.test(e.contain||"")}function st(){return null==it&&(it="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),it}function lt(t){return/^(html|body|#document)$/.test(q(t))}function at(t){return X(t).getComputedStyle(t)}function ct(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ft(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Q(t)&&t.host||_(t);return Q(e)?e.host:e}function ht(t){const e=ft(t);return lt(e)?t.ownerDocument?t.ownerDocument.body:t.body:K(e)&&U(e)?e:ht(e)}function ut(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=ht(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=X(i);if(r){const t=dt(s);return e.concat(s,s.visualViewport||[],U(i)?i:[],t&&n?ut(t):[])}return e.concat(i,ut(i,[],n))}function dt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pt(t){const e=at(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=K(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=x(n)!==r||x(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function mt(t){return J(t)?t:t.contextElement}function gt(t){const e=mt(t);if(!K(e))return b(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=pt(e);let s=(r?x(n.width):n.width)/o,l=(r?x(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const yt=b(0);function wt(t){const e=X(t);return st()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:yt}function xt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=mt(t);let s=b(1);e&&(o?J(o)&&(s=gt(o)):s=gt(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==X(t))&&e}(r,n,o)?wt(r):b(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(r){const t=X(r),e=o&&J(o)?X(o):o;let n=t,i=dt(n);for(;i&&o&&e!==n;){const t=gt(i),e=i.getBoundingClientRect(),o=at(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,h*=t.y,a+=r,c+=s,n=X(i),i=dt(n)}}return H({width:f,height:h,x:a,y:c})}function vt(t,e){const n=ct(t).scrollLeft;return e?e.left+n:xt(_(t)).left+n}function bt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function At(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=X(t),o=_(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const t=st();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}const c=vt(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=_(t),n=ct(t),o=t.ownerDocument.body,i=w(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=w(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+vt(t);const l=-n.scrollTop;return"rtl"===at(o).direction&&(s+=w(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}(_(t));else if(J(e))o=function(t,e){const n=xt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=K(t)?gt(t):b(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=wt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return H(o)}function Rt(t,e){const n=ft(t);return!(n===e||!J(n)||lt(n))&&("fixed"===at(n).position||Rt(n,e))}function kt(t,e,n){const o=K(e),i=_(e),r="fixed"===n,s=xt(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=b(0);function c(){a.x=vt(i)}if(o||!o&&!r)if(("body"!==q(e)||U(i))&&(l=ct(e)),o){const t=xt(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const f=!i||o||r?b(0):bt(i,l);return{x:s.left+l.scrollLeft-a.x-f.x,y:s.top+l.scrollTop-a.y-f.y,width:s.width,height:s.height}}function Lt(t){return"static"===at(t).position}function Et(t,e){if(!K(t)||"fixed"===at(t).position)return null;if(e)return e(t);let n=t.offsetParent;return _(t)===n&&(n=n.ownerDocument.body),n}function Tt(t,e){const n=X(t);if(tt(t))return n;if(!K(t)){let e=ft(t);for(;e&&!lt(e);){if(J(e)&&!Lt(e))return e;e=ft(e)}return n}let o=Et(t,e);for(;o&&Z(o)&&Lt(o);)o=Et(o,e);return o&<(o)&&Lt(o)&&!rt(o)?n:o||function(t){let e=ft(t);for(;K(e)&&!lt(e);){if(rt(e))return e;if(tt(e))return null;e=ft(e)}return null}(t)||n}const St={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=_(o),l=!!e&&tt(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=b(1);const f=b(0),h=K(o);if((h||!h&&!r)&&(("body"!==q(o)||U(s))&&(a=ct(o)),h)){const t=xt(o);c=gt(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const u=!s||h||r?b(0):bt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+u.x,y:n.y*c.y-a.scrollTop*c.y+f.y+u.y}},getDocumentElement:_,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?tt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=ut(t,[],!1).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===at(t).position;let s=r?ft(t):t;for(;J(s)&&!lt(s);){const e=at(s),n=rt(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||U(s)&&!n&&Rt(t,s))?o=o.filter(t=>t!==s):i=e,s=ft(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=At(e,r[0],i);let l=s.top,a=s.right,c=s.bottom,f=s.left;for(let t=1;t<r.length;t++){const n=At(e,r[t],i);l=w(n.top,l),a=y(n.right,a),c=y(n.bottom,c),f=w(n.left,f)}return{width:a-f,height:c-l,x:f,y:l}},getOffsetParent:Tt,getElementRects:async function(t){const e=this.getOffsetParent||Tt,n=this.getDimensions,o=await n(t.floating);return{reference:kt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=pt(t);return{width:e,height:n}},getScale:gt,isElement:J,isRTL:function(t){return"rtl"===at(t).direction}};function Wt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ct(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,c=mt(t),f=i||r?[...c?ut(c):[],...e?ut(e):[]]:[];f.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const h=c&&l?function(t,e){let n,o=null;const i=_(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function s(l,a){void 0===l&&(l=!1),void 0===a&&(a=1),r();const c=t.getBoundingClientRect(),{left:f,top:h,width:u,height:d}=c;if(l||e(),!u||!d)return;const p={rootMargin:-v(h)+"px "+-v(i.clientWidth-(f+u))+"px "+-v(i.clientHeight-(h+d))+"px "+-v(f)+"px",threshold:w(0,y(1,a))||1};let m=!0;function g(e){const o=e[0].intersectionRatio;if(o!==a){if(!m)return s();o?s(!1,o):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==o||Wt(c,t.getBoundingClientRect())||s(),m=!1}try{o=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(g,p)}o.observe(t)}(!0),r}(c,n):null;let u,d=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&e&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),c&&!a&&p.observe(c),e&&p.observe(e));let m=a?xt(t):null;return a&&function e(){const o=xt(t);m&&!Wt(m,o)&&n();m=o,u=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==h||h(),null==(t=p)||t.disconnect(),p=null,a&&cancelAnimationFrame(u)}}const Ot=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=L(n),l=E(n),a="y"===W(n),c=j.has(s)?-1:1,f=r&&a?-1:1,h=k(e,t);let{mainAxis:u,crossAxis:d,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&"number"==typeof p&&(d="end"===l?-1*p:p),a?{x:d*f,y:u*c}:{x:u*c,y:d*f}}(e,t);return s===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},$t=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=k(t,e),f={x:n,y:o},h=await r.detectOverflow(e,c),u=W(L(i)),d=T(u);let p=f[d],m=f[u];if(s){const t="y"===d?"bottom":"right";p=R(p+h["y"===d?"top":"left"],p,p-h[t])}if(l){const t="y"===u?"bottom":"right";m=R(m+h["y"===u?"top":"left"],m,m-h[t])}const g=a.fn({...e,[d]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:s,[u]:l}}}}}},Dt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=k(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=L(i),w=W(l),x=L(l)===l,v=await(null==a.isRTL?void 0:a.isRTL(c.floating)),b=u||(x||!m?[B(l)]:function(t){const e=B(t);return[O(t),e,O(e)]}(l)),A="none"!==p;!u&&A&&b.push(...F(l,m,p,v));const R=[l,...b],T=await a.detectOverflow(e,g),$=[];let D=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&$.push(T[y]),h){const t=function(t,e,n){void 0===n&&(n=!1);const o=E(t),i=C(t),r=S(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=B(s)),[s,B(s)]}(i,s,v);$.push(T[t[0]],T[t[1]])}if(D=[...D,{placement:i,overflows:$}],!$.every(t=>t<=0)){var M,P;const t=((null==(M=r.flip)?void 0:M.index)||0)+1,e=R[t];if(e){if(!("alignment"===h&&w!==W(e))||D.every(t=>W(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:D},reset:{placement:e}}}let n=null==(P=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!n)switch(d){case"bestFit":{var N;const t=null==(N=D.filter(t=>{if(A){const e=W(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:N[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:a,y:c}=k(t,e),f=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),h=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>H(Y(t)))}(f),u=H(Y(f)),d=N(l);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=a&&null!=c)return h.find(t=>a>t.left-d.left&&a<t.right+d.right&&c>t.top-d.top&&c<t.bottom+d.bottom)||u;if(h.length>=2){if("y"===W(n)){const t=h[0],e=h[h.length-1],o="top"===L(n),i=t.top,r=e.bottom,s=o?t.left:e.left,l=o?t.right:e.right;return{top:i,bottom:r,left:s,right:l,width:l-s,height:r-i,x:s,y:i}}const t="left"===L(n),e=w(...h.map(t=>t.right)),o=y(...h.map(t=>t.left)),i=h.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return{top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return u}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},Pt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=k(t,e),f={x:n,y:o},h=W(i),u=T(h);let d=f[u],p=f[h];const m=k(l,e),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const t="y"===u?"height":"width",e=r.reference[u]-r.floating[t]+g.mainAxis,n=r.reference[u]+r.reference[t]-g.mainAxis;d<e?d=e:d>n&&(d=n)}if(c){var y,w;const t="y"===u?"width":"height",e=j.has(L(i)),n=r.reference[h]-r.floating[t]+(e&&(null==(y=s.offset)?void 0:y[h])||0)+(e?0:g.crossAxis),o=r.reference[h]+r.reference[t]+(e?0:(null==(w=s.offset)?void 0:w[h])||0)-(e?g.crossAxis:0);p<n?p=n:p>o&&(p=o)}return{[u]:d,[h]:p}}}},Ft=(t,e,n)=>{const o=new Map,i={platform:St,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:z},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:h}=V(c,o,a),u=o,d=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:g,fn:y}=m,{x:w,y:x,data:v,reset:b}=await y({x:f,y:h,initialPlacement:o,placement:u,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=w?w:f,h=null!=x?x:h,p[g]={...p[g],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:h}=V(c,u,a))),n=-1)}return{x:f,y:h,placement:u,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})};function Bt(t){return function(t){for(let e=t;e;e=Nt(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Nt(t);e;e=Nt(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||rt(t))return e;if("BODY"===e.tagName)return e}}return null}(t)}function Nt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}async function Ht(t,e,n,o){async function i(){const i=new Array;n?.inline&&i.push(Mt()),n.flip&&i.push(!0===n.flip?Dt():Dt({fallbackPlacements:n.flip})),n.shift&&i.push($t({mainAxis:"main"===n.shift||"both"===n.shift,crossAxis:"cross"===n.shift||"both"===n.shift,limiter:Pt()})),n.offset&&!isNaN(n.offset)&&i.push(Ot(n.offset));const r=await Ft(e,t,{placement:n.position,middleware:i,platform:{...St,getOffsetParent:t=>St.getOffsetParent(t,Bt)}});o(r.x,r.y,r.placement)}return await i(),Ct(e,t,async()=>await i())}var Vt,zt,Yt,jt,It,qt,Xt;let _t=class extends(a(c(o))){constructor(){super(...arguments),Vt.set(this,void 0),zt.set(this,void 0),Yt.set(this,void 0),jt.set(this,new f(this,{target:null,callback:()=>this.hide()})),It.set(this,n=>{switch(n.newState){case"open":t(this,jt,"f").observe(this),t(this,zt,"f")&&t(this,jt,"f").observe(t(this,zt,"f"));break;case"closed":t(this,jt,"f").unobserveAll(),t(this,Yt,"f")?.call(this),e(this,Yt,void 0,"f")}}),qt.set(this,new h(this,{target:null,callback:()=>this.hide(!1)})),Xt.set(this,new u(this,{target:null,callback:()=>{t(this,zt,"f")&&this.fitAnchorWidth&&(this.style.minWidth=`${t(this,zt,"f").clientWidth}px`)}})),this.scrollStrategy="hide",this.fitAnchorWidth=!1,this.anchorOffset=0}get isOpen(){return void 0!==t(this,Vt,"f")}get trigger(){return t(this,Vt,"f")??null}connectedCallback(){super.connectedCallback(),this.setAttribute("popover","manual"),this.addEventListener("toggle",t(this,It,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",t(this,It,"f"))}async show(n,o){t(this,Vt,"f")&&t(this,Vt,"f")!==n&&this.hide(),e(this,Vt,n,"f"),t(this,Vt,"f").ariaExpanded="true",e(this,zt,o??n,"f"),"hide"===this.scrollStrategy&&t(this,qt,"f").observe(t(this,zt,"f")),this.fitAnchorWidth&&(t(this,Xt,"f").observe(t(this,zt,"f")),this.style.minWidth=`${t(this,zt,"f").clientWidth}px`),e(this,Yt,await Ht(this,t(this,zt,"f"),{position:"bottom-start",inline:!0,flip:!0,offset:this.anchorOffset>0?this.anchorOffset:void 0},(t,e,n)=>{m(this,"--top",n.includes("top")),m(this,"--bottom",n.includes("bottom")),"rtl"===g.current?(this.style.right=window.innerWidth-t-this.clientWidth+"px",this.style.left=""):(this.style.left=`${t}px`,this.style.right=""),this.style.top=`${e}px`}),"f"),this.showPopover()}hide(n=!1){this.hidePopover(),t(this,Vt,"f")&&(t(this,Vt,"f").ariaExpanded="false",n&&t(this,Vt,"f").focus(),t(this,zt,"f")&&(t(this,qt,"f").unobserve(t(this,zt,"f")),this.fitAnchorWidth&&t(this,Xt,"f").unobserve(t(this,zt,"f"))),e(this,Vt,void 0,"f"),e(this,zt,void 0,"f"))}async toggle(e,n){t(this,Vt,"f")?this.hide():await this.show(e,n)}render(){return i`<div class="base"><slot></slot></div>`}};Vt=new WeakMap,zt=new WeakMap,Yt=new WeakMap,jt=new WeakMap,It=new WeakMap,qt=new WeakMap,Xt=new WeakMap,_t.styles=s`:host { position: absolute; flex-direction: column; padding: unset; margin: unset; border: unset; overflow-y: auto; scrollbar-width: ${d.scrollbar.thinWidth}; scrollbar-color: ${d.scrollbar.color}; scroll-padding-block: calc( var(--m3e-focus-ring-thickness, 3px) + var(--m3e-floating-panel-container-padding-block, 0.25rem) ); border-radius: var(--m3e-floating-panel-container-shape, ${d.shape.corner.large}); min-width: var(--m3e-floating-panel-container-min-width, 7rem); max-width: var(--m3e-floating-panel-container-max-width, 17.5rem); max-height: var(--m3e-floating-panel-container-max-height, 17.5rem); background-color: var(--m3e-floating-panel-container-color, ${d.color.surfaceContainer}); box-shadow: var(--m3e-floating-panel-container-elevation, ${d.elevation.level3}); opacity: 0; display: none; } .base { box-sizing: border-box; display: flex; flex-direction: column; padding-block: var(--m3e-floating-panel-container-padding-block, 0.25rem); padding-inline: var(--m3e-floating-panel-container-padding-inline, 0.25rem); } :host(:not(:is(:state(--no-animate), :--no-animate))) { transition: ${r(`opacity ${d.motion.duration.short2} ${d.motion.easing.standard}, \n transform ${d.motion.duration.short2} ${d.motion.easing.standard},\n overlay ${d.motion.duration.short2} ${d.motion.easing.standard} allow-discrete,\n display ${d.motion.duration.short2} ${d.motion.easing.standard} allow-discrete`)}; } :host { transform: scaleY(0.8); } :host(:popover-open) { transform: scaleY(1); display: block; opacity: 1; } :host::backdrop { background-color: transparent; } :host(:is(:state(--bottom), :--bottom)) { transform-origin: top; } :host(:is(:state(--top), :--top)) { transform-origin: bottom; } @starting-style { :host(:popover-open) { transform: scaleY(0.8); } } @media (prefers-reduced-motion) { :host(:not(:is(:state(--no-animate), :--no-animate))) { transition: none; } } @media (forced-colors: active) { :host { background-color: Menu; color: MenuText; outline: 1px solid MenuText; } }`,n([l({attribute:"scroll-strategy"})],_t.prototype,"scrollStrategy",void 0),n([l({attribute:"fit-anchor-width",type:Boolean})],_t.prototype,"fitAnchorWidth",void 0),n([l({attribute:"anchor-offset",type:Number})],_t.prototype,"anchorOffset",void 0),_t=n([p("m3e-floating-panel")],_t);export{_t as M3eFloatingPanelElement,Ht as positionAnchor};
|
|
6
|
+
import{__classPrivateFieldGet as t,__classPrivateFieldSet as e,__decorate as n}from"tslib";import{LitElement as o,html as i,unsafeCSS as r,css as s}from"lit";import{property as l}from"lit/decorators.js";import{SuppressInitialAnimation as a,AttachInternals as c,ClickOutsideController as f,ScrollController as h,ResizeController as u,DesignToken as d,customElement as p,setCustomState as m}from"@m3e/web/core";import{M3eDirectionality as g}from"@m3e/web/core/bidi";const y=Math.min,w=Math.max,x=Math.round,v=Math.floor,b=t=>({x:t,y:t}),A={left:"right",right:"left",bottom:"top",top:"bottom"};function R(t,e,n){return w(t,y(e,n))}function k(t,e){return"function"==typeof t?t(e):t}function E(t){return t.split("-")[0]}function L(t){return t.split("-")[1]}function T(t){return"x"===t?"y":"x"}function S(t){return"y"===t?"height":"width"}function W(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function C(t){return T(W(t))}function O(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const M=["left","right"],$=["right","left"],D=["top","bottom"],P=["bottom","top"];function N(t,e,n,o){const i=L(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?$:M:e?M:$;case"left":case"right":return e?D:P;default:return[]}}(E(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function F(t){const e=E(t);return A[e]+t.slice(e.length)}function B(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function H(t){const{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 V(t,e,n){let{reference:o,floating:i}=t;const r=W(e),s=C(e),l=S(s),a=E(e),c="y"===r,f=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,u=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:h};break;case"left":d={x:o.x-i.width,y:h};break;default:d={x:o.x,y:o.y}}switch(L(e)){case"start":d[s]-=u*(n&&c?-1:1);break;case"end":d[s]+=u*(n&&c?-1:1)}return d}async function z(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:u=!1,padding:d=0}=k(e,t),p=B(d),m=l[u?"floating"===h?"reference":"floating":h],g=H(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),y="floating"===h?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),x=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=H(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-v.top+p.top)/x.y,bottom:(v.bottom-g.bottom+p.bottom)/x.y,left:(g.left-v.left+p.left)/x.x,right:(v.right-g.right+p.right)/x.x}}function I(t){const e=y(...t.map(t=>t.left)),n=y(...t.map(t=>t.top));return{x:e,y:n,width:w(...t.map(t=>t.right))-e,height:w(...t.map(t=>t.bottom))-n}}const Y=new Set(["left","top"]);function _(){return"undefined"!=typeof window}function j(t){return X(t)?(t.nodeName||"").toLowerCase():"#document"}function q(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function G(t){var e;return null==(e=(X(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function X(t){return!!_()&&(t instanceof Node||t instanceof q(t).Node)}function J(t){return!!_()&&(t instanceof Element||t instanceof q(t).Element)}function K(t){return!!_()&&(t instanceof HTMLElement||t instanceof q(t).HTMLElement)}function Q(t){return!(!_()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof q(t).ShadowRoot)}function U(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=at(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function Z(t){return/^(table|td|th)$/.test(j(t))}function tt(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const et=/transform|translate|scale|rotate|perspective|filter/,nt=/paint|layout|strict|content/,ot=t=>!!t&&"none"!==t;let it;function rt(t){const e=J(t)?at(t):t;return ot(e.transform)||ot(e.translate)||ot(e.scale)||ot(e.rotate)||ot(e.perspective)||!st()&&(ot(e.backdropFilter)||ot(e.filter))||et.test(e.willChange||"")||nt.test(e.contain||"")}function st(){return null==it&&(it="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),it}function lt(t){return/^(html|body|#document)$/.test(j(t))}function at(t){return q(t).getComputedStyle(t)}function ct(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ft(t){if("html"===j(t))return t;const e=t.assignedSlot||t.parentNode||Q(t)&&t.host||G(t);return Q(e)?e.host:e}function ht(t){const e=ft(t);return lt(e)?t.ownerDocument?t.ownerDocument.body:t.body:K(e)&&U(e)?e:ht(e)}function ut(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=ht(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=q(i);if(r){const t=dt(s);return e.concat(s,s.visualViewport||[],U(i)?i:[],t&&n?ut(t):[])}return e.concat(i,ut(i,[],n))}function dt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pt(t){const e=at(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=K(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=x(n)!==r||x(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function mt(t){return J(t)?t:t.contextElement}function gt(t){const e=mt(t);if(!K(e))return b(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=pt(e);let s=(r?x(n.width):n.width)/o,l=(r?x(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const yt=b(0);function wt(t){const e=q(t);return st()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:yt}function xt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=mt(t);let s=b(1);e&&(o?J(o)&&(s=gt(o)):s=gt(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==q(t))&&e}(r,n,o)?wt(r):b(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(r){const t=q(r),e=o&&J(o)?q(o):o;let n=t,i=dt(n);for(;i&&o&&e!==n;){const t=gt(i),e=i.getBoundingClientRect(),o=at(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,h*=t.y,a+=r,c+=s,n=q(i),i=dt(n)}}return H({width:f,height:h,x:a,y:c})}function vt(t,e){const n=ct(t).scrollLeft;return e?e.left+n:xt(G(t)).left+n}function bt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function At(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=q(t),o=G(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const t=st();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}const c=vt(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=G(t),n=ct(t),o=t.ownerDocument.body,i=w(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=w(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+vt(t);const l=-n.scrollTop;return"rtl"===at(o).direction&&(s+=w(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}(G(t));else if(J(e))o=function(t,e){const n=xt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=K(t)?gt(t):b(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=wt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return H(o)}function Rt(t,e){const n=ft(t);return!(n===e||!J(n)||lt(n))&&("fixed"===at(n).position||Rt(n,e))}function kt(t,e,n){const o=K(e),i=G(e),r="fixed"===n,s=xt(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=b(0);function c(){a.x=vt(i)}if(o||!o&&!r)if(("body"!==j(e)||U(i))&&(l=ct(e)),o){const t=xt(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const f=!i||o||r?b(0):bt(i,l);return{x:s.left+l.scrollLeft-a.x-f.x,y:s.top+l.scrollTop-a.y-f.y,width:s.width,height:s.height}}function Et(t){return"static"===at(t).position}function Lt(t,e){if(!K(t)||"fixed"===at(t).position)return null;if(e)return e(t);let n=t.offsetParent;return G(t)===n&&(n=n.ownerDocument.body),n}function Tt(t,e){const n=q(t);if(tt(t))return n;if(!K(t)){let e=ft(t);for(;e&&!lt(e);){if(J(e)&&!Et(e))return e;e=ft(e)}return n}let o=Lt(t,e);for(;o&&Z(o)&&Et(o);)o=Lt(o,e);return o&<(o)&&Et(o)&&!rt(o)?n:o||function(t){let e=ft(t);for(;K(e)&&!lt(e);){if(rt(e))return e;if(tt(e))return null;e=ft(e)}return null}(t)||n}const St={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=G(o),l=!!e&&tt(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=b(1);const f=b(0),h=K(o);if((h||!h&&!r)&&(("body"!==j(o)||U(s))&&(a=ct(o)),h)){const t=xt(o);c=gt(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const u=!s||h||r?b(0):bt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+u.x,y:n.y*c.y-a.scrollTop*c.y+f.y+u.y}},getDocumentElement:G,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?tt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=ut(t,[],!1).filter(t=>J(t)&&"body"!==j(t)),i=null;const r="fixed"===at(t).position;let s=r?ft(t):t;for(;J(s)&&!lt(s);){const e=at(s),n=rt(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||U(s)&&!n&&Rt(t,s))?o=o.filter(t=>t!==s):i=e,s=ft(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=At(e,r[0],i);let l=s.top,a=s.right,c=s.bottom,f=s.left;for(let t=1;t<r.length;t++){const n=At(e,r[t],i);l=w(n.top,l),a=y(n.right,a),c=y(n.bottom,c),f=w(n.left,f)}return{width:a-f,height:c-l,x:f,y:l}},getOffsetParent:Tt,getElementRects:async function(t){const e=this.getOffsetParent||Tt,n=this.getDimensions,o=await n(t.floating);return{reference:kt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=pt(t);return{width:e,height:n}},getScale:gt,isElement:J,isRTL:function(t){return"rtl"===at(t).direction}};function Wt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ct(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,c=mt(t),f=i||r?[...c?ut(c):[],...e?ut(e):[]]:[];f.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const h=c&&l?function(t,e){let n,o=null;const i=G(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function s(l,a){void 0===l&&(l=!1),void 0===a&&(a=1),r();const c=t.getBoundingClientRect(),{left:f,top:h,width:u,height:d}=c;if(l||e(),!u||!d)return;const p={rootMargin:-v(h)+"px "+-v(i.clientWidth-(f+u))+"px "+-v(i.clientHeight-(h+d))+"px "+-v(f)+"px",threshold:w(0,y(1,a))||1};let m=!0;function g(e){const o=e[0].intersectionRatio;if(o!==a){if(!m)return s();o?s(!1,o):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==o||Wt(c,t.getBoundingClientRect())||s(),m=!1}try{o=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(g,p)}o.observe(t)}(!0),r}(c,n):null;let u,d=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&e&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),c&&!a&&p.observe(c),e&&p.observe(e));let m=a?xt(t):null;return a&&function e(){const o=xt(t);m&&!Wt(m,o)&&n();m=o,u=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==h||h(),null==(t=p)||t.disconnect(),p=null,a&&cancelAnimationFrame(u)}}const Ot=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=E(n),l=L(n),a="y"===W(n),c=Y.has(s)?-1:1,f=r&&a?-1:1,h=k(e,t);let{mainAxis:u,crossAxis:d,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&"number"==typeof p&&(d="end"===l?-1*p:p),a?{x:d*f,y:u*c}:{x:u*c,y:d*f}}(e,t);return s===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Mt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=k(t,e),f={x:n,y:o},h=await r.detectOverflow(e,c),u=W(E(i)),d=T(u);let p=f[d],m=f[u];if(s){const t="y"===d?"bottom":"right";p=R(p+h["y"===d?"top":"left"],p,p-h[t])}if(l){const t="y"===u?"bottom":"right";m=R(m+h["y"===u?"top":"left"],m,m-h[t])}const g=a.fn({...e,[d]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:s,[u]:l}}}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=k(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=E(i),w=W(l),x=E(l)===l,v=await(null==a.isRTL?void 0:a.isRTL(c.floating)),b=u||(x||!m?[F(l)]:function(t){const e=F(t);return[O(t),e,O(e)]}(l)),A="none"!==p;!u&&A&&b.push(...N(l,m,p,v));const R=[l,...b],T=await a.detectOverflow(e,g),M=[];let $=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&M.push(T[y]),h){const t=function(t,e,n){void 0===n&&(n=!1);const o=L(t),i=C(t),r=S(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=F(s)),[s,F(s)]}(i,s,v);M.push(T[t[0]],T[t[1]])}if($=[...$,{placement:i,overflows:M}],!M.every(t=>t<=0)){var D,P;const t=((null==(D=r.flip)?void 0:D.index)||0)+1,e=R[t];if(e){if(!("alignment"===h&&w!==W(e))||$.every(t=>W(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:$},reset:{placement:e}}}let n=null==(P=$.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!n)switch(d){case"bestFit":{var B;const t=null==(B=$.filter(t=>{if(A){const e=W(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},Dt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:a,y:c}=k(t,e),f=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),h=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>H(I(t)))}(f),u=H(I(f)),d=B(l);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=a&&null!=c)return h.find(t=>a>t.left-d.left&&a<t.right+d.right&&c>t.top-d.top&&c<t.bottom+d.bottom)||u;if(h.length>=2){if("y"===W(n)){const t=h[0],e=h[h.length-1],o="top"===E(n),i=t.top,r=e.bottom,s=o?t.left:e.left,l=o?t.right:e.right;return{top:i,bottom:r,left:s,right:l,width:l-s,height:r-i,x:s,y:i}}const t="left"===E(n),e=w(...h.map(t=>t.right)),o=y(...h.map(t=>t.left)),i=h.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return{top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return u}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},Pt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=k(t,e),f={x:n,y:o},h=W(i),u=T(h);let d=f[u],p=f[h];const m=k(l,e),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const t="y"===u?"height":"width",e=r.reference[u]-r.floating[t]+g.mainAxis,n=r.reference[u]+r.reference[t]-g.mainAxis;d<e?d=e:d>n&&(d=n)}if(c){var y,w;const t="y"===u?"width":"height",e=Y.has(E(i)),n=r.reference[h]-r.floating[t]+(e&&(null==(y=s.offset)?void 0:y[h])||0)+(e?0:g.crossAxis),o=r.reference[h]+r.reference[t]+(e?0:(null==(w=s.offset)?void 0:w[h])||0)-(e?g.crossAxis:0);p<n?p=n:p>o&&(p=o)}return{[u]:d,[h]:p}}}},Nt=(t,e,n)=>{const o=new Map,i={platform:St,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:z},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:h}=V(c,o,a),u=o,d=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:g,fn:y}=m,{x:w,y:x,data:v,reset:b}=await y({x:f,y:h,initialPlacement:o,placement:u,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=w?w:f,h=null!=x?x:h,p[g]={...p[g],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:h}=V(c,u,a))),n=-1)}return{x:f,y:h,placement:u,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})};function Ft(t){return function(t){for(let e=t;e;e=Bt(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Bt(t);e;e=Bt(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||rt(t))return e;if("BODY"===e.tagName)return e}}return null}(t)}function Bt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}async function Ht(t,e,n,o){const i={x:Number.MIN_SAFE_INTEGER,y:Number.MIN_SAFE_INTEGER,placement:"bottom"};async function r(){const r=new Array;n?.inline&&r.push(Dt()),n.flip&&r.push(!0===n.flip?$t():$t({fallbackPlacements:n.flip})),n.shift&&r.push(Mt({mainAxis:"main"===n.shift||"both"===n.shift,crossAxis:"cross"===n.shift||"both"===n.shift,limiter:Pt()})),n.offset&&!isNaN(n.offset)&&r.push(Ot(n.offset));const s=await Nt(e,t,{placement:n.position,middleware:r,platform:{...St,getOffsetParent:t=>St.getOffsetParent(t,Ft)}}),{x:l,y:a,placement:c}=s;i.x===l&&i.y===a&&i.placement===c||o(l,a,c),Object.assign(i,{x:l,y:a,placement:c})}return await r(),Ct(e,t,async()=>await r())}var Vt,zt,It,Yt,_t,jt,qt,Gt;let Xt=class extends(a(c(o))){constructor(){super(...arguments),Vt.set(this,void 0),zt.set(this,void 0),It.set(this,void 0),Yt.set(this,void 0),_t.set(this,new f(this,{target:null,callback:()=>this.hide()})),jt.set(this,n=>{switch(n.newState){case"open":t(this,_t,"f").observe(this),t(this,zt,"f")&&t(this,_t,"f").observe(t(this,zt,"f"));break;case"closed":t(this,_t,"f").unobserveAll(),t(this,It,"f")?.call(this),e(this,It,void 0,"f"),e(this,Yt,void 0,"f")}}),qt.set(this,new h(this,{target:null,callback:()=>this.hide(!1)})),Gt.set(this,new u(this,{target:null,callback:()=>{t(this,zt,"f")&&this.fitAnchorWidth&&(this.style.minWidth=`${t(this,zt,"f").clientWidth}px`)}})),this.scrollStrategy="hide",this.fitAnchorWidth=!1,this.anchorOffset=0}get isOpen(){return void 0!==t(this,Vt,"f")}get trigger(){return t(this,Vt,"f")??null}connectedCallback(){super.connectedCallback(),this.setAttribute("popover","manual"),this.addEventListener("toggle",t(this,jt,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",t(this,jt,"f"))}async show(n,o){t(this,Vt,"f")&&t(this,Vt,"f")!==n&&this.hide(),e(this,Vt,n,"f"),t(this,Vt,"f").ariaExpanded="true",e(this,zt,o??n,"f"),"hide"===this.scrollStrategy&&t(this,qt,"f").observe(t(this,zt,"f")),this.fitAnchorWidth&&(t(this,Gt,"f").observe(t(this,zt,"f")),this.style.minWidth=`${t(this,zt,"f").clientWidth}px`),e(this,It,await Ht(this,t(this,zt,"f"),{position:"bottom-start",inline:!0,flip:!0,offset:this.anchorOffset>0?this.anchorOffset:void 0},(n,o,i)=>{m(this,"--top",i.includes("top")),m(this,"--bottom",i.includes("bottom")),t(this,Yt,"f")?.dir===g.current&&t(this,Yt,"f")?.x===n||("rtl"===g.current?(this.style.right=window.innerWidth-n-this.clientWidth+"px",this.style.left=""):(this.style.left=`${n}px`,this.style.right="")),t(this,Yt,"f")?.y!==o&&(this.style.top=`${o}px`),e(this,Yt,{x:n,y:o,dir:g.current},"f")}),"f"),this.showPopover()}hide(n=!1){this.hidePopover(),t(this,Vt,"f")&&(t(this,Vt,"f").ariaExpanded="false",n&&t(this,Vt,"f").focus(),t(this,zt,"f")&&(t(this,qt,"f").unobserve(t(this,zt,"f")),this.fitAnchorWidth&&t(this,Gt,"f").unobserve(t(this,zt,"f"))),e(this,Vt,void 0,"f"),e(this,zt,void 0,"f"))}async toggle(e,n){t(this,Vt,"f")?this.hide():await this.show(e,n)}render(){return i`<div class="base"><slot></slot></div>`}};Vt=new WeakMap,zt=new WeakMap,It=new WeakMap,Yt=new WeakMap,_t=new WeakMap,jt=new WeakMap,qt=new WeakMap,Gt=new WeakMap,Xt.styles=s`:host { position: absolute; flex-direction: column; padding: unset; margin: unset; border: unset; overflow-y: auto; scrollbar-width: ${d.scrollbar.thinWidth}; scrollbar-color: ${d.scrollbar.color}; scroll-padding-block: calc( var(--m3e-focus-ring-thickness, 3px) + var(--m3e-floating-panel-container-padding-block, 0.25rem) ); border-radius: var(--m3e-floating-panel-container-shape, ${d.shape.corner.large}); min-width: var(--m3e-floating-panel-container-min-width, 7rem); max-width: var(--m3e-floating-panel-container-max-width, 17.5rem); max-height: var(--m3e-floating-panel-container-max-height, 17.5rem); background-color: var(--m3e-floating-panel-container-color, ${d.color.surfaceContainer}); box-shadow: var(--m3e-floating-panel-container-elevation, ${d.elevation.level3}); opacity: 0; display: none; } .base { contain: layout style paint; box-sizing: border-box; display: flex; flex-direction: column; padding-block: var(--m3e-floating-panel-container-padding-block, 0.25rem); padding-inline: var(--m3e-floating-panel-container-padding-inline, 0.25rem); } :host(:not(:is(:state(--no-animate), :--no-animate))) { transition: ${r(`opacity ${d.motion.duration.short2} ${d.motion.easing.standard}, \n transform ${d.motion.duration.short2} ${d.motion.easing.standard},\n overlay ${d.motion.duration.short2} ${d.motion.easing.standard} allow-discrete,\n display ${d.motion.duration.short2} ${d.motion.easing.standard} allow-discrete`)}; } :host { transform: scaleY(0.8); } :host(:popover-open) { transform: scaleY(1); display: block; opacity: 1; } :host::backdrop { background-color: transparent; } :host(:is(:state(--bottom), :--bottom)) { transform-origin: top; } :host(:is(:state(--top), :--top)) { transform-origin: bottom; } @starting-style { :host(:popover-open) { transform: scaleY(0.8); } } @media (prefers-reduced-motion) { :host(:not(:is(:state(--no-animate), :--no-animate))) { transition: none; } } @media (forced-colors: active) { :host { background-color: Menu; color: MenuText; outline: 1px solid MenuText; } }`,n([l({attribute:"scroll-strategy"})],Xt.prototype,"scrollStrategy",void 0),n([l({attribute:"fit-anchor-width",type:Boolean})],Xt.prototype,"fitAnchorWidth",void 0),n([l({attribute:"anchor-offset",type:Number})],Xt.prototype,"anchorOffset",void 0),Xt=n([p("m3e-floating-panel")],Xt);export{Xt as M3eFloatingPanelElement,Ht as positionAnchor};
|
|
7
7
|
//# sourceMappingURL=core-anchoring.min.js.map
|