@vonage/vivid 5.5.0 → 5.7.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/LICENSE.md +201 -0
- package/accordion/definition.cjs +5 -0
- package/accordion/definition.js +5 -0
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +14 -3
- package/accordion-item/definition.cjs +1 -1
- package/accordion-item/definition.js +1 -1
- package/alert/definition.cjs +4 -12
- package/alert/definition.js +5 -13
- package/alert/index.cjs +11 -11
- package/alert/index.js +33 -37
- package/audio-player/definition.cjs +4 -0
- package/audio-player/definition.js +4 -0
- package/audio-player/index.cjs +1 -1
- package/audio-player/index.js +8 -2
- package/avatar/definition.cjs +1 -1
- package/avatar/definition.js +1 -1
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +4 -4
- package/banner/definition.cjs +2 -4
- package/banner/definition.js +2 -4
- package/banner/index.cjs +2 -2
- package/banner/index.js +1 -1
- package/breadcrumb/definition.cjs +1 -0
- package/breadcrumb/definition.js +1 -0
- package/breadcrumb/index.cjs +1 -1
- package/breadcrumb/index.js +1 -0
- package/breadcrumb-item/definition.cjs +1 -1
- package/breadcrumb-item/definition.js +1 -1
- package/breadcrumb-item/index.cjs +4 -4
- package/breadcrumb-item/index.js +4 -4
- package/bundled/affix.js +1 -1
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +3 -1
- package/bundled/base-color-picker.cjs +1 -1
- package/bundled/base-color-picker.js +9 -3
- package/bundled/base-progress.cjs +1 -1
- package/bundled/base-progress.js +3 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +14 -10
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +3 -1
- package/bundled/definition.cjs +1 -1
- package/bundled/definition.js +21 -21
- package/bundled/definition10.cjs +7 -7
- package/bundled/definition10.js +27 -17
- package/bundled/definition11.cjs +2 -2
- package/bundled/definition11.js +5 -5
- package/bundled/definition12.cjs +3 -3
- package/bundled/definition12.js +2 -1
- package/bundled/definition13.cjs +1 -1
- package/bundled/definition13.js +1 -1
- package/bundled/definition17.cjs +1 -1
- package/bundled/definition17.js +4 -1
- package/bundled/definition18.cjs +1 -1
- package/bundled/definition18.js +18 -7
- package/bundled/definition19.cjs +6 -6
- package/bundled/definition19.js +103 -68
- package/bundled/definition2.cjs +8 -9
- package/bundled/definition2.js +67 -75
- package/bundled/definition20.cjs +1 -1
- package/bundled/definition20.js +4 -4
- package/bundled/definition22.cjs +1 -1
- package/bundled/definition22.js +2 -1
- package/bundled/definition3.cjs +2 -2
- package/bundled/definition3.js +2 -1
- package/bundled/definition5.cjs +1 -1
- package/bundled/definition5.js +10 -4
- package/bundled/definition6.cjs +2 -2
- package/bundled/definition6.js +2 -1
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +8 -5
- package/bundled/definition8.cjs +1 -1
- package/bundled/definition8.js +6 -5
- package/bundled/definition9.cjs +6 -6
- package/bundled/definition9.js +545 -488
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +3 -1
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +11 -3
- package/bundled/host-semantics.js +4 -4
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +21 -3
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +137 -67
- package/bundled/mixins.cjs +4 -4
- package/bundled/mixins.js +10 -7
- package/bundled/picker-field.template.cjs +1 -1
- package/bundled/picker-field.template.js +1 -0
- package/bundled/scrollIntoView.cjs +1 -1
- package/bundled/scrollIntoView.js +4 -1
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +11 -11
- package/bundled/time-selection-picker.template.js +4 -1
- package/bundled/vivid-element.cjs +4 -4
- package/bundled/vivid-element.js +529 -492
- package/calendar/definition.cjs +2 -0
- package/calendar/definition.js +2 -0
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +2 -0
- package/calendar-event/definition.cjs +1 -1
- package/calendar-event/definition.js +1 -1
- package/calendar-event/index.cjs +2 -2
- package/calendar-event/index.js +5 -5
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/checkbox/definition.cjs +2 -1
- package/checkbox/definition.js +2 -1
- package/color-picker/definition.cjs +6 -1
- package/color-picker/definition.js +6 -1
- package/color-picker/index.cjs +1 -1
- package/color-picker/index.js +6 -1
- package/combobox/definition.cjs +17 -6
- package/combobox/definition.js +17 -6
- package/combobox/index.cjs +14 -9
- package/combobox/index.js +48 -36
- package/contextual-help/definition.cjs +1 -1
- package/contextual-help/definition.js +1 -1
- package/custom-elements.json +6985 -542
- package/data-grid/definition.cjs +106 -8
- package/data-grid/definition.js +106 -8
- package/data-grid/index.cjs +52 -38
- package/data-grid/index.js +313 -242
- package/date-range-picker/definition.cjs +2 -0
- package/date-range-picker/definition.js +2 -0
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +5 -1
- package/dial-pad/definition.cjs +10 -1
- package/dial-pad/definition.js +10 -1
- package/dial-pad/index.cjs +2 -2
- package/dial-pad/index.js +37 -13
- package/dialog/definition.cjs +2 -1
- package/dialog/definition.js +2 -1
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +2 -1
- package/fab/definition.cjs +2 -1
- package/fab/definition.js +2 -1
- package/fab/index.cjs +1 -1
- package/fab/index.js +6 -5
- package/file-picker/definition.cjs +7 -2
- package/file-picker/definition.js +7 -2
- package/file-picker/index.cjs +6 -6
- package/file-picker/index.js +82 -73
- package/icon/definition.cjs +12 -21
- package/icon/definition.js +13 -22
- package/index.cjs +21 -0
- package/index.js +1 -1
- package/lib/data-grid/locale.d.ts +5 -0
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/icon/icon.d.ts +0 -1
- package/lib/menu/menu.d.ts +4 -4
- package/lib/rich-text-editor/definition.d.ts +3 -2
- package/lib/rich-text-editor/locale.d.ts +29 -3
- package/lib/rich-text-editor/popover.d.ts +19 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +16 -45
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +2 -2
- package/lib/rich-text-editor/rte/config.d.ts +18 -0
- package/lib/rich-text-editor/rte/document.d.ts +28 -0
- package/lib/rich-text-editor/rte/exports.d.ts +23 -0
- package/lib/rich-text-editor/rte/feature.d.ts +46 -0
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +33 -0
- package/lib/rich-text-editor/rte/features/internal/foreign-html.d.ts +11 -0
- package/lib/rich-text-editor/rte/features/internal/history.d.ts +10 -0
- package/lib/rich-text-editor/rte/features/internal/text-style.d.ts +18 -0
- package/lib/rich-text-editor/rte/html-parser.d.ts +24 -0
- package/lib/rich-text-editor/rte/html-serializer.d.ts +30 -0
- package/lib/rich-text-editor/rte/instance.d.ts +57 -0
- package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -0
- package/lib/rich-text-editor/rte/utils/impl.d.ts +1 -0
- package/lib/rich-text-editor/rte/utils/textblock-attrs.d.ts +29 -0
- package/lib/rich-text-editor/rte/utils/textblock-marks.d.ts +10 -0
- package/lib/rich-text-editor/rte/utils/ui.d.ts +109 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +4 -4
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +4 -4
- package/locales/de-DE.cjs +42 -4
- package/locales/de-DE.js +42 -4
- package/locales/en-GB.cjs +43 -5
- package/locales/en-GB.js +43 -5
- package/locales/en-US.cjs +43 -5
- package/locales/en-US.js +43 -5
- package/locales/ja-JP.cjs +43 -5
- package/locales/ja-JP.js +43 -5
- package/locales/zh-CN.cjs +43 -5
- package/locales/zh-CN.js +43 -5
- package/menu/definition.cjs +2 -1
- package/menu/definition.js +2 -1
- package/nav-disclosure/definition.cjs +1 -1
- package/nav-disclosure/definition.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/definition.cjs +1 -1
- package/nav-item/definition.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +5 -5
- package/number-field/definition.cjs +5 -3
- package/number-field/definition.js +5 -3
- package/number-field/index.cjs +5 -3
- package/number-field/index.js +34 -32
- package/package.json +76 -62
- package/pagination/definition.cjs +2 -0
- package/pagination/definition.js +2 -0
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +2 -0
- package/radio/definition.cjs +5 -1
- package/radio/definition.js +5 -1
- package/range-slider/definition.cjs +3 -2
- package/range-slider/definition.js +3 -2
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +4 -2
- package/rich-text-editor/definition.cjs +17942 -1074
- package/rich-text-editor/definition.js +17926 -1079
- package/rich-text-editor/index.cjs +29 -130
- package/rich-text-editor/index.js +5565 -2474
- package/searchable-select/definition.cjs +7 -3
- package/searchable-select/definition.js +7 -3
- package/searchable-select/index.cjs +5 -5
- package/searchable-select/index.js +11 -7
- package/select/definition.cjs +17 -2
- package/select/definition.js +17 -2
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +1 -1
- package/shared/patterns/anchored.d.ts +8 -8
- package/shared/patterns/char-count/char-count.d.ts +1 -1
- package/shared/patterns/localized.d.ts +386 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/shared/utils/promise.d.ts +7 -0
- package/simple-color-picker/definition.cjs +4 -1
- package/simple-color-picker/definition.js +4 -1
- package/simple-color-picker/index.cjs +3 -3
- package/simple-color-picker/index.js +4 -1
- package/slider/definition.cjs +8 -2
- package/slider/definition.js +8 -2
- package/split-button/definition.cjs +1 -1
- package/split-button/definition.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +5 -1
- package/styles/core/theme.css +5 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/definition.cjs +2 -1
- package/switch/definition.js +2 -1
- package/switch/index.cjs +2 -2
- package/switch/index.js +11 -10
- package/tab/definition.cjs +1 -1
- package/tab/definition.js +1 -1
- package/tabs/definition.cjs +2 -0
- package/tabs/definition.js +2 -0
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +2 -0
- package/tag/definition.cjs +1 -1
- package/tag/definition.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/definition.cjs +13 -7
- package/text-area/definition.js +13 -7
- package/text-area/index.cjs +6 -6
- package/text-area/index.js +20 -14
- package/text-field/definition.cjs +16 -6
- package/text-field/definition.js +16 -6
- package/toggletip/definition.cjs +5 -1
- package/toggletip/definition.js +5 -1
- package/tooltip/definition.cjs +4 -1
- package/tooltip/definition.js +4 -1
- package/tree-view/definition.cjs +28 -6
- package/tree-view/definition.js +28 -6
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +28 -6
- package/unbundled/_commonjsHelpers.cjs +0 -26
- package/unbundled/_commonjsHelpers.js +1 -26
- package/unbundled/attribute-binding-behaviour.cjs +1 -0
- package/unbundled/attribute-binding-behaviour.js +1 -0
- package/unbundled/base-color-picker.cjs +9 -3
- package/unbundled/base-color-picker.js +9 -3
- package/unbundled/base-progress.cjs +3 -0
- package/unbundled/base-progress.js +3 -0
- package/unbundled/button.cjs +14 -10
- package/unbundled/button.js +14 -10
- package/unbundled/calendar-picker.template.cjs +3 -1
- package/unbundled/calendar-picker.template.js +3 -1
- package/unbundled/definition.cjs +2 -1
- package/unbundled/definition.js +2 -1
- package/unbundled/definition2.cjs +5 -2
- package/unbundled/definition2.js +5 -2
- package/unbundled/definition3.cjs +2 -1
- package/unbundled/definition3.js +2 -1
- package/unbundled/definition4.cjs +2 -1
- package/unbundled/definition4.js +2 -1
- package/unbundled/definition5.cjs +3 -2
- package/unbundled/definition5.js +4 -3
- package/unbundled/delegates-aria.cjs +1 -0
- package/unbundled/delegates-aria.js +1 -0
- package/unbundled/form-associated.cjs +4 -0
- package/unbundled/form-associated.js +4 -0
- package/unbundled/listbox.cjs +16 -1
- package/unbundled/listbox.js +16 -1
- package/unbundled/localized.cjs +36 -0
- package/unbundled/localized.js +37 -2
- package/unbundled/mixins.cjs +2 -0
- package/unbundled/mixins.js +2 -0
- package/unbundled/picker-field.template.cjs +1 -0
- package/unbundled/picker-field.template.js +1 -0
- package/unbundled/scrollIntoView.cjs +1 -0
- package/unbundled/scrollIntoView.js +1 -0
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -1
- package/unbundled/time-selection-picker.template.js +4 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +54 -44
- package/video-player/definition.js +51 -41
- package/video-player/index.cjs +28 -28
- package/video-player/index.js +1449 -1443
- package/vivid.api.json +6463 -6099
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +0 -4
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +0 -18
- package/lib/rich-text-editor/image-placeholder/definition.d.ts +0 -2
- package/lib/rich-text-editor/image-placeholder/image-placeholder.d.ts +0 -7
- package/lib/rich-text-editor/image-placeholder/image-placeholder.template.d.ts +0 -4
- package/lib/rich-text-editor/menubar/consts.d.ts +0 -18
- package/lib/rich-text-editor/menubar/definition.d.ts +0 -2
- package/lib/rich-text-editor/menubar/menubar.d.ts +0 -386
- package/lib/rich-text-editor/menubar/menubar.template.d.ts +0 -4
package/bundled/definition9.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";const Vt=require("./definition3.cjs"),Wt=require("./definition4.cjs"),S=require("./vivid-element.cjs"),mt=require("./ref.cjs"),Pt=require("./when.cjs"),Qt=require("./class-names.cjs"),Ht=["top","right","bottom","left"],At=["start","end"],Ct=Ht.reduce((t,e)=>t.concat(e,e+"-"+At[0],e+"-"+At[1]),[]),H=Math.min,E=Math.max,ct=Math.round,lt=Math.floor,X=t=>({x:t,y:t}),Zt={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function ee(t,e,n){return E(t,H(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function W(t){return t.split("-")[1]}function ne(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}const oe=new Set(["top","bottom"]);function q(t){return oe.has(_(t))?"y":"x"}function yt(t){return ne(q(t))}function _t(t,e,n){n===void 0&&(n=!1);const o=W(t),i=yt(t),r=bt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function ie(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>te[e])}const Et=["left","right"],St=["right","left"],re=["top","bottom"],se=["bottom","top"];function le(t,e,n){switch(t){case"top":case"bottom":return n?e?St:Et:e?Et:St;case"left":case"right":return e?re:se;default:return[]}}function ce(t,e,n,o){const i=W(t);let r=le(_(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Zt[e])}function ae(t){return{top:0,right:0,bottom:0,left:0,...t}}function vt(t){return typeof t!="number"?ae(t):{top:t,right:t,bottom:t,left:t}}function tt(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 Lt(t,e,n){let{reference:o,floating:i}=t;const r=q(e),s=yt(e),l=bt(s),c=_(e),a=r==="y",u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:o.y-i.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-i.width,y:f};break;default:p={x:o.x,y:o.y}}switch(W(e)){case"start":p[s]-=d*(n&&a?-1:1);break;case"end":p[s]+=d*(n&&a?-1:1);break}return p}const fe=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Lt(a,o,c),d=o,p={},h=0;for(let m=0;m<l.length;m++){const{name:g,fn:w}=l[m],{x:y,y:v,data:R,reset:x}=await w({x:u,y:f,initialPlacement:o,placement:d,strategy:i,middlewareData:p,rects:a,platform:s,elements:{reference:t,floating:e}});u=y??u,f=v??f,p={...p,[g]:{...p[g],...R}},x&&h<=50&&(h++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(a=x.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:u,y:f}=Lt(a,d,c)),m=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:p}};async function it(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=J(e,t),h=vt(p),g=l[d?f==="floating"?"reference":"floating":f],w=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),y=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),R=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},x=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:c}):y);return{top:(w.top-x.top+h.top)/R.y,bottom:(x.bottom-w.bottom+h.bottom)/R.y,left:(w.left-x.left+h.left)/R.x,right:(x.right-w.right+h.right)/R.x}}const ue=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:u=0}=J(t,e)||{};if(a==null)return{};const f=vt(u),d={x:n,y:o},p=yt(i),h=bt(p),m=await s.getDimensions(a),g=p==="y",w=g?"top":"left",y=g?"bottom":"right",v=g?"clientHeight":"clientWidth",R=r.reference[h]+r.reference[p]-d[p]-r.floating[h],x=d[p]-r.reference[p],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let O=P?P[v]:0;(!O||!await(s.isElement==null?void 0:s.isElement(P)))&&(O=l.floating[v]||r.floating[h]);const B=R/2-x/2,L=O/2-m[h]/2-1,b=H(f[w],L),A=H(f[y],L),T=b,D=O-m[h]-A,C=O/2-m[h]/2+B,V=ee(T,C,D),M=!c.arrow&&W(i)!=null&&C!==V&&r.reference[h]/2-(C<T?b:A)-m[h]/2<0,$=M?C<T?C-T:C-D:0;return{[p]:d[p]+$,data:{[p]:V,centerOffset:C-V-$,...M&&{alignmentOffset:$}},reset:M}}});function pe(t,e,n){return(t?[...n.filter(i=>W(i)===t),...n.filter(i=>W(i)!==t)]:n.filter(i=>_(i)===i)).filter(i=>t?W(i)===t||(e?at(i)!==i:!1):!0)}const de=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:l,platform:c,elements:a}=e,{crossAxis:u=!1,alignment:f,allowedPlacements:d=Ct,autoAlignment:p=!0,...h}=J(t,e),m=f!==void 0||d===Ct?pe(f||null,p,d):d,g=await it(e,h),w=((n=s.autoPlacement)==null?void 0:n.index)||0,y=m[w];if(y==null)return{};const v=_t(y,r,await(c.isRTL==null?void 0:c.isRTL(a.floating)));if(l!==y)return{reset:{placement:m[0]}};const R=[g[_(y)],g[v[0]],g[v[1]]],x=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:R}],P=m[w+1];if(P)return{data:{index:w+1,overflows:x},reset:{placement:P}};const O=x.map(b=>{const A=W(b.placement);return[b.placement,A&&u?b.overflows.slice(0,2).reduce((T,D)=>T+D,0):b.overflows[0],b.overflows]}).sort((b,A)=>b[1]-A[1]),L=((i=O.filter(b=>b[2].slice(0,W(b[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||O[0][0];return L!==l?{data:{index:w+1,overflows:x},reset:{placement:L}}:{}}}},he=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=J(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=_(i),y=q(l),v=_(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(a.floating)),x=d||(v||!m?[ft(l)]:ie(l)),P=h!=="none";!d&&P&&x.push(...ce(l,m,h,R));const O=[l,...x],B=await it(e,g),L=[];let b=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&L.push(B[w]),f){const C=_t(i,s,R);L.push(B[C[0]],B[C[1]])}if(b=[...b,{placement:i,overflows:L}],!L.every(C=>C<=0)){var A,T;const C=(((A=r.flip)==null?void 0:A.index)||0)+1,V=O[C];if(V&&(!(f==="alignment"?y!==q(V):!1)||b.every(k=>q(k.placement)===y?k.overflows[0]>0:!0)))return{data:{index:C,overflows:b},reset:{placement:V}};let M=(T=b.filter($=>$.overflows[0]<=0).sort(($,k)=>$.overflows[1]-k.overflows[1])[0])==null?void 0:T.placement;if(!M)switch(p){case"bestFit":{var D;const $=(D=b.filter(k=>{if(P){const K=q(k.placement);return K===y||K==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(K=>K>0).reduce((K,Jt)=>K+Jt,0)]).sort((k,K)=>k[1]-K[1])[0])==null?void 0:D[0];$&&(M=$);break}case"initialPlacement":M=l;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function Tt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Ht.some(e=>t[e]>=0)}const me=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=J(t,e);switch(o){case"referenceHidden":{const r=await it(e,{...i,elementContext:"reference"}),s=Tt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await it(e,{...i,altBoundary:!0}),s=Tt(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};function Nt(t){const e=H(...t.map(r=>r.left)),n=H(...t.map(r=>r.top)),o=E(...t.map(r=>r.right)),i=E(...t.map(r=>r.bottom));return{x:e,y:n,width:o-e,height:i-n}}function ge(t){const e=t.slice().sort((i,r)=>i.y-r.y),n=[];let o=null;for(let i=0;i<e.length;i++){const r=e[i];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(i=>tt(Nt(i)))}const we=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:c,y:a}=J(t,e),u=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(o.reference))||[]),f=ge(u),d=tt(Nt(u)),p=vt(l);function h(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&a!=null)return f.find(g=>c>g.left-p.left&&c<g.right+p.right&&a>g.top-p.top&&a<g.bottom+p.bottom)||d;if(f.length>=2){if(q(n)==="y"){const b=f[0],A=f[f.length-1],T=_(n)==="top",D=b.top,C=A.bottom,V=T?b.left:A.left,M=T?b.right:A.right,$=M-V,k=C-D;return{top:D,bottom:C,left:V,right:M,width:$,height:k,x:V,y:D}}const g=_(n)==="left",w=E(...f.map(b=>b.right)),y=H(...f.map(b=>b.left)),v=f.filter(b=>g?b.left===y:b.right===w),R=v[0].top,x=v[v.length-1].bottom,P=y,O=w,B=O-P,L=x-R;return{top:R,bottom:x,left:P,right:O,width:B,height:L,x:P,y:R}}return d}const m=await r.getElementRects({reference:{getBoundingClientRect:h},floating:o.floating,strategy:s});return i.reference.x!==m.reference.x||i.reference.y!==m.reference.y||i.reference.width!==m.reference.width||i.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},be=new Set(["left","top"]);async function ye(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=_(n),l=W(n),c=q(n)==="y",a=be.has(s)?-1:1,u=r&&c?-1:1,f=J(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),c?{x:p*u,y:d*a}:{x:d*a,y:p*u}}const ve=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,c=await ye(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},xe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:l}=e,{apply:c=()=>{},...a}=J(t,e),u=await it(e,a),f=_(i),d=W(i),p=q(i)==="y",{width:h,height:m}=r.floating;let g,w;f==="top"||f==="bottom"?(g=f,w=d===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,g=d==="end"?"top":"bottom");const y=m-u.top-u.bottom,v=h-u.left-u.right,R=H(m-u[g],y),x=H(h-u[w],v),P=!e.middlewareData.shift;let O=R,B=x;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=v),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=y),P&&!d){const b=E(u.left,0),A=E(u.right,0),T=E(u.top,0),D=E(u.bottom,0);p?B=h-2*(b!==0||A!==0?b+A:E(u.left,u.right)):O=m-2*(T!==0||D!==0?T+D:E(u.top,u.bottom))}await c({...e,availableWidth:B,availableHeight:O});const L=await s.getDimensions(l.floating);return h!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function nt(t){return zt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(zt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zt(t){return ut()?t instanceof Node||t instanceof F(t).Node:!1}function N(t){return ut()?t instanceof Element||t instanceof F(t).Element:!1}function I(t){return ut()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function $t(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const Re=new Set(["inline","contents"]);function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Re.has(i)}const Oe=new Set(["table","td","th"]);function Pe(t){return Oe.has(nt(t))}const Ae=[":popover-open",":modal"];function pt(t){return Ae.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ce=["transform","translate","scale","rotate","perspective"],Ee=["transform","translate","scale","rotate","perspective","filter"],Se=["paint","layout","strict","content"];function xt(t){const e=Rt(),n=N(t)?z(t):t;return Ce.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ee.some(o=>(n.willChange||"").includes(o))||Se.some(o=>(n.contain||"").includes(o))}function Le(t){let e=G(t);for(;I(e)&&!et(e);){if(xt(e))return e;if(pt(e))return null;e=G(e)}return null}function Rt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Te=new Set(["html","body","#document"]);function et(t){return Te.has(nt(t))}function z(t){return F(t).getComputedStyle(t)}function dt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$t(t)&&t.host||Y(t);return $t(e)?e.host:e}function jt(t){const e=G(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:I(e)&&st(e)?e:jt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=jt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=F(i);if(r){const l=wt(s);return e.concat(s,s.visualViewport||[],st(i)?i:[],l&&n?rt(l):[])}return e.concat(i,rt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Xt(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=I(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=ct(n)!==r||ct(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Ot(t){return N(t)?t:t.contextElement}function Z(t){const e=Ot(t);if(!I(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Xt(e);let s=(r?ct(n.width):n.width)/o,l=(r?ct(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const De=X(0);function It(t){const e=F(t);return!Rt()||!e.visualViewport?De:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $e(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Ot(t);let s=X(1);e&&(o?N(o)&&(s=Z(o)):s=Z(t));const l=$e(r,n,o)?It(r):X(0);let c=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(r){const d=F(r),p=o&&N(o)?F(o):o;let h=d,m=wt(h);for(;m&&o&&p!==h;){const g=Z(m),w=m.getBoundingClientRect(),y=z(m),v=w.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,R=w.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,a*=g.y,u*=g.x,f*=g.y,c+=v,a+=R,h=F(m),m=wt(h)}}return tt({width:u,height:f,x:c,y:a})}function ht(t,e){const n=dt(t).scrollLeft;return e?e.left+n:Q(Y(t)).left+n}function Yt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ht(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ke(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),l=e?pt(e.floating):!1;if(o===s||l&&r)return n;let c={scrollLeft:0,scrollTop:0},a=X(1);const u=X(0),f=I(o);if((f||!f&&!r)&&((nt(o)!=="body"||st(s))&&(c=dt(o)),I(o))){const p=Q(o);a=Z(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}const d=s&&!f&&!r?Yt(s,c):X(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+d.x,y:n.y*a.y-c.scrollTop*a.y+u.y+d.y}}function Fe(t){return Array.from(t.getClientRects())}function Be(t){const e=Y(t),n=dt(t),o=t.ownerDocument.body,i=E(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=E(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ht(t);const l=-n.scrollTop;return z(o).direction==="rtl"&&(s+=E(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}const kt=25;function Me(t,e){const n=F(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const u=Rt();(!u||u&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const a=ht(o);if(a<=0){const u=o.ownerDocument,f=u.body,d=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(o.clientWidth-f.clientWidth-p);h<=kt&&(r-=h)}else a<=kt&&(r+=a);return{width:r,height:s,x:l,y:c}}const Ve=new Set(["absolute","fixed"]);function We(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=I(t)?Z(t):X(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=o*r.y;return{width:s,height:l,x:c,y:a}}function Ft(t,e,n){let o;if(e==="viewport")o=Me(t,n);else if(e==="document")o=Be(Y(t));else if(N(e))o=We(e,n);else{const i=It(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function qt(t,e){const n=G(t);return n===e||!N(n)||et(n)?!1:z(n).position==="fixed"||qt(n,e)}function He(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(l=>N(l)&&nt(l)!=="body"),i=null;const r=z(t).position==="fixed";let s=r?G(t):t;for(;N(s)&&!et(s);){const l=z(s),c=xt(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&Ve.has(i.position)||st(s)&&!c&&qt(t,s))?o=o.filter(u=>u!==s):i=l,s=G(s)}return e.set(t,o),o}function _e(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:He(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((a,u)=>{const f=Ft(e,u,i);return a.top=E(f.top,a.top),a.right=H(f.right,a.right),a.bottom=H(f.bottom,a.bottom),a.left=E(f.left,a.left),a},Ft(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ne(t){const{width:e,height:n}=Xt(t);return{width:e,height:n}}function ze(t,e,n){const o=I(e),i=Y(e),r=n==="fixed",s=Q(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=X(0);function a(){c.x=ht(i)}if(o||!o&&!r)if((nt(e)!=="body"||st(i))&&(l=dt(e)),o){const p=Q(e,!0,r,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&a();r&&!o&&i&&a();const u=i&&!o&&!r?Yt(i,l):X(0),f=s.left+l.scrollLeft-c.x-u.x,d=s.top+l.scrollTop-c.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function gt(t){return z(t).position==="static"}function Bt(t,e){if(!I(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Ut(t,e){const n=F(t);if(pt(t))return n;if(!I(t)){let i=G(t);for(;i&&!et(i);){if(N(i)&&!gt(i))return i;i=G(i)}return n}let o=Bt(t,e);for(;o&&Pe(o)&>(o);)o=Bt(o,e);return o&&et(o)&>(o)&&!xt(o)?n:o||Le(t)||n}const je=async function(t){const e=this.getOffsetParent||Ut,n=this.getDimensions,o=await n(t.floating);return{reference:ze(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Xe(t){return z(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:ke,getDocumentElement:Y,getClippingRect:_e,getOffsetParent:Ut,getElementRects:je,getClientRects:Fe,getDimensions:Ne,getScale:Z,isElement:N,isRTL:Xe};function Kt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ye(t,e){let n=null,o;const i=Y(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const a=t.getBoundingClientRect(),{left:u,top:f,width:d,height:p}=a;if(l||e(),!d||!p)return;const h=lt(f),m=lt(i.clientWidth-(u+d)),g=lt(i.clientHeight-(f+p)),w=lt(u),v={rootMargin:-h+"px "+-m+"px "+-g+"px "+-w+"px",threshold:E(0,H(1,c))||1};let R=!0;function x(P){const O=P[0].intersectionRatio;if(O!==c){if(!R)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Kt(a,t.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(x,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(t)}return s(!0),r}function qe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=Ot(t),u=i||r?[...a?rt(a):[],...rt(e)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const f=a&&l?Ye(a,n):null;let d=-1,p=null;s&&(p=new ResizeObserver(w=>{let[y]=w;y&&y.target===a&&p&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(e)})),n()}),a&&!c&&p.observe(a),p.observe(e));let h,m=c?Q(t):null;c&&g();function g(){const w=Q(t);m&&!Kt(m,w)&&n(),m=w,h=requestAnimationFrame(g)}return n(),()=>{var w;u.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),(w=p)==null||w.disconnect(),p=null,c&&cancelAnimationFrame(h)}}const Ue=ve,Mt=de,Ke=he,Ge=xe,Je=me,Qe=ue,Ze=we,tn=(t,e,n)=>{const o=new Map,i={platform:Ie,...n},r={...i.platform,_c:o};return fe(t,e,{...i,platform:r})};var en=Object.defineProperty,U=(t,e,n,o)=>{for(var i=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=s(e,n,i)||i);return i&&en(e,n,i),i};const ot={Flip:"flip",AutoPlacementHorizontal:"auto-placement-horizontal",AutoPlacementVertical:"auto-placement-vertical"},nn={[ot.Flip]:Ke(),[ot.AutoPlacementHorizontal]:Mt({allowedPlacements:["bottom","top","bottom-start","bottom-end","top-start","top-end"]}),[ot.AutoPlacementVertical]:Mt({allowedPlacements:["left","right","left-start","left-end","right-start","right-end"]})};class j extends S.VividElement{constructor(){super(...arguments),this.open=!1,this.dismissible=!1,this.arrow=!1,this.alternate=!1,this.placementStrategy=ot.Flip,this.animationFrame=!1,this.strategy="fixed",this.offset=null,this.#i=()=>(this.#n=this.updatePosition(),this.#n)}get#r(){let e=[Ze(),nn[this.placementStrategy],Je(),Ge({apply({availableWidth:o,availableHeight:i,elements:r}){Object.assign(r.floating.style,{maxWidth:`${o}px`,maxHeight:`${i}px`})}})],n=this.offset??0;return this.arrow&&(n+=12,e=[...e,Qe({element:this.arrowEl,padding:10})]),n>0&&e.unshift(Ue(n)),e}#o;openChanged(e,n){this.#e(),this.#t(),this.$emit(n?"vwc-popup:open":"vwc-popup:close")}animationFrameChanged(){this.#t()}anchorChanged(){this.#t()}strategyChanged(){this.#e()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#t()}#t(){this.#o?.(),this.open&&this.controlEl&&this.controlEl.classList.add("open"),this.anchorEl&&this.open&&this.popupEl&&(this.#o=qe(this.anchorEl,this.popupEl,this.#i,{animationFrame:this.animationFrame}))}#e(){this.popupEl&&this.strategy==="fixed"&&(this.open?this.popupEl.showPopover():this.popupEl.hidePopover())}#n;#i;async updatePosition(){if(!this.open||!this.anchorEl)return;const e=await tn(this.anchorEl,this.popupEl,{placement:this.placement,strategy:this.strategy,middleware:this.#r});this.#s(e),this.arrow&&this.#l(e)}#s(e){const{x:n,y:o}=e,{referenceHidden:i}=e.middlewareData.hide;Object.assign(this.popupEl.style,{left:`${n}px`,top:`${o}px`,visibility:i?"hidden":"visible"})}#l(e){const{x:n,y:o}=e.middlewareData.arrow,i={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},r=e.placement.split("-")[0];Object.assign(this.arrowEl.style,{left:n?`${n}px`:i[r],top:o?`${o}px`:i[r]})}get anchorEl(){return this.anchor??null}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}}U([S.attr({mode:"boolean"})],j.prototype,"open");U([S.attr({mode:"boolean"})],j.prototype,"dismissible");U([S.attr({mode:"boolean"})],j.prototype,"arrow");U([S.attr({mode:"boolean"})],j.prototype,"alternate");U([S.attr({mode:"fromView"})],j.prototype,"placement");U([S.attr({mode:"boolean",attribute:"animation-frame"})],j.prototype,"animationFrame");U([S.attr({mode:"fromView"})],j.prototype,"strategy");U([S.attr({attribute:"offset",converter:S.nullableNumberConverter})],j.prototype,"offset");U([S.observable],j.prototype,"anchor");const on=":host{display:var(--_popup-display, inline)}.control{border-radius:inherit;background:var(--vvd-color-surface-4dp);contain:layout}.control:not(.open){display:none}.popup-wrapper{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.popup-wrapper{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.popup-wrapper ::-webkit-scrollbar{width:4px}.popup-wrapper ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.popup-wrapper ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.popup-wrapper{z-index:var(--_popup-z-index, 10);overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content}.popup-wrapper:not(.absolute){position:fixed}.popup-wrapper.absolute{position:absolute;top:0;left:0}.popup-content{display:grid;color:var(--vvd-color-canvas-text)}.dismissible .popup-content{align-content:start;grid-template-columns:1fr auto}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismissible-button{align-self:flex-start;margin-block-start:4px;margin-inline-end:4px}",rn=({open:t,dismissible:e,alternate:n})=>Qt.classNames("control",["open",!!t],["dismissible",!!e],["alternate",!!n]);function sn(t){return t.strategy&&t.strategy==="fixed"?"manual":null}const ln=t=>{const e=t.tagFor(Wt.Elevation),n=t.tagFor(Vt.Button);return S.html`
|
|
1
|
+
"use strict";const Wt=require("./definition3.cjs"),Ht=require("./definition4.cjs"),E=require("./vivid-element.cjs"),ht=require("./ref.cjs"),Pt=require("./when.cjs"),te=require("./class-names.cjs"),_t=["top","right","bottom","left"],Ct=["start","end"],St=_t.reduce((t,e)=>t.concat(e,e+"-"+Ct[0],e+"-"+Ct[1]),[]),_=Math.min,S=Math.max,ct=Math.round,lt=Math.floor,I=t=>({x:t,y:t}),ee={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"};function wt(t,e,n){return S(t,_(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function V(t){return t.split("-")[0]}function H(t){return t.split("-")[1]}function Nt(t){return t==="x"?"y":"x"}function xt(t){return t==="y"?"height":"width"}const oe=new Set(["top","bottom"]);function X(t){return oe.has(V(t))?"y":"x"}function bt(t){return Nt(X(t))}function zt(t,e,n){n===void 0&&(n=!1);const o=H(t),i=bt(t),r=xt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function ie(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>ne[e])}const Et=["left","right"],Lt=["right","left"],re=["top","bottom"],se=["bottom","top"];function le(t,e,n){switch(t){case"top":case"bottom":return n?e?Lt:Et:e?Et:Lt;case"left":case"right":return e?re:se;default:return[]}}function ce(t,e,n,o){const i=H(t);let r=le(V(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>ee[e])}function ae(t){return{top:0,right:0,bottom:0,left:0,...t}}function vt(t){return typeof t!="number"?ae(t):{top:t,right:t,bottom:t,left:t}}function tt(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 Tt(t,e,n){let{reference:o,floating:i}=t;const r=X(e),s=bt(e),l=xt(s),a=V(e),f=r==="y",u=o.x+o.width/2-i.width/2,c=o.y+o.height/2-i.height/2,p=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:u,y:o.y-i.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:c};break;case"left":d={x:o.x-i.width,y:c};break;default:d={x:o.x,y:o.y}}switch(H(e)){case"start":d[s]-=p*(n&&f?-1:1);break;case"end":d[s]+=p*(n&&f?-1:1);break}return d}const fe=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:c}=Tt(f,o,a),p=o,d={},m=0;for(let h=0;h<l.length;h++){const{name:g,fn:w}=l[h],{x:y,y:b,data:A,reset:v}=await w({x:u,y:c,initialPlacement:o,placement:p,strategy:i,middlewareData:d,rects:f,platform:s,elements:{reference:t,floating:e}});u=y??u,c=b??c,d={...d,[g]:{...d[g],...A}},v&&m<=50&&(m++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(f=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:u,y:c}=Tt(f,p,a)),h=-1)}return{x:u,y:c,placement:p,strategy:i,middlewareData:d}};async function et(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:c="floating",altBoundary:p=!1,padding:d=0}=U(e,t),m=vt(d),g=l[p?c==="floating"?"reference":"floating":c],w=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:f,rootBoundary:u,strategy:a})),y=c==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),A=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},v=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:a}):y);return{top:(w.top-v.top+m.top)/A.y,bottom:(v.bottom-w.bottom+m.bottom)/A.y,left:(w.left-v.left+m.left)/A.x,right:(v.right-w.right+m.right)/A.x}}const ue=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:f,padding:u=0}=U(t,e)||{};if(f==null)return{};const c=vt(u),p={x:n,y:o},d=bt(i),m=xt(d),h=await s.getDimensions(f),g=d==="y",w=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",A=r.reference[m]+r.reference[d]-p[d]-r.floating[m],v=p[d]-r.reference[d],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let R=O?O[b]:0;(!R||!await(s.isElement==null?void 0:s.isElement(O)))&&(R=l.floating[b]||r.floating[m]);const B=A/2-v/2,L=R/2-h[m]/2-1,x=_(c[w],L),P=_(c[y],L),T=x,D=R-h[m]-P,C=R/2-h[m]/2+B,W=wt(T,C,D),M=!a.arrow&&H(i)!=null&&C!==W&&r.reference[m]/2-(C<T?x:P)-h[m]/2<0,k=M?C<T?C-T:C-D:0;return{[d]:p[d]+k,data:{[d]:W,centerOffset:C-W-k,...M&&{alignmentOffset:k}},reset:M}}});function de(t,e,n){return(t?[...n.filter(i=>H(i)===t),...n.filter(i=>H(i)!==t)]:n.filter(i=>V(i)===i)).filter(i=>t?H(i)===t||(e?at(i)!==i:!1):!0)}const pe=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:l,platform:a,elements:f}=e,{crossAxis:u=!1,alignment:c,allowedPlacements:p=St,autoAlignment:d=!0,...m}=U(t,e),h=c!==void 0||p===St?de(c||null,d,p):p,g=await et(e,m),w=((n=s.autoPlacement)==null?void 0:n.index)||0,y=h[w];if(y==null)return{};const b=zt(y,r,await(a.isRTL==null?void 0:a.isRTL(f.floating)));if(l!==y)return{reset:{placement:h[0]}};const A=[g[V(y)],g[b[0]],g[b[1]]],v=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:A}],O=h[w+1];if(O)return{data:{index:w+1,overflows:v},reset:{placement:O}};const R=v.map(x=>{const P=H(x.placement);return[x.placement,P&&u?x.overflows.slice(0,2).reduce((T,D)=>T+D,0):x.overflows[0],x.overflows]}).sort((x,P)=>x[1]-P[1]),L=((i=R.filter(x=>x[2].slice(0,H(x[0])?2:3).every(P=>P<=0))[0])==null?void 0:i[0])||R[0][0];return L!==l?{data:{index:w+1,overflows:v},reset:{placement:L}}:{}}}},me=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:f}=e,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=U(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=V(i),y=X(l),b=V(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(f.floating)),v=p||(b||!h?[ft(l)]:ie(l)),O=m!=="none";!p&&O&&v.push(...ce(l,h,m,A));const R=[l,...v],B=await et(e,g),L=[];let x=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&L.push(B[w]),c){const C=zt(i,s,A);L.push(B[C[0]],B[C[1]])}if(x=[...x,{placement:i,overflows:L}],!L.every(C=>C<=0)){var P,T;const C=(((P=r.flip)==null?void 0:P.index)||0)+1,W=R[C];if(W&&(!(c==="alignment"?y!==X(W):!1)||x.every($=>X($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:C,overflows:x},reset:{placement:W}};let M=(T=x.filter(k=>k.overflows[0]<=0).sort((k,$)=>k.overflows[1]-$.overflows[1])[0])==null?void 0:T.placement;if(!M)switch(d){case"bestFit":{var D;const k=(D=x.filter($=>{if(O){const G=X($.placement);return G===y||G==="y"}return!0}).map($=>[$.placement,$.overflows.filter(G=>G>0).reduce((G,Zt)=>G+Zt,0)]).sort(($,G)=>$[1]-G[1])[0])==null?void 0:D[0];k&&(M=k);break}case"initialPlacement":M=l;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function Dt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function kt(t){return _t.some(e=>t[e]>=0)}const he=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=U(t,e);switch(o){case"referenceHidden":{const r=await et(e,{...i,elementContext:"reference"}),s=Dt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:kt(s)}}}case"escaped":{const r=await et(e,{...i,altBoundary:!0}),s=Dt(r,n.floating);return{data:{escapedOffsets:s,escaped:kt(s)}}}default:return{}}}}};function jt(t){const e=_(...t.map(r=>r.left)),n=_(...t.map(r=>r.top)),o=S(...t.map(r=>r.right)),i=S(...t.map(r=>r.bottom));return{x:e,y:n,width:o-e,height:i-n}}function ge(t){const e=t.slice().sort((i,r)=>i.y-r.y),n=[];let o=null;for(let i=0;i<e.length;i++){const r=e[i];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(i=>tt(jt(i)))}const we=function(t){return t===void 0&&(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:f}=U(t,e),u=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(o.reference))||[]),c=ge(u),p=tt(jt(u)),d=vt(l);function m(){if(c.length===2&&c[0].left>c[1].right&&a!=null&&f!=null)return c.find(g=>a>g.left-d.left&&a<g.right+d.right&&f>g.top-d.top&&f<g.bottom+d.bottom)||p;if(c.length>=2){if(X(n)==="y"){const x=c[0],P=c[c.length-1],T=V(n)==="top",D=x.top,C=P.bottom,W=T?x.left:P.left,M=T?x.right:P.right,k=M-W,$=C-D;return{top:D,bottom:C,left:W,right:M,width:k,height:$,x:W,y:D}}const g=V(n)==="left",w=S(...c.map(x=>x.right)),y=_(...c.map(x=>x.left)),b=c.filter(x=>g?x.left===y:x.right===w),A=b[0].top,v=b[b.length-1].bottom,O=y,R=w,B=R-O,L=v-A;return{top:A,bottom:v,left:O,right:R,width:B,height:L,x:O,y:A}}return p}const h=await r.getElementRects({reference:{getBoundingClientRect:m},floating:o.floating,strategy:s});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},ye=new Set(["left","top"]);async function xe(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=V(n),l=H(n),a=X(n)==="y",f=ye.has(s)?-1:1,u=r&&a?-1:1,c=U(e,t);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return l&&typeof m=="number"&&(d=l==="end"?m*-1:m),a?{x:d*u,y:p*f}:{x:p*f,y:d*u}}const be=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await xe(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}}}}},ve=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:w,y}=g;return{x:w,y}}},...a}=U(t,e),f={x:n,y:o},u=await et(e,a),c=X(V(i)),p=Nt(c);let d=f[p],m=f[c];if(r){const g=p==="y"?"top":"left",w=p==="y"?"bottom":"right",y=d+u[g],b=d-u[w];d=wt(y,d,b)}if(s){const g=c==="y"?"top":"left",w=c==="y"?"bottom":"right",y=m+u[g],b=m-u[w];m=wt(y,m,b)}const h=l.fn({...e,[p]:d,[c]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:r,[c]:s}}}}}},Ae=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:l}=e,{apply:a=()=>{},...f}=U(t,e),u=await et(e,f),c=V(i),p=H(i),d=X(i)==="y",{width:m,height:h}=r.floating;let g,w;c==="top"||c==="bottom"?(g=c,w=p===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=c,g=p==="end"?"top":"bottom");const y=h-u.top-u.bottom,b=m-u.left-u.right,A=_(h-u[g],y),v=_(m-u[w],b),O=!e.middlewareData.shift;let R=A,B=v;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=b),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(R=y),O&&!p){const x=S(u.left,0),P=S(u.right,0),T=S(u.top,0),D=S(u.bottom,0);d?B=m-2*(x!==0||P!==0?x+P:S(u.left,u.right)):R=h-2*(T!==0||D!==0?T+D:S(u.top,u.bottom))}await a({...e,availableWidth:B,availableHeight:R});const L=await s.getDimensions(l.floating);return m!==L.width||h!==L.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function ot(t){return Xt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function q(t){var e;return(e=(Xt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xt(t){return ut()?t instanceof Node||t instanceof F(t).Node:!1}function N(t){return ut()?t instanceof Element||t instanceof F(t).Element:!1}function Y(t){return ut()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function $t(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const Re=new Set(["inline","contents"]);function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Re.has(i)}const Oe=new Set(["table","td","th"]);function Pe(t){return Oe.has(ot(t))}const Ce=[":popover-open",":modal"];function dt(t){return Ce.some(e=>{try{return t.matches(e)}catch{return!1}})}const Se=["transform","translate","scale","rotate","perspective"],Ee=["transform","translate","scale","rotate","perspective","filter"],Le=["paint","layout","strict","content"];function At(t){const e=Rt(),n=N(t)?z(t):t;return Se.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ee.some(o=>(n.willChange||"").includes(o))||Le.some(o=>(n.contain||"").includes(o))}function Te(t){let e=J(t);for(;Y(e)&&!nt(e);){if(At(e))return e;if(dt(e))return null;e=J(e)}return null}function Rt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const De=new Set(["html","body","#document"]);function nt(t){return De.has(ot(t))}function z(t){return F(t).getComputedStyle(t)}function pt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function J(t){if(ot(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$t(t)&&t.host||q(t);return $t(e)?e.host:e}function It(t){const e=J(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Y(e)&&st(e)?e:It(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=It(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=F(i);if(r){const l=yt(s);return e.concat(s,s.visualViewport||[],st(i)?i:[],l&&n?rt(l):[])}return e.concat(i,rt(i,[],n))}function yt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yt(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Y(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=ct(n)!==r||ct(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Ot(t){return N(t)?t:t.contextElement}function Z(t){const e=Ot(t);if(!Y(e))return I(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(e);let s=(r?ct(n.width):n.width)/o,l=(r?ct(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const ke=I(0);function qt(t){const e=F(t);return!Rt()||!e.visualViewport?ke:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $e(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Ot(t);let s=I(1);e&&(o?N(o)&&(s=Z(o)):s=Z(t));const l=$e(r,n,o)?qt(r):I(0);let a=(i.left+l.x)/s.x,f=(i.top+l.y)/s.y,u=i.width/s.x,c=i.height/s.y;if(r){const p=F(r),d=o&&N(o)?F(o):o;let m=p,h=yt(m);for(;h&&o&&d!==m;){const g=Z(h),w=h.getBoundingClientRect(),y=z(h),b=w.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,A=w.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;a*=g.x,f*=g.y,u*=g.x,c*=g.y,a+=b,f+=A,m=F(h),h=yt(m)}}return tt({width:u,height:c,x:a,y:f})}function mt(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Q(q(t)).left+n}function Ut(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-mt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Fe(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=q(o),l=e?dt(e.floating):!1;if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},f=I(1);const u=I(0),c=Y(o);if((c||!c&&!r)&&((ot(o)!=="body"||st(s))&&(a=pt(o)),Y(o))){const d=Q(o);f=Z(o),u.x=d.x+o.clientLeft,u.y=d.y+o.clientTop}const p=s&&!c&&!r?Ut(s,a):I(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+u.x+p.x,y:n.y*f.y-a.scrollTop*f.y+u.y+p.y}}function Be(t){return Array.from(t.getClientRects())}function Me(t){const e=q(t),n=pt(t),o=t.ownerDocument.body,i=S(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=S(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mt(t);const l=-n.scrollTop;return z(o).direction==="rtl"&&(s+=S(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}const Ft=25;function Ve(t,e){const n=F(t),o=q(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const u=Rt();(!u||u&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}const f=mt(o);if(f<=0){const u=o.ownerDocument,c=u.body,p=getComputedStyle(c),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-c.clientWidth-d);m<=Ft&&(r-=m)}else f<=Ft&&(r+=f);return{width:r,height:s,x:l,y:a}}const We=new Set(["absolute","fixed"]);function He(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Y(t)?Z(t):I(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,f=o*r.y;return{width:s,height:l,x:a,y:f}}function Bt(t,e,n){let o;if(e==="viewport")o=Ve(t,n);else if(e==="document")o=Me(q(t));else if(N(e))o=He(e,n);else{const i=qt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function Kt(t,e){const n=J(t);return n===e||!N(n)||nt(n)?!1:z(n).position==="fixed"||Kt(n,e)}function _e(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(l=>N(l)&&ot(l)!=="body"),i=null;const r=z(t).position==="fixed";let s=r?J(t):t;for(;N(s)&&!nt(s);){const l=z(s),a=At(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&We.has(i.position)||st(s)&&!a&&Kt(t,s))?o=o.filter(u=>u!==s):i=l,s=J(s)}return e.set(t,o),o}function Ne(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?dt(e)?[]:_e(e,this._c):[].concat(n),o],l=s[0],a=s.reduce((f,u)=>{const c=Bt(e,u,i);return f.top=S(c.top,f.top),f.right=_(c.right,f.right),f.bottom=_(c.bottom,f.bottom),f.left=S(c.left,f.left),f},Bt(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ze(t){const{width:e,height:n}=Yt(t);return{width:e,height:n}}function je(t,e,n){const o=Y(e),i=q(e),r=n==="fixed",s=Q(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=I(0);function f(){a.x=mt(i)}if(o||!o&&!r)if((ot(e)!=="body"||st(i))&&(l=pt(e)),o){const d=Q(e,!0,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else i&&f();r&&!o&&i&&f();const u=i&&!o&&!r?Ut(i,l):I(0),c=s.left+l.scrollLeft-a.x-u.x,p=s.top+l.scrollTop-a.y-u.y;return{x:c,y:p,width:s.width,height:s.height}}function gt(t){return z(t).position==="static"}function Mt(t,e){if(!Y(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return q(t)===n&&(n=n.ownerDocument.body),n}function Gt(t,e){const n=F(t);if(dt(t))return n;if(!Y(t)){let i=J(t);for(;i&&!nt(i);){if(N(i)&&!gt(i))return i;i=J(i)}return n}let o=Mt(t,e);for(;o&&Pe(o)&>(o);)o=Mt(o,e);return o&&nt(o)&>(o)&&!At(o)?n:o||Te(t)||n}const Xe=async function(t){const e=this.getOffsetParent||Gt,n=this.getDimensions,o=await n(t.floating);return{reference:je(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ie(t){return z(t).direction==="rtl"}const Ye={convertOffsetParentRelativeRectToViewportRelativeRect:Fe,getDocumentElement:q,getClippingRect:Ne,getOffsetParent:Gt,getElementRects:Xe,getClientRects:Be,getDimensions:ze,getScale:Z,isElement:N,isRTL:Ie};function Jt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qe(t,e){let n=null,o;const i=q(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();const f=t.getBoundingClientRect(),{left:u,top:c,width:p,height:d}=f;if(l||e(),!p||!d)return;const m=lt(c),h=lt(i.clientWidth-(u+p)),g=lt(i.clientHeight-(c+d)),w=lt(u),b={rootMargin:-m+"px "+-h+"px "+-g+"px "+-w+"px",threshold:S(0,_(1,a))||1};let A=!0;function v(O){const R=O[0].intersectionRatio;if(R!==a){if(!A)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!Jt(f,t.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(v,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,b)}n.observe(t)}return s(!0),r}function Ue(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,f=Ot(t),u=i||r?[...f?rt(f):[],...rt(e)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const c=f&&l?qe(f,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(w=>{let[y]=w;y&&y.target===f&&d&&(d.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=d)==null||b.observe(e)})),n()}),f&&!a&&d.observe(f),d.observe(e));let m,h=a?Q(t):null;a&&g();function g(){const w=Q(t);h&&!Jt(h,w)&&n(),h=w,m=requestAnimationFrame(g)}return n(),()=>{var w;u.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),c?.(),(w=d)==null||w.disconnect(),d=null,a&&cancelAnimationFrame(m)}}const Ke=be,Vt=pe,Ge=ve,Je=me,Qe=Ae,Ze=he,tn=ue,en=we,nn=(t,e,n)=>{const o=new Map,i={platform:Ye,...n},r={...i.platform,_c:o};return fe(t,e,{...i,platform:r})};var on=Object.defineProperty,K=(t,e,n,o)=>{for(var i=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=s(e,n,i)||i);return i&&on(e,n,i),i};const it={Flip:"flip",AutoPlacementHorizontal:"auto-placement-horizontal",AutoPlacementVertical:"auto-placement-vertical"},rn={[it.Flip]:Je(),[it.AutoPlacementHorizontal]:Vt({allowedPlacements:["bottom","top","bottom-start","bottom-end","top-start","top-end"]}),[it.AutoPlacementVertical]:Vt({allowedPlacements:["left","right","left-start","left-end","right-start","right-end"]})};class j extends E.VividElement{constructor(){super(...arguments),this.open=!1,this.dismissible=!1,this.arrow=!1,this.alternate=!1,this.placementStrategy=it.Flip,this.animationFrame=!1,this.strategy="fixed",this.offset=null,this.#i=()=>(this.#n=this.updatePosition(),this.#n)}get#r(){let e=[en(),rn[this.placementStrategy],Ze(),Qe({apply({availableWidth:o,availableHeight:i,elements:r}){Object.assign(r.floating.style,{maxWidth:`${o}px`,maxHeight:`${i}px`})}}),Ge()],n=this.offset??0;return this.arrow&&(n+=12,e=[...e,tn({element:this.arrowEl,padding:10})]),n>0&&e.unshift(Ke(n)),e}#o;openChanged(e,n){this.#e(),this.#t(),this.$emit(n?"vwc-popup:open":"vwc-popup:close")}animationFrameChanged(){this.#t()}anchorChanged(){this.#t()}strategyChanged(){this.#e()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#t()}#t(){this.#o?.(),this.open&&this.controlEl&&this.controlEl.classList.add("open"),this.anchorEl&&this.open&&this.popupEl&&(this.#o=Ue(this.anchorEl,this.popupEl,this.#i,{animationFrame:this.animationFrame}))}#e(){this.popupEl&&this.strategy==="fixed"&&(this.open?this.popupEl.showPopover():this.popupEl.hidePopover())}#n;#i;async updatePosition(){if(!this.open||!this.anchorEl)return;const e=await nn(this.anchorEl,this.popupEl,{placement:this.placement,strategy:this.strategy,middleware:this.#r});this.#s(e),this.arrow&&this.#l(e)}#s(e){const{x:n,y:o}=e,{referenceHidden:i}=e.middlewareData.hide;Object.assign(this.popupEl.style,{left:`${n}px`,top:`${o}px`,visibility:i?"hidden":"visible"})}#l(e){const{x:n,y:o}=e.middlewareData.arrow,i={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},r=e.placement.split("-")[0];Object.assign(this.arrowEl.style,{left:n?`${n}px`:i[r],top:o?`${o}px`:i[r]})}get anchorEl(){return this.anchor??null}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}}K([E.attr({mode:"boolean"})],j.prototype,"open");K([E.attr({mode:"boolean"})],j.prototype,"dismissible");K([E.attr({mode:"boolean"})],j.prototype,"arrow");K([E.attr({mode:"boolean"})],j.prototype,"alternate");K([E.attr({mode:"fromView"})],j.prototype,"placement");K([E.attr({mode:"boolean",attribute:"animation-frame"})],j.prototype,"animationFrame");K([E.attr({mode:"fromView"})],j.prototype,"strategy");K([E.attr({attribute:"offset",converter:E.nullableNumberConverter})],j.prototype,"offset");K([E.observable],j.prototype,"anchor");const sn=":host{display:var(--_popup-display, inline)}.control{border-radius:inherit;background:var(--vvd-color-surface-4dp);contain:layout}.control:not(.open){display:none}.popup-wrapper{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.popup-wrapper{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.popup-wrapper ::-webkit-scrollbar{width:4px}.popup-wrapper ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.popup-wrapper ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.popup-wrapper{z-index:var(--_popup-z-index, 10);overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content;min-inline-size:fit-content}.popup-wrapper:not(.absolute){position:fixed}.popup-wrapper.absolute{position:absolute;top:0;left:0}.popup-content{display:grid;color:var(--vvd-color-canvas-text)}.dismissible .popup-content{align-content:start;grid-template-columns:1fr auto}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismissible-button{align-self:flex-start;margin-block-start:4px;margin-inline-end:4px}",ln=({open:t,dismissible:e,alternate:n})=>te.classNames("control",["open",!!t],["dismissible",!!e],["alternate",!!n]);function cn(t){return t.strategy&&t.strategy==="fixed"?"manual":null}const an=t=>{const e=t.tagFor(Ht.Elevation),n=t.tagFor(Wt.Button);return E.html`
|
|
2
2
|
<${e}>
|
|
3
|
-
<div popover="${
|
|
4
|
-
<div ${
|
|
3
|
+
<div popover="${cn}" class="popup-wrapper ${o=>o.strategy}" ${ht.ref("popupEl")} part="popup-base">
|
|
4
|
+
<div ${ht.ref("controlEl")} class="${ln}" aria-hidden="${o=>o.open?"false":"true"}"
|
|
5
5
|
part="${o=>o.alternate?"vvd-theme-alternate":""}">
|
|
6
6
|
<div class="popup-content">
|
|
7
7
|
<slot></slot>
|
|
8
|
-
${Pt.when(o=>o.dismissible,
|
|
8
|
+
${Pt.when(o=>o.dismissible,E.html`<${n} size="condensed" @click="${o=>o.open=!1}"
|
|
9
9
|
class="dismissible-button" icon="close-small-solid" shape="pill"></${n}>`)}
|
|
10
10
|
</div>
|
|
11
|
-
${Pt.when(o=>o.arrow,
|
|
11
|
+
${Pt.when(o=>o.arrow,E.html`<div class="arrow" ${ht.ref("arrowEl")}></div>`)}
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
|
-
</${e}>`},
|
|
14
|
+
</${e}>`},Qt=E.defineVividComponent("popup",j,an,[Ht.elevationDefinition,Wt.buttonDefinition],{styles:sn}),fn=E.createRegisterFunction(Qt);exports.PlacementStrategy=it;exports.Popup=j;exports.popupDefinition=Qt;exports.registerPopup=fn;
|