@swisspost/design-system-components 10.5.0 → 10.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/README.md +2 -2
- package/dist/cjs/{create-validator-decorator-u-Byhihe.js → create-validator-decorator-D7nAb9KJ.js} +1 -1
- package/dist/cjs/{index-CXnlZiX8.js → index-DWIlRT6N.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-LGG0uEIi.js → one-of-B8RUgrZk.js} +1 -1
- package/dist/cjs/{package-DdU-rENe.js → package-BtKYhTNj.js} +1 -1
- package/dist/cjs/{pattern-B-csvfNt.js → pattern-B6VoDk_m.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +5 -5
- package/dist/cjs/post-autocomplete.cjs.entry.js +5 -5
- package/dist/cjs/post-avatar.cjs.entry.js +6 -6
- package/dist/cjs/post-back-to-top.cjs.entry.js +5 -5
- package/dist/cjs/post-banner.cjs.entry.js +4 -4
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +32 -10
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +158 -58
- package/dist/cjs/post-closebutton_14.cjs.entry.js +63 -53
- package/dist/cjs/post-collapsible_2.cjs.entry.js +7 -7
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +38 -34
- package/dist/cjs/post-footer.cjs.entry.js +8 -8
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
- package/dist/cjs/post-listbox.cjs.entry.js +3 -3
- package/dist/cjs/post-number-input.cjs.entry.js +4 -4
- package/dist/cjs/post-pagination.cjs.entry.js +5 -5
- package/dist/cjs/post-popover-trigger.cjs.entry.js +6 -6
- package/dist/cjs/post-popover.cjs.entry.js +9 -9
- package/dist/cjs/post-progressbar.cjs.entry.js +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +6 -6
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +6 -6
- package/dist/cjs/post-side-navigation.cjs.entry.js +7 -7
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +7 -7
- package/dist/cjs/post-tab-item.cjs.entry.js +6 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
- package/dist/cjs/post-tabs.cjs.entry.js +8 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -7
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -5
- package/dist/cjs/{required-bJzxBV-V.js → required-bXtlqqaA.js} +1 -1
- package/dist/cjs/{type-CGPnqGY1.js → type-BqLE7Uui.js} +1 -1
- package/dist/cjs/{url-Dxdd6tWj.js → url-CUy3C3sH.js} +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +30 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +184 -57
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +2 -2
- package/dist/collection/components/post-date-picker/native-mask-element.js +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +31 -29
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +2 -2
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +14 -8
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.js +1 -1
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +3 -3
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +1 -1
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +2 -2
- package/dist/collection/components/post-popover/post-popover.js +3 -3
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +2 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -22
- package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.js +1 -1
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +1 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +2 -2
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -2
- package/dist/collection/utils/floating-ui.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +1 -1
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-date-picker.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/react/index.js +1 -1
- package/dist/components/react/{p-CLeWLMJn.js → p-1y1rv5Tw.js} +1 -1
- package/dist/components/react/{p-D3rq_-Qk.js → p-BBv5JYsW.js} +1 -1
- package/dist/components/react/p-BBz9PVf0.js +1 -0
- package/dist/components/react/{p-DasK590W.js → p-BgEY7xhT.js} +1 -1
- package/dist/components/react/{p-DiFAKI9o.js → p-C3J7fIWx.js} +1 -1
- package/dist/components/react/p-C5ibTdH5.js +1 -0
- package/dist/components/react/{p-DD-Sl3Ji.js → p-C8_zqgAP.js} +1 -1
- package/dist/components/react/{p-PYoaz_Xl.js → p-CUKzje9q.js} +1 -1
- package/dist/components/react/{p-C8vlYfD-.js → p-DS46v3ju.js} +1 -1
- package/dist/components/react/{p-CoCua20S.js → p-DTBtJCjk.js} +1 -1
- package/dist/components/react/{p-CuVhOs8F.js → p-XUkUhxaz.js} +1 -1
- package/dist/components/react/p-ialuSSl2.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-autocomplete.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +1 -1
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +1 -1
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-date-picker.js +1 -1
- package/dist/components/react/post-footer.js +1 -1
- package/dist/components/react/post-header.js +1 -1
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.js +1 -1
- package/dist/components/react/post-language-menu.js +1 -1
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-listbox-option.js +1 -1
- package/dist/components/react/post-listbox.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +1 -1
- package/dist/components/react/post-megadropdown-trigger.js +1 -1
- package/dist/components/react/post-megadropdown.js +1 -1
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-number-input.js +1 -1
- package/dist/components/react/post-pagination.js +1 -1
- package/dist/components/react/post-popover-trigger.js +1 -1
- package/dist/components/react/post-popover.js +1 -1
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-progressbar.js +1 -1
- package/dist/components/react/post-rating.js +1 -1
- package/dist/components/react/post-side-navigation-trigger.js +1 -1
- package/dist/components/react/post-side-navigation.js +1 -1
- package/dist/components/react/post-stepper-item.js +1 -1
- package/dist/components/react/post-stepper.js +1 -1
- package/dist/components/react/post-tab-item.js +1 -1
- package/dist/components/react/post-tab-panel.js +1 -1
- package/dist/components/react/post-tabs.js +1 -1
- package/dist/components/react/post-togglebutton.js +1 -1
- package/dist/components/react/post-tooltip-trigger.js +1 -1
- package/dist/components/react/post-tooltip.js +1 -1
- package/dist/docs.json +57 -12
- package/dist/esm/{create-validator-decorator-CbYxqPSB.js → create-validator-decorator-DFpQtJzK.js} +1 -1
- package/dist/esm/{index-D3NdvMgy.js → index-Bs0zeM5Q.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-Mx4vYjem.js → one-of-DQCfaZpw.js} +1 -1
- package/dist/esm/{package-Ny5VnydI.js → package-BBz9PVf0.js} +1 -1
- package/dist/esm/{pattern-CqQVrJPN.js → pattern-3lnaFlkk.js} +1 -1
- package/dist/esm/post-accordion_2.entry.js +5 -5
- package/dist/esm/post-autocomplete.entry.js +5 -5
- package/dist/esm/post-avatar.entry.js +6 -6
- package/dist/esm/post-back-to-top.entry.js +5 -5
- package/dist/esm/post-banner.entry.js +4 -4
- package/dist/esm/post-breadcrumb-item.entry.js +32 -10
- package/dist/esm/post-breadcrumbs.entry.js +158 -58
- package/dist/esm/post-closebutton_14.entry.js +63 -53
- package/dist/esm/post-collapsible_2.entry.js +7 -7
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +38 -34
- package/dist/esm/post-footer.entry.js +8 -8
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +4 -4
- package/dist/esm/post-listbox.entry.js +3 -3
- package/dist/esm/post-number-input.entry.js +4 -4
- package/dist/esm/post-pagination.entry.js +5 -5
- package/dist/esm/post-popover-trigger.entry.js +6 -6
- package/dist/esm/post-popover.entry.js +9 -9
- package/dist/esm/post-progressbar.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +6 -6
- package/dist/esm/post-side-navigation-trigger.entry.js +6 -6
- package/dist/esm/post-side-navigation.entry.js +7 -7
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +7 -7
- package/dist/esm/post-tab-item.entry.js +6 -6
- package/dist/esm/post-tab-panel.entry.js +6 -6
- package/dist/esm/post-tabs.entry.js +8 -8
- package/dist/esm/post-tooltip-trigger.entry.js +7 -7
- package/dist/esm/post-tooltip.entry.js +5 -5
- package/dist/esm/{required-CxvSCYJj.js → required-NuzPg5jZ.js} +1 -1
- package/dist/esm/{type-CYB7_Yi8.js → type-ChnksJ25.js} +1 -1
- package/dist/esm/{url-DOwgyBfp.js → url-BCk3ZU-x.js} +1 -1
- package/dist/post-components/{p-c7a39444.entry.js → p-10e430c3.entry.js} +1 -1
- package/dist/post-components/{p-e463e7ac.entry.js → p-31550a50.entry.js} +1 -1
- package/dist/post-components/{p-2cb843f4.entry.js → p-31a97aae.entry.js} +1 -1
- package/dist/post-components/p-32e1e951.entry.js +1 -0
- package/dist/post-components/{p-b856263a.entry.js → p-43240818.entry.js} +1 -1
- package/dist/post-components/{p-44718c1a.entry.js → p-451ec8ee.entry.js} +1 -1
- package/dist/post-components/{p-2379e498.entry.js → p-4f08b99b.entry.js} +1 -1
- package/dist/post-components/{p-5a44b217.entry.js → p-54432b47.entry.js} +1 -1
- package/dist/post-components/{p-e7f97f6d.entry.js → p-58b66607.entry.js} +1 -1
- package/dist/post-components/{p-1d67c427.entry.js → p-5d7de657.entry.js} +1 -1
- package/dist/post-components/p-61a45246.entry.js +1 -0
- package/dist/post-components/p-63dd9a76.entry.js +1 -0
- package/dist/post-components/{p-665d877f.entry.js → p-63e570c4.entry.js} +1 -1
- package/dist/post-components/{p-ffec1880.entry.js → p-64480e3a.entry.js} +1 -1
- package/dist/post-components/p-6a2f47af.entry.js +1 -0
- package/dist/post-components/p-96d07f2b.entry.js +1 -0
- package/dist/post-components/p-9a1e8b1d.entry.js +1 -0
- package/dist/post-components/p-BBz9PVf0.js +1 -0
- package/dist/post-components/p-Bl-_v3aT.js +1 -0
- package/dist/post-components/p-Bs0zeM5Q.js +2 -0
- package/dist/post-components/{p-sgCfAEQU.js → p-BwhzbRIR.js} +1 -1
- package/dist/post-components/p-D1s6tESz.js +1 -0
- package/dist/post-components/p-DH-eJVHZ.js +1 -0
- package/dist/post-components/p-DeUk3rcv.js +1 -0
- package/dist/post-components/p-Dk-DtPZn.js +1 -0
- package/dist/post-components/p-aa33141b.entry.js +1 -0
- package/dist/post-components/p-aff180f5.entry.js +1 -0
- package/dist/post-components/{p-781efeb8.entry.js → p-bd128657.entry.js} +1 -1
- package/dist/post-components/{p-b6e231a8.entry.js → p-c2de3702.entry.js} +1 -1
- package/dist/post-components/{p-4e2bb082.entry.js → p-d5327dd1.entry.js} +1 -1
- package/dist/post-components/{p-030bfaa1.entry.js → p-e1817744.entry.js} +1 -1
- package/dist/post-components/{p-e8c19f72.entry.js → p-e6a4146b.entry.js} +1 -1
- package/dist/post-components/{p-e8268a8d.entry.js → p-f275b872.entry.js} +1 -1
- package/dist/post-components/{p-894b20dd.entry.js → p-f566768e.entry.js} +1 -1
- package/dist/post-components/{p-2ee255c1.entry.js → p-f6da5e69.entry.js} +1 -1
- package/dist/post-components/{p-a9223467.entry.js → p-f784e149.entry.js} +1 -1
- package/dist/post-components/p-f917527c.entry.js +1 -0
- package/dist/post-components/post-components.css +2 -2
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +8 -1
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +39 -22
- package/dist/types/components/post-date-picker/post-date-picker.d.ts +2 -1
- package/dist/types/components/post-header/post-header.d.ts +3 -1
- package/dist/types/components.d.ts +18 -7
- package/hydrate/index.js +308 -165
- package/hydrate/index.mjs +308 -165
- package/package.json +28 -20
- package/dist/components/react/p-0nNMdSBr.js +0 -1
- package/dist/components/react/p-Ny5VnydI.js +0 -1
- package/dist/components/react/p-SBBBSmJM.js +0 -1
- package/dist/post-components/p-29e6c2a4.entry.js +0 -1
- package/dist/post-components/p-3a75186d.entry.js +0 -1
- package/dist/post-components/p-65e12f2c.entry.js +0 -1
- package/dist/post-components/p-795eb5ad.entry.js +0 -1
- package/dist/post-components/p-9ad2216e.entry.js +0 -1
- package/dist/post-components/p-BmpkvdQk.js +0 -1
- package/dist/post-components/p-C-FunIfQ.js +0 -1
- package/dist/post-components/p-CCciE4QO.js +0 -1
- package/dist/post-components/p-D3NdvMgy.js +0 -2
- package/dist/post-components/p-Ny5VnydI.js +0 -1
- package/dist/post-components/p-X1vWfzMK.js +0 -1
- package/dist/post-components/p-cGcyMrvx.js +0 -1
- package/dist/post-components/p-cde00944.entry.js +0 -1
- package/dist/post-components/p-cf7493ab.entry.js +0 -1
- package/dist/post-components/p-ecfc494e.entry.js +0 -1
- package/dist/post-components/p-eda4a376.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as s,transformTag as i}from"@stencil/core/internal/client";import{d as r,a
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as s,transformTag as i}from"@stencil/core/internal/client";import{d as r,a}from"./post-popovercontainer2.js";import"./breakpoints.js";import{a as n}from"./get-focusable-children.js";import{v as c}from"./package.js";import{d as p}from"./post-closebutton2.js";import{d as l}from"./post-icon2.js";import{O as d}from"./one-of.js";import{R as f}from"./required.js";import{T as h}from"./type.js";var m=function(t,e,o,s){var i,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,s);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(a=(r<3?i(a):r>3?i(e,o,a):i(e,o))||a);return r>3&&a&&Object.defineProperty(e,o,a),a};const b=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.placement="top",this.arrow=!0,this.breakpointChange=()=>{requestAnimationFrame((()=>this.updateEdgeGap()))}}async show(t){await this.popoverRef.show(t),this.focusFirstEl(),this.updateEdgeGap()}async hide(){this.popoverRef.hide()}async toggle(t,e){await this.popoverRef.toggle(t,e)&&(this.updateEdgeGap(),this.focusFirstEl())}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange)}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange)}updateEdgeGap(){const t=this.host.shadowRoot?.querySelector("post-closebutton");if(!t)return;const e=t.getBoundingClientRect().width;e&&!Number.isNaN(e)&&(this.edgeGap=e/2)}focusFirstEl(){const t=n(this.host)[0];t&&t.focus()}render(){return o(s,{key:"0e57981004d99d528a4652598739afbf1208376c","data-version":c},o("post-popovercontainer",{key:"380838970ed2c62f9e21e95da6957e9ff36db31a",arrow:this.arrow,placement:this.placement,edgeGap:this.edgeGap,autoHide:!0,ref:t=>{t&&(this.popoverRef=t)}},o("div",{key:"77465a8e943f61492869a3e05cf03f90b9fd553c",class:"popover-container"},o("div",{key:"0ab4e621ecc58a9775c4a9b8dfba3d26eb577878",class:"popover-content"},o("slot",{key:"1b2d37d50ef23edad118abc5949686e59e15b931"})),o("post-closebutton",{key:"8c2138b22f49681d37d2f38f6fb6331c730849f3"},this.textClose))))}get host(){return this}static get style(){return"*{box-sizing:border-box}:host{display:contents}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:8px;min-width:160px;max-width:var(--post-popover-max-width, 280px)}.popover-content{padding:8px;flex-grow:1}post-closebutton{color-scheme:light}"}},[257,"post-popover",{placement:[1],textClose:[513,"text-close"],arrow:[4],edgeGap:[32],show:[64],hide:[64],toggle:[64]}]);m([d(a)],b.prototype,"placement",void 0),m([f(),h("string")],b.prototype,"textClose",void 0);const u=b,v=function(){"undefined"!=typeof customElements&&["post-popover","post-closebutton","post-icon","post-popovercontainer"].forEach((t=>{switch(t){case"post-popover":customElements.get(i(t))||customElements.define(i(t),b);break;case"post-closebutton":customElements.get(i(t))||p();break;case"post-icon":customElements.get(i(t))||l();break;case"post-popovercontainer":customElements.get(i(t))||r()}}))};export{u as PostPopover,v as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as n,Build as o,h as r,Host as i,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as a}from"./package.js";import{O as c}from"./one-of.js";import{T as l}from"./type.js";const p=["top","right","bottom","left","top-start","top-end","right-start","right-end","bottom-start","bottom-end","left-start","left-end"],f=["top","right","bottom","left"],u=Math.min,h=Math.max,d=Math.round,m=Math.floor,v=t=>({x:t,y:t}),g={left:"right",right:"left",bottom:"top",top:"bottom"};function w(t,e,n){return h(t,u(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function x(t){return t.split("-")[0]}function b(t){return t.split("-")[1]}function S(t){return"x"===t?"y":"x"}function k(t){return"y"===t?"height":"width"}function E(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function T(t){return S(E(t))}function M(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const A=["left","right"],O=["right","left"],H=["top","bottom"],L=["bottom","top"];function $(t){const e=x(t);return g[e]+t.slice(e.length)}function C(t){return"number"!=typeof t?function(t){var e,n,o,r;return{top:null!=(e=t.top)?e:0,right:null!=(n=t.right)?n:0,bottom:null!=(o=t.bottom)?o:0,left:null!=(r=t.left)?r:0}}(t):{top:t,right:t,bottom:t,left:t}}function D(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function R(t,e,n){let{reference:o,floating:r}=t;const i=E(e),s=T(e),a=k(s),c=x(e),l="y"===i,p=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2;let h;switch(c){case"top":h={x:p,y:o.y-r.height};break;case"bottom":h={x:p,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}const d=b(e);return d&&(h[s]+=u*("end"===d?1:-1)*(n&&l?-1:1)),h}async function j(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:u=!1,padding:h=0}=y(e,t),d=C(h),m=a[u?"floating"===f?"reference":"floating":f],v=D(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:p,strategy:c})),g="floating"===f?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=D(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:w,strategy:c}):g);return{top:(v.top-b.top+d.top)/x.y,bottom:(b.bottom-v.bottom+d.bottom)/x.y,left:(v.left-b.left+d.left)/x.x,right:(b.right-v.right+d.right)/x.x}}function z(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function F(t){return f.some((e=>t[e]>=0))}function P(t){const e=u(...t.map((t=>t.left))),n=u(...t.map((t=>t.top)));return{x:e,y:n,width:h(...t.map((t=>t.right)))-e,height:h(...t.map((t=>t.bottom)))-n}}const W=new Set(["left","top"]);function B(){return"undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function I(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function N(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return!!B()&&(t instanceof Node||t instanceof I(t).Node)}function V(t){return!!B()&&(t instanceof Element||t instanceof I(t).Element)}function X(t){return!!B()&&(t instanceof HTMLElement||t instanceof I(t).HTMLElement)}function Y(t){return!(!B()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof I(t).ShadowRoot)}function _(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==r&&"contents"!==r}function J(t){return/^(table|td|th)$/.test(q(t))}function K(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const Q=/transform|translate|scale|rotate|perspective|filter/,U=/paint|layout|strict|content/,Z=t=>!!t&&"none"!==t;let tt;function et(t){const e=V(t)?rt(t):t;return Z(e.transform)||Z(e.translate)||Z(e.scale)||Z(e.rotate)||Z(e.perspective)||!nt()&&(Z(e.backdropFilter)||Z(e.filter))||Q.test(e.willChange||"")||U.test(e.contain||"")}function nt(){return null==tt&&(tt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tt}function ot(t){return/^(html|body|#document)$/.test(q(t))}function rt(t){return I(t).getComputedStyle(t)}function it(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function st(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Y(t)&&t.host||N(t);return Y(e)?e.host:e}function at(t){const e=st(t);return ot(e)?(t.ownerDocument||t).body:X(e)&&_(e)?e:at(e)}function ct(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=at(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),s=I(r);if(i){const t=lt(s);return e.concat(s,s.visualViewport||[],_(r)?r:[],t&&n?ct(t):[])}return e.concat(r,ct(r,[],n))}function lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pt(t){const e=rt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=X(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=d(n)!==i||d(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function ft(t){return V(t)?t:t.contextElement}function ut(t){const e=ft(t);if(!X(e))return v(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=pt(e);let s=(i?d(n.width):n.width)/o,a=(i?d(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ht=v(0);function dt(t){const e=I(t);return nt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ht}function mt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=ft(t);let s=v(1);e&&(o?V(o)&&(s=ut(o)):s=ut(t));const a=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===I(t)}(i,n,o)?dt(i):v(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,p=r.width/s.x,f=r.height/s.y;if(i&&o){const t=I(i),e=V(o)?I(o):o;let n=t,r=lt(n);for(;r&&e!==n;){const t=ut(r),e=r.getBoundingClientRect(),o=rt(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,l*=t.y,p*=t.x,f*=t.y,c+=i,l+=s,n=I(r),r=lt(n)}}return D({width:p,height:f,x:c,y:l})}function vt(t,e){const n=it(t).scrollLeft;return e?e.left+n:mt(N(t)).left+n}function gt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function wt(t,e,n){let o;if("viewport"===e||"layoutViewport"===e)o=function(t,e,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,r=I(t),i=N(t),s=r.visualViewport;let a=i.clientWidth,c=i.clientHeight,l=0,p=0;if(s){const t=!nt()||"fixed"===e;o?t||(l=-s.offsetLeft,p=-s.offsetTop):(a=s.width,c=s.height,t&&(l=s.offsetLeft,p=s.offsetTop))}if(vt(i)<=0){const t=i.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-e.clientWidth-o),s="stable both-edges"===getComputedStyle(i).scrollbarGutter?r/2:r;s<=25&&(a-=s)}return{width:a,height:c,x:l,y:p}}(t,n,e);else if("document"===e)o=function(t){const e=it(t),n=t.ownerDocument.body,o=h(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=h(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+vt(t);const s=-e.scrollTop;return"rtl"===rt(n).direction&&(i+=h(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}(N(t));else if(V(e))o=function(t,e){const n=mt(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=ut(t);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=dt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return D(o)}function yt(t,e,n){const o=X(e),r=N(e),i="fixed"===n,s=mt(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=v(0);if((o||!i)&&(("body"!==q(e)||_(r))&&(a=it(e)),o)){const t=mt(e,!0,i,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}!o&&r&&(c.x=vt(r));const l=!r||o||i?v(0):gt(r,a);return{x:s.left+a.scrollLeft-c.x-l.x,y:s.top+a.scrollTop-c.y-l.y,width:s.width,height:s.height}}function xt(t){return"static"===rt(t).position}function bt(t,e){if(!X(t)||"fixed"===rt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return N(t)===n&&(n=n.ownerDocument.body),n}function St(t,e){const n=I(t);if(K(t))return n;if(!X(t)){let e=st(t);for(;e&&!ot(e);){if(V(e)&&!xt(e))return e;e=st(e)}return n}let o=bt(t,e);for(;o&&J(o)&&xt(o);)o=bt(o,e);return o&&ot(o)&&xt(o)&&!et(o)?n:o||function(t){let e=st(t);for(;X(e)&&!ot(e);){if(et(e))return e;if(K(e))return null;e=st(e)}return null}(t)||n}const kt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,s=N(o),a=!!e&&K(e.floating);if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=v(1);const p=v(0),f=X(o);if((f||!i)&&(("body"!==q(o)||_(s))&&(c=it(o)),f)){const t=mt(o);l=ut(o),p.x=t.x+o.clientLeft,p.y=t.y+o.clientTop}const u=!s||f||i?v(0):gt(s,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+p.x+u.x,y:n.y*l.y-c.scrollTop*l.y+p.y+u.y}},getDocumentElement:N,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?K(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=ct(t,[],!1).filter((t=>V(t)&&"body"!==q(t))),r=null;const i="fixed"===rt(t).position;let s=i?st(t):t;for(;V(s)&&!ot(s);){const t=rt(s),e=et(s),n=r?r.position:i?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?r=t:o=o.filter((t=>t!==s)),s=st(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=wt(e,i[0],r);let a=s.top,c=s.right,l=s.bottom,p=s.left;for(let t=1;t<i.length;t++){const n=wt(e,i[t],r);a=h(n.top,a),c=u(n.right,c),l=u(n.bottom,l),p=h(n.left,p)}return{width:c-p,height:l-a,x:p,y:a}},getOffsetParent:St,getElementRects:async function(t){const e=this.getOffsetParent||St,n=this.getDimensions,o=await n(t.floating);return{reference:yt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=pt(t);return{width:e,height:n}},getScale:ut,isElement:V,isRTL:function(t){return"rtl"===rt(t).direction}};function Et(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const Tt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=e,c=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),s=x(n),a=b(n),c="y"===E(n),l=W.has(s)?-1:1,p=i&&c?-1:1,f=y(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:d}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof d&&(h="end"===a?-1*d:d),c?{x:h*p,y:u*l}:{x:u*l,y:h*p}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},Mt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...v}=y(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=x(r),w=E(a),S=x(a)===a,C=await(null==c.isRTL?void 0:c.isRTL(l.floating)),D=u||(S||!m?[$(a)]:function(t){const e=$(t);return[M(t),e,M(e)]}(a)),R="none"!==d;!u&&R&&D.push(...function(t,e,n,o){const r=b(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?O:A:e?A:O;case"left":case"right":return e?H:L;default:return[]}}(x(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(M)))),i}(a,m,d,C));const j=[a,...D],z=await c.detectOverflow(e,v),F=[];let P=(null==(o=i.flip)?void 0:o.overflows)||[];if(p&&F.push(z[g]),f){const t=function(t,e,n){void 0===n&&(n=!1);const o=b(t),r=T(t),i=k(r);let s="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=$(s)),[s,$(s)]}(r,s,C);F.push(z[t[0]],z[t[1]])}if(P=[...P,{placement:r,overflows:F}],!F.every((t=>t<=0))){var W,B;const t=((null==(W=i.flip)?void 0:W.index)||0)+1,e=j[t];if(e&&("alignment"!==f||w===E(e)||P.every((t=>E(t.placement)!==w||t.overflows[0]>0))))return{data:{index:t,overflows:P},reset:{placement:e}};let n=null==(B=P.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:B.placement;if(!n)switch(h){case"bestFit":{var q;const t=null==(q=P.filter((t=>{if(R){const e=E(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:q[0];t&&(n=t);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},At=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:r,elements:i}=e,{apply:s=()=>{},...a}=y(t,e),c=await r.detectOverflow(e,a),l=x(n),p=b(n),f="y"===E(n),{width:d,height:m}=o.floating;let v,g;"top"===l||"bottom"===l?(v=l,g=p===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=l,v="end"===p?"top":"bottom");const w=m-c.top-c.bottom,S=d-c.left-c.right,k=u(m-c[v],w),T=u(d-c[g],S),M=e.middlewareData.shift;let A=k,O=T;null!=M&&M.enabled.x&&(O=S),null!=M&&M.enabled.y&&(A=w),!M&&!p&&(f?O=d-2*h(c.left,c.right):A=m-2*h(c.top,c.bottom)),await s({...e,availableWidth:O,availableHeight:A});const H=await r.getDimensions(i.floating);return d!==H.width||m!==H.height?{reset:{rects:!0}}:{}}}},Ot=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:i,strategy:s}=e,{padding:a=2,x:c,y:l}=y(t,e),p=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]);if(!p.length)return{};const f=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 r=e[t];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map((t=>D(P(t))))}(p),d=D(P(p)),m=C(a),v=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&(f[0].left>f[1].right||f[1].left>f[0].right)&&null!=c&&null!=l)return f.find((t=>c>t.left-m.left&&c<t.right+m.right&&l>t.top-m.top&&l<t.bottom+m.bottom))||d;if(f.length>=2){if("y"===E(n)){const t=f[0],e=f[f.length-1],o="top"===x(n),r=t.top,i=o?t.left:e.left;return D({x:i,y:r,width:(o?t.right:e.right)-i,height:e.bottom-r})}const t="left"===x(n),e=h(...f.map((t=>t.right))),o=u(...f.map((t=>t.left))),r=f.filter((n=>t?n.left===o:n.right===e)),i=r[0].top;return D({x:o,y:i,width:e-o,height:r[r.length-1].bottom-i})}return d}},floating:o.floating,strategy:s});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Ht=function(t){return void 0===t&&(t={}),{options:t,fn(e){var n,o;const{x:r,y:i,placement:s,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:p=!0,crossAxis:f=!0}=y(t,e),u={x:r,y:i},h=E(s),d=S(h);let m=u[d],v=u[h];const g=y(l,e),w="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:null!=(n=g.mainAxis)?n:0,crossAxis:null!=(o=g.crossAxis)?o:0};if(p){const t="y"===d?"height":"width",e=a.reference[d]-a.floating[t]+w.mainAxis,n=a.reference[d]+a.reference[t]-w.mainAxis;m<e?m=e:m>n&&(m=n)}if(f){var b,k;const t="y"===d?"width":"height",e=W.has(x(s)),n=a.reference[h]-a.floating[t]+(e&&(null==(b=c.offset)?void 0:b[h])||0)+(e?0:w.crossAxis),o=a.reference[h]+a.reference[t]+(e?0:(null==(k=c.offset)?void 0:k[h])||0)-(e?w.crossAxis:0);v<n?v=n:v>o&&(v=o)}return{[d]:m,[h]:v}}}};var Lt=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:n="",...o}={}){super(t,o),this.oldState=String(e||""),this.newState=String(n||"")}},$t=new WeakMap;function Ct(t,e,n){$t.set(t,setTimeout((()=>{$t.has(t)&&t.dispatchEvent(new Lt("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var Dt=globalThis.ShadowRoot||function(){},Rt=globalThis.HTMLDialogElement||function(){},jt=new WeakMap,zt=new WeakMap,Ft=new WeakMap,Pt=new WeakMap;function Wt(t){return Pt.get(t)||"hidden"}var Bt=new WeakMap;function qt(t){return[...t].pop()}function It(t,e){return!("auto"!==t.popover&&"manual"!==t.popover&&"hint"!==t.popover||!t.isConnected||e&&"showing"!==Wt(t)||!e&&"hidden"!==Wt(t)||t instanceof Rt&&t.hasAttribute("open")||document.fullscreenElement===t)}function Nt(t){if(!t)return 0;const e=zt.get(document)||new Set,n=Ft.get(document)||new Set;return n.has(t)?[...n].indexOf(t)+e.size+1:e.has(t)?[...e].indexOf(t)+1:0}function Gt(t){let e;const n=Ft.get(t)||new Set,o=zt.get(t)||new Set,r=n.size>0?n:o.size>0?o:null;return r?(e=qt(r),e.isConnected?e:(r.delete(e),Gt(t))):null}function Vt(t){for(const e of t||[]){if(e.isConnected)return e;t.delete(e)}return null}function Xt(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?Xt(t.parentNode):t}function Yt(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===Pt.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||Xt(t))instanceof Dt&&(t=t.host),t instanceof Document)return}}function _t(t,e){const n=new Map;let o=0;for(const t of e||[])n.set(t,o),o+=1;n.set(t,o),o+=1;let r=null;return function(e){if(!e)return;let o=!1,i=null,s=null;for(;!o;){if(i=Yt(e)||null,null===i)return;if(!n.has(i))return;"hint"!==t.popover&&"auto"!==i.popover||(o=!0),o||(e=i.parentElement)}s=n.get(i),(null===r||n.get(r)<s)&&(r=i)}(t.parentElement||Xt(t)),r}function Jt(t){return!(t.hidden||t instanceof Dt||(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)&&t.disabled||t instanceof HTMLInputElement&&"hidden"===t.type||t instanceof HTMLAnchorElement&&""===t.href||"number"!=typeof t.tabIndex||-1===t.tabIndex)}var Kt=new WeakMap;function Qt(t){if(!It(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new Lt("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!It(t,!1))return;let n=!1;const o=t.popover;let r=null;const i=_t(t,zt.get(e)||new Set),s=_t(t,Ft.get(e)||new Set);if("auto"===o&&(Zt(Ft.get(e)||new Set,n,!0),ee(i||e,n,!0),r="auto"),"hint"===o&&(s?(ee(s,n,!0),r="hint"):(Zt(Ft.get(e)||new Set,n,!0),i?(ee(i,n,!0),r="auto"):r="hint")),"auto"===o||"hint"===o){if(o!==t.popover||!It(t,!1))return;Gt(e)||(n=!0),"auto"===r?(zt.has(e)||zt.set(e,new Set),zt.get(e).add(t)):"hint"===r&&(Ft.has(e)||Ft.set(e,new Set),Ft.get(e).add(t))}Kt.delete(t);const a=e.activeElement;var c;t.classList.add(":popover-open"),Pt.set(t,"showing"),jt.has(e)||jt.set(e,new Set),jt.get(e).add(t),ie(Bt.get(t),!0),c=t,function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let n=e.querySelector("[autofocus]");if(n)return n;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(n=e.querySelector("[autofocus]"),n)return n}}}const o=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let r=o.currentNode;for(;r;){if(Jt(r))return r;r=o.nextNode()}}(c)?.focus(),n&&a&&"auto"===t.popover&&Kt.set(t,a),Ct(t,"closed","open")}function Ut(t,e=!1,n=!1){if(!It(t,!0))return;const o=t.ownerDocument;if(["auto","hint"].includes(t.popover)&&(ee(t,e,n),!It(t,!0)))return;const r=zt.get(o)||new Set,i=r.has(t)&&qt(r)===t;if(ie(Bt.get(t),!1),Bt.delete(t),n&&(t.dispatchEvent(new Lt("beforetoggle",{oldState:"open",newState:"closed"})),i&&qt(r)!==t&&ee(t,e,n),!It(t,!0)))return;jt.get(o)?.delete(t),r.delete(t),Ft.get(o)?.delete(t),t.classList.remove(":popover-open"),Pt.set(t,"hidden"),n&&Ct(t,"open","closed");const s=Kt.get(t);s&&(Kt.delete(t),e&&s.focus())}function Zt(t,e=!1,n=!1){let o=Vt(t);for(;o;)Ut(o,e,n),o=Vt(t)}function te(t,e,n,o){let r=!1,i=!1;for(;r||!i;){i=!0;let s=null,a=!1;for(const n of e)if(n===t)a=!0;else if(a){s=n;break}if(!s)return;for(;"showing"===Wt(s)&&e.size;)Ut(qt(e),n,o);e.has(t)&&qt(e)!==t&&(r=!0),r&&(o=!1)}}function ee(t,e,n){const o=t.ownerDocument||t;if(t instanceof Document)return function(t,e=!1,n=!1){let o=Gt(t);for(;o;)Ut(o,e,n),o=Gt(t)}(o,e,n);Ft.get(o)?.has(t)?te(t,Ft.get(o),e,n):(Zt(Ft.get(o)||new Set,e,n),zt.get(o)?.has(t)&&te(t,zt.get(o),e,n))}var ne=new WeakMap;function oe(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!Gt(n))return;const o=function(t){const e=Yt(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||Xt(t))instanceof Dt&&(t=t.host),t instanceof Document)return}}(t);return Nt(e)>Nt(n)?e:n}(e);if(o&&"pointerdown"===t.type)ne.set(n,o);else if("pointerup"===t.type){const t=ne.get(n)===o;ne.delete(n),t&&ee(o||n,!1,!0)}}var re=new WeakMap;function ie(t,e=!1){if(!t)return;re.has(t)||re.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=re.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var se=globalThis.ShadowRoot||function(){};function ae(t,e,n){const o=t[e];Object.defineProperty(t,e,{value(t){return o.call(this,n(t))}})}var ce=/(^|[^\\]):popover-open\b/g;var le=null;function pe(t){const e=function(){const t="function"==typeof globalThis.CSSLayerBlockRule;return`\n${t?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${t?"}":""}\n`}();if(null===le)try{(le=new CSSStyleSheet).replaceSync(e)}catch{le=!1}if(!1===le){const n=document.createElement("style");n.textContent=e,t instanceof Document?t.head.prepend(n):t.prepend(n)}else t.adoptedStyleSheets=[le,...t.adoptedStyleSheets]}const fe=Symbol("Clipping Rect Cache"),ue={...kt,getClippingRect:async function(...t){const e=t[0].element,n=this[fe].get(e);if(n)return n;const o=await kt.getClippingRect.apply(this,t);return function(t,e){const n=e.ownerDocument.querySelector("post-header");if(null===n)return;let o=e;for(;!ot(o);)if(o=st(o),X(o)&&(K(o)||o===n))return;const r=n.getBoundingClientRect(),i=Math.max(t.y,r.bottom);t.height-=i-t.y,t.y=i}(o,e),this[fe].set(e,o),o}};var he=function(t,e,n,o){var r,i=arguments.length,s=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,n,s):r(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s};const de={"pop-in":function(t){if(t)return t.animate([{transform:"scale(0.9)",opacity:0},{transform:"scale(1)",opacity:1}],{duration:250,easing:"ease-out",fill:"forwards"})}},me=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postBeforeShow=n(this,"postBeforeShow",7),this.postShow=n(this,"postShow",7),this.postHide=n(this,"postHide",7),this.postBeforeToggle=n(this,"postBeforeToggle",7),this.postToggle=n(this,"postToggle",7),this.toggleTimeoutId=null,this.hasOpenedOnce=!0,this.placement="top",this.edgeGap=8,this.arrow=!1,this.animation="pop-in",this.currentAnimation=null,this.boundMouseTrackingHandler=this.mouseTrackingHandler.bind(this)}mouseTrackingHandler(t){this.host.style.setProperty("--post-safe-space-cursor-x",`${t.clientX}px`),this.host.style.setProperty("--post-safe-space-cursor-y",`${t.clientY}px`)}connectedCallback(){!o.isBrowser||"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){if("undefined"==typeof window)return;function t(t){return t?.includes(":popover-open")&&(t=t.replace(ce,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||Lt,ae(Document.prototype,"querySelector",t),ae(Document.prototype,"querySelectorAll",t),ae(Element.prototype,"querySelector",t),ae(Element.prototype,"querySelectorAll",t),ae(Element.prototype,"matches",t),ae(Element.prototype,"closest",t),ae(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"hint"==t?"hint":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(t={}){Qt(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Ut(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t={}){return"boolean"==typeof t&&(t={force:t}),"showing"===Pt.get(this)&&void 0===t.force||!1===t.force?Ut(this,!0,!0):void 0!==t.force&&!0!==t.force||Qt(this),"showing"===Pt.get(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const n=e.call(this,t);return pe(n),n}}});const n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=n.call(this);return t.shadowRoot&&pe(t.shadowRoot),t}}});const o=new WeakMap;function r(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),o.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),o.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=o.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return o.delete(this),null;const e=Xt(this),n=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof se)&&n&&e.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}var i;r(HTMLButtonElement),r(HTMLInputElement),(i=document).addEventListener("click",(t=>{const e=t.composedPath(),n=e[0];if(!(n instanceof Element)||n?.shadowRoot)return;const o=Xt(n);if(!(o instanceof se||o instanceof Document))return;const r=e.find((t=>t.matches?.("[popovertargetaction],[popovertarget]")));return r?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const n=Wt(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?Ut(e,!0,!0):It(e,!1)&&(Bt.set(e,t),Qt(e)))}(r),void t.preventDefault()):void 0})),i.addEventListener("keydown",(t=>{const e=t.key,n=t.target;t.defaultPrevented||!n||"Escape"!==e&&"Esc"!==e||ee(n.ownerDocument,!0,!0)})),i.addEventListener("pointerdown",oe),i.addEventListener("pointerup",oe),pe(document)}()}componentDidLoad(){this.host.addEventListener("beforetoggle",this.handleToggle.bind(this))}disconnectedCallback(){"function"==typeof this.clearAutoUpdate&&this.clearAutoUpdate(),this.host.removeEventListener("beforetoggle",this.handleToggle.bind(this))}async show(t){!this.toggleTimeoutId&&t&&(this.eventTarget=t,this.updatePosition(),this.host.showPopover())}async hide(){this.toggleTimeoutId||(this.eventTarget=null,this.host.hidePopover(),this.postHide.emit())}async toggle(t,e){const n=this.host.matches(":where(:popover-open, .popover-open)");return!0!==e&&(void 0!==e||n)||t?(this.eventTarget=t,this.toggleTimeoutId||(this.updatePosition(),this.host.togglePopover(e),this.toggleTimeoutId=null),this.host.matches(":where(:popover-open, .popover-open)")):n}open(){const t=this.host.shadowRoot?.querySelector(".popover-content");if(this.startAutoupdates(),t){const e=de[this.animation];"function"==typeof e?this.runOpenAnimation(e,t):(this.postBeforeToggle.emit({willOpen:!0}),this.postBeforeShow.emit({first:this.hasOpenedOnce}),this.postToggle.emit({isOpen:!0}),this.postShow.emit({first:this.hasOpenedOnce}),this.hasOpenedOnce&&(this.hasOpenedOnce=!1))}this.safeSpace&&globalThis.addEventListener("mousemove",this.boundMouseTrackingHandler)}close(){"function"==typeof this.clearAutoUpdate&&this.clearAutoUpdate(),this.safeSpace&&globalThis.removeEventListener("mousemove",this.boundMouseTrackingHandler),this.currentAnimation&&(this.currentAnimation.cancel(),this.currentAnimation=null),this.postBeforeToggle.emit({willOpen:!1}),this.postToggle.emit({isOpen:!1}),this.postHide.emit()}async runOpenAnimation(t,e){let n;try{if(n=t(e),!n)return this.postBeforeToggle.emit({willOpen:!0}),this.postBeforeShow.emit({first:this.hasOpenedOnce}),this.postToggle.emit({isOpen:!0}),void this.postShow.emit({first:this.hasOpenedOnce});this.currentAnimation=n,"running"===n.playState&&(this.postBeforeToggle.emit({willOpen:!0}),this.postBeforeShow.emit({first:this.hasOpenedOnce})),await n.finished,this.postToggle.emit({isOpen:!0}),this.postShow.emit({first:this.hasOpenedOnce}),this.hasOpenedOnce=!0}catch(t){console.warn("Animation failed or was interrupted:",t),this.postBeforeToggle.emit({willOpen:!1}),this.postBeforeShow.emit({first:this.hasOpenedOnce}),this.postToggle.emit({isOpen:!1})}finally{this.currentAnimation===n&&(this.currentAnimation=null)}}handleToggle(t){this.toggleTimeoutId=globalThis.setTimeout((()=>this.toggleTimeoutId=null),10),"open"===t.newState?this.open():this.close()}startAutoupdates(){this.eventTarget&&this.host&&(this.clearAutoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,l=ft(t),p=r||i?[...l?ct(l):[],...e?ct(e):[]]:[];p.forEach((t=>{r&&t.addEventListener("scroll",n),i&&t.addEventListener("resize",n)}));const f=l&&a?function(t,e,n){let o,r=null;const i=N(t);function s(){var t;clearTimeout(o),null==(t=r)||t.disconnect(),r=null}function a(n,c){void 0===n&&(n=!1),void 0===c&&(c=1),s();const l=t.getBoundingClientRect(),{left:p,top:f,width:d,height:v}=l;if(n||e(),!d||!v)return;const g={rootMargin:-m(f)+"px "+-m(i.clientWidth-(p+d))+"px "+-m(i.clientHeight-(f+v))+"px "+-m(p)+"px",threshold:h(0,u(1,c))||1};let w=!0;function y(e){const n=e[0].intersectionRatio;if(!Et(l,t.getBoundingClientRect()))return a();if(n!==c){if(!w)return a();n?a(!1,n):o=setTimeout((()=>{a(!1,1e-7)}),1e3)}w=!1}try{r=new IntersectionObserver(y,{...g,root:i.ownerDocument})}catch(t){r=new IntersectionObserver(y,g)}r.observe(t)}const c=I(t),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),s()}}(l,n,i):null;let d,v=-1,g=null;s&&(g=new ResizeObserver((t=>{let[o]=t;o&&o.target===l&&g&&e&&(g.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame((()=>{var t;null==(t=g)||t.observe(e)}))),n()})),l&&!c&&g.observe(l),e&&g.observe(e));let w=c?mt(t):null;return c&&function e(){const o=mt(t);w&&!Et(w,o)&&n(),w=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;p.forEach((t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),null==f||f(),null==(t=g)||t.disconnect(),g=null,c&&cancelAnimationFrame(d)}}(this.eventTarget,this.host,this.updatePosition.bind(this)))}async updatePosition(){const{x:e,y:n,middlewareData:o,placement:r}=await this.calculatePosition();o.hide?.referenceHidden&&this.host.hidePopover();const i=r.split("-")[0];if(this.dynamicPlacement=i,this.host.style.left=`${e}px`,this.host.style.top=`${n}px`,this.arrow&&o.arrow){const{x:e,y:n}=o.arrow,r=t.STATIC_SIDES[i],s=-.5*this.arrowRef.offsetWidth;r&&Object.assign(this.arrowRef.style,{left:e?`${e}px`:"",top:n?`${n}px`:"",[r]:`${s}px`})}this.safeSpace&&this.eventTarget&&await this.updateSafeSpaceBoundaries(i)}async calculatePosition(){const t=this.edgeGap,e=(this.placement||"top").includes("-"),n=[Mt({elementContext:"reference",crossAxis:!1}),Mt({elementContext:"floating",crossAxis:!1})],o=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),p={x:n,y:o},f=await i.detectOverflow(e,l),u=E(r),h=S(u);let d=p[h],m=p[u];const v=(t,e)=>w(e+f["y"===t?"top":"left"],e,e-f["y"===t?"bottom":"right"]);s&&(d=v(h,d)),a&&(m=v(u,m));const g=c.fn({...e,[h]:d,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:s,[u]:a}}}}}}({padding:t,limiter:Ht({offset:32})}),r=[Tt(this.offset??(this.arrow?t+4:t)),Ot(),...e?[...n,o]:[o,...n],At({apply({availableWidth:e,elements:n}){Object.assign(n.floating.style,{maxWidth:e-2*t+"px"})}})];return this.arrow&&r.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=e,{element:l,padding:p=0}=y(t,e)||{};if(null==l)return{};const f=C(p),h={x:n,y:o},d=T(r),m=k(d),v=await s.getDimensions(l),g="y"===d,x=g?"top":"left",S=g?"bottom":"right",E=g?"clientHeight":"clientWidth",M=i.reference[m]+i.reference[d]-h[d]-i.floating[m],A=h[d]-i.reference[d],O=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let H=O?O[E]:0;H&&await(null==s.isElement?void 0:s.isElement(O))||(H=a.floating[E]||i.floating[m]);const L=M/2-A/2,$=H/2-v[m]/2-1,D=u(f[x],$),R=u(f[S],$),j=H-v[m]-R,z=H/2-v[m]/2+L,F=w(D,z,j),P=!c.arrow&&null!=b(r)&&z!==F&&i.reference[m]/2-(z<D?D:R)-v[m]/2<0,W=P?z<D?z-D:z-j:0;return{[d]:h[d]+W,data:{[d]:F,centerOffset:z-F-W,...P&&{alignmentOffset:W}},reset:P}}}))({element:this.arrowRef,padding:t})),this.autoHide&&r.push(function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...i}=y(t,e);switch(r){case"referenceHidden":{const t=z(await o.detectOverflow(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:F(t)}}}case"escaped":{const t=z(await o.detectOverflow(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:F(t)}}}default:return{}}}}}({strategy:"referenceHidden"})),(i={placement:this.placement||"top",strategy:"fixed",middleware:r})??(i={}),((t,e,n)=>{const o=new Map,r=null!=n?n:{},i={...kt,...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:j},c=await(null==s.isRTL?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:p,y:f}=R(l,o,c),u=o,h=0;const d={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:v,fn:g}=m,{x:w,y,data:x,reset:b}=await g({x:p,y:f,initialPlacement:o,placement:u,strategy:r,middlewareData:d,rects:l,platform:a,elements:{reference:t,floating:e}});p=null!=w?w:p,f=null!=y?y:f,d[v]={...d[v],...x},b&&h<50&&(h++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(l=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),({x:p,y:f}=R(l,u,c))),n=-1)}return{x:p,y:f,placement:u,strategy:r,middlewareData:d}})(t,e,{...r,platform:i})})(this.eventTarget,this.host,{...i,platform:{...ue,...i.platform,[fe]:new Map}});var i}async updateSafeSpaceBoundaries(e){const n=this.eventTarget.getBoundingClientRect(),o="top"===e||"bottom"===e,r=((t,e,n)=>"top"===t||"bottom"===t?{popover:{y:"top"===t?e.bottom:e.top,xStart:e.left,xEnd:e.right},trigger:{y:"top"===t?n.top:n.bottom,xStart:n.left,xEnd:n.right}}:{popover:{x:"left"===t?e.right:e.left,yStart:e.top,yEnd:e.bottom},trigger:{x:"left"===t?n.left:n.right,yStart:n.top,yEnd:n.bottom}})(e,this.host.getBoundingClientRect(),n);t.PROPERTIES_TO_CLEAR.forEach((t=>{this.host.style.removeProperty(t)})),o?(this.host.style.setProperty("--post-safe-space-popover-y",`${r.popover.y}px`),this.host.style.setProperty("--post-safe-space-popover-x-start",`${r.popover.xStart}px`),this.host.style.setProperty("--post-safe-space-popover-x-end",`${r.popover.xEnd}px`),this.host.style.setProperty("--post-safe-space-trigger-y",`${r.trigger.y}px`),this.host.style.setProperty("--post-safe-space-trigger-x-start",`${r.trigger.xStart}px`),this.host.style.setProperty("--post-safe-space-trigger-x-end",`${r.trigger.xEnd}px`)):(this.host.style.setProperty("--post-safe-space-popover-x",`${r.popover.x}px`),this.host.style.setProperty("--post-safe-space-popover-y-start",`${r.popover.yStart}px`),this.host.style.setProperty("--post-safe-space-popover-y-end",`${r.popover.yEnd}px`),this.host.style.setProperty("--post-safe-space-trigger-x",`${r.trigger.x}px`),this.host.style.setProperty("--post-safe-space-trigger-y-start",`${r.trigger.yStart}px`),this.host.style.setProperty("--post-safe-space-trigger-y-end",`${r.trigger.yEnd}px`))}render(){return r(i,{key:"a6f41ad3ef982f9e9ec0d6450837d1cfdca73d16","data-version":a,popover:"auto"},r("div",{key:"40afab436d5550fda44c8995139080161eab5b09",part:"post-popovercontainer-content",class:"popover-content"},this.arrow&&r("span",{key:"580bd8fcaecb89334aca05001137a4d7cccd254a","dynamic-placement":this.dynamicPlacement,class:"arrow",ref:t=>{this.arrowRef=t}}),r("span",{key:"61a6e4e8026832afc188edd5a74535716db65945",part:"post-popovercontainer-border-mask"}),r("slot",{key:"d79cb69a77dbba13ffa3c30e0393db4f3a669a12"})))}get host(){return this}static get style(){return'@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host>div{border:2px solid rgba(0,0,0,0)}}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[dynamic-placement=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[dynamic-placement=top]{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[dynamic-placement=left]{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[dynamic-placement=right]{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[dynamic-placement=bottom]{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:host([safe-space=triangle])::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:host([safe-space=trapezoid])::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:host(:not(:has(.arrow)))>div{box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=top]))>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=left]))>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=right]))>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}'}},[257,"post-popovercontainer",{placement:[1],edgeGap:[2,"edge-gap"],offset:[2],arrow:[4],safeSpace:[513,"safe-space"],autoHide:[4,"auto-hide"],dynamicPlacement:[32],show:[64],hide:[64],toggle:[64]}]);function ve(){"undefined"!=typeof customElements&&["post-popovercontainer"].forEach((t=>{"post-popovercontainer"===t&&(customElements.get(s(t))||customElements.define(s(t),me))}))}me.STATIC_SIDES={top:"bottom",right:"left",bottom:"top",left:"right"},me.PROPERTIES_TO_CLEAR=["--post-safe-space-popover-x","--post-safe-space-popover-y","--post-safe-space-popover-x-start","--post-safe-space-popover-x-end","--post-safe-space-popover-y-start","--post-safe-space-popover-y-end","--post-safe-space-trigger-x","--post-safe-space-trigger-y","--post-safe-space-trigger-x-start","--post-safe-space-trigger-x-end","--post-safe-space-trigger-y-start","--post-safe-space-trigger-y-end"],he([c(p)],me.prototype,"placement",void 0),he([l("number")],me.prototype,"edgeGap",void 0),he([c(["triangle","trapezoid"])],me.prototype,"safeSpace",void 0);export{me as P,p as a,ve as d}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as n,Build as o,h as r,Host as i,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as a}from"./package.js";import{O as c}from"./one-of.js";import{T as l}from"./type.js";const p=["top","right","bottom","left","top-start","top-end","right-start","right-end","bottom-start","bottom-end","left-start","left-end"],f=["top","right","bottom","left"],u=Math.min,h=Math.max,d=Math.round,m=Math.floor,v=t=>({x:t,y:t}),g={left:"right",right:"left",bottom:"top",top:"bottom"};function w(t,e,n){return h(t,u(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function x(t){return t.split("-")[0]}function b(t){return t.split("-")[1]}function S(t){return"x"===t?"y":"x"}function k(t){return"y"===t?"height":"width"}function E(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function T(t){return S(E(t))}function M(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const A=["left","right"],O=["right","left"],H=["top","bottom"],L=["bottom","top"];function $(t){const e=x(t);return g[e]+t.slice(e.length)}function C(t){return"number"!=typeof t?function(t){var e,n,o,r;return{top:null!=(e=t.top)?e:0,right:null!=(n=t.right)?n:0,bottom:null!=(o=t.bottom)?o:0,left:null!=(r=t.left)?r:0}}(t):{top:t,right:t,bottom:t,left:t}}function D(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function R(t,e,n){let{reference:o,floating:r}=t;const i=E(e),s=T(e),a=k(s),c=x(e),l="y"===i,p=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2;let h;switch(c){case"top":h={x:p,y:o.y-r.height};break;case"bottom":h={x:p,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}const d=b(e);return d&&(h[s]+=u*("end"===d?1:-1)*(n&&l?-1:1)),h}async function j(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:u=!1,padding:h=0}=y(e,t),d=C(h),m=a[u?"floating"===f?"reference":"floating":f],v=D(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:p,strategy:c})),g="floating"===f?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=D(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:w,strategy:c}):g);return{top:(v.top-b.top+d.top)/x.y,bottom:(b.bottom-v.bottom+d.bottom)/x.y,left:(v.left-b.left+d.left)/x.x,right:(b.right-v.right+d.right)/x.x}}function z(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function F(t){return f.some((e=>t[e]>=0))}function P(t){const e=u(...t.map((t=>t.left))),n=u(...t.map((t=>t.top)));return{x:e,y:n,width:h(...t.map((t=>t.right)))-e,height:h(...t.map((t=>t.bottom)))-n}}const W=new Set(["left","top"]);function B(){return"undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function I(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function N(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return!!B()&&(t instanceof Node||t instanceof I(t).Node)}function V(t){return!!B()&&(t instanceof Element||t instanceof I(t).Element)}function X(t){return!!B()&&(t instanceof HTMLElement||t instanceof I(t).HTMLElement)}function Y(t){return!(!B()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof I(t).ShadowRoot)}function _(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==r&&"contents"!==r}function J(t){return/^(table|td|th)$/.test(q(t))}function K(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const Q=/transform|translate|scale|rotate|perspective|filter/,U=/paint|layout|strict|content/,Z=t=>!!t&&"none"!==t;let tt;function et(t){const e=V(t)?rt(t):t;return Z(e.transform)||Z(e.translate)||Z(e.scale)||Z(e.rotate)||Z(e.perspective)||!nt()&&(Z(e.backdropFilter)||Z(e.filter))||Q.test(e.willChange||"")||U.test(e.contain||"")}function nt(){return null==tt&&(tt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tt}function ot(t){return/^(html|body|#document)$/.test(q(t))}function rt(t){return I(t).getComputedStyle(t)}function it(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function st(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Y(t)&&t.host||N(t);return Y(e)?e.host:e}function at(t){const e=st(t);return ot(e)?(t.ownerDocument||t).body:X(e)&&_(e)?e:at(e)}function ct(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=at(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),s=I(r);if(i){const t=lt(s);return e.concat(s,s.visualViewport||[],_(r)?r:[],t&&n?ct(t):[])}return e.concat(r,ct(r,[],n))}function lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pt(t){const e=rt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=X(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=d(n)!==i||d(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function ft(t){return V(t)?t:t.contextElement}function ut(t){const e=ft(t);if(!X(e))return v(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=pt(e);let s=(i?d(n.width):n.width)/o,a=(i?d(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ht=v(0);function dt(t){const e=I(t);return nt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ht}function mt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=ft(t);let s=v(1);e&&(o?V(o)&&(s=ut(o)):s=ut(t));const a=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===I(t)}(i,n,o)?dt(i):v(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,p=r.width/s.x,f=r.height/s.y;if(i&&o){const t=I(i),e=V(o)?I(o):o;let n=t,r=lt(n);for(;r&&e!==n;){const t=ut(r),e=r.getBoundingClientRect(),o=rt(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,l*=t.y,p*=t.x,f*=t.y,c+=i,l+=s,n=I(r),r=lt(n)}}return D({width:p,height:f,x:c,y:l})}function vt(t,e){const n=it(t).scrollLeft;return e?e.left+n:mt(N(t)).left+n}function gt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function wt(t,e,n){let o;if("viewport"===e||"layoutViewport"===e)o=function(t,e,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,r=I(t),i=N(t),s=r.visualViewport;let a=i.clientWidth,c=i.clientHeight,l=0,p=0;if(s){const t=!nt()||"fixed"===e;o?t||(l=-s.offsetLeft,p=-s.offsetTop):(a=s.width,c=s.height,t&&(l=s.offsetLeft,p=s.offsetTop))}if(vt(i)<=0){const t=i.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-e.clientWidth-o),s="stable both-edges"===getComputedStyle(i).scrollbarGutter?r/2:r;s<=25&&(a-=s)}return{width:a,height:c,x:l,y:p}}(t,n,e);else if("document"===e)o=function(t){const e=it(t),n=t.ownerDocument.body,o=h(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=h(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+vt(t);const s=-e.scrollTop;return"rtl"===rt(n).direction&&(i+=h(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}(N(t));else if(V(e))o=function(t,e){const n=mt(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=ut(t);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=dt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return D(o)}function yt(t,e,n){const o=X(e),r=N(e),i="fixed"===n,s=mt(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=v(0);if((o||!i)&&(("body"!==q(e)||_(r))&&(a=it(e)),o)){const t=mt(e,!0,i,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}!o&&r&&(c.x=vt(r));const l=!r||o||i?v(0):gt(r,a);return{x:s.left+a.scrollLeft-c.x-l.x,y:s.top+a.scrollTop-c.y-l.y,width:s.width,height:s.height}}function xt(t){return"static"===rt(t).position}function bt(t,e){if(!X(t)||"fixed"===rt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return N(t)===n&&(n=n.ownerDocument.body),n}function St(t,e){const n=I(t);if(K(t))return n;if(!X(t)){let e=st(t);for(;e&&!ot(e);){if(V(e)&&!xt(e))return e;e=st(e)}return n}let o=bt(t,e);for(;o&&J(o)&&xt(o);)o=bt(o,e);return o&&ot(o)&&xt(o)&&!et(o)?n:o||function(t){let e=st(t);for(;X(e)&&!ot(e);){if(et(e))return e;if(K(e))return null;e=st(e)}return null}(t)||n}const kt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,s=N(o),a=!!e&&K(e.floating);if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=v(1);const p=v(0),f=X(o);if((f||!i)&&(("body"!==q(o)||_(s))&&(c=it(o)),f)){const t=mt(o);l=ut(o),p.x=t.x+o.clientLeft,p.y=t.y+o.clientTop}const u=!s||f||i?v(0):gt(s,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+p.x+u.x,y:n.y*l.y-c.scrollTop*l.y+p.y+u.y}},getDocumentElement:N,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?K(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=ct(t,[],!1).filter((t=>V(t)&&"body"!==q(t))),r=null;const i="fixed"===rt(t).position;let s=i?st(t):t;for(;V(s)&&!ot(s);){const t=rt(s),e=et(s),n=r?r.position:i?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?r=t:o=o.filter((t=>t!==s)),s=st(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=wt(e,i[0],r);let a=s.top,c=s.right,l=s.bottom,p=s.left;for(let t=1;t<i.length;t++){const n=wt(e,i[t],r);a=h(n.top,a),c=u(n.right,c),l=u(n.bottom,l),p=h(n.left,p)}return{width:c-p,height:l-a,x:p,y:a}},getOffsetParent:St,getElementRects:async function(t){const e=this.getOffsetParent||St,n=this.getDimensions,o=await n(t.floating);return{reference:yt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=pt(t);return{width:e,height:n}},getScale:ut,isElement:V,isRTL:function(t){return"rtl"===rt(t).direction}};function Et(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const Tt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=e,c=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),s=x(n),a=b(n),c="y"===E(n),l=W.has(s)?-1:1,p=i&&c?-1:1,f=y(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:d}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof d&&(h="end"===a?-1*d:d),c?{x:h*p,y:u*l}:{x:u*l,y:h*p}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},Mt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...v}=y(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=x(r),w=E(a),S=x(a)===a,C=await(null==c.isRTL?void 0:c.isRTL(l.floating)),D=u||(S||!m?[$(a)]:function(t){const e=$(t);return[M(t),e,M(e)]}(a)),R="none"!==d;!u&&R&&D.push(...function(t,e,n,o){const r=b(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?O:A:e?A:O;case"left":case"right":return e?H:L;default:return[]}}(x(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(M)))),i}(a,m,d,C));const j=[a,...D],z=await c.detectOverflow(e,v),F=[];let P=(null==(o=i.flip)?void 0:o.overflows)||[];if(p&&F.push(z[g]),f){const t=function(t,e,n){void 0===n&&(n=!1);const o=b(t),r=T(t),i=k(r);let s="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=$(s)),[s,$(s)]}(r,s,C);F.push(z[t[0]],z[t[1]])}if(P=[...P,{placement:r,overflows:F}],!F.every((t=>t<=0))){var W,B;const t=((null==(W=i.flip)?void 0:W.index)||0)+1,e=j[t];if(e&&("alignment"!==f||w===E(e)||P.every((t=>E(t.placement)!==w||t.overflows[0]>0))))return{data:{index:t,overflows:P},reset:{placement:e}};let n=null==(B=P.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:B.placement;if(!n)switch(h){case"bestFit":{var q;const t=null==(q=P.filter((t=>{if(R){const e=E(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:q[0];t&&(n=t);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},At=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:r,elements:i}=e,{apply:s=()=>{},...a}=y(t,e),c=await r.detectOverflow(e,a),l=x(n),p=b(n),f="y"===E(n),{width:d,height:m}=o.floating;let v,g;"top"===l||"bottom"===l?(v=l,g=p===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=l,v="end"===p?"top":"bottom");const w=m-c.top-c.bottom,S=d-c.left-c.right,k=u(m-c[v],w),T=u(d-c[g],S),M=e.middlewareData.shift;let A=k,O=T;null!=M&&M.enabled.x&&(O=S),null!=M&&M.enabled.y&&(A=w),!M&&!p&&(f?O=d-2*h(c.left,c.right):A=m-2*h(c.top,c.bottom)),await s({...e,availableWidth:O,availableHeight:A});const H=await r.getDimensions(i.floating);return d!==H.width||m!==H.height?{reset:{rects:!0}}:{}}}},Ot=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:i,strategy:s}=e,{padding:a=2,x:c,y:l}=y(t,e),p=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]);if(!p.length)return{};const f=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 r=e[t];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map((t=>D(P(t))))}(p),d=D(P(p)),m=C(a),v=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&(f[0].left>f[1].right||f[1].left>f[0].right)&&null!=c&&null!=l)return f.find((t=>c>t.left-m.left&&c<t.right+m.right&&l>t.top-m.top&&l<t.bottom+m.bottom))||d;if(f.length>=2){if("y"===E(n)){const t=f[0],e=f[f.length-1],o="top"===x(n),r=t.top,i=o?t.left:e.left;return D({x:i,y:r,width:(o?t.right:e.right)-i,height:e.bottom-r})}const t="left"===x(n),e=h(...f.map((t=>t.right))),o=u(...f.map((t=>t.left))),r=f.filter((n=>t?n.left===o:n.right===e)),i=r[0].top;return D({x:o,y:i,width:e-o,height:r[r.length-1].bottom-i})}return d}},floating:o.floating,strategy:s});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Ht=function(t){return void 0===t&&(t={}),{options:t,fn(e){var n,o;const{x:r,y:i,placement:s,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:p=!0,crossAxis:f=!0}=y(t,e),u={x:r,y:i},h=E(s),d=S(h);let m=u[d],v=u[h];const g=y(l,e),w="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:null!=(n=g.mainAxis)?n:0,crossAxis:null!=(o=g.crossAxis)?o:0};if(p){const t="y"===d?"height":"width",e=a.reference[d]-a.floating[t]+w.mainAxis,n=a.reference[d]+a.reference[t]-w.mainAxis;m<e?m=e:m>n&&(m=n)}if(f){var b,k;const t="y"===d?"width":"height",e=W.has(x(s)),n=a.reference[h]-a.floating[t]+(e&&(null==(b=c.offset)?void 0:b[h])||0)+(e?0:w.crossAxis),o=a.reference[h]+a.reference[t]+(e?0:(null==(k=c.offset)?void 0:k[h])||0)-(e?w.crossAxis:0);v<n?v=n:v>o&&(v=o)}return{[d]:m,[h]:v}}}};var Lt=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:n="",...o}={}){super(t,o),this.oldState=String(e||""),this.newState=String(n||"")}},$t=new WeakMap;function Ct(t,e,n){$t.set(t,setTimeout((()=>{$t.has(t)&&t.dispatchEvent(new Lt("toggle",{cancelable:!1,oldState:e,newState:n}))}),0))}var Dt=globalThis.ShadowRoot||function(){},Rt=globalThis.HTMLDialogElement||function(){},jt=new WeakMap,zt=new WeakMap,Ft=new WeakMap,Pt=new WeakMap;function Wt(t){return Pt.get(t)||"hidden"}var Bt=new WeakMap;function qt(t){return[...t].pop()}function It(t,e){return!("auto"!==t.popover&&"manual"!==t.popover&&"hint"!==t.popover||!t.isConnected||e&&"showing"!==Wt(t)||!e&&"hidden"!==Wt(t)||t instanceof Rt&&t.hasAttribute("open")||document.fullscreenElement===t)}function Nt(t){if(!t)return 0;const e=zt.get(document)||new Set,n=Ft.get(document)||new Set;return n.has(t)?[...n].indexOf(t)+e.size+1:e.has(t)?[...e].indexOf(t)+1:0}function Gt(t){let e;const n=Ft.get(t)||new Set,o=zt.get(t)||new Set,r=n.size>0?n:o.size>0?o:null;return r?(e=qt(r),e.isConnected?e:(r.delete(e),Gt(t))):null}function Vt(t){for(const e of t||[]){if(e.isConnected)return e;t.delete(e)}return null}function Xt(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?Xt(t.parentNode):t}function Yt(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===Pt.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||Xt(t))instanceof Dt&&(t=t.host),t instanceof Document)return}}function _t(t,e){const n=new Map;let o=0;for(const t of e||[])n.set(t,o),o+=1;n.set(t,o),o+=1;let r=null;return function(e){if(!e)return;let o=!1,i=null,s=null;for(;!o;){if(i=Yt(e)||null,null===i)return;if(!n.has(i))return;"hint"!==t.popover&&"auto"!==i.popover||(o=!0),o||(e=i.parentElement)}s=n.get(i),(null===r||n.get(r)<s)&&(r=i)}(t.parentElement||Xt(t)),r}function Jt(t){return!(t.hidden||t instanceof Dt||(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)&&t.disabled||t instanceof HTMLInputElement&&"hidden"===t.type||t instanceof HTMLAnchorElement&&""===t.href||"number"!=typeof t.tabIndex||-1===t.tabIndex)}var Kt=new WeakMap;function Qt(t){if(!It(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new Lt("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!It(t,!1))return;let n=!1;const o=t.popover;let r=null;const i=_t(t,zt.get(e)||new Set),s=_t(t,Ft.get(e)||new Set);if("auto"===o&&(Zt(Ft.get(e)||new Set,n,!0),ee(i||e,n,!0),r="auto"),"hint"===o&&(s?(ee(s,n,!0),r="hint"):(Zt(Ft.get(e)||new Set,n,!0),i?(ee(i,n,!0),r="auto"):r="hint")),"auto"===o||"hint"===o){if(o!==t.popover||!It(t,!1))return;Gt(e)||(n=!0),"auto"===r?(zt.has(e)||zt.set(e,new Set),zt.get(e).add(t)):"hint"===r&&(Ft.has(e)||Ft.set(e,new Set),Ft.get(e).add(t))}Kt.delete(t);const a=e.activeElement;var c;t.classList.add(":popover-open"),Pt.set(t,"showing"),jt.has(e)||jt.set(e,new Set),jt.get(e).add(t),ie(Bt.get(t),!0),c=t,function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let n=e.querySelector("[autofocus]");if(n)return n;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(n=e.querySelector("[autofocus]"),n)return n}}}const o=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let r=o.currentNode;for(;r;){if(Jt(r))return r;r=o.nextNode()}}(c)?.focus(),n&&a&&"auto"===t.popover&&Kt.set(t,a),Ct(t,"closed","open")}function Ut(t,e=!1,n=!1){if(!It(t,!0))return;const o=t.ownerDocument;if(["auto","hint"].includes(t.popover)&&(ee(t,e,n),!It(t,!0)))return;const r=zt.get(o)||new Set,i=r.has(t)&&qt(r)===t;if(ie(Bt.get(t),!1),Bt.delete(t),n&&(t.dispatchEvent(new Lt("beforetoggle",{oldState:"open",newState:"closed"})),i&&qt(r)!==t&&ee(t,e,n),!It(t,!0)))return;jt.get(o)?.delete(t),r.delete(t),Ft.get(o)?.delete(t),t.classList.remove(":popover-open"),Pt.set(t,"hidden"),n&&Ct(t,"open","closed");const s=Kt.get(t);s&&(Kt.delete(t),e&&s.focus())}function Zt(t,e=!1,n=!1){let o=Vt(t);for(;o;)Ut(o,e,n),o=Vt(t)}function te(t,e,n,o){let r=!1,i=!1;for(;r||!i;){i=!0;let s=null,a=!1;for(const n of e)if(n===t)a=!0;else if(a){s=n;break}if(!s)return;for(;"showing"===Wt(s)&&e.size;)Ut(qt(e),n,o);e.has(t)&&qt(e)!==t&&(r=!0),r&&(o=!1)}}function ee(t,e,n){const o=t.ownerDocument||t;if(t instanceof Document)return function(t,e=!1,n=!1){let o=Gt(t);for(;o;)Ut(o,e,n),o=Gt(t)}(o,e,n);Ft.get(o)?.has(t)?te(t,Ft.get(o),e,n):(Zt(Ft.get(o)||new Set,e,n),zt.get(o)?.has(t)&&te(t,zt.get(o),e,n))}var ne=new WeakMap;function oe(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!Gt(n))return;const o=function(t){const e=Yt(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||Xt(t))instanceof Dt&&(t=t.host),t instanceof Document)return}}(t);return Nt(e)>Nt(n)?e:n}(e);if(o&&"pointerdown"===t.type)ne.set(n,o);else if("pointerup"===t.type){const t=ne.get(n)===o;ne.delete(n),t&&ee(o||n,!1,!0)}}var re=new WeakMap;function ie(t,e=!1){if(!t)return;re.has(t)||re.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=re.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var se=globalThis.ShadowRoot||function(){};function ae(t,e,n){const o=t[e];Object.defineProperty(t,e,{value(t){return o.call(this,n(t))}})}var ce=/(^|[^\\]):popover-open\b/g;var le=null;function pe(t){const e=function(){const t="function"==typeof globalThis.CSSLayerBlockRule;return`\n${t?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${t?"}":""}\n`}();if(null===le)try{(le=new CSSStyleSheet).replaceSync(e)}catch{le=!1}if(!1===le){const n=document.createElement("style");n.textContent=e,t instanceof Document?t.head.prepend(n):t.prepend(n)}else t.adoptedStyleSheets=[le,...t.adoptedStyleSheets]}const fe=Symbol("Clipping Rect Cache"),ue={...kt,getClippingRect:async function(...t){const e=t[0].element,n=this[fe].get(e);if(n)return n;const o=await kt.getClippingRect.apply(this,t);return function(t,e){const n=e.ownerDocument.querySelector("post-header");if(null===n)return;let o=e;for(;!ot(o);)if(o=st(o),X(o)&&(K(o)||o===n))return;const r=n.getBoundingClientRect(),i=Math.max(t.y,r.bottom);t.height-=i-t.y,t.y=i}(o,e),this[fe].set(e,o),o}};var he=function(t,e,n,o){var r,i=arguments.length,s=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,n,s):r(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s};const de={"pop-in":function(t){if(t)return t.animate([{transform:"scale(0.9)",opacity:0},{transform:"scale(1)",opacity:1}],{duration:250,easing:"ease-out",fill:"forwards"})}},me=t(class t extends e{static{this.STATIC_SIDES={top:"bottom",right:"left",bottom:"top",left:"right"}}static{this.PROPERTIES_TO_CLEAR=["--post-safe-space-popover-x","--post-safe-space-popover-y","--post-safe-space-popover-x-start","--post-safe-space-popover-x-end","--post-safe-space-popover-y-start","--post-safe-space-popover-y-end","--post-safe-space-trigger-x","--post-safe-space-trigger-y","--post-safe-space-trigger-x-start","--post-safe-space-trigger-x-end","--post-safe-space-trigger-y-start","--post-safe-space-trigger-y-end"]}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postBeforeShow=n(this,"postBeforeShow",7),this.postShow=n(this,"postShow",7),this.postHide=n(this,"postHide",7),this.postBeforeToggle=n(this,"postBeforeToggle",7),this.postToggle=n(this,"postToggle",7),this.toggleTimeoutId=null,this.hasOpenedOnce=!0,this.placement="top",this.edgeGap=8,this.arrow=!1,this.animation="pop-in",this.currentAnimation=null,this.boundMouseTrackingHandler=this.mouseTrackingHandler.bind(this)}mouseTrackingHandler(t){this.host.style.setProperty("--post-safe-space-cursor-x",`${t.clientX}px`),this.host.style.setProperty("--post-safe-space-cursor-y",`${t.clientY}px`)}connectedCallback(){!o.isBrowser||"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){if("undefined"==typeof window)return;function t(t){return t?.includes(":popover-open")&&(t=t.replace(ce,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||Lt,ae(Document.prototype,"querySelector",t),ae(Document.prototype,"querySelectorAll",t),ae(Element.prototype,"querySelector",t),ae(Element.prototype,"querySelectorAll",t),ae(Element.prototype,"matches",t),ae(Element.prototype,"closest",t),ae(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"hint"==t?"hint":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(t={}){Qt(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Ut(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t={}){return"boolean"==typeof t&&(t={force:t}),"showing"===Pt.get(this)&&void 0===t.force||!1===t.force?Ut(this,!0,!0):void 0!==t.force&&!0!==t.force||Qt(this),"showing"===Pt.get(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const n=e.call(this,t);return pe(n),n}}});const n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=n.call(this);return t.shadowRoot&&pe(t.shadowRoot),t}}});const o=new WeakMap;function r(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),o.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),o.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=o.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return o.delete(this),null;const e=Xt(this),n=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof se)&&n&&e.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}var i;r(HTMLButtonElement),r(HTMLInputElement),(i=document).addEventListener("click",(t=>{const e=t.composedPath(),n=e[0];if(!(n instanceof Element)||n?.shadowRoot)return;const o=Xt(n);if(!(o instanceof se||o instanceof Document))return;const r=e.find((t=>t.matches?.("[popovertargetaction],[popovertarget]")));return r?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const n=Wt(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?Ut(e,!0,!0):It(e,!1)&&(Bt.set(e,t),Qt(e)))}(r),void t.preventDefault()):void 0})),i.addEventListener("keydown",(t=>{const e=t.key,n=t.target;t.defaultPrevented||!n||"Escape"!==e&&"Esc"!==e||ee(n.ownerDocument,!0,!0)})),i.addEventListener("pointerdown",oe),i.addEventListener("pointerup",oe),pe(document)}()}componentDidLoad(){this.host.addEventListener("beforetoggle",this.handleToggle.bind(this))}disconnectedCallback(){"function"==typeof this.clearAutoUpdate&&this.clearAutoUpdate(),this.host.removeEventListener("beforetoggle",this.handleToggle.bind(this))}async show(t){!this.toggleTimeoutId&&t&&(this.eventTarget=t,this.updatePosition(),this.host.showPopover())}async hide(){this.toggleTimeoutId||(this.eventTarget=null,this.host.hidePopover(),this.postHide.emit())}async toggle(t,e){const n=this.host.matches(":where(:popover-open, .popover-open)");return!0!==e&&(void 0!==e||n)||t?(this.eventTarget=t,this.toggleTimeoutId||(this.updatePosition(),this.host.togglePopover(e),this.toggleTimeoutId=null),this.host.matches(":where(:popover-open, .popover-open)")):n}open(){const t=this.host.shadowRoot?.querySelector(".popover-content");if(this.startAutoupdates(),t){const e=de[this.animation];"function"==typeof e?this.runOpenAnimation(e,t):(this.postBeforeToggle.emit({willOpen:!0}),this.postBeforeShow.emit({first:this.hasOpenedOnce}),this.postToggle.emit({isOpen:!0}),this.postShow.emit({first:this.hasOpenedOnce}),this.hasOpenedOnce&&(this.hasOpenedOnce=!1))}this.safeSpace&&globalThis.addEventListener("mousemove",this.boundMouseTrackingHandler)}close(){"function"==typeof this.clearAutoUpdate&&this.clearAutoUpdate(),this.safeSpace&&globalThis.removeEventListener("mousemove",this.boundMouseTrackingHandler),this.currentAnimation&&(this.currentAnimation.cancel(),this.currentAnimation=null),this.postBeforeToggle.emit({willOpen:!1}),this.postToggle.emit({isOpen:!1}),this.postHide.emit()}async runOpenAnimation(t,e){let n;try{if(n=t(e),!n)return this.postBeforeToggle.emit({willOpen:!0}),this.postBeforeShow.emit({first:this.hasOpenedOnce}),this.postToggle.emit({isOpen:!0}),void this.postShow.emit({first:this.hasOpenedOnce});this.currentAnimation=n,"running"===n.playState&&(this.postBeforeToggle.emit({willOpen:!0}),this.postBeforeShow.emit({first:this.hasOpenedOnce})),await n.finished,this.postToggle.emit({isOpen:!0}),this.postShow.emit({first:this.hasOpenedOnce}),this.hasOpenedOnce=!0}catch(t){console.warn("Animation failed or was interrupted:",t),this.postBeforeToggle.emit({willOpen:!1}),this.postBeforeShow.emit({first:this.hasOpenedOnce}),this.postToggle.emit({isOpen:!1})}finally{this.currentAnimation===n&&(this.currentAnimation=null)}}handleToggle(t){this.toggleTimeoutId=globalThis.setTimeout((()=>this.toggleTimeoutId=null),10),"open"===t.newState?this.open():this.close()}startAutoupdates(){this.eventTarget&&this.host&&(this.clearAutoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,l=ft(t),p=r||i?[...l?ct(l):[],...e?ct(e):[]]:[];p.forEach((t=>{r&&t.addEventListener("scroll",n),i&&t.addEventListener("resize",n)}));const f=l&&a?function(t,e,n){let o,r=null;const i=N(t);function s(){var t;clearTimeout(o),null==(t=r)||t.disconnect(),r=null}function a(n,c){void 0===n&&(n=!1),void 0===c&&(c=1),s();const l=t.getBoundingClientRect(),{left:p,top:f,width:d,height:v}=l;if(n||e(),!d||!v)return;const g={rootMargin:-m(f)+"px "+-m(i.clientWidth-(p+d))+"px "+-m(i.clientHeight-(f+v))+"px "+-m(p)+"px",threshold:h(0,u(1,c))||1};let w=!0;function y(e){const n=e[0].intersectionRatio;if(!Et(l,t.getBoundingClientRect()))return a();if(n!==c){if(!w)return a();n?a(!1,n):o=setTimeout((()=>{a(!1,1e-7)}),1e3)}w=!1}try{r=new IntersectionObserver(y,{...g,root:i.ownerDocument})}catch(t){r=new IntersectionObserver(y,g)}r.observe(t)}const c=I(t),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),s()}}(l,n,i):null;let d,v=-1,g=null;s&&(g=new ResizeObserver((t=>{let[o]=t;o&&o.target===l&&g&&e&&(g.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame((()=>{var t;null==(t=g)||t.observe(e)}))),n()})),l&&!c&&g.observe(l),e&&g.observe(e));let w=c?mt(t):null;return c&&function e(){const o=mt(t);w&&!Et(w,o)&&n(),w=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;p.forEach((t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),null==f||f(),null==(t=g)||t.disconnect(),g=null,c&&cancelAnimationFrame(d)}}(this.eventTarget,this.host,this.updatePosition.bind(this)))}async updatePosition(){const{x:e,y:n,middlewareData:o,placement:r}=await this.calculatePosition();o.hide?.referenceHidden&&this.host.hidePopover();const i=r.split("-")[0];if(this.dynamicPlacement=i,this.host.style.left=`${e}px`,this.host.style.top=`${n}px`,this.arrow&&o.arrow){const{x:e,y:n}=o.arrow,r=t.STATIC_SIDES[i],s=-.5*this.arrowRef.offsetWidth;r&&Object.assign(this.arrowRef.style,{left:e?`${e}px`:"",top:n?`${n}px`:"",[r]:`${s}px`})}this.safeSpace&&this.eventTarget&&await this.updateSafeSpaceBoundaries(i)}async calculatePosition(){const t=this.edgeGap,e=(this.placement||"top").includes("-"),n=[Mt({elementContext:"reference",crossAxis:!1}),Mt({elementContext:"floating",crossAxis:!1})],o=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),p={x:n,y:o},f=await i.detectOverflow(e,l),u=E(r),h=S(u);let d=p[h],m=p[u];const v=(t,e)=>w(e+f["y"===t?"top":"left"],e,e-f["y"===t?"bottom":"right"]);s&&(d=v(h,d)),a&&(m=v(u,m));const g=c.fn({...e,[h]:d,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:s,[u]:a}}}}}}({padding:t,limiter:Ht({offset:32})}),r=[Tt(this.offset??(this.arrow?t+4:t)),Ot(),...e?[...n,o]:[o,...n],At({apply({availableWidth:e,elements:n}){Object.assign(n.floating.style,{maxWidth:e-2*t+"px"})}})];return this.arrow&&r.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=e,{element:l,padding:p=0}=y(t,e)||{};if(null==l)return{};const f=C(p),h={x:n,y:o},d=T(r),m=k(d),v=await s.getDimensions(l),g="y"===d,x=g?"top":"left",S=g?"bottom":"right",E=g?"clientHeight":"clientWidth",M=i.reference[m]+i.reference[d]-h[d]-i.floating[m],A=h[d]-i.reference[d],O=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let H=O?O[E]:0;H&&await(null==s.isElement?void 0:s.isElement(O))||(H=a.floating[E]||i.floating[m]);const L=M/2-A/2,$=H/2-v[m]/2-1,D=u(f[x],$),R=u(f[S],$),j=H-v[m]-R,z=H/2-v[m]/2+L,F=w(D,z,j),P=!c.arrow&&null!=b(r)&&z!==F&&i.reference[m]/2-(z<D?D:R)-v[m]/2<0,W=P?z<D?z-D:z-j:0;return{[d]:h[d]+W,data:{[d]:F,centerOffset:z-F-W,...P&&{alignmentOffset:W}},reset:P}}}))({element:this.arrowRef,padding:t})),this.autoHide&&r.push(function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...i}=y(t,e);switch(r){case"referenceHidden":{const t=z(await o.detectOverflow(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:F(t)}}}case"escaped":{const t=z(await o.detectOverflow(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:F(t)}}}default:return{}}}}}({strategy:"referenceHidden"})),i=this.eventTarget,s=this.host,a={placement:this.placement||"top",strategy:"fixed",middleware:r},a??={},((t,e,n)=>{const o=new Map,r=null!=n?n:{},i={...kt,...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:j},c=await(null==s.isRTL?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:p,y:f}=R(l,o,c),u=o,h=0;const d={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:v,fn:g}=m,{x:w,y,data:x,reset:b}=await g({x:p,y:f,initialPlacement:o,placement:u,strategy:r,middlewareData:d,rects:l,platform:a,elements:{reference:t,floating:e}});p=null!=w?w:p,f=null!=y?y:f,d[v]={...d[v],...x},b&&h<50&&(h++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(l=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),({x:p,y:f}=R(l,u,c))),n=-1)}return{x:p,y:f,placement:u,strategy:r,middlewareData:d}})(t,e,{...r,platform:i})})(i,s,{...a,platform:{...ue,...a.platform,[fe]:new Map}});var i,s,a}async updateSafeSpaceBoundaries(e){const n=this.eventTarget.getBoundingClientRect(),o="top"===e||"bottom"===e,r=((t,e,n)=>"top"===t||"bottom"===t?{popover:{y:"top"===t?e.bottom:e.top,xStart:e.left,xEnd:e.right},trigger:{y:"top"===t?n.top:n.bottom,xStart:n.left,xEnd:n.right}}:{popover:{x:"left"===t?e.right:e.left,yStart:e.top,yEnd:e.bottom},trigger:{x:"left"===t?n.left:n.right,yStart:n.top,yEnd:n.bottom}})(e,this.host.getBoundingClientRect(),n);t.PROPERTIES_TO_CLEAR.forEach((t=>{this.host.style.removeProperty(t)})),o?(this.host.style.setProperty("--post-safe-space-popover-y",`${r.popover.y}px`),this.host.style.setProperty("--post-safe-space-popover-x-start",`${r.popover.xStart}px`),this.host.style.setProperty("--post-safe-space-popover-x-end",`${r.popover.xEnd}px`),this.host.style.setProperty("--post-safe-space-trigger-y",`${r.trigger.y}px`),this.host.style.setProperty("--post-safe-space-trigger-x-start",`${r.trigger.xStart}px`),this.host.style.setProperty("--post-safe-space-trigger-x-end",`${r.trigger.xEnd}px`)):(this.host.style.setProperty("--post-safe-space-popover-x",`${r.popover.x}px`),this.host.style.setProperty("--post-safe-space-popover-y-start",`${r.popover.yStart}px`),this.host.style.setProperty("--post-safe-space-popover-y-end",`${r.popover.yEnd}px`),this.host.style.setProperty("--post-safe-space-trigger-x",`${r.trigger.x}px`),this.host.style.setProperty("--post-safe-space-trigger-y-start",`${r.trigger.yStart}px`),this.host.style.setProperty("--post-safe-space-trigger-y-end",`${r.trigger.yEnd}px`))}render(){return r(i,{key:"f3ea4bfc9a59faa2fbf1e413a1ec648f598a6779","data-version":a,popover:"auto"},r("div",{key:"a328c73c7e08eca1e423fcbe736798188cca2a87",part:"post-popovercontainer-content",class:"popover-content"},this.arrow&&r("span",{key:"8fad0095fb8d8c903ba84a639b4efc3e321c6aef","dynamic-placement":this.dynamicPlacement,class:"arrow",ref:t=>{this.arrowRef=t}}),r("span",{key:"deadbcc5892ed545a64b4a0e5e0936e0dd1feb70",part:"post-popovercontainer-border-mask"}),r("slot",{key:"48c4db7ab222f3ef18157ce19d8ba15d75441f98"})))}get host(){return this}static get style(){return'@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host>div{border:2px solid rgba(0,0,0,0)}}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[dynamic-placement=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[dynamic-placement=top]{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[dynamic-placement=left]{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[dynamic-placement=right]{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[dynamic-placement=bottom]{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:host([safe-space=triangle])::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:host([safe-space=trapezoid])::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:host(:not(:has(.arrow)))>div{box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=top]))>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=left]))>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=right]))>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}'}},[257,"post-popovercontainer",{placement:[1],edgeGap:[2,"edge-gap"],offset:[2],arrow:[4],safeSpace:[513,"safe-space"],autoHide:[4,"auto-hide"],dynamicPlacement:[32],show:[64],hide:[64],toggle:[64]}]);function ve(){"undefined"!=typeof customElements&&["post-popovercontainer"].forEach((t=>{"post-popovercontainer"===t&&(customElements.get(s(t))||customElements.define(s(t),me))}))}he([c(p)],me.prototype,"placement",void 0),he([l("number")],me.prototype,"edgeGap",void 0),he([c(["triangle","trapezoid"])],me.prototype,"safeSpace",void 0);export{me as P,p as a,ve as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as r,Host as o,transformTag as s}from"@stencil/core/internal/client";import{r as i,c as n,g as a}from"./breakpoints.js";import{T as c}from"./type.js";function u(e,t,r){const o=n({priority:1,blocking:!1,run(o,s){const{value:i,showError:n}=a(o,s);if("number"!=typeof i)return!0;const c=function(e,t){const r="string"==typeof t?e[t]:t;return"number"==typeof r?r:null}(o,e);if(null===c){if("string"==typeof e){const t=typeof o[e];if("number"!==t)return n(`references property "${e}" which must be a number but got ${t}`),!1}return!0}const u=t.include??r.includeDefault;return!!r.compare(i,c,u)||(n("must be "+r.formatExpectation("string"==typeof e?c+"":e+"",u)),!1)}});return function(t,r){"string"==typeof e&&i(t,e,r),o(t,r)}}function l(e,t={}){return u(e,{include:t.includeMin},{includeDefault:!1,compare:(e,t,r)=>r?e>=t:e>t,formatExpectation:(e,t)=>t?`greater than or equal to "${e}"`:`greater than "${e}"`})}var p=function(e,t,r,o){var s,i=arguments.length,n=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n};const
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as r,Host as o,transformTag as s}from"@stencil/core/internal/client";import{r as i,c as n,g as a}from"./breakpoints.js";import{T as c}from"./type.js";function u(e,t,r){const o=n({priority:1,blocking:!1,run(o,s){const{value:i,showError:n}=a(o,s);if("number"!=typeof i)return!0;const c=function(e,t){const r="string"==typeof t?e[t]:t;return"number"==typeof r?r:null}(o,e);if(null===c){if("string"==typeof e){const t=typeof o[e];if("number"!==t)return n(`references property "${e}" which must be a number but got ${t}`),!1}return!0}const u=t.include??r.includeDefault;return!!r.compare(i,c,u)||(n("must be "+r.formatExpectation("string"==typeof e?c+"":e+"",u)),!1)}});return function(t,r){"string"==typeof e&&i(t,e,r),o(t,r)}}function l(e,t={}){return u(e,{include:t.includeMin},{includeDefault:!1,compare:(e,t,r)=>r?e>=t:e>t,formatExpectation:(e,t)=>t?`greater than or equal to "${e}"`:`greater than "${e}"`})}var p=function(e,t,r,o){var s,i=arguments.length,n=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n};const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.min=0,this.max=100}getEffectiveMin(){return Number.isFinite(this.min)?this.min:0}getEffectiveMax(){return Number.isFinite(this.max)&&this.max>this.getEffectiveMin()?this.max:100}getEffectiveValue(e,t){return void 0===this.value||!Number.isFinite(this.value)||this.value<e||this.value>t?e:this.value}render(){const e=this.getEffectiveMin(),t=this.getEffectiveMax(),s=this.getEffectiveValue(e,t);return r(o,{key:"c29b1fa3dca89d999c2a55bd58c9c7450ed767c6",role:"progressbar","aria-valuenow":s,"aria-valuemin":e,"aria-valuemax":t},r("div",{key:"aaff038be7bdaf99de1e94c7479c2b57947195ac",class:"progress-value",style:{"--post-progressbar-value":(s-e)/(t-e)*100+"%"}}))}get host(){return this}static get style(){return":host{display:block;position:relative;height:var(--post-device-sizing-interactive-progressbar-indicator);border-radius:var(--post-device-border-radius-round);box-shadow:0px 0px 0px var(--post-device-border-width-alternative1) var(--post-scheme-color-interactive-primary-enabled-stroke) inset;overflow:hidden}.progress-value{position:absolute;inset-block:0;inset-inline-start:0;width:var(--post-progressbar-value, 0);border-radius:var(--post-device-border-radius-round);background-color:var(--post-progressbar-status-color, var(--post-scheme-color-interactive-primary-enabled-bg2));transition:width 250ms cubic-bezier(0.4, 0, 0.2, 1)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host{border:1px solid Highlight}.progress-value{background-color:Highlight}}"}},[1,"post-progressbar",{min:[2],max:[2],value:[2]}]);p([c("number")],d.prototype,"min",void 0),p([c("number"),l("min")],d.prototype,"max",void 0),p([c("number"),l("min"),function(e,t={}){return u("max",{include:t.includeMax},{includeDefault:!0,compare:(e,t,r)=>r?e<=t:e<t,formatExpectation:(e,t)=>t?`less than or equal to "${e}"`:`less than "${e}"`})}()],d.prototype,"value",void 0);const b=d,f=function(){"undefined"!=typeof customElements&&["post-progressbar"].forEach((e=>{"post-progressbar"===e&&(customElements.get(s(e))||customElements.define(s(e),d))}))};export{b as PostProgressbar,f as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,createEvent as r,h as i,Host as a,transformTag as e}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as o}from"./package.js";import{d as n}from"./post-icon2.js";import{R as l}from"./required.js";import{T as h}from"./type.js";var c=function(t,s,r,i){var a,e=arguments.length,o=e<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,r,i);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(o=(e<3?a(o):e>3?a(s,r,o):a(s,r))||o);return e>3&&o&&Object.defineProperty(s,r,o),o};const
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as r,h as i,Host as a,transformTag as e}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as o}from"./package.js";import{d as n}from"./post-icon2.js";import{R as l}from"./required.js";import{T as h}from"./type.js";var c=function(t,s,r,i){var a,e=arguments.length,o=e<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,r,i);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(o=(e<3?a(o):e>3?a(s,r,o):a(s,r))||o);return e>3&&o&&Object.defineProperty(s,r,o),o};const p=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postInput=r(this,"postInput",7),this.postChange=r(this,"postChange",7),this.hasChanged=!1,this.stars=5,this.currentRating=0,this.readonly=!1,this.keydownHandler=this.keydownHandler.bind(this),this.blurHandler=this.blurHandler.bind(this),this.hoverHandler=this.hoverHandler.bind(this)}update(t){this.readonly||t<0||t>this.stars||(this.currentRating=this.currentRating!==t?t:0,this.postInput.emit({value:this.currentRating}),this.hasChanged=!0)}keydownHandler(t){switch(t.key){case"ArrowDown":case"ArrowLeft":t.preventDefault(),this.update(this.currentRating-1);break;case"ArrowUp":case"ArrowRight":t.preventDefault(),this.update(this.currentRating+1);break;case"Home":t.preventDefault(),this.update(0);break;case"End":t.preventDefault(),this.update(this.stars);break;case"Enter":case" ":this.blurHandler();break;default:return}}blurHandler(){this.hasChanged&&(this.postChange.emit({value:this.currentRating}),this.hasChanged=!1)}hoverHandler(t,s){this.readonly||("mouseenter"===s.type?this.hoveredIndex=t:"mouseleave"===s.type&&(this.hoveredIndex=void 0))}render(){return i(a,{key:"727813875ba5d754ec17f4a2b151c0c6cd4ab5ca","data-version":o},i("div",{key:"1ac7e5db0098568c16551a4850442e4c8f0e686b",role:"slider",class:"rating",tabindex:"0","aria-label":this.label,"aria-valuemin":"0","aria-valuemax":this.stars,"aria-valuenow":this.currentRating,"aria-valuetext":`${this.currentRating} / ${this.stars}`,"aria-readonly":this.readonly?"true":"false",onKeyDown:this.keydownHandler,onBlur:this.blurHandler},Array.from({length:this.stars}).map(((t,s)=>i("div",{key:"star-"+t,"aria-hidden":"true",class:{star:!0,"before-hover":s<this.hoveredIndex,active:s<Math.round(this.currentRating),hover:s===this.hoveredIndex,"after-active":s>this.hoveredIndex&&s<this.currentRating},onClick:()=>this.update(s+1),onMouseEnter:t=>this.hoverHandler(s,t),onMouseLeave:t=>this.hoverHandler(s,t)},i("post-icon",{name:"favoritestar",class:"stroke"}),i("post-icon",{name:"favoritestar-solid",class:"fill"}))))))}get host(){return this}static get style(){return":host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 calc(var(--post-core-dimension-4)*-1);border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:var(--post-core-dimension-2);outline:var(--post-core-dimension-2) solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}"}},[1,"post-rating",{label:[513],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]}]);c([l(),h("string")],p.prototype,"label",void 0),c([l(),h("number")],p.prototype,"stars",void 0),c([l(),h("number")],p.prototype,"currentRating",void 0);const f=p,d=function(){"undefined"!=typeof customElements&&["post-rating","post-icon"].forEach((t=>{switch(t){case"post-rating":customElements.get(e(t))||customElements.define(e(t),p);break;case"post-icon":customElements.get(e(t))||n()}}))};export{f as PostRating,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as i,h as s,Host as e,transformTag as o}from"@stencil/core/internal/client";import{v as n}from"./package.js";import"./breakpoints.js";import{E as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,h as s,Host as e,transformTag as o}from"@stencil/core/internal/client";import{v as n}from"./package.js";import"./breakpoints.js";import{E as r}from"./event-from.js";import{g as a}from"./get-root.js";import{R as c}from"./required.js";import{T as h}from"./type.js";var l=function(t,i,s,e){var o,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,e);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(i,s,r):o(i,s))||r);return n>3&&r&&Object.defineProperty(i,s,r),r};const d=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.observer=new MutationObserver((()=>this.setTrigger())),this.toggleSideNavigation=this.toggleSideNavigation.bind(this),this.handlePostToggle=this.handlePostToggle.bind(this)}connectedCallback(){this.root=a(this.host),this.root.addEventListener("postToggle",this.handlePostToggle),this.observer.observe(this.host,{childList:!0,subtree:!0})}componentDidLoad(){this.setTrigger(),this.trigger||console.warn("The post-side-navigation-trigger must contain a button.")}disconnectedCallback(){this.observer.disconnect(),this.root.removeEventListener("postToggle",this.handlePostToggle),this.trigger?.removeEventListener("click",this.toggleSideNavigation)}get sideNavigation(){const t=this.root.getElementById(this.for);return t&&"post-side-navigation"===t.localName?t:null}setTrigger(){const t=this.host.querySelector("button");!t||this.trigger&&t.isEqualNode(this.trigger)||(this.trigger&&this.trigger.removeEventListener("click",this.toggleSideNavigation),this.trigger=t,this.trigger.addEventListener("click",this.toggleSideNavigation),this.updateAriaAttributes())}updateAriaAttributes(){if(!this.trigger)return;const t=this.trigger.getAttribute("aria-controls");t?.includes(this.for)||this.trigger.setAttribute("aria-controls",t?`${t} ${this.for}`:this.for),this.trigger.setAttribute("aria-expanded","false")}handlePostToggle(t){this.trigger?.setAttribute("aria-expanded",""+t.detail)}async update(){this.updateAriaAttributes()}async toggleSideNavigation(){await(this.sideNavigation?.toggle())}render(){return s(e,{key:"1c908083562ec5ca01cd9410c72ac78ae11ce72f","data-version":n},s("slot",{key:"38f63424e8c66b4bf926418b57555dc676d24d45"}))}get host(){return this}static get style(){return":host{display:inline-block}@media screen and (min-width: 1024px){:host{display:none}}"}},[257,"post-side-navigation-trigger",{for:[513],update:[64]}]);l([c(),h("string")],d.prototype,"for",void 0),l([r("post-side-navigation",{ignoreNestedComponents:!1})],d.prototype,"handlePostToggle",null);const g=d,p=function(){"undefined"!=typeof customElements&&["post-side-navigation-trigger"].forEach((t=>{"post-side-navigation-trigger"===t&&(customElements.get(o(t))||customElements.define(o(t),d))}))};export{g as PostSideNavigationTrigger,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as o,Host as i,transformTag as r}from"@stencil/core/internal/client";import{v as n}from"./package.js";import{b as a}from"./breakpoints.js";import{g as l}from"./get-focusable-children.js";import{d as c}from"./post-closebutton2.js";import{d as h}from"./post-icon2.js";import{R as d}from"./required.js";import{T as p}from"./type.js";import{O as m}from"./one-of.js";var u=function(t,s,e,o){var i,r=arguments.length,n=r<3?s:null===o?o=Object.getOwnPropertyDescriptor(s,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,e,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(r<3?i(n):r>3?i(s,e,n):i(s,e))||n);return r>3&&n&&Object.defineProperty(s,e,n),n};const g=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postToggle=e(this,"postToggle",7),this.device=a.get("device"),this.size="large",this.breakpointChange=t=>{this.device=t.detail,"desktop"===this.device&&(this.dialog?.open&&this.dialog.close(),this.postToggle.emit(!1))},this.handleKeyDown=t=>{if("Escape"!==t.key)return;const s=this.collapsible;s&&!s.collapsed&&(t.preventDefault(),t.stopPropagation(),s.toggle(!1),this.collapsibleTrigger?.querySelector("button")?.focus())},this.handleDialogClick=t=>{t.composedPath().some((t=>t instanceof HTMLAnchorElement))&&this.dialog.close()}}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange),this.host.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange),this.host.removeEventListener("keydown",this.handleKeyDown)}get dialog(){return this.host.shadowRoot?.querySelector("dialog")}get collapsibleTrigger(){return document.activeElement?.closest("post-collapsible-trigger")??null}get collapsible(){return this.collapsibleTrigger?.querySelector(":scope > post-collapsible")??null}async toggle(){if("desktop"!==this.device)return this.dialog?.open?this.hide():this.show()}async show(){"desktop"!==this.device&&(this.dialog.showModal(),this.postToggle.emit(!0),this.focusNav())}async hide(){"desktop"!==this.device&&this.dialog.close()}focusNav(){const t=this.host.shadowRoot?.querySelector("slot"),s=t?.assignedElements({flatten:!0})[0];if(!s)return;const[e]=l(s);e?.focus()}renderNav(){return o("slot",null)}renderDialog(){return o("dialog",{onClick:this.handleDialogClick,onClose:()=>{this.postToggle.emit(!1)}},o("slot",null),o("post-closebutton",{onClick:()=>this.hide()},this.textClose))}render(){return o(i,{key:"
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as o,Host as i,transformTag as r}from"@stencil/core/internal/client";import{v as n}from"./package.js";import{b as a}from"./breakpoints.js";import{g as l}from"./get-focusable-children.js";import{d as c}from"./post-closebutton2.js";import{d as h}from"./post-icon2.js";import{R as d}from"./required.js";import{T as p}from"./type.js";import{O as m}from"./one-of.js";var u=function(t,s,e,o){var i,r=arguments.length,n=r<3?s:null===o?o=Object.getOwnPropertyDescriptor(s,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,e,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(r<3?i(n):r>3?i(s,e,n):i(s,e))||n);return r>3&&n&&Object.defineProperty(s,e,n),n};const g=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postToggle=e(this,"postToggle",7),this.device=a.get("device"),this.size="large",this.breakpointChange=t=>{this.device=t.detail,"desktop"===this.device&&(this.dialog?.open&&this.dialog.close(),this.postToggle.emit(!1))},this.handleKeyDown=t=>{if("Escape"!==t.key)return;const s=this.collapsible;s&&!s.collapsed&&(t.preventDefault(),t.stopPropagation(),s.toggle(!1),this.collapsibleTrigger?.querySelector("button")?.focus())},this.handleDialogClick=t=>{t.composedPath().some((t=>t instanceof HTMLAnchorElement))&&this.dialog.close()}}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange),this.host.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange),this.host.removeEventListener("keydown",this.handleKeyDown)}get dialog(){return this.host.shadowRoot?.querySelector("dialog")}get collapsibleTrigger(){return document.activeElement?.closest("post-collapsible-trigger")??null}get collapsible(){return this.collapsibleTrigger?.querySelector(":scope > post-collapsible")??null}async toggle(){if("desktop"!==this.device)return this.dialog?.open?this.hide():this.show()}async show(){"desktop"!==this.device&&(this.dialog.showModal(),this.postToggle.emit(!0),this.focusNav())}async hide(){"desktop"!==this.device&&this.dialog.close()}focusNav(){const t=this.host.shadowRoot?.querySelector("slot"),s=t?.assignedElements({flatten:!0})[0];if(!s)return;const[e]=l(s);e?.focus()}renderNav(){return o("slot",null)}renderDialog(){return o("dialog",{onClick:this.handleDialogClick,onClose:()=>{this.postToggle.emit(!1)}},o("slot",null),o("post-closebutton",{onClick:()=>this.hide()},this.textClose))}render(){return o(i,{key:"f7d9b4e515e5085d78e452298bdfbfb2325e7422","data-version":n},"desktop"===this.device?this.renderNav():this.renderDialog())}get host(){return this}static get style(){return":host{display:flex}:host,:host dialog{background-color:var(--post-scheme-color-palette-bg-2);border-inline-end:var(--post-device-border-width-alternative1) solid var(--post-scheme-color-interactive-primary-enabled-stroke4)}:host dialog{overflow:visible;width:var(--post-core-dimension-296);bottom:auto;right:auto;border:none;padding:0;max-height:100dvh;transform:translateX(-100%);transition-property:transform,overlay,display;transition-behavior:allow-discrete;transition-duration:350ms;box-shadow:var(--post-device-elevation-300)}:host dialog[open]{transform:translateX(0)}@starting-style{:host dialog[open]{transform:translateX(-100%)}}@media (prefers-reduced-motion: reduce){:host dialog{transition:none}}:host post-closebutton{transform:translate(50%, 0)}"}},[257,"post-side-navigation",{textClose:[513,"text-close"],size:[1],device:[32],toggle:[64],show:[64],hide:[64]}]);u([d(),p("string")],g.prototype,"textClose",void 0),u([m(["large","small"])],g.prototype,"size",void 0);const f=g,b=function(){"undefined"!=typeof customElements&&["post-side-navigation","post-closebutton","post-icon"].forEach((t=>{switch(t){case"post-side-navigation":customElements.get(r(t))||customElements.define(r(t),g);break;case"post-closebutton":customElements.get(r(t))||c();break;case"post-icon":customElements.get(r(t))||h()}}))};export{f as PostSideNavigation,b as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as i,Host as o,transformTag as r}from"@stencil/core/internal/client";import{v as c}from"./package.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){return i(o,{key:"486be1addaa512c39628cfa2fab567d5dfb4b517","data-version":c,role:"listitem"},i("span",{key:"a89be43022ff5b9d9cbcad1e4f934fdcef8919c3",class:"stepper-item-content"},i("span",{key:"60e217eab48532d7985b57159251f84217f1b362",class:"step-hidden-label visually-hidden"}),i("span",{key:"b847451659b699693d168dd8164c878281fb7793",class:"label"},i("slot",{key:"823229cba3855d597f08ebc6fc4e5a5059ef7f98"}))))}static get style(){return':host{grid-row:1;position:relative;padding-inline-start:0}:host::before,:host::after{content:"";display:block;position:absolute;inset-block-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - 2px)/2);height:2px;background-color:var(--post-scheme-color-interactive-primary-disabled-bg4);inset-inline:0}:host(:not(:first-of-type)){padding-inline-start:calc(var(--post-device-sizing-interactive-stepper-indicator) / 2)}:host(:not(:last-of-type)){padding-inline-end:calc(var(--post-device-sizing-interactive-stepper-indicator) / 2);grid-column:span 2}:host(:not(:first-of-type,:last-of-type))::before{inset-inline-end:50%}:host(:not(:first-of-type,:last-of-type))::after{inset-inline-start:50%}:host(.stepper-item-current:not(:last-of-type))::after,:host(.stepper-item-current:first-of-type)::before,:host(.stepper-item-after-current)::before,:host(.stepper-item-after-current:last-of-type)::after{background-color:var(--post-scheme-color-interactive-primary-enabled-fg1)}:host(.stepper-item-current:not(:first-of-type))::before,:host(.stepper-item-current:last-of-type)::after,:host(.stepper-item-completed)::before,:host(.stepper-item-completed)::after{background-color:var(--post-scheme-color-interactive-primary-selected-bg2);z-index:1}.stepper-item-content{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;position:relative;z-index:2;overflow:hidden;text-decoration:none;color:var(--post-scheme-color-interactive-primary-disabled-fg1);width:fit-content;overflow-wrap:anywhere;hyphens:auto;line-break:strict;font-size:var(--post-device-font-size-7)}:host(:not(:first-of-type,:last-of-type))>.stepper-item-content{margin-inline:auto;text-align:center}:host(:last-of-type)>.stepper-item-content{margin-inline-start:auto;margin-inline-end:-20px;text-align:end}:host(.stepper-item-completed)>.stepper-item-content{color:var(--post-scheme-color-interactive-primary-enabled-fg1)}:host(.stepper-item-selected)>.stepper-item-content{font-weight:var(--post-device-font-weight-bold)}:host(.stepper-item-selected)>.stepper-item-content::before{font-weight:var(--post-device-font-weight-regular)}:host(.stepper-item-current)>.stepper-item-content{color:var(--post-scheme-color-interactive-primary-enabled-fg1)}:host(.stepper-item-current)>.stepper-item-content::before{color:var(--post-scheme-color-interactive-primary-enabled-fg3)}.stepper-item-content::before{content:var(--step-number, "?");display:flex;align-items:center;justify-content:center;z-index:1;height:var(--post-device-sizing-interactive-stepper-indicator);width:var(--post-device-sizing-interactive-stepper-indicator);box-sizing:border-box;margin-block-end:var(--post-device-spacing-gap-1);color:var(--post-scheme-color-interactive-primary-disabled-fg3);background-color:var(--post-scheme-color-interactive-primary-disabled-bg4);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-disabled-stroke3);border-radius:var(--post-device-border-radius-round);text-indent:initial}:host(:not(:first-of-type,:last-of-type))>.stepper-item-content::before{margin-inline:auto}:host(:last-of-type)>.stepper-item-content::before{margin-inline-start:auto}:host(.stepper-item-completed)>.stepper-item-content::before{color:rgba(0,0,0,0);background-color:var(--post-scheme-color-interactive-primary-selected-bg2);border-color:var(--post-scheme-color-interactive-primary-selected-stroke3)}:host(.stepper-item-current)>.stepper-item-content::before{color:var(--post-scheme-color-interactive-primary-enabled-fg3);background-color:var(--post-scheme-color-interactive-primary-enabled-bg2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3)}.stepper-item-content::after{display:block;position:absolute;inset-block-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size7))/2);z-index:1;mask-image:var(--post-icon-checkmark-solid);background-color:currentColor;width:var(--post-device-sizing-interactive-icon-size7);height:var(--post-device-sizing-interactive-icon-size7);background-color:var(--post-scheme-color-interactive-primary-enabled-fg3)}:root,:host{--post-icon-checkmark-solid:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hlY2ttYXJrLXNvbGlkIj48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0ibTcuNDkgMTIuOTktMy42NC0zLjljLS40Ny0uNS0uNDQtMS4zLjA2LTEuNzdzMS4yOS0uNDQgMS43Ny4wNmwxLjQ4IDEuNTggMy4wNS00LjYyYy4zOC0uNTggMS4xNi0uNzQgMS43My0uMzUuNTguMzguNzQgMS4xNi4zNSAxLjczeiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InMyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJtMTEuMTggMTguODgtNS4xNC01LjUxYTEuNSAxLjUgMCAwIDEgLjA3LTIuMTJjLjYtLjU2IDEuNTUtLjUzIDIuMTIuMDdsMi41NCAyLjcyIDQuODQtNy4zM2MuNDYtLjY5IDEuMzktLjg4IDIuMDgtLjQzLjY5LjQ2Ljg4IDEuMzkuNDMgMi4wOGwtNi45NCAxMC41MVoiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTE0Ljg3IDI0LjgxIDguMjMgMTcuN2MtLjY2LS43MS0uNjItMS44MS4wOC0yLjQ3LjcxLS42NiAxLjgxLS42MiAyLjQ3LjA4bDMuNjEgMy44NiA2LjYyLTEwLjA0Yy41My0uODEgMS42Mi0xLjAzIDIuNDItLjUuODEuNTMgMS4wMyAxLjYyLjUgMi40MkwxNC44NiAyNC44WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJtMTguNTYgMzAuNi04LjE0LTguNzFjLS43NS0uODEtLjcxLTIuMDcuMS0yLjgzLjgxLS43NSAyLjA3LS43MSAyLjgzLjFsNC42NyA1IDguNDEtMTIuNzRhMiAyIDAgMCAxIDMuMzQgMi4yeiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0OCIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJtMjIuMjYgMzYuNTctOS42My0xMC4zMmMtLjg1LS45MS0uOC0yLjMzLjExLTMuMThzMi4zMy0uOCAzLjE4LjExbDUuNzQgNi4xNCAxMC4yLTE1LjQ1YTIuMjU0IDIuMjU0IDAgMCAxIDMuMTItLjY0YzEuMDQuNjggMS4zMiAyLjA4LjY0IDMuMTJMMjIuMjcgMzYuNTdaIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczY0IiB2aWV3Qm94PSIwIDAgNjQgNjQiPjxwYXRoIGQ9Ik0yOS42MSA0Ny45MSAxNy4yIDM0LjYyYTIuNDk3IDIuNDk3IDAgMSAxIDMuNjUtMy40MWw4LjA4IDguNjUgMTMuOTUtMjEuMTNhMi40OTkgMi40OTkgMCAwIDEgNC4xNyAyLjc1TDI5LjYgNDcuOTFaIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZWNrbWFyay1zb2xpZCIvPjwvZz48L3N2Zz4=")}:host(:first-of-type)>.stepper-item-content::after{inset-inline-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size7))/2)}:host(:not(:first-of-type,:last-of-type))>.stepper-item-content::after{inset-inline-start:calc(50% - var(--post-device-sizing-interactive-icon-size7)/2)}:host(:last-of-type)>.stepper-item-content::after{inset-inline-end:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size7))/2)}:host(.stepper-item-completed)>.stepper-item-content::after{content:""}:host([aria-current=step])>.stepper-item-content::after{mask-image:var(--post-icon-edit-solid);background-color:currentColor;width:var(--post-device-sizing-interactive-icon-size4);height:var(--post-device-sizing-interactive-icon-size4);background-color:var(--post-scheme-color-interactive-primary-enabled-fg3);inset-block-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size4))/2)}:root,:host{--post-icon-edit-solid:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktZWRpdC1zb2xpZCI+PHN5bWJvbCBpZD0iczE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxwYXRoIGQ9Im0xLjUgMTAuOTkgOC41LTguNXMuMDMuMDUuMDUuMDdsMy41IDMuNDUtOC41MiA4LjUxem0tLjkyIDEuMi0uNTYgMy44IDMuODEtLjU2LTMuMjQtMy4yNFptMTUuMjUtOS4zN0wxMy4xOS4xOGEuNjMuNjMgMCAwIDAtLjg4IDBsLTEuMjcgMS4yN3MuMDQuMDIuMDYuMDRsMy41IDMuNDUgMS4yMy0xLjIzYy4yNC0uMjQuMjQtLjY0IDAtLjg4WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InMyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNS44NCAyMy4xNS4wMiAyNGwuODUtNS44MnptMS40MS0xLjA4TDIwLjQ5IDguODNsLTUuMjUtNS4xN3MtLjA0LS4wNy0uMDctLjFMMS45NSAxNi43OGw1LjMgNS4zWm0xNi41LTE3LjgzTDE5Ljc4LjI3YS45MzYuOTM2IDAgMCAwLTEuMzMgMGwtMi4wOSAyLjA5cy4wNi4wMy4wOS4wNmw1LjI2IDUuMTggMi4wMy0yLjAzYy4zNy0uMzcuMzctLjk2IDAtMS4zM1oiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0ibTguMDcgMzAuNzctOC4wNCAxLjIgMS4yMS04LjA3em0xLjUzLTEuMzEgMTcuODMtMTcuODQtNi45OS02Ljg5cy0uMDYtLjA5LS4wOS0uMTRMMi41NiAyMi4zOGw3LjAzIDcuMDdaTTMxLjY2IDUuNjIgMjYuMzcuMzNjLS40OS0uNDktMS4yOC0uNDktMS43NiAwbC0yLjg5IDIuODlzLjA5LjA0LjEyLjA4bDcuMDEgNi45IDIuODItMi44MmMuNDktLjQ5LjQ5LTEuMjggMC0xLjc2WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMi40MSAyOC43OSAyNS41MiA1LjcxYy4wNC4wNi4wNi4xMi4xMS4xN2w4Ljc0IDguNkwxMS4yMyAzNy42em0tMS4wMiAyLjE2TC4wNCA0MC4wMWw5LjA0LTEuMzktNy42OS03LjY4Wk0zOS41OCA3LjA3IDMyLjk3LjQ3Yy0uNjEtLjYxLTEuNi0uNjEtMi4yMSAwbC0zLjcgMy43Yy4wNS4wNC4xMS4wNi4xNS4xbDguNzYgOC42MSAzLjYxLTMuNjFjLjYxLS42MS42MS0xLjYgMC0yLjIiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCI+PHBhdGggZD0iTTIuODMgMzQuNTggMzEuMyA2LjExYy4wNS4wNy4wOC4xNC4xNC4ybDEwLjQ5IDEwLjMzLTI4LjU1IDI4LjU0em0tMS4xOCAyLjM2TDAgNDhsMTAuOTktMS42NnpNNDcuNDYgOC40NyAzOS41My41NGMtLjczLS43My0xLjkyLS43My0yLjY1IDBsLTMuODcgMy44N2MuMDYuMDQuMTMuMDcuMTkuMTJsMTAuNTEgMTAuMzQgMy43NS0zLjc1Yy43My0uNzMuNzMtMS45MiAwLTIuNjUiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTE1LjA4IDYxLjcyIDAgNjMuOThsMi4zLTE1LjA0ek00Mi41MiA3Ljg0Yy0uMDgtLjA4LS4xMy0uMTgtLjE5LS4yOEwzLjU5IDQ2LjM0bDE0LjA5IDE0LjA5LTEuMDcgMS4wN2guMDJMNTYuNSAyMS42em0yMC43NiAzLjQ1TDUyLjcxLjcxYy0uOTctLjk3LTIuNTUtLjk3LTMuNTMgMGwtNC45OSA1Yy4wOS4wNS4xOC4xLjI2LjE3bDEzLjk5IDEzLjc4IDQuODQtNC44NGMuOTctLjk3Ljk3LTIuNTUgMC0zLjUzIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWVkaXQtc29saWQiLz48L2c+PC9zdmc+")}:host([aria-current=step]:first-of-type)>.stepper-item-content::after{inset-inline-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size4))/2)}:host([aria-current=step]:not(:first-of-type,:last-of-type))>.stepper-item-content::after{inset-inline-start:calc(50% - var(--post-device-sizing-interactive-icon-size4)/2)}:host([aria-current=step]:last-of-type)>.stepper-item-content::after{inset-inline-end:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size4))/2)}@media screen and (max-width: 779.98px){:host{flex-grow:1;margin-inline:0;padding:0 !important}:host::before{content:unset}:host::after{inset-inline-start:0 !important}:host(:last-of-type){flex:0 0 32px}:host(:last-of-type)::after{content:unset}.stepper-item-content{margin-inline:0 !important}.label{display:none}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host::before,:host::after{background-color:CanvasText !important}:host(.stepper-item-current:not(:first-of-type))::before,:host(.stepper-item-current:last-of-type)::after,:host(.stepper-item-completed)::after,:host(.stepper-item-completed)::before{background-color:Highlight !important}.stepper-item-content::before{forced-color-adjust:none}:host(.stepper-item-current) .stepper-item-content::before{background-color:Canvas;color:CanvasText}:host(.stepper-item-completed) .stepper-item-content::before,:host(.stepper-item-inactive) .stepper-item-content::before{border-color:Canvas;background-color:CanvasText}:host(.stepper-item-inactive) .stepper-item-content::before{color:Canvas}.stepper-item-content::after{color:Canvas}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}'}},[257,"post-stepper-item"]),a=s,n=function(){"undefined"!=typeof customElements&&["post-stepper-item"].forEach((e=>{"post-stepper-item"===e&&(customElements.get(r(e))||customElements.define(r(e),s))}))};export{a as PostStepperItem,n as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as i,Host as o,transformTag as r}from"@stencil/core/internal/client";import{v as c}from"./package.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){return i(o,{key:"f41ae27d8de89912b3aa34d9c89f5ec69f3df301","data-version":c,role:"listitem"},i("span",{key:"00a0dd2eb3fb020e49c5782245e1f3e72c77e780",class:"stepper-item-content"},i("span",{key:"bc9932083d295b92db24ddd22cb18a755db5ad11",class:"step-hidden-label visually-hidden"}),i("span",{key:"efe2d809c82c1d7de9e0cdf4e52b924943afa0bf",class:"label"},i("slot",{key:"47aceca3fc331ef91da60674dbc2af5ea7e76ec8"}))))}static get style(){return':host{grid-row:1;position:relative;padding-inline-start:0}:host::before,:host::after{content:"";display:block;position:absolute;inset-block-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - 2px)/2);height:2px;background-color:var(--post-scheme-color-interactive-primary-disabled-bg4);inset-inline:0}:host(:not(:first-of-type)){padding-inline-start:calc(var(--post-device-sizing-interactive-stepper-indicator) / 2)}:host(:not(:last-of-type)){padding-inline-end:calc(var(--post-device-sizing-interactive-stepper-indicator) / 2);grid-column:span 2}:host(:not(:first-of-type,:last-of-type))::before{inset-inline-end:50%}:host(:not(:first-of-type,:last-of-type))::after{inset-inline-start:50%}:host(.stepper-item-current:not(:last-of-type))::after,:host(.stepper-item-current:first-of-type)::before,:host(.stepper-item-after-current)::before,:host(.stepper-item-after-current:last-of-type)::after{background-color:var(--post-scheme-color-interactive-primary-enabled-fg1)}:host(.stepper-item-current:not(:first-of-type))::before,:host(.stepper-item-current:last-of-type)::after,:host(.stepper-item-completed)::before,:host(.stepper-item-completed)::after{background-color:var(--post-scheme-color-interactive-primary-selected-bg2);z-index:1}.stepper-item-content{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;position:relative;z-index:2;overflow:hidden;text-decoration:none;color:var(--post-scheme-color-interactive-primary-disabled-fg1);width:fit-content;overflow-wrap:anywhere;hyphens:auto;line-break:strict;font-size:var(--post-device-font-size-7)}:host(:not(:first-of-type,:last-of-type))>.stepper-item-content{margin-inline:auto;text-align:center}:host(:last-of-type)>.stepper-item-content{margin-inline-start:auto;margin-inline-end:-20px;text-align:end}:host(.stepper-item-completed)>.stepper-item-content{color:var(--post-scheme-color-interactive-primary-enabled-fg1)}:host(.stepper-item-selected)>.stepper-item-content{font-weight:var(--post-device-font-weight-bold)}:host(.stepper-item-selected)>.stepper-item-content::before{font-weight:var(--post-device-font-weight-regular)}:host(.stepper-item-current)>.stepper-item-content{color:var(--post-scheme-color-interactive-primary-enabled-fg1)}:host(.stepper-item-current)>.stepper-item-content::before{color:var(--post-scheme-color-interactive-primary-enabled-fg3)}.stepper-item-content::before{content:var(--step-number, "?");display:flex;align-items:center;justify-content:center;z-index:1;height:var(--post-device-sizing-interactive-stepper-indicator);width:var(--post-device-sizing-interactive-stepper-indicator);box-sizing:border-box;margin-block-end:var(--post-device-spacing-gap-1);color:var(--post-scheme-color-interactive-primary-disabled-fg3);background-color:var(--post-scheme-color-interactive-primary-disabled-bg4);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-disabled-stroke3);border-radius:var(--post-device-border-radius-round);text-indent:initial}:host(:not(:first-of-type,:last-of-type))>.stepper-item-content::before{margin-inline:auto}:host(:last-of-type)>.stepper-item-content::before{margin-inline-start:auto}:host(.stepper-item-completed)>.stepper-item-content::before{color:rgba(0,0,0,0);background-color:var(--post-scheme-color-interactive-primary-selected-bg2);border-color:var(--post-scheme-color-interactive-primary-selected-stroke3)}:host(.stepper-item-current)>.stepper-item-content::before{color:var(--post-scheme-color-interactive-primary-enabled-fg3);background-color:var(--post-scheme-color-interactive-primary-enabled-bg2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3)}.stepper-item-content::after{display:block;position:absolute;inset-block-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size7))/2);z-index:1;mask-image:var(--post-icon-checkmark-solid);background-color:currentColor;width:var(--post-device-sizing-interactive-icon-size7);height:var(--post-device-sizing-interactive-icon-size7);background-color:var(--post-scheme-color-interactive-primary-enabled-fg3)}:root,:host{--post-icon-checkmark-solid:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hlY2ttYXJrLXNvbGlkIj48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0ibTcuNDkgMTIuOTktMy42NC0zLjljLS40Ny0uNS0uNDQtMS4zLjA2LTEuNzdzMS4yOS0uNDQgMS43Ny4wNmwxLjQ4IDEuNTggMy4wNS00LjYyYy4zOC0uNTggMS4xNi0uNzQgMS43My0uMzUuNTguMzguNzQgMS4xNi4zNSAxLjczeiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InMyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJtMTEuMTggMTguODgtNS4xNC01LjUxYTEuNSAxLjUgMCAwIDEgLjA3LTIuMTJjLjYtLjU2IDEuNTUtLjUzIDIuMTIuMDdsMi41NCAyLjcyIDQuODQtNy4zM2MuNDYtLjY5IDEuMzktLjg4IDIuMDgtLjQzLjY5LjQ2Ljg4IDEuMzkuNDMgMi4wOGwtNi45NCAxMC41MVoiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTE0Ljg3IDI0LjgxIDguMjMgMTcuN2MtLjY2LS43MS0uNjItMS44MS4wOC0yLjQ3LjcxLS42NiAxLjgxLS42MiAyLjQ3LjA4bDMuNjEgMy44NiA2LjYyLTEwLjA0Yy41My0uODEgMS42Mi0xLjAzIDIuNDItLjUuODEuNTMgMS4wMyAxLjYyLjUgMi40MkwxNC44NiAyNC44WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJtMTguNTYgMzAuNi04LjE0LTguNzFjLS43NS0uODEtLjcxLTIuMDcuMS0yLjgzLjgxLS43NSAyLjA3LS43MSAyLjgzLjFsNC42NyA1IDguNDEtMTIuNzRhMiAyIDAgMCAxIDMuMzQgMi4yeiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0OCIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJtMjIuMjYgMzYuNTctOS42My0xMC4zMmMtLjg1LS45MS0uOC0yLjMzLjExLTMuMThzMi4zMy0uOCAzLjE4LjExbDUuNzQgNi4xNCAxMC4yLTE1LjQ1YTIuMjU0IDIuMjU0IDAgMCAxIDMuMTItLjY0YzEuMDQuNjggMS4zMiAyLjA4LjY0IDMuMTJMMjIuMjcgMzYuNTdaIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczY0IiB2aWV3Qm94PSIwIDAgNjQgNjQiPjxwYXRoIGQ9Ik0yOS42MSA0Ny45MSAxNy4yIDM0LjYyYTIuNDk3IDIuNDk3IDAgMSAxIDMuNjUtMy40MWw4LjA4IDguNjUgMTMuOTUtMjEuMTNhMi40OTkgMi40OTkgMCAwIDEgNC4xNyAyLjc1TDI5LjYgNDcuOTFaIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZWNrbWFyay1zb2xpZCIvPjwvZz48L3N2Zz4=")}:host(:first-of-type)>.stepper-item-content::after{inset-inline-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size7))/2)}:host(:not(:first-of-type,:last-of-type))>.stepper-item-content::after{inset-inline-start:calc(50% - var(--post-device-sizing-interactive-icon-size7)/2)}:host(:last-of-type)>.stepper-item-content::after{inset-inline-end:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size7))/2)}:host(.stepper-item-completed)>.stepper-item-content::after{content:""}:host([aria-current=step])>.stepper-item-content::after{mask-image:var(--post-icon-edit-solid);background-color:currentColor;width:var(--post-device-sizing-interactive-icon-size4);height:var(--post-device-sizing-interactive-icon-size4);background-color:var(--post-scheme-color-interactive-primary-enabled-fg3);inset-block-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size4))/2)}:root,:host{--post-icon-edit-solid:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktZWRpdC1zb2xpZCI+PHN5bWJvbCBpZD0iczE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxwYXRoIGQ9Im0xLjUgMTAuOTkgOC41LTguNXMuMDMuMDUuMDUuMDdsMy41IDMuNDUtOC41MiA4LjUxem0tLjkyIDEuMi0uNTYgMy44IDMuODEtLjU2LTMuMjQtMy4yNFptMTUuMjUtOS4zN0wxMy4xOS4xOGEuNjMuNjMgMCAwIDAtLjg4IDBsLTEuMjcgMS4yN3MuMDQuMDIuMDYuMDRsMy41IDMuNDUgMS4yMy0xLjIzYy4yNC0uMjQuMjQtLjY0IDAtLjg4WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InMyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNS44NCAyMy4xNS4wMiAyNGwuODUtNS44MnptMS40MS0xLjA4TDIwLjQ5IDguODNsLTUuMjUtNS4xN3MtLjA0LS4wNy0uMDctLjFMMS45NSAxNi43OGw1LjMgNS4zWm0xNi41LTE3LjgzTDE5Ljc4LjI3YS45MzYuOTM2IDAgMCAwLTEuMzMgMGwtMi4wOSAyLjA5cy4wNi4wMy4wOS4wNmw1LjI2IDUuMTggMi4wMy0yLjAzYy4zNy0uMzcuMzctLjk2IDAtMS4zM1oiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0ibTguMDcgMzAuNzctOC4wNCAxLjIgMS4yMS04LjA3em0xLjUzLTEuMzEgMTcuODMtMTcuODQtNi45OS02Ljg5cy0uMDYtLjA5LS4wOS0uMTRMMi41NiAyMi4zOGw3LjAzIDcuMDdaTTMxLjY2IDUuNjIgMjYuMzcuMzNjLS40OS0uNDktMS4yOC0uNDktMS43NiAwbC0yLjg5IDIuODlzLjA5LjA0LjEyLjA4bDcuMDEgNi45IDIuODItMi44MmMuNDktLjQ5LjQ5LTEuMjggMC0xLjc2WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMi40MSAyOC43OSAyNS41MiA1LjcxYy4wNC4wNi4wNi4xMi4xMS4xN2w4Ljc0IDguNkwxMS4yMyAzNy42em0tMS4wMiAyLjE2TC4wNCA0MC4wMWw5LjA0LTEuMzktNy42OS03LjY4Wk0zOS41OCA3LjA3IDMyLjk3LjQ3Yy0uNjEtLjYxLTEuNi0uNjEtMi4yMSAwbC0zLjcgMy43Yy4wNS4wNC4xMS4wNi4xNS4xbDguNzYgOC42MSAzLjYxLTMuNjFjLjYxLS42MS42MS0xLjYgMC0yLjIiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCI+PHBhdGggZD0iTTIuODMgMzQuNTggMzEuMyA2LjExYy4wNS4wNy4wOC4xNC4xNC4ybDEwLjQ5IDEwLjMzLTI4LjU1IDI4LjU0em0tMS4xOCAyLjM2TDAgNDhsMTAuOTktMS42NnpNNDcuNDYgOC40NyAzOS41My41NGMtLjczLS43My0xLjkyLS43My0yLjY1IDBsLTMuODcgMy44N2MuMDYuMDQuMTMuMDcuMTkuMTJsMTAuNTEgMTAuMzQgMy43NS0zLjc1Yy43My0uNzMuNzMtMS45MiAwLTIuNjUiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTE1LjA4IDYxLjcyIDAgNjMuOThsMi4zLTE1LjA0ek00Mi41MiA3Ljg0Yy0uMDgtLjA4LS4xMy0uMTgtLjE5LS4yOEwzLjU5IDQ2LjM0bDE0LjA5IDE0LjA5LTEuMDcgMS4wN2guMDJMNTYuNSAyMS42em0yMC43NiAzLjQ1TDUyLjcxLjcxYy0uOTctLjk3LTIuNTUtLjk3LTMuNTMgMGwtNC45OSA1Yy4wOS4wNS4xOC4xLjI2LjE3bDEzLjk5IDEzLjc4IDQuODQtNC44NGMuOTctLjk3Ljk3LTIuNTUgMC0zLjUzIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWVkaXQtc29saWQiLz48L2c+PC9zdmc+")}:host([aria-current=step]:first-of-type)>.stepper-item-content::after{inset-inline-start:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size4))/2)}:host([aria-current=step]:not(:first-of-type,:last-of-type))>.stepper-item-content::after{inset-inline-start:calc(50% - var(--post-device-sizing-interactive-icon-size4)/2)}:host([aria-current=step]:last-of-type)>.stepper-item-content::after{inset-inline-end:calc((var(--post-device-sizing-interactive-stepper-indicator) - var(--post-device-sizing-interactive-icon-size4))/2)}@media screen and (max-width: 779.98px){:host{flex-grow:1;margin-inline:0;padding:0 !important}:host::before{content:unset}:host::after{inset-inline-start:0 !important}:host(:last-of-type){flex:0 0 32px}:host(:last-of-type)::after{content:unset}.stepper-item-content{margin-inline:0 !important}.label{display:none}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host::before,:host::after{background-color:CanvasText !important}:host(.stepper-item-current:not(:first-of-type))::before,:host(.stepper-item-current:last-of-type)::after,:host(.stepper-item-completed)::after,:host(.stepper-item-completed)::before{background-color:Highlight !important}.stepper-item-content::before{forced-color-adjust:none}:host(.stepper-item-current) .stepper-item-content::before{background-color:Canvas;color:CanvasText}:host(.stepper-item-completed) .stepper-item-content::before,:host(.stepper-item-inactive) .stepper-item-content::before{border-color:Canvas;background-color:CanvasText}:host(.stepper-item-inactive) .stepper-item-content::before{color:Canvas}.stepper-item-content::after{color:Canvas}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}'}},[257,"post-stepper-item"]),a=s,n=function(){"undefined"!=typeof customElements&&["post-stepper-item"].forEach((e=>{"post-stepper-item"===e&&(customElements.get(r(e))||customElements.define(r(e),s))}))};export{a as PostStepperItem,n as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as i,Host as s,transformTag as n}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as r}from"./package.js";import{R as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as i,Host as s,transformTag as n}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as r}from"./package.js";import{R as d}from"./required.js";import{T as a}from"./type.js";import{P as c}from"./pattern.js";var p=function(e,t,i,s){var n,r=arguments.length,d=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(d=(r<3?n(d):r>3?n(t,i,d):n(t,i))||d);return r>3&&d&&Object.defineProperty(t,i,d),d};const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.currentIndex=-1}validateCurrentIndex(){this.stepItems&&(this.updateSteps(),this.checkIndexes())}validateSelectedIndex(){void 0===this.selectedIndex?this.selectedIndex=this.currentIndex:this.checkIndexes(),this.updateSteps()}updateActiveStepNumber(){this.textStepNumber&&(this.mobileActiveStepLabel=this.textStepNumber.replaceAll("{number}",""+(this.selectedIndex+1)),this.stepItems&&this.updateMobileActiveStepVisibility())}componentDidLoad(){setTimeout((()=>{this.validateCurrentIndex(),this.validateSelectedIndex()}))}checkIndexes(){this.selectedIndex>this.currentIndex&&console.error("The selected-index cannot be higher than the current-index, as only the current and completed steps can be selected.")}updateSteps(){this.stepItems=this.host.querySelectorAll("post-stepper-item"),!this.stepItems||this.stepItems.length<3?console.error("The post-stepper component should have at least three steps."):(this.updateActiveStepNumber(),this.stepItems.forEach(((e,t)=>{e.style.setProperty("--step-number",`"${t+1}"`),this.selectedIndex===t&&(this.mobileActiveStepName=e.innerHTML),e.classList.toggle("stepper-item-completed",this.currentIndex>t),e.classList.toggle("stepper-item-current",this.currentIndex===t),e.classList.toggle("stepper-item-selected",this.selectedIndex===t),e.classList.toggle("stepper-item-inactive",this.currentIndex<t),e.classList.toggle("stepper-item-after-current",t===this.currentIndex+1);const i=e.shadowRoot?.querySelector(".step-hidden-label");if(i){let e="";this.currentIndex>t&&(e=this.textCompletedStep+": "),this.selectedIndex===t&&(e=`${e}${this.textCurrentStep}: `),i.textContent=e}this.selectedIndex===t?(e.setAttribute("aria-current","step"),e.setAttribute("aria-live","polite")):(e.removeAttribute("aria-current"),e.removeAttribute("aria-live"))})),this.updateMobileActiveStepVisibility())}updateMobileActiveStepVisibility(){(this.selectedIndex>=this.stepItems.length||this.selectedIndex<0)&&(this.mobileActiveStepLabel="",this.mobileActiveStepName="")}render(){return i(s,{key:"e6d1f0498cb3de68badef6428cfe8fdff73b879b","data-version":r},i("ol",{key:"4c10c32d36eaeeb19712f7d99dcba7d5337d89a1"},i("slot",{key:"ced502f01025f44c09747299cf60c82ebcd905da",onSlotchange:()=>this.updateSteps()})),i("div",{key:"93cfc9fbd328d4a384c56ccf1f884053643f88e6",class:"active-step","aria-hidden":"true"},i("span",{key:"076fad4efc393852d024157011a0e86d90ecfe99",class:"active-step-label"},this.mobileActiveStepLabel),i("span",{key:"814817862389cd55859aec49205fae255cbbf1d7",innerHTML:this.mobileActiveStepName})))}get host(){return this}static get watchers(){return{currentIndex:[{validateCurrentIndex:0}],selectedIndex:[{validateSelectedIndex:0}],textStepNumber:[{updateActiveStepNumber:0}]}}static get style(){return"ol{margin-block:0;padding-inline-start:0;list-style:none;counter-reset:step-index;display:grid;position:relative;overflow:hidden;grid-template-columns:20px;grid-auto-columns:minmax(0, 1fr);padding-inline-end:20px}@media screen and (max-width: 779.98px){ol{display:flex;padding-inline-end:0}}.active-step{font-size:var(--post-device-font-size-7);font-weight:var(--post-device-font-weight-bold);color:var(--post-scheme-color-interactive-primary-enabled-fg1)}.active-step .active-step-label:has(+span:empty){visibility:hidden}@media screen and (min-width: 780px){.active-step{display:none}}"}},[257,"post-stepper",{textCurrentStep:[513,"text-current-step"],textCompletedStep:[513,"text-completed-step"],textStepNumber:[513,"text-step-number"],currentIndex:[2,"current-index"],selectedIndex:[2,"selected-index"],mobileActiveStepLabel:[32],mobileActiveStepName:[32]},void 0,{currentIndex:[{validateCurrentIndex:0}],selectedIndex:[{validateSelectedIndex:0}],textStepNumber:[{updateActiveStepNumber:0}]}]);p([d(),a("string")],o.prototype,"textCurrentStep",void 0),p([d(),a("string")],o.prototype,"textCompletedStep",void 0),p([d(),c(/\{number\}/)],o.prototype,"textStepNumber",void 0),p([d(),a("number")],o.prototype,"currentIndex",void 0),p([a("number")],o.prototype,"selectedIndex",void 0);const l=o,h=function(){"undefined"!=typeof customElements&&["post-stepper"].forEach((e=>{"post-stepper"===e&&(customElements.get(n(e))||customElements.define(n(e),o))}))};export{l as PostStepper,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as s,Host as i,transformTag as a,Build as o}from"@stencil/core/internal/client";import"./breakpoints.js";import{n}from"./nanoid.js";import{v as r}from"./package.js";import{R as c}from"./required.js";import{T as l}from"./type.js";const d=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.mutationObserver=new MutationObserver(this.checkPagesVariant.bind(this)),this.isPagesVariant=!1,this.disabled=!1}connectedCallback(){this.mutationObserver.observe(this.host,{childList:!0,subtree:!0})}componentWillLoad(){this.tabId="tab-"+(this.host.id||n(6)),this.checkPagesVariant()}disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect()}checkPagesVariant(){const t=null!==this.host.querySelector("a");this.isPagesVariant=t}render(){const t=o.isServer;return s(i,{key:"0c98772d01658e932be9982b6983eb3c1f0c4053",id:this.tabId,role:this.isPagesVariant?void 0:"tab","data-version":r,"data-pages-variant":""+this.isPagesVariant,"aria-selected":this.isPagesVariant?void 0:"false","aria-disabled":this.disabled?"true":void 0,tabindex:this.isPagesVariant?void 0:"-1",class:`${this.isPagesVariant?"nav-item":"tab-title"}${t&&!this.isPagesVariant?" ssr":""}`,style:t&&!this.isPagesVariant?{"--active":`var(--post-tab-item-${this.name}, 0)`}:void 0},s("slot",{key:"fba27566a1226e560161f839df050666763bdce5"}))}get host(){return this}},[257,"post-tab-item",{name:[513],disabled:[516],tabId:[32],isPagesVariant:[32]}]);!function(t,e,s,i){var a,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(o<3?a(n):o>3?a(e,s,n):a(e,s))||n);o>3&&n&&Object.defineProperty(e,s,n)}([c(),l("string")],d.prototype,"name",void 0);const h=d,m=function(){"undefined"!=typeof customElements&&["post-tab-item"].forEach((t=>{"post-tab-item"===t&&(customElements.get(a(t))||customElements.define(a(t),d))}))};export{h as PostTabItem,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as s,transformTag as n,Build as a}from"@stencil/core/internal/client";import"./breakpoints.js";import{n as r}from"./nanoid.js";import{v as i}from"./package.js";import{R as l}from"./required.js";import{T as p}from"./type.js";const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}componentWillLoad(){this.panelId="panel-"+(this.host.id||r(6))}render(){return o(s,{key:"2b02063bf2e67f4e826155759f28a1ae47b0c8e0","data-version":i,id:this.panelId,role:"tabpanel",slot:"panels",style:a.isServer?{display:`var(--post-tab-panel-${this.for}, none)`}:void 0},o("slot",{key:"b4c39e035d0f49f5654b030f4aada27fbebb122c"}))}get host(){return this}static get style(){return":host{display:none}"}},[257,"post-tab-panel",{for:[513],panelId:[32]}]);!function(t,e,o,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,s);else for(var i=t.length-1;i>=0;i--)(n=t[i])&&(r=(a<3?n(r):a>3?n(e,o,r):n(e,o))||r);a>3&&r&&Object.defineProperty(e,o,r)}([l(),p("string")],c.prototype,"for",void 0);const f=c,m=function(){"undefined"!=typeof customElements&&["post-tab-panel"].forEach((t=>{"post-tab-panel"===t&&(customElements.get(n(t))||customElements.define(n(t),c))}))};export{f as PostTabPanel,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as o,transformTag as r,Build as a}from"@stencil/core/internal/client";import{f as n}from"./fade.js";import"./breakpoints.js";import{c}from"./component-on-ready.js";import{v as h}from"./package.js";import{d as l}from"./post-icon2.js";import{O as b}from"./one-of.js";import{T as p}from"./type.js";var d=function(t,s,e,i){var o,r=arguments.length,a=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,s,e,i);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(s,e,a):o(s,e))||a);return r>3&&a&&Object.defineProperty(s,e,a),a};const v=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postChange=e(this,"postChange",7),this.showing=null,this.hiding=null,this.isLoaded=!1,this.isPagesVariant=!1,this.showLeftScrollButton=!1,this.showRightScrollButton=!1,this.textPrevTabItems="Previous tab items",this.textNextTabItems="Next tab items",this.size="large",this.updateScrollButtons=()=>{if(!this.tabsContainer)return;const t=getComputedStyle(this.tabsContainer),s=Number.parseFloat(t.paddingInlineStart)||0,e=Number.parseFloat(t.paddingInlineEnd)||0,i=this.tabsContainer.clientWidth-s-e,o=this.tabsContainer.scrollWidth-s-e;this.showLeftScrollButton=this.tabsContainer.scrollLeft>0,this.showRightScrollButton=this.tabsContainer.scrollLeft+i<o}}get tabs(){return Array.from(this.host.querySelectorAll("post-tab-item")).filter((t=>t.closest("post-tabs")===this.host))}get panels(){return Array.from(this.host.querySelectorAll("post-tab-panel")).filter((t=>t.closest("post-tabs")===this.host))}validateLabel(){this.isPagesVariant&&!this.label&&console.error(`[${this.host.localName}] Property "label" is required in Pages variant. Received: ${JSON.stringify(this.label)}.`,this.host)}componentWillRender(){this.detectVariant()}componentDidLoad(){if(this.leftScrollButton.ariaControlsElements=[this.tabsContainer],this.rightScrollButton.ariaControlsElements=[this.tabsContainer],this.moveMisplacedTabs(),this.moveMisplacedPanels(),this.enableTabs(),this.handleScrollButtons(),this.setupContentObserver(),this.setupResizeObserver(),this.validateLabel(),this.isPagesVariant){const t=this.findActivePagesTab();t&&(this.activateTab(t),this.scrollTabIntoView(t))}else{const t=this.activeTab||this.tabs[0]?.name;if(t){this.show(t);const s=this.tabs.find((s=>s.name===t));s&&this.scrollTabIntoView(s)}}this.isLoaded=!0}disconnectedCallback(){this.showing&&(this.showing.cancel(),this.showing=null),this.hiding&&(this.hiding.cancel(),this.hiding=null),this.contentObserver&&this.contentObserver?.disconnect(),this.resizeObserver?.disconnect(),this.tabsContainer?.removeEventListener("scroll",this.updateScrollButtons)}setupContentObserver(){this.contentObserver=new MutationObserver(this.handleContentChange.bind(this)),this.contentObserver?.observe(this.host,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-pages-variant","aria-current"]})}setupResizeObserver(){this.resizeObserver=new ResizeObserver(this.updateScrollButtons),this.resizeObserver.observe(this.tabsContainer)}handleContentChange(t){const s=this.shouldRedetectVariant(t);this.hasAriaCurrentChanged(t)&&this.isPagesVariant&&this.updateActivePagesTab(),s&&this.handleVariantChange(),this.updateScrollButtons()}shouldRedetectVariant(t){return t.some((t=>"childList"===t.type?t.addedNodes.length>0||t.removedNodes.length>0:"attributes"===t.type&&"data-pages-variant"===t.attributeName))}hasAriaCurrentChanged(t){return t.some((t=>"attributes"===t.type&&"aria-current"===t.attributeName))}updateActivePagesTab(){const t=this.findActivePagesTab();t&&t!==this.currentActiveTab&&(this.activateTab(t),this.scrollTabIntoView(t,"smooth"))}handleVariantChange(){const t=this.isPagesVariant;this.detectVariant(),t!==this.isPagesVariant&&(this.enableTabs(),this.initializeActiveTab())}initializeActiveTab(){if(this.isPagesVariant){const t=this.findActivePagesTab();t&&(this.activateTab(t),this.scrollTabIntoView(t))}else{const t=this.activeTab||this.tabs[0]?.name;t&&this.show(t)}}detectVariant(){const t=this.tabs.some((t=>null!==t.querySelector("a")||"true"===t.dataset.pagesVariant));if(t&&this.panels.length>0)throw Error("PostTabs: Mixed mode detected. Cannot use both Page Tabs (anchor elements) and Content Tabs (post-tab-panel elements) variants at the same time.");this.isPagesVariant=t,this.host.classList.remove("page-tabs","content-tabs"),this.host.classList.add(this.isPagesVariant?"page-tabs":"content-tabs")}findActivePagesTab(){return this.tabs.find((t=>null!==t.querySelector('a[aria-current="page"]')))||null}async show(t){try{if(t===this.currentActiveTab?.name)return;const s=this.currentActiveTab,e=this.host.querySelector(`post-tab-item[name="${t}"]`);if(!e)return;if(this.activateTab(e),this.scrollTabIntoView(e,"smooth"),this.showing&&(this.showing.finish(),this.showing=null),!s||this.showing||this.hiding||this.hidePanel(s.name),await this.awaitAnimation(this.hiding))return;if(this.showSelectedPanel(),await this.awaitAnimation(this.showing))return;this.isLoaded&&this.currentActiveTab&&this.postChange.emit(this.currentActiveTab.name)}catch(t){if(this.isAbortError(t))return;throw t}}async awaitAnimation(t){if(!t)return!1;try{return await t.finished,!1}catch(t){if(this.isAbortError(t))return!0;throw t}}isAbortError(t){return(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name}moveMisplacedTabs(){this.tabs&&this.tabs.forEach((t=>{t.getAttribute("slot")&&t.removeAttribute("slot")}))}moveMisplacedPanels(){this.panels&&this.panels.forEach((t=>{"panels"!==t.getAttribute("slot")&&t.setAttribute("slot","panels")}))}enableTabs(){this.tabs&&(this.tabs.forEach((async t=>{if(await c(t),this.isPagesVariant)return;if(t.getAttribute("aria-controls"))return;const s=this.getPanel(t.name);s&&(t.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",t.id)),t.addEventListener("click",(()=>{this.show(t.name)})),t.addEventListener("keydown",(s=>{if("Enter"!==s.key&&" "!==s.key||(s.preventDefault(),this.show(t.name)),"Home"!==s.key&&"End"!==s.key)return;s.preventDefault();const e=this.tabs.filter((t=>!t.hasAttribute("disabled")));if(0===e.length)return;const i="Home"===s.key?e[0]:e.at(-1);i&&(i?.focus(),this.show(i.name))})),t.addEventListener("keydown",(s=>{"ArrowRight"!==s.key&&"ArrowLeft"!==s.key||this.navigateTabs(t,s.key)}))})),this.currentActiveTab&&!this.currentActiveTab.isConnected&&this.show(this.tabs[0]?.name))}activateTab(t){this.currentActiveTab&&(this.isPagesVariant||(this.currentActiveTab.setAttribute("aria-selected","false"),this.currentActiveTab.setAttribute("tabindex","-1"))),this.isPagesVariant||(t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0")),this.currentActiveTab=t}hidePanel(t){const s=this.getPanel(t);s&&(this.hiding=n(s,"out"),this.hiding.onfinish=()=>{s.style.display="none",this.hiding=null})}showSelectedPanel(){if(!this.currentActiveTab)return;const t=this.getPanel(this.currentActiveTab.name);t&&(t.style.display="block",this.isLoaded&&(this.showing=n(t,"in"),this.showing.onfinish=()=>{this.showing=null}))}getPanel(t){return this.host.querySelector(`post-tab-panel[for=${t}]`)}navigateTabs(t,s){const e=Array.from(this.tabs).indexOf(t);let i;i="ArrowRight"===s?this.tabs[e+1]||this.tabs[0]:this.tabs[e-1]||this.tabs.at(-1),i&&(i.focus(),this.show(i.name))}scrollTabs(t){const s="prev"===t?-1:1,e=getComputedStyle(this.tabsContainer),i=Number.parseFloat(e.paddingInlineStart)||0,o=Number.parseFloat(e.paddingInlineEnd)||0;this.tabsContainer.scrollBy({left:s*(this.tabsContainer.clientWidth-i-o),behavior:"smooth"})}scrollTabIntoView(t,s="instant"){const e=this.tabsContainer,i=getComputedStyle(e),o=Number.parseFloat(i.paddingInlineStart)||0,r=Number.parseFloat(i.paddingInlineEnd)||0,a=t.offsetLeft,n=a+t.offsetWidth,c=e.scrollLeft+o,h=c+e.clientWidth-o-r;a<c?e.scrollTo({left:a-o,behavior:s}):n>h&&e.scrollTo({left:n-e.clientWidth+r,behavior:s})}handleScrollButtons(){this.updateScrollButtons(),this.tabsContainer.addEventListener("scroll",this.updateScrollButtons)}render(){const t=this.activeTab??this.tabs[0]?.name,s=this.isPagesVariant?"nav":"div";return i(o,{key:"ad4f55f50dbd83e1383944984f79d195d1c531e7","data-version":h,style:a.isServer&&!this.isPagesVariant&&t?{["--post-tab-panel-"+t]:"block",["--post-tab-item-"+t]:"1"}:void 0},i("div",{key:"48456590c7b6cead75b689e3b2b463c641600cdd",class:"tabs-wrapper",part:"post-tabs"},i("button",{key:"6337fd1ba75f53f09bd80ff0873b129cb2387498",ref:t=>this.leftScrollButton=t,class:"scroll-btn scroll-btn-left",type:"button","aria-label":this.textPrevTabItems,tabindex:this.showLeftScrollButton?0:-1,hidden:!this.showLeftScrollButton,onClick:()=>this.scrollTabs("prev")},i("post-icon",{key:"97897bb7329a070f40e6ecbacff394b10f660aec",name:"chevronleft"})),i(s,{key:"edc801dcadf41c85ed9aafdd2dda11ff4c87756b",ref:t=>this.tabsContainer=t,class:"tabs",role:this.isPagesVariant?void 0:"tablist","aria-label":this.isPagesVariant?this.label:void 0},i("slot",{key:"908aaf787f545de1738236412dc4094cabe87155",onSlotchange:()=>{this.moveMisplacedTabs(),this.enableTabs()}})),i("button",{key:"ed12a602b399e1a8dcd190fca7828fcb2683b925",ref:t=>this.rightScrollButton=t,class:"scroll-btn scroll-btn-right",type:"button","aria-label":this.textNextTabItems,tabindex:this.showRightScrollButton?0:-1,hidden:!this.showRightScrollButton,onClick:()=>this.scrollTabs("next")},i("post-icon",{key:"0ecd4444455da92f371b300299ff2f1a53f804a2",name:"chevronright"}))),!this.isPagesVariant&&i("div",{key:"2252fefeca18a6135796852e511c779d413aa2c5",class:"tab-content",part:"post-tabs-content"},i("slot",{key:"dc553352c6fa9ea4c5780108bc9ed8e3e9b29b24",name:"panels",onSlotchange:()=>this.moveMisplacedPanels()})))}get host(){return this}static get watchers(){return{label:[{validateLabel:0}]}}static get style(){return':host{display:block}:host .tabs-wrapper{position:relative;display:flex;align-items:center}:host .tabs-wrapper button.scroll-btn{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;align-items:center;justify-content:center;transition:background-color 100ms,border-color 100ms,color 100ms;cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn{background-color:ButtonFace !important}:host .tabs-wrapper button.scroll-btn:hover{background-color:Highlight !important}}:host .tabs-wrapper button.scroll-btn post-icon{color:currentColor}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn post-icon{color:Highlight}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:hover post-icon{color:canvas}}:host .tabs-wrapper button.scroll-btn[hidden]{display:none}:host .tabs-wrapper button.scroll-btn{outline-offset:var(--post-device-spacing-padding-44) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .tabs-wrapper .tabs{overflow-x:hidden;background-color:rgba(0,0,0,0) !important;display:flex;flex-wrap:nowrap;align-items:end;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;padding-inline-start:0;list-style:none}:host(.page-tabs){overflow:visible !important}:host(.page-tabs) .tabs-wrapper{margin-inline:calc(-1*(var(--post-container-offset)))}:host(.page-tabs) .tabs-wrapper button.scroll-btn{color:var(--post-scheme-color-interactive-primary-enabled-fg5);background-color:var(--post-scheme-color-interactive-primary-enabled-bg5);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke);position:absolute;z-index:2;box-shadow:var(--post-device-elevation-200);border-radius:var(--post-device-border-radius-2)}:host(.page-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-primary-hover-fg4);background-color:var(--post-scheme-color-interactive-primary-hover-bg8)}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-left{inset-inline-start:0;border-inline-start:none;border-radius:0 var(--post-device-border-radius-2) var(--post-device-border-radius-2) 0}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-right{inset-inline-end:0;border-inline-end:none;border-radius:var(--post-device-border-radius-2) 0 0 var(--post-device-border-radius-2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn{background-color:Highlight;color:HighlightText}}:host(.page-tabs) .tabs-wrapper::after{content:"";position:absolute;inset-block-end:0;inset-inline-start:0;width:100%;height:var(--post-device-border-width-default);background-color:var(--post-palette-color-nested-tabs-page-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper::after{background-color:LinkText}}:host(.page-tabs) .tabs-wrapper .tabs{padding-inline:calc(var(--post-container-offset));gap:var(--post-device-spacing-gap-inline-5);scrollbar-width:none}:host(.page-tabs) .tabs-wrapper .tabs::-webkit-scrollbar{display:none}:host(.page-tabs:not([size=small])) button.scroll-btn{top:var(--post-device-spacing-padding-36)}:host(.page-tabs[size=small]) button.scroll-btn{top:var(--post-device-spacing-padding-36)}:host(.content-tabs) .tabs-wrapper button.scroll-btn{flex-shrink:0;color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{color:HighlightText}}:host(post-tabs:not([size=small])) button.scroll-btn{height:var(--post-device-sizing-interactive-button-height-10);width:var(--post-device-sizing-interactive-button-width-1);border-radius:var(--post-device-border-radius-2)}:host(post-tabs:not([size=small])) button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size5);width:var(--post-device-sizing-interactive-icon-size5)}:host(.page-tabs:not([size=small])) button.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-39) var(--post-device-spacing-padding-40)}:host(.page-tabs:not([size=small])) button.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-40) var(--post-device-spacing-padding-39)}:host([size=small]) button.scroll-btn{height:var(--post-device-sizing-interactive-button-size-1);width:var(--post-device-sizing-interactive-button-size-1);border-radius:var(--post-device-border-radius-2)}:host([size=small]) button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4)}:host(.page-tabs[size=small]) button.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-42) var(--post-device-spacing-padding-43)}:host(.page-tabs[size=small]) button.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-43) var(--post-device-spacing-padding-42)}'}},[257,"post-tabs",{textPrevTabItems:[513,"text-prev-tab-items"],textNextTabItems:[513,"text-next-tab-items"],activeTab:[513,"active-tab"],size:[513],label:[513],isPagesVariant:[32],showLeftScrollButton:[32],showRightScrollButton:[32],show:[64]},void 0,{label:[{validateLabel:0}]}]);d([b(["small","large"])],v.prototype,"size",void 0),d([p("string")],v.prototype,"label",void 0);const u=v,g=function(){"undefined"!=typeof customElements&&["post-tabs","post-icon"].forEach((t=>{switch(t){case"post-tabs":customElements.get(r(t))||customElements.define(r(t),v);break;case"post-icon":customElements.get(r(t))||l()}}))};export{u as PostTabs,g as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as o,transformTag as a,Build as r}from"@stencil/core/internal/client";import{f as n}from"./fade.js";import"./breakpoints.js";import{c}from"./component-on-ready.js";import{v as h}from"./package.js";import{d as l}from"./post-icon2.js";import{O as b}from"./one-of.js";import{T as p}from"./type.js";var d=function(t,s,e,i){var o,a=arguments.length,r=a<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,s,e,i);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(r=(a<3?o(r):a>3?o(s,e,r):o(s,e))||r);return a>3&&r&&Object.defineProperty(s,e,r),r};const v=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postChange=e(this,"postChange",7),this.showing=null,this.hiding=null,this.isLoaded=!1,this.isPagesVariant=!1,this.showLeftScrollButton=!1,this.showRightScrollButton=!1,this.textPrevTabItems="Previous tab items",this.textNextTabItems="Next tab items",this.size="large",this.updateScrollButtons=()=>{if(!this.tabsContainer)return;const t=getComputedStyle(this.tabsContainer),s=Number.parseFloat(t.paddingInlineStart)||0,e=Number.parseFloat(t.paddingInlineEnd)||0,i=this.tabsContainer.clientWidth-s-e,o=this.tabsContainer.scrollWidth-s-e;this.showLeftScrollButton=this.tabsContainer.scrollLeft>0,this.showRightScrollButton=this.tabsContainer.scrollLeft+i<o}}get tabs(){return Array.from(this.host.querySelectorAll("post-tab-item")).filter((t=>t.closest("post-tabs")===this.host))}get panels(){return Array.from(this.host.querySelectorAll("post-tab-panel")).filter((t=>t.closest("post-tabs")===this.host))}validateLabel(){this.isPagesVariant&&!this.label&&console.error(`[${this.host.localName}] Property "label" is required in Pages variant. Received: ${JSON.stringify(this.label)}.`,this.host)}componentWillRender(){this.detectVariant()}componentDidLoad(){if(this.leftScrollButton.ariaControlsElements=[this.tabsContainer],this.rightScrollButton.ariaControlsElements=[this.tabsContainer],this.moveMisplacedTabs(),this.moveMisplacedPanels(),this.enableTabs(),this.handleScrollButtons(),this.setupContentObserver(),this.setupResizeObserver(),this.validateLabel(),this.isPagesVariant){const t=this.findActivePagesTab();t&&(this.activateTab(t),this.scrollTabIntoView(t))}else{const t=this.activeTab||this.tabs[0]?.name;if(t){this.show(t);const s=this.tabs.find((s=>s.name===t));s&&this.scrollTabIntoView(s)}}this.isLoaded=!0}disconnectedCallback(){this.showing&&(this.showing.cancel(),this.showing=null),this.hiding&&(this.hiding.cancel(),this.hiding=null),this.contentObserver&&this.contentObserver?.disconnect(),this.resizeObserver?.disconnect(),this.tabsContainer?.removeEventListener("scroll",this.updateScrollButtons)}setupContentObserver(){this.contentObserver=new MutationObserver(this.handleContentChange.bind(this)),this.contentObserver?.observe(this.host,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-pages-variant","aria-current"]})}setupResizeObserver(){this.resizeObserver=new ResizeObserver(this.updateScrollButtons),this.resizeObserver.observe(this.tabsContainer)}handleContentChange(t){const s=this.shouldRedetectVariant(t);this.hasAriaCurrentChanged(t)&&this.isPagesVariant&&this.updateActivePagesTab(),s&&this.handleVariantChange(),this.updateScrollButtons()}shouldRedetectVariant(t){return t.some((t=>"childList"===t.type?t.addedNodes.length>0||t.removedNodes.length>0:"attributes"===t.type&&"data-pages-variant"===t.attributeName))}hasAriaCurrentChanged(t){return t.some((t=>"attributes"===t.type&&"aria-current"===t.attributeName))}updateActivePagesTab(){const t=this.findActivePagesTab();t&&t!==this.currentActiveTab&&(this.activateTab(t),this.scrollTabIntoView(t,"smooth"))}handleVariantChange(){const t=this.isPagesVariant;this.detectVariant(),t!==this.isPagesVariant&&(this.enableTabs(),this.initializeActiveTab())}initializeActiveTab(){if(this.isPagesVariant){const t=this.findActivePagesTab();t&&(this.activateTab(t),this.scrollTabIntoView(t))}else{const t=this.activeTab||this.tabs[0]?.name;t&&this.show(t)}}detectVariant(){const t=this.tabs.some((t=>null!==t.querySelector("a")||"true"===t.dataset.pagesVariant));if(t&&this.panels.length>0)throw Error("PostTabs: Mixed mode detected. Cannot use both Page Tabs (anchor elements) and Content Tabs (post-tab-panel elements) variants at the same time.");this.isPagesVariant=t,this.host.classList.remove("page-tabs","content-tabs"),this.host.classList.add(this.isPagesVariant?"page-tabs":"content-tabs")}findActivePagesTab(){return this.tabs.find((t=>null!==t.querySelector('a[aria-current="page"]')))||null}async show(t){try{if(t===this.currentActiveTab?.name)return;const s=this.currentActiveTab,e=this.host.querySelector(`post-tab-item[name="${t}"]`);if(!e)return;if(this.activateTab(e),this.scrollTabIntoView(e,"smooth"),this.showing&&(this.showing.finish(),this.showing=null),!s||this.showing||this.hiding||this.hidePanel(s.name),await this.awaitAnimation(this.hiding))return;if(this.showSelectedPanel(),await this.awaitAnimation(this.showing))return;this.isLoaded&&this.currentActiveTab&&this.postChange.emit(this.currentActiveTab.name)}catch(t){if(this.isAbortError(t))return;throw t}}async awaitAnimation(t){if(!t)return!1;try{return await t.finished,!1}catch(t){if(this.isAbortError(t))return!0;throw t}}isAbortError(t){return(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name}moveMisplacedTabs(){this.tabs&&this.tabs.forEach((t=>{t.getAttribute("slot")&&t.removeAttribute("slot")}))}moveMisplacedPanels(){this.panels&&this.panels.forEach((t=>{"panels"!==t.getAttribute("slot")&&t.setAttribute("slot","panels")}))}enableTabs(){this.tabs&&(this.tabs.forEach((async t=>{if(await c(t),this.isPagesVariant)return;if(t.getAttribute("aria-controls"))return;const s=this.getPanel(t.name);s&&(t.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",t.id)),t.addEventListener("click",(()=>{this.show(t.name)})),t.addEventListener("keydown",(s=>{if("Enter"!==s.key&&" "!==s.key||(s.preventDefault(),this.show(t.name)),"Home"!==s.key&&"End"!==s.key)return;s.preventDefault();const e=this.tabs.filter((t=>!t.hasAttribute("disabled")));if(0===e.length)return;const i="Home"===s.key?e[0]:e.at(-1);i&&(i?.focus(),this.show(i.name))})),t.addEventListener("keydown",(s=>{"ArrowRight"!==s.key&&"ArrowLeft"!==s.key||this.navigateTabs(t,s.key)}))})),this.currentActiveTab&&!this.currentActiveTab.isConnected&&this.show(this.tabs[0]?.name))}activateTab(t){this.currentActiveTab&&(this.isPagesVariant||(this.currentActiveTab.setAttribute("aria-selected","false"),this.currentActiveTab.setAttribute("tabindex","-1"))),this.isPagesVariant||(t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0")),this.currentActiveTab=t}hidePanel(t){const s=this.getPanel(t);s&&(this.hiding=n(s,"out"),this.hiding.onfinish=()=>{s.style.display="none",this.hiding=null})}showSelectedPanel(){if(!this.currentActiveTab)return;const t=this.getPanel(this.currentActiveTab.name);t&&(t.style.display="block",this.isLoaded&&(this.showing=n(t,"in"),this.showing.onfinish=()=>{this.showing=null}))}getPanel(t){return this.host.querySelector(`post-tab-panel[for=${t}]`)}navigateTabs(t,s){const e=Array.from(this.tabs).indexOf(t);let i;i="ArrowRight"===s?this.tabs[e+1]||this.tabs[0]:this.tabs[e-1]||this.tabs.at(-1),i&&(i.focus(),this.show(i.name))}scrollTabs(t){const s="prev"===t?-1:1,e=getComputedStyle(this.tabsContainer),i=Number.parseFloat(e.paddingInlineStart)||0,o=Number.parseFloat(e.paddingInlineEnd)||0;this.tabsContainer.scrollBy({left:s*(this.tabsContainer.clientWidth-i-o),behavior:"smooth"})}scrollTabIntoView(t,s="instant"){const e=this.tabsContainer,i=getComputedStyle(e),o=Number.parseFloat(i.paddingInlineStart)||0,a=Number.parseFloat(i.paddingInlineEnd)||0,r=t.offsetLeft,n=r+t.offsetWidth,c=e.scrollLeft+o,h=c+e.clientWidth-o-a;r<c?e.scrollTo({left:r-o,behavior:s}):n>h&&e.scrollTo({left:n-e.clientWidth+a,behavior:s})}handleScrollButtons(){this.updateScrollButtons(),this.tabsContainer.addEventListener("scroll",this.updateScrollButtons)}render(){const t=this.activeTab??this.tabs[0]?.name,s=this.isPagesVariant?"nav":"div";return i(o,{key:"fb65fd2589517dd6d86e86435ec6b3a3b64b093d","data-version":h,style:r.isServer&&!this.isPagesVariant&&t?{["--post-tab-panel-"+t]:"block",["--post-tab-item-"+t]:"1"}:void 0},i("div",{key:"dbcdd791af381ccc23953acb38a8e71527a804ee",class:"tabs-wrapper",part:"post-tabs"},i("button",{key:"20ce30515d80b282aa93f20a1f3281a1ef0f6359",ref:t=>this.leftScrollButton=t,class:"scroll-btn scroll-btn-left",type:"button","aria-label":this.textPrevTabItems,tabindex:this.showLeftScrollButton?0:-1,hidden:!this.showLeftScrollButton,onClick:()=>this.scrollTabs("prev")},i("post-icon",{key:"9a5402a28656d7a4459b9b848425bd15a45a0fce",name:"chevronleft"})),i(s,{key:"e821db02fd66aef6cf7a9fb5d925b0906571f3b6",ref:t=>this.tabsContainer=t,class:"tabs",role:this.isPagesVariant?void 0:"tablist","aria-label":this.isPagesVariant?this.label:void 0},i("slot",{key:"e3650e43ac269173cb58f1624f02778bf094573c",onSlotchange:()=>{this.moveMisplacedTabs(),this.enableTabs()}})),i("button",{key:"4345a9bc121ce187022cddf019d5c86d875a70e9",ref:t=>this.rightScrollButton=t,class:"scroll-btn scroll-btn-right",type:"button","aria-label":this.textNextTabItems,tabindex:this.showRightScrollButton?0:-1,hidden:!this.showRightScrollButton,onClick:()=>this.scrollTabs("next")},i("post-icon",{key:"2df749c1a4e506d9940ce61e077d0f0f330b7342",name:"chevronright"}))),!this.isPagesVariant&&i("div",{key:"184db29a5826af78d142ed1489be33c45831970b",class:"tab-content",part:"post-tabs-content"},i("slot",{key:"4a984c7de97f2f89e7fd0f829f5bc62e2323f056",name:"panels",onSlotchange:()=>this.moveMisplacedPanels()})))}get host(){return this}static get watchers(){return{label:[{validateLabel:0}]}}static get style(){return':host{display:block}:host .tabs-wrapper{position:relative;display:flex;align-items:center}:host .tabs-wrapper button.scroll-btn{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;align-items:center;justify-content:center;transition:background-color 100ms,border-color 100ms,color 100ms;cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn{background-color:ButtonFace !important}:host .tabs-wrapper button.scroll-btn:hover{background-color:Highlight !important}}:host .tabs-wrapper button.scroll-btn post-icon{color:currentColor}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn post-icon{color:Highlight}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:hover post-icon{color:canvas}}:host .tabs-wrapper button.scroll-btn[hidden]{display:none}:host .tabs-wrapper button.scroll-btn{outline-offset:var(--post-device-spacing-padding-44) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .tabs-wrapper .tabs{overflow-x:hidden;background-color:rgba(0,0,0,0) !important;display:flex;flex-wrap:nowrap;align-items:end;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;padding-inline-start:0;list-style:none}:host(.page-tabs){overflow:visible !important}:host(.page-tabs) .tabs-wrapper{margin-inline:calc(-1*(var(--post-container-offset)))}@media screen and (min-width: 1024px){:host(.page-tabs) .tabs-wrapper{margin-inline:calc(-1 * (var(--post-container-offset)) + 20px)}:host(.page-tabs) .tabs-wrapper::after{box-shadow:20px 0 0 var(--post-palette-color-nested-tabs-page-stroke),-20px 0 0 var(--post-palette-color-nested-tabs-page-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper::after{box-shadow:20px 0 0 LinkText,-20px 0 0 LinkText}}:host(.page-tabs) .tabs-wrapper button.scroll-btn{color:var(--post-scheme-color-interactive-primary-enabled-fg5);background-color:var(--post-scheme-color-interactive-primary-enabled-bg5);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke);position:absolute;z-index:2;box-shadow:var(--post-device-elevation-200);border-radius:var(--post-device-border-radius-2)}:host(.page-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-primary-hover-fg4);background-color:var(--post-scheme-color-interactive-primary-hover-bg8)}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-left{inset-inline-start:0;border-inline-start:none;border-radius:0 var(--post-device-border-radius-2) var(--post-device-border-radius-2) 0}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-right{inset-inline-end:0;border-inline-end:none;border-radius:var(--post-device-border-radius-2) 0 0 var(--post-device-border-radius-2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn{background-color:Highlight;color:HighlightText}}:host(.page-tabs) .tabs-wrapper::after{content:"";position:absolute;inset-block-end:0;inset-inline-start:0;width:100%;height:var(--post-device-border-width-default);background-color:var(--post-palette-color-nested-tabs-page-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper::after{background-color:LinkText}}:host(.page-tabs) .tabs-wrapper .tabs{padding-inline:calc(var(--post-container-offset));gap:var(--post-device-spacing-gap-inline-5);scrollbar-width:none}:host(.page-tabs) .tabs-wrapper .tabs::-webkit-scrollbar{display:none}:host(.page-tabs:not([size=small])) button.scroll-btn{top:var(--post-device-spacing-padding-36)}:host(.page-tabs[size=small]) button.scroll-btn{top:var(--post-device-spacing-padding-36)}:host(.content-tabs) .tabs-wrapper button.scroll-btn{flex-shrink:0;color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{color:HighlightText}}:host(post-tabs:not([size=small])) button.scroll-btn{height:var(--post-device-sizing-interactive-button-height-10);width:var(--post-device-sizing-interactive-button-width-1);border-radius:var(--post-device-border-radius-2)}:host(post-tabs:not([size=small])) button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size5);width:var(--post-device-sizing-interactive-icon-size5)}:host(.page-tabs:not([size=small])) button.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-39) var(--post-device-spacing-padding-40)}:host(.page-tabs:not([size=small])) button.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-40) var(--post-device-spacing-padding-39)}:host([size=small]) button.scroll-btn{height:var(--post-device-sizing-interactive-button-size-1);width:var(--post-device-sizing-interactive-button-size-1);border-radius:var(--post-device-border-radius-2)}:host([size=small]) button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4)}:host(.page-tabs[size=small]) button.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-42) var(--post-device-spacing-padding-43)}:host(.page-tabs[size=small]) button.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-43) var(--post-device-spacing-padding-42)}'}},[257,"post-tabs",{textPrevTabItems:[513,"text-prev-tab-items"],textNextTabItems:[513,"text-next-tab-items"],activeTab:[513,"active-tab"],size:[513],label:[513],isPagesVariant:[32],showLeftScrollButton:[32],showRightScrollButton:[32],show:[64]},void 0,{label:[{validateLabel:0}]}]);d([b(["small","large"])],v.prototype,"size",void 0),d([p("string")],v.prototype,"label",void 0);const u=v,g=function(){"undefined"!=typeof customElements&&["post-tabs","post-icon"].forEach((t=>{switch(t){case"post-tabs":customElements.get(a(t))||customElements.define(a(t),v);break;case"post-icon":customElements.get(a(t))||l()}}))};export{u as PostTabs,g as defineCustomElement}
|