@solid-design-system/components 4.0.8 → 4.0.9
Sign up to get free protection for your applications and to get access to all the features.
- package/{cdn-versioned/chunks/chunk.2OLKGLBS.js → cdn/chunks/chunk.IR3YQSPY.js} +1 -1
- package/cdn/components/map-marker/map-marker.js +1 -1
- package/cdn/custom-elements.json +907 -907
- package/cdn/solid-components.bundle.js +1 -1
- package/cdn/solid-components.iife.js +1 -1
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +1 -1
- package/cdn-versioned/_components/menu/menu.js +1 -1
- package/cdn-versioned/_components/menu/menu.styles.js +1 -1
- package/cdn-versioned/_components/menu-item/menu-item.js +2 -2
- package/cdn-versioned/chunks/chunk.25ETUACJ.js +1 -1
- package/cdn-versioned/chunks/chunk.27EYM5XP.js +4 -4
- package/cdn-versioned/chunks/chunk.2H5XA4I4.js +1 -1
- package/cdn-versioned/chunks/chunk.3H546YPQ.js +1 -1
- package/cdn-versioned/chunks/chunk.4EXZ2RBI.js +1 -1
- package/cdn-versioned/chunks/chunk.4QUXWXQ7.js +1 -1
- package/cdn-versioned/chunks/chunk.5CIQRJCC.js +1 -1
- package/cdn-versioned/chunks/chunk.65NSSTJE.js +1 -1
- package/cdn-versioned/chunks/chunk.7ZYFSBMR.js +1 -1
- package/cdn-versioned/chunks/chunk.A63P52TG.js +1 -1
- package/cdn-versioned/chunks/chunk.A772RQJV.js +1 -1
- package/cdn-versioned/chunks/chunk.ANH5V2SE.js +2 -2
- package/cdn-versioned/chunks/chunk.AS7L23H2.js +2 -2
- package/cdn-versioned/chunks/chunk.B3H3PR6Y.js +1 -1
- package/cdn-versioned/chunks/chunk.B5YKUN6P.js +1 -1
- package/cdn-versioned/chunks/chunk.B6I2NZMP.js +4 -4
- package/cdn-versioned/chunks/chunk.BAO3UVTY.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.D4RLVVDK.js +1 -1
- package/cdn-versioned/chunks/chunk.DUM4IQT6.js +1 -1
- package/cdn-versioned/chunks/chunk.EDD4HHHP.js +1 -1
- package/cdn-versioned/chunks/chunk.EJKLI2Q4.js +1 -1
- package/cdn-versioned/chunks/chunk.EP7OA5FU.js +1 -1
- package/cdn-versioned/chunks/chunk.F4GGY7NW.js +1 -1
- package/cdn-versioned/chunks/chunk.GNYJN5QM.js +3 -3
- package/cdn-versioned/chunks/chunk.GQU4LYQ6.js +1 -1
- package/cdn-versioned/chunks/chunk.GX6NOXTL.js +1 -1
- package/{cdn/chunks/chunk.2OLKGLBS.js → cdn-versioned/chunks/chunk.IR3YQSPY.js} +1 -1
- package/cdn-versioned/chunks/chunk.JUGW2WJP.js +1 -1
- package/cdn-versioned/chunks/chunk.LPXG67S4.js +1 -1
- package/cdn-versioned/chunks/chunk.LQZOBUFT.js +1 -1
- package/cdn-versioned/chunks/chunk.MOQCXANY.js +2 -2
- package/cdn-versioned/chunks/chunk.N5OYRZY6.js +1 -1
- package/cdn-versioned/chunks/chunk.OCT5SOOS.js +1 -1
- package/cdn-versioned/chunks/chunk.PPMFZ77L.js +1 -1
- package/cdn-versioned/chunks/chunk.QA3NVZY4.js +1 -1
- package/cdn-versioned/chunks/chunk.QOQO2KP5.js +1 -1
- package/cdn-versioned/chunks/chunk.QV7OIYLT.js +1 -1
- package/cdn-versioned/chunks/chunk.QWPCVRMH.js +1 -1
- package/cdn-versioned/chunks/chunk.SJ2JO4KS.js +1 -1
- package/cdn-versioned/chunks/chunk.SWUGEKNC.js +1 -1
- package/cdn-versioned/chunks/chunk.TR52VDPR.js +1 -1
- package/cdn-versioned/chunks/chunk.U5SOEJO4.js +1 -1
- package/cdn-versioned/chunks/chunk.UCTR6UM6.js +1 -1
- package/cdn-versioned/chunks/chunk.V3WIIJLB.js +1 -1
- package/cdn-versioned/chunks/chunk.VYV6SKST.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.WADGCWRK.js +1 -1
- package/cdn-versioned/chunks/chunk.WG3IQMLL.js +1 -1
- package/cdn-versioned/chunks/chunk.WNV6OGRG.js +1 -1
- package/cdn-versioned/chunks/chunk.WVYVGVBF.js +1 -1
- package/cdn-versioned/chunks/chunk.Y67MAFTR.js +1 -1
- package/cdn-versioned/chunks/chunk.ZWWTEE7R.js +1 -1
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +4 -4
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.js +1 -1
- package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +2 -2
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +2 -2
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +4 -4
- package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
- package/cdn-versioned/components/step/step.d.ts +1 -1
- package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
- package/cdn-versioned/components/switch/switch.d.ts +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +1101 -1101
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +17 -17
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +17 -17
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +80 -80
- package/cdn-versioned/web-types.json +137 -137
- package/dist/chunks/{chunk.HP2TVELZ.js → chunk.I5ZJV32M.js} +3 -3
- package/dist/components/map-marker/map-marker.js +1 -1
- package/dist/custom-elements.json +907 -907
- package/dist/solid-components.js +1 -1
- package/dist/web-types.json +1 -1
- package/dist-versioned/_components/menu/menu.js +1 -1
- package/dist-versioned/_components/menu/menu.styles.js +1 -1
- package/dist-versioned/_components/menu-item/menu-item.js +2 -2
- package/dist-versioned/chunks/chunk.274HT4QS.js +3 -3
- package/dist-versioned/chunks/chunk.2FXKQI26.js +2 -2
- package/dist-versioned/chunks/chunk.4MHQ63NW.js +26 -26
- package/dist-versioned/chunks/chunk.4Q7KKH5Z.js +2 -2
- package/dist-versioned/chunks/chunk.674S2Z6M.js +1 -1
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.7E7C4YEQ.js +3 -3
- package/dist-versioned/chunks/chunk.A5S7GZJI.js +3 -3
- package/dist-versioned/chunks/chunk.A625ONY2.js +2 -2
- package/dist-versioned/chunks/chunk.ACST636J.js +1 -1
- package/dist-versioned/chunks/chunk.AJ7V76EG.js +1 -1
- package/dist-versioned/chunks/chunk.AKF4KQEW.js +2 -2
- package/dist-versioned/chunks/chunk.AQZSZKBJ.js +13 -13
- package/dist-versioned/chunks/chunk.BJIZPRT4.js +5 -5
- package/dist-versioned/chunks/chunk.CCQCEONR.js +2 -2
- package/dist-versioned/chunks/chunk.D26WCHLT.js +6 -6
- package/dist-versioned/chunks/chunk.DPY2TYIS.js +9 -9
- package/dist-versioned/chunks/chunk.DU3O42BH.js +2 -2
- package/dist-versioned/chunks/chunk.EH2FHVPN.js +3 -3
- package/dist-versioned/chunks/chunk.F63YFNZS.js +5 -5
- package/dist-versioned/chunks/chunk.FFKZQXJ2.js +2 -2
- package/dist-versioned/chunks/chunk.FTXUZOXH.js +2 -2
- package/dist-versioned/chunks/chunk.H5ARRBLT.js +2 -2
- package/dist-versioned/chunks/chunk.H5BDO4H5.js +11 -11
- package/dist-versioned/chunks/chunk.HFHUY7YD.js +1 -1
- package/dist-versioned/chunks/{chunk.HP2TVELZ.js → chunk.I5ZJV32M.js} +4 -4
- package/dist-versioned/chunks/chunk.IN7RNHBF.js +1 -1
- package/dist-versioned/chunks/chunk.JIWTAZZS.js +5 -5
- package/dist-versioned/chunks/chunk.JZB2D4IZ.js +1 -1
- package/dist-versioned/chunks/chunk.K3JCC7KV.js +5 -5
- package/dist-versioned/chunks/chunk.KH4M6HPE.js +2 -2
- package/dist-versioned/chunks/chunk.KPA6BEFU.js +5 -5
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.L32THKSR.js +3 -3
- package/dist-versioned/chunks/chunk.LZA2QYUU.js +1 -1
- package/dist-versioned/chunks/chunk.NUIZDE7R.js +1 -1
- package/dist-versioned/chunks/chunk.OBWOMZNU.js +2 -2
- package/dist-versioned/chunks/chunk.OMBVLHXJ.js +1 -1
- package/dist-versioned/chunks/chunk.OR7JTZLE.js +2 -2
- package/dist-versioned/chunks/chunk.OZU372TI.js +2 -2
- package/dist-versioned/chunks/chunk.PRXP5CUW.js +5 -5
- package/dist-versioned/chunks/chunk.PT7MDSWH.js +1 -1
- package/dist-versioned/chunks/chunk.QTFIZJGB.js +2 -2
- package/dist-versioned/chunks/chunk.QUYKT56M.js +1 -1
- package/dist-versioned/chunks/chunk.SNCHAQYL.js +4 -4
- package/dist-versioned/chunks/chunk.TGJ2SBPH.js +6 -6
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.UTSM3BM3.js +13 -13
- package/dist-versioned/chunks/chunk.VTUCPGYW.js +1 -1
- package/dist-versioned/chunks/chunk.X2PI2F35.js +1 -1
- package/dist-versioned/chunks/chunk.XL2PSGM5.js +2 -2
- package/dist-versioned/chunks/chunk.XQNY7RZD.js +29 -29
- package/dist-versioned/chunks/chunk.Y7254YJM.js +2 -2
- package/dist-versioned/components/accordion/accordion.d.ts +1 -1
- package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist-versioned/components/animation/animation.d.ts +1 -1
- package/dist-versioned/components/audio/audio.d.ts +1 -1
- package/dist-versioned/components/badge/badge.d.ts +1 -1
- package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/dist-versioned/components/button/button.d.ts +1 -1
- package/dist-versioned/components/button-group/button-group.d.ts +1 -1
- package/dist-versioned/components/carousel/carousel.d.ts +1 -1
- package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist-versioned/components/combobox/combobox.d.ts +4 -4
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.js +1 -1
- package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +2 -2
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +2 -2
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +4 -4
- package/dist-versioned/components/spinner/spinner.d.ts +1 -1
- package/dist-versioned/components/step/step.d.ts +1 -1
- package/dist-versioned/components/step-group/step-group.d.ts +1 -1
- package/dist-versioned/components/switch/switch.d.ts +1 -1
- package/dist-versioned/components/tab/tab.d.ts +1 -1
- package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist-versioned/components/tag/tag.d.ts +1 -1
- package/dist-versioned/components/textarea/textarea.d.ts +1 -1
- package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +1101 -1101
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +1 -1
- package/dist-versioned/vscode.html-custom-data.json +80 -80
- package/dist-versioned/web-types.json +137 -137
- package/package.json +2 -2
@@ -1,6 +1,6 @@
|
|
1
|
-
import{a as k}from"./chunk.CBQWVOOS.js";import{a as T}from"./chunk.EUGX6XW6.js";import{a as L}from"./chunk.SWUGEKNC.js";import{c as M}from"./chunk.RQYP7MH5.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as $}from"./chunk.26YUWEYR.js";import{a as n}from"./chunk.DCOFYPWX.js";import{a as E,b as g,c as f,d as v,e as A,h as P}from"./chunk.GQU4LYQ6.js";import{b as x,e as b}from"./chunk.IRWHG2Q4.js";import{e as o}from"./chunk.TJOCV4DC.js";function _(h,d,e){let i=t=>Object.is(t,-0)?0:t;return h<d?i(d):h>e?i(e):i(h)}function*C(h,d){if(h!==void 0){let e=0;for(let i of h)yield d(i,e++)}}function*I(h,d,e=1){let i=d===void 0?0:h;d!=null||(d=h);for(let t=i;e>0?t<d:d<t;t+=e)yield t}var r=class extends P{constructor(){super(...arguments);this.variant="number";this.inverted=!1;this.loop=!1;this.autoplay=!1;this.slidesPerPage=1;this.slidesPerMove=1;this.activeSlide=0;this.currentPage=1;this.pausedAutoplay=!1;this.autoplayController=new k(this,()=>this.next());this.scrollController=new T(this);this.slides=this.getElementsByTagName("sd-4-0-
|
1
|
+
import{a as k}from"./chunk.CBQWVOOS.js";import{a as T}from"./chunk.EUGX6XW6.js";import{a as L}from"./chunk.SWUGEKNC.js";import{c as M}from"./chunk.RQYP7MH5.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as $}from"./chunk.26YUWEYR.js";import{a as n}from"./chunk.DCOFYPWX.js";import{a as E,b as g,c as f,d as v,e as A,h as P}from"./chunk.GQU4LYQ6.js";import{b as x,e as b}from"./chunk.IRWHG2Q4.js";import{e as o}from"./chunk.TJOCV4DC.js";function _(h,d,e){let i=t=>Object.is(t,-0)?0:t;return h<d?i(d):h>e?i(e):i(h)}function*C(h,d){if(h!==void 0){let e=0;for(let i of h)yield d(i,e++)}}function*I(h,d,e=1){let i=d===void 0?0:h;d!=null||(d=h);for(let t=i;e>0?t<d:d<t;t+=e)yield t}var r=class extends P{constructor(){super(...arguments);this.variant="number";this.inverted=!1;this.loop=!1;this.autoplay=!1;this.slidesPerPage=1;this.slidesPerMove=1;this.activeSlide=0;this.currentPage=1;this.pausedAutoplay=!1;this.autoplayController=new k(this,()=>this.next());this.scrollController=new T(this);this.slides=this.getElementsByTagName("sd-4-0-9-carousel-item");this.intersectionObserverEntries=new Map;this.localize=new $(this);this.userInteracted=!1;this.handleUserInteraction=()=>{this.userInteracted=!0};this.handleSlotChange=e=>{e.some(t=>[...t.addedNodes,...t.removedNodes].some(s=>L.isCarouselItem(s)&&!s.hasAttribute("data-clone")))&&this.initializeSlides(),this.requestUpdate()};this.unblockAutoplay=(e,i)=>{e.detail&&i.blur()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-label",this.localize.term("carousel")),["click","keydown"].forEach(i=>this.addEventListener(i,this.handleUserInteraction));let e=new IntersectionObserver(i=>{i.forEach(t=>{this.intersectionObserverEntries.set(t.target,t);let s=t.target;s.toggleAttribute("inert",!t.isIntersecting),s.classList.toggle("--in-view",t.isIntersecting),s.setAttribute("aria-hidden",t.isIntersecting?"false":"true")})},{root:this,threshold:.6});this.intersectionObserver=e,e.takeRecords().forEach(i=>{this.intersectionObserverEntries.set(i.target,i)})}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.mutationObserver.disconnect(),["click","keydown"].forEach(e=>this.removeEventListener(e,this.handleUserInteraction))}firstUpdated(){this.initializeSlides(),this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!1})}getPageCount(e,i,t){return Math.ceil((e-i)/t)+1>0?Math.ceil((e-i)/t)+1:1}getCurrentPage(e,i,t,s){return Math.ceil((e-t)/s)-Math.ceil((e-t-i)/s)+1}getSlides({excludeClones:e=!0}={}){return[...this.slides].filter(i=>!e||!i.hasAttribute("data-clone"))}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){let i=e.target,t=this.localize.dir()==="rtl",s=i.closest('[part~="pagination-item"]')!==null,l=e.key==="ArrowDown"||!t&&e.key==="ArrowRight"||t&&e.key==="ArrowLeft",c=e.key==="ArrowUp"||!t&&e.key==="ArrowLeft"||t&&e.key==="ArrowRight";e.preventDefault(),c&&this.previous(),l&&this.next(),e.key==="Home"&&this.goToSlide(0),e.key==="End"&&this.goToSlide(this.getSlides().length-1),s&&this.updateComplete.then(()=>{var a;let u=(a=this.shadowRoot)==null?void 0:a.querySelector('[part~="pagination-item--active"]');u&&u.focus()})}}handleScrollEnd(){let e=this.getSlides(),t=[...this.intersectionObserverEntries.values()].find(s=>s.isIntersecting);if(this.loop&&(t!=null&&t.target.hasAttribute("data-clone"))){let s=Number(t.target.getAttribute("data-clone"));this.goToSlide(s,"auto");return}t&&(this.activeSlide=e.indexOf(t.target))}pause(){this.pausedAutoplay=!0}resume(){this.pausedAutoplay=!1}handlePausedAutoplay(){var e,i;this.pausedAutoplay?(this.autoplayController.stop(),(e=this.autoplayControls)==null||e.setAttribute("aria-pressed","false")):this.autoplay&&(this.autoplayController.start(3e3),(i=this.autoplayControls)==null||i.setAttribute("aria-pressed","true"))}initializeSlides(){let e=this.getSlides(),i=this.intersectionObserver;if(this.intersectionObserverEntries.clear(),this.getSlides({excludeClones:!1}).forEach((t,s)=>{i.unobserve(t),t.classList.remove("--in-view"),t.classList.remove("--is-active"),t.setAttribute("aria-label",this.localize.term("slideNum",s+1,e.length)),t.hasAttribute("data-clone")&&t.remove()}),this.loop){let t=this.slidesPerPage,s=e.slice(-t),l=e.slice(0,t);s.reverse().forEach((c,u)=>{let a=c.cloneNode(!0);a.setAttribute("data-clone",String(e.length-u-1)),this.prepend(a)}),l.forEach((c,u)=>{let a=c.cloneNode(!0);a.setAttribute("data-clone",String(u)),this.append(a)})}this.getSlides({excludeClones:!1}).forEach(t=>{i.observe(t)}),this.goToSlide(this.activeSlide,"auto")}handleSlideChange(){let e=this.getSlides();e.forEach((s,l)=>{s.classList.toggle("--is-active",l===this.activeSlide)});let i=this.getCurrentPage(e.length,this.activeSlide,this.slidesPerPage,this.slidesPerMove);this.currentPage!==i&&(this.currentPage=i),this.hasUpdated&&this.emit("sd-slide-change",{detail:{index:this.activeSlide,slide:e[this.activeSlide]}});let t=this.getPageCount(e.length,this.slidesPerPage,this.slidesPerMove);this.currentPage>t&&requestAnimationFrame(()=>{this.nextTillFirst()})}handleSlidesPerMoveChange(){let e=this.getSlides({excludeClones:!1}),i=this.slidesPerMove;e.forEach((t,s)=>{Math.abs(s-i)%i===0?t.style.removeProperty("scroll-snap-align"):t.style.setProperty("scroll-snap-align","none")})}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&!this.pausedAutoplay&&this.autoplayController.start(3e3)}previous(e="smooth"){let i=this.activeSlide||this.activeSlide-this.slidesPerMove,t=!1;for(;!t&&i>0;)i-=1,t=Math.abs(i-this.slidesPerMove)%this.slidesPerMove===0;this.currentPage-1===0&&this.loop?this.goToSlide(this.activeSlide-this.slidesPerPage,e):this.goToSlide(i,e)}next(e="smooth"){this.currentPage+1<=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove)?this.goToSlide(this.activeSlide+this.slidesPerMove,e):this.loop&&this.nextTillFirst(e)}nextTillFirst(e="smooth"){for(;this.activeSlide!==0;)this.goToSlide(this.activeSlide+1,e);this.currentPage=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove)}goToSlide(e,i="smooth"){let{slidesPerPage:t,loop:s,scrollContainer:l}=this,c=this.getSlides(),u=this.getSlides({excludeClones:!1}),a=(e+c.length)%c.length;this.activeSlide=a;let p=_(e+(s?t:0),0,u.length+1),y=u[p],w=l.getBoundingClientRect(),S=y.getBoundingClientRect();if(l.scrollTo({left:S.left-w.left+l.scrollLeft,top:S.top-w.top+l.scrollTop,behavior:M()?"auto":i}),this.userInteracted&&!this.loop){let O=this.activeSlide===c.length-1||this.activeSlide===this.slides.length-this.slidesPerPage,B=this.activeSlide===0;O?this.previousButton.focus({preventScroll:!0}):B&&this.nextButton.focus({preventScroll:!0})}}render(){let{scrollController:e,slidesPerMove:i}=this,t=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove),s=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove),l=this.loop||s>1,c=this.loop||s<t,u=this.localize.dir()==="ltr";return b`<div part="base" class="${n("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${n(`carousel__slides mb-6
|
2
2
|
grid max-h-full w-full items-center justify-items-center overflow-auto`,this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",`overscroll-x-contain grid-flow-col auto-rows-[100%]
|
3
|
-
snap-x snap-mandatory overflow-y-hidden`)}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" role="status" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${n("w-full flex items-center justify-center relative")}"><div part="navigation" class="${n("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!l}" class="${n("!mr-6 !rounded-sm sd-interactive",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-4-0-
|
3
|
+
snap-x snap-mandatory overflow-y-hidden`)}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" role="status" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${n("w-full flex items-center justify-center relative")}"><div part="navigation" class="${n("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!l}" class="${n("!mr-6 !rounded-sm sd-interactive",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-4-0-9-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${u?"chevron-down":"chevron-up"}"></sd-4-0-9-icon></slot></button> ${this.variant==="dot"?b`<div part="pagination-dot" role="tablist" class="${n("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${C(I(t),a=>{let p=a+1===s;return b`<button part="pagination-item ${p?"pagination-item--active":""}" class="${n("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",p?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${p?"true":"false"}" aria-label="${this.localize.term("goToSlide",a+1,t)}" @click="${y=>{this.goToSlide(a*i),this.unblockAutoplay(y,this.paginationItems[a])}}" @keydown="${this.handleKeyDown}"><span class="${n("h-4 w-4 block border hover:border-primary-500 rounded-full",this.inverted?"border-white hover:border-primary-500":"border-primary",p&&"bg-accent border-none",p?this.inverted?"hover:bg-accent-300":"hover:bg-accent-550":"")}"></span></button>`})}</div>`:b`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${n("w-5 text-center border-b-2 border-accent",this.inverted?"text-white":"text-black")}">${s}</span> <span part="pagination-divider" class="${n("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${n("w-5 text-center",this.inverted?"text-white":"text-black")}">${t}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!c}" class="${n("!ml-6 !rounded-sm sd-interactive ",!c&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${c?"false":"true"}" @click="${c?a=>{this.next(),this.unblockAutoplay(a,this.nextButton)}:null}"><slot name="next-icon"><sd-4-0-9-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${u?"chevron-up":"chevron-down"}"></sd-4-0-9-icon></slot></button></div><button class="${n("ml-6 !rounded-sm","!absolute !right-0 sd-interactive",this.inverted?"sd-interactive--inverted":"sd-interactive--reset",!this.autoplay&&"!hidden")}" part="autoplay-controls" aria-label="${this.localize.term("autoplay")}" aria-pressed="true" @click="${a=>{this.pausedAutoplay=!this.pausedAutoplay,a.detail&&this.autoplayControls.blur()}}"><slot name="autoplay-start" class="${n(this.pausedAutoplay?"":"hidden")}"><sd-4-0-9-icon class="h-6 w-6 grid place-items-center" library="system" name="start"></sd-4-0-9-icon></slot><slot name="autoplay-pause" class="${n(this.pausedAutoplay?"hidden":"")}"><sd-4-0-9-icon class="h-6 w-6 grid place-items-center" library="system" name="pause"></sd-4-0-9-icon></slot></button></div></div>`}};r.styles=[...P.styles,x`:host{--slide-gap:var(--sl-spacing-medium,1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:". slides ." ". pagination ."}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1)*var(--slide-gap))/var(--slides-per-page));-moz-column-gap:var(--slide-gap);column-gap:var(--slide-gap);grid-auto-columns:var(--slide-size);padding-inline:var(--scroll-hint);scroll-padding-inline:var(--scroll-hint)}.carousel__slides::-webkit-scrollbar{display:none}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__navigation{grid-area:navigation}sd-4-0-9-button::part(label){align-items:center;display:flex;flex:1 1 auto;pointer-events:none}`],o([v('[part~="autoplay-controls"]')],r.prototype,"autoplayControls",2),o([v('[part~="navigation-button--previous"]')],r.prototype,"previousButton",2),o([v('[part~="navigation-button--next"]')],r.prototype,"nextButton",2),o([A('[part~="pagination-item"]')],r.prototype,"paginationItems",2),o([g({type:String,reflect:!0})],r.prototype,"variant",2),o([g({type:Boolean,reflect:!0})],r.prototype,"inverted",2),o([g({type:Boolean,reflect:!0})],r.prototype,"loop",2),o([g({type:Boolean,reflect:!0})],r.prototype,"autoplay",2),o([g({type:Number,attribute:"slides-per-page"})],r.prototype,"slidesPerPage",2),o([g({type:Number,attribute:"slides-per-move"})],r.prototype,"slidesPerMove",2),o([v("slot:not([name])")],r.prototype,"defaultSlot",2),o([v(".carousel__slides")],r.prototype,"scrollContainer",2),o([v(".carousel__pagination")],r.prototype,"paginationContainer",2),o([f()],r.prototype,"activeSlide",2),o([f()],r.prototype,"currentPage",2),o([f()],r.prototype,"pausedAutoplay",2),o([m("pausedAutoplay")],r.prototype,"handlePausedAutoplay",1),o([m("loop",{waitUntilFirstUpdate:!0}),m("slidesPerPage",{waitUntilFirstUpdate:!0})],r.prototype,"initializeSlides",1),o([m("activeSlide")],r.prototype,"handleSlideChange",1),o([m("slidesPerMove")],r.prototype,"handleSlidesPerMoveChange",1),o([m("autoplay")],r.prototype,"handleAutoplayChange",1),r=o([E("sd-4-0-9-carousel")],r);export{r as a};
|
4
4
|
/*! Bundled license information:
|
5
5
|
|
6
6
|
lit-html/directives/map.js:
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import{b as d}from"./chunk.5CK64GWQ.js";import{a as f}from"./chunk.D7TMPF3D.js";import{b as m}from"./chunk.65NSSTJE.js";import{a as p}from"./chunk.HE2LNCWW.js";import{a as n}from"./chunk.E2DRD2OX.js";import{a as s}from"./chunk.DCOFYPWX.js";import{a as c,b as r,c as u,d as a,h as o}from"./chunk.GQU4LYQ6.js";import{b as h,e as l}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.formControlController=new m(this,{value:i=>i.checked?i.value||"on":void 0,defaultValue:i=>i.defaultChecked,setValue:(i,b)=>i.checked=b});this.title="";this.name="";this.size="lg";this.disabled=!1;this.checked=!1;this.indeterminate=!1;this.defaultChecked=!1;this.form="";this.required=!1;this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(i){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(i),this.invalidMessage.textContent=i.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(i){this.input.focus(i)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(i){this.input.setCustomValidity(i),this.formControlController.updateValidity()}render(){let i=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return l`<label part="base" class="${s("sd-4-0-
|
1
|
+
import{b as d}from"./chunk.5CK64GWQ.js";import{a as f}from"./chunk.D7TMPF3D.js";import{b as m}from"./chunk.65NSSTJE.js";import{a as p}from"./chunk.HE2LNCWW.js";import{a as n}from"./chunk.E2DRD2OX.js";import{a as s}from"./chunk.DCOFYPWX.js";import{a as c,b as r,c as u,d as a,h as o}from"./chunk.GQU4LYQ6.js";import{b as h,e as l}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.formControlController=new m(this,{value:i=>i.checked?i.value||"on":void 0,defaultValue:i=>i.defaultChecked,setValue:(i,b)=>i.checked=b});this.title="";this.name="";this.size="lg";this.disabled=!1;this.checked=!1;this.indeterminate=!1;this.defaultChecked=!1;this.form="";this.required=!1;this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(i){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(i),this.invalidMessage.textContent=i.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(i){this.input.focus(i)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(i){this.input.setCustomValidity(i),this.formControlController.updateValidity()}render(){let i=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return l`<label part="base" class="${s("sd-4-0-9-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${p(this.value)}" .indeterminate="${d(this.indeterminate)}" .checked="${d(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" aria-describedby="invalid-message" aria-invalid="${this.showInvalidStyle}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"} ${this.indeterminate?" control--indeterminate":""}" class="${s(`relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4
|
2
2
|
peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2
|
3
|
-
peer-focus-visible:outline-primary`,{sm:"mt-[2px]",md:"mt-[3px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[i])}">${this.checked?l`<sd-4-0-
|
3
|
+
peer-focus-visible:outline-primary`,{sm:"mt-[2px]",md:"mt-[3px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[i])}">${this.checked?l`<sd-4-0-9-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-check"></sd-4-0-9-icon>`:""} ${!this.checked&&this.indeterminate?l`<sd-4-0-9-icon part="indeterminate-icon" class="text-white w-3 h-3" library="system" name="status-minus"></sd-4-0-9-icon>`:""} </span><span part="label" id="label" class="${s("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};e.styles=[...o.styles,h`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline-width:0}:host([required]) #label:after{content:" *"}`],t([a('input[type="checkbox"]')],e.prototype,"input",2),t([a("#invalid-message")],e.prototype,"invalidMessage",2),t([r()],e.prototype,"title",2),t([r()],e.prototype,"name",2),t([r()],e.prototype,"value",2),t([r({reflect:!0})],e.prototype,"size",2),t([r({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([r({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([r({type:Boolean,reflect:!0})],e.prototype,"indeterminate",2),t([f("checked")],e.prototype,"defaultChecked",2),t([r({reflect:!0})],e.prototype,"form",2),t([r({type:Boolean,reflect:!0})],e.prototype,"required",2),t([u()],e.prototype,"showInvalidStyle",2),t([n("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),t([n(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],e.prototype,"handleStateChange",1),e=t([c("sd-4-0-9-checkbox")],e);export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a}from"./chunk.HE2LNCWW.js";import{a as n,b as s}from"./chunk.5ZILM4TA.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as i}from"./chunk.DCOFYPWX.js";import{a as u,b as r,h as o}from"./chunk.GQU4LYQ6.js";import{b as d}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.size="lg";this.orientation="horizontal";this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1)}handleDisabledChange(){this.disabled&&(this.current=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1)}render(){let c=this.isLink(),h=this.notInteractive?n`div`:c?n`a`:n`button`;return s`<div role="listitem" part="base" class="${i("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-min overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${i("flex shrink-0 gap-2",this.noTail&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",this.orientation==="horizontal"?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3")}"><${h} part="circle" href="${a(c?this.href:void 0)}" aria-disabled="${a(this.disabled||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${a("label")}" aria-describedby="${a("description")}" class="${i("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":"focus-visible:focus-outline group-hover:cursor-pointer",this.notInteractive?this.size==="lg"?"w-[72px]":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&"border-primary group-hover:bg-primary-100 group-hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white")}"><slot name="circle-content" class="${i(!this.disabled&&!this.current&&!this.notInteractive&&"text-primary group-hover:text-primary-500 group-hover:fill-primary-500",this.notInteractive&&"text-primary",this.size==="lg"?"text-lg":"text-sm")}">${!this.disabled&&!this.current&&!this.notInteractive?s`<sd-4-0-
|
1
|
+
import{a}from"./chunk.HE2LNCWW.js";import{a as n,b as s}from"./chunk.5ZILM4TA.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as i}from"./chunk.DCOFYPWX.js";import{a as u,b as r,h as o}from"./chunk.GQU4LYQ6.js";import{b as d}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.size="lg";this.orientation="horizontal";this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1)}handleDisabledChange(){this.disabled&&(this.current=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1)}render(){let c=this.isLink(),h=this.notInteractive?n`div`:c?n`a`:n`button`;return s`<div role="listitem" part="base" class="${i("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-min overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${i("flex shrink-0 gap-2",this.noTail&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",this.orientation==="horizontal"?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3")}"><${h} part="circle" href="${a(c?this.href:void 0)}" aria-disabled="${a(this.disabled||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${a("label")}" aria-describedby="${a("description")}" class="${i("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":"focus-visible:focus-outline group-hover:cursor-pointer",this.notInteractive?this.size==="lg"?"w-[72px]":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&"border-primary group-hover:bg-primary-100 group-hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white")}"><slot name="circle-content" class="${i(!this.disabled&&!this.current&&!this.notInteractive&&"text-primary group-hover:text-primary-500 group-hover:fill-primary-500",this.notInteractive&&"text-primary",this.size==="lg"?"text-lg":"text-sm")}">${!this.disabled&&!this.current&&!this.notInteractive?s`<sd-4-0-9-icon name="status-check" library="system"></sd-4-0-9-icon>`:s`${this.index}`}</slot></${h}>${this.noTail?"":s`<div part="tail" class="${i(this.orientation==="horizontal"?"border-t w-full my-auto mr-2":"border-l flex-grow flex-shrink-0 basis-auto h-full w-[1px] mx-auto",!this.disabled&&!this.current&&!this.notInteractive?" border-primary group-hover:border-primary-500":"border-neutral-400")}"></div>`}</div><div part="text-container" class="${i("mt-4 break-words flex flex-col gap-2",this.orientation==="horizontal"?"text-center w-40":"w-max text-left",this.disabled&&"!text-neutral-700",this.notInteractive?"ml-3":"mr-4")}"><div part="label" id="label" class="${i("!font-bold sd-paragraph",this.disabled&&"!text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive?"!text-primary group-hover:!text-primary-500 group-hover:cursor-pointer":"text-black")}"><slot name="label">${this.label}</slot></div><div part="description" id="description" class="${i("sd-paragraph sd-paragraph--size-sm",this.disabled&&"!text-neutral-700")}">${this.description||s`<slot></slot>`}</div></div></div>`}};t.styles=[...o.styles,d`:host{flex:1 1 0%}:host([no-tail]){flex-grow:0}.translateLg{transform:translateX(55px)}.translateSm{transform:translateX(64px)}`],e([r({reflect:!0})],t.prototype,"size",2),e([r({reflect:!0})],t.prototype,"orientation",2),e([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([r({type:Boolean,reflect:!0})],t.prototype,"current",2),e([r({reflect:!0,type:Boolean,attribute:"no-tail"})],t.prototype,"noTail",2),e([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),e([r()],t.prototype,"label",2),e([r()],t.prototype,"description",2),e([r({type:Number,reflect:!0,attribute:"index"})],t.prototype,"index",2),e([r()],t.prototype,"href",2),e([l("current")],t.prototype,"handleCurrentChange",1),e([l("disabled")],t.prototype,"handleDisabledChange",1),e([l("notInteractive")],t.prototype,"handleInteractivityChange",1),t=e([u("sd-4-0-9-step")],t);export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as p,c as m}from"./chunk.A3DKF5BY.js";import{b as w}from"./chunk.5ZILM4TA.js";import{a as h,d,e as c}from"./chunk.RQYP7MH5.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as g}from"./chunk.26YUWEYR.js";import{a as o}from"./chunk.DCOFYPWX.js";import{a as y,b as n,d as a,h as l}from"./chunk.GQU4LYQ6.js";import{b as f}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends l{constructor(){super(...arguments);this.localize=new g(this);this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this.open&&(this.accordion.open=!0),this.accordionObserver=new MutationObserver(e=>{for(let s of e)s.type==="attributes"&&s.attributeName==="open"&&(this.accordion.open?this.show():this.hide())}),this.accordionObserver.observe(this.accordion,{attributes:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.accordionObserver)==null||e.disconnect()}handleSummaryClick(e){e.preventDefault(),this.open?this.hide():this.show()}handleSummaryKeyDown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.open?this.hide():this.show()),(e.key==="ArrowUp"||e.key==="ArrowLeft")&&(e.preventDefault(),this.hide()),(e.key==="ArrowDown"||e.key==="ArrowRight")&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.accordion.open=!0,this.emit("sd-show",{cancelable:!0}).defaultPrevented){this.open=!1,this.accordion.open=!1;return}await d(this.body),this.body.hidden=!1;let{keyframes:s,options:r}=m(this,"accordion.show",{dir:this.localize.dir()});await h(this.body,c(s,this.body.scrollHeight),r),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented){this.accordion.open=!0,this.open=!0;return}await d(this.body);let{keyframes:s,options:r}=m(this,"accordion.hide",{dir:this.localize.dir()});await h(this.body,c(s,this.body.scrollHeight),r),this.body.hidden=!0,this.body.style.height="auto",this.accordion.open=!1,this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}render(){return w`<details part="base" class="border-y border-neutral-400"><summary part="header" id="header" class="${o("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary hover:bg-neutral-200 relative group")}" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${o(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-all h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${o("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${o(this.open&&"hidden")}"><sd-4-0-
|
1
|
+
import{a as p,c as m}from"./chunk.A3DKF5BY.js";import{b as w}from"./chunk.5ZILM4TA.js";import{a as h,d,e as c}from"./chunk.RQYP7MH5.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as g}from"./chunk.26YUWEYR.js";import{a as o}from"./chunk.DCOFYPWX.js";import{a as y,b as n,d as a,h as l}from"./chunk.GQU4LYQ6.js";import{b as f}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends l{constructor(){super(...arguments);this.localize=new g(this);this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this.open&&(this.accordion.open=!0),this.accordionObserver=new MutationObserver(e=>{for(let s of e)s.type==="attributes"&&s.attributeName==="open"&&(this.accordion.open?this.show():this.hide())}),this.accordionObserver.observe(this.accordion,{attributes:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.accordionObserver)==null||e.disconnect()}handleSummaryClick(e){e.preventDefault(),this.open?this.hide():this.show()}handleSummaryKeyDown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.open?this.hide():this.show()),(e.key==="ArrowUp"||e.key==="ArrowLeft")&&(e.preventDefault(),this.hide()),(e.key==="ArrowDown"||e.key==="ArrowRight")&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.accordion.open=!0,this.emit("sd-show",{cancelable:!0}).defaultPrevented){this.open=!1,this.accordion.open=!1;return}await d(this.body),this.body.hidden=!1;let{keyframes:s,options:r}=m(this,"accordion.show",{dir:this.localize.dir()});await h(this.body,c(s,this.body.scrollHeight),r),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented){this.accordion.open=!0,this.open=!0;return}await d(this.body);let{keyframes:s,options:r}=m(this,"accordion.hide",{dir:this.localize.dir()});await h(this.body,c(s,this.body.scrollHeight),r),this.body.hidden=!0,this.body.style.height="auto",this.accordion.open=!1,this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}render(){return w`<details part="base" class="border-y border-neutral-400"><summary part="header" id="header" class="${o("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary hover:bg-neutral-200 relative group")}" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${o(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-all h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${o("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${o(this.open&&"hidden")}"><sd-4-0-9-icon library="system" name="chevron-down"></sd-4-0-9-icon></slot><slot name="collapse-icon" class="${o(!this.open&&"hidden")}"><sd-4-0-9-icon library="system" name="chevron-down"></sd-4-0-9-icon></slot></span></summary><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></details>`}};t.styles=[...l.styles,f`:host{display:block}`],i([a('[part="base"]')],t.prototype,"accordion",2),i([a('[part="header"]')],t.prototype,"header",2),i([a('[part="content"]')],t.prototype,"body",2),i([n({type:Boolean,reflect:!0})],t.prototype,"open",2),i([n()],t.prototype,"summary",2),i([b("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),t=i([y("sd-4-0-9-accordion")],t);p("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}});p("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{t as a};
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import{a as F}from"./chunk.GX6NOXTL.js";import{a as z}from"./chunk.DUM4IQT6.js";import{a as M}from"./chunk.D7TMPF3D.js";import{c as A}from"./chunk.3L472FD4.js";import{b as L}from"./chunk.65NSSTJE.js";import{a as x,c as O}from"./chunk.A3DKF5BY.js";import{a as E,b as k}from"./chunk.LQZOBUFT.js";import{a as g,d as y}from"./chunk.RQYP7MH5.js";import{a as w}from"./chunk.KLRPP4NQ.js";import{a as f}from"./chunk.E2DRD2OX.js";import{a as D}from"./chunk.6HO6CE4A.js";import{a as I}from"./chunk.26YUWEYR.js";import{a as p}from"./chunk.DCOFYPWX.js";import{a as T,b as n,c as u,d as m,g as $,h as v}from"./chunk.GQU4LYQ6.js";import{b as C,e as d}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var s=class extends v{constructor(){super(...arguments);this.formControlController=new L(this,{assumeInteractionOn:["sd-blur","sd-4-0-
|
1
|
+
import{a as F}from"./chunk.GX6NOXTL.js";import{a as z}from"./chunk.DUM4IQT6.js";import{a as M}from"./chunk.D7TMPF3D.js";import{c as A}from"./chunk.3L472FD4.js";import{b as L}from"./chunk.65NSSTJE.js";import{a as x,c as O}from"./chunk.A3DKF5BY.js";import{a as E,b as k}from"./chunk.LQZOBUFT.js";import{a as g,d as y}from"./chunk.RQYP7MH5.js";import{a as w}from"./chunk.KLRPP4NQ.js";import{a as f}from"./chunk.E2DRD2OX.js";import{a as D}from"./chunk.6HO6CE4A.js";import{a as I}from"./chunk.26YUWEYR.js";import{a as p}from"./chunk.DCOFYPWX.js";import{a as T,b as n,c as u,d as m,g as $,h as v}from"./chunk.GQU4LYQ6.js";import{b as C,e as d}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var s=class extends v{constructor(){super(...arguments);this.formControlController=new L(this,{assumeInteractionOn:["sd-blur","sd-4-0-9-input"]});this.hasSlotController=new D(this,"help-text","label");this.localize=new I(this);this.typeToSelectString="";this.hasHover=!1;this.displayLabel="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=e=>d`<sd-4-0-9-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
2
2
|
base:tag__base,
|
3
3
|
content:tag__content,
|
4
4
|
removable-indicator:tag__removable-indicator,
|
5
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagKeyDown(t,e)}" @sd-remove="${t=>this.handleTagRemove(t,e)}">${e.getTextLabel()}</sd-4-0-
|
5
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagKeyDown(t,e)}" @sd-remove="${t=>this.handleTagRemove(t,e)}">${e.getTextLabel()}</sd-4-0-9-tag>`;this.handleDocumentFocusIn=e=>{let t=e.composedPath();this&&!t.includes(this)&&this.hide()};this.handleDocumentKeyDown=e=>{let t=e.target,l=t.closest(".select__clear")!==null,a=t.closest("sd-4-0-9-icon-button")!==null;if(!(l||a)){if(e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),e.key==="Enter"||e.key===" "&&this.typeToSelectString===""){if(e.preventDefault(),e.stopImmediatePropagation(),!this.open){this.show();return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let h=this.getAllOptions(),o=h.indexOf(this.currentOption),r=Math.max(0,o);if(e.preventDefault(),!this.open&&(this.show(),this.currentOption))return;e.key==="ArrowDown"?(r=o+1,r>h.length-1&&(r=0)):e.key==="ArrowUp"?(r=o-1,r<0&&(r=h.length-1)):e.key==="Home"?r=0:e.key==="End"&&(r=h.length-1),this.setCurrentOption(h[r])}if(e.key.length===1||e.key==="Backspace"){let h=this.getAllOptions();if(e.metaKey||e.ctrlKey||e.altKey)return;if(!this.open){if(e.key==="Backspace")return;this.show()}e.stopPropagation(),e.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),e.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=e.key.toLowerCase();for(let o of h)if(o.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(o);break}}}};this.handleDocumentMouseDown=e=>{let t=e.composedPath();this&&!t.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(e,t){var l,a,h;if(e.key==="Backspace"&&this.multiple){e.preventDefault(),e.stopPropagation();let o=(l=e.currentTarget)==null?void 0:l.parentElement,r=(a=o==null?void 0:o.previousElementSibling)==null?void 0:a.querySelector("sd-4-0-9-tag"),c=(h=o==null?void 0:o.nextElementSibling)==null?void 0:h.querySelector("sd-4-0-9-tag");this.handleTagRemove(new CustomEvent("sd-remove"),t),this.updateComplete.then(()=>{c?c.focus():r?r.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(e){e.key==="Backspace"&&this.multiple&&(e.preventDefault(),e.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var l;let t=(l=this.shadowRoot)==null?void 0:l.querySelectorAll("sd-4-0-9-tag");t&&t.length>0?t==null||t[(t==null?void 0:t.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(e){let l=e.composedPath().some(a=>a instanceof HTMLSlotElement&&a.name==="removable-indicator");this.disabled||l||(e.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(e){e.stopPropagation(),this.handleDocumentKeyDown(e)}handleClearClick(e){e.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(e){e.stopPropagation(),e.preventDefault()}handleOptionClick(e){let l=e.target.closest("sd-4-0-9-option"),a=this.value;l&&!l.disabled&&(this.multiple?this.toggleOptionSelection(l):this.setSelectedOptions(l),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.value!==a&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){let e=this.getAllOptions(),t=Array.isArray(this.value)?this.value:[this.value],l=[];customElements.get("sd-4-0-9-option")?(e.forEach(a=>{this.multiple&&(a.checkbox=!0),l.push(a.value)}),this.setSelectedOptions(e.filter(a=>t.includes(a.value)))):customElements.whenDefined("sd-4-0-9-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(e,t){e.stopPropagation(),t||this.clearSelect(),t&&!this.disabled&&(this.toggleOptionSelection(t,!1),this.deletedTagLabel=this.localize.term("removed",t.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-4-0-9-option")]}getFirstOption(){return this.querySelector("sd-4-0-9-option")}setCurrentOption(e){this.getAllOptions().forEach(l=>{l.current=!1,l.tabIndex=-1}),e&&(this.currentOption=e,e.current=!0,e.tabIndex=0,e.focus())}setSelectedOptions(e){let t=this.getAllOptions(),l=Array.isArray(e)?e:[e];t.forEach(a=>a.selected=!1),l.length&&l.forEach(a=>a.selected=!0),Array.isArray(e)?this.selectionChanged():this.selectionChanged(e)}toggleOptionSelection(e,t){t===!0||t===!1?e.selected=t:e.selected=!e.selected,Array.isArray(e)?this.selectionChanged():this.selectionChanged(e)}selectionChanged(e){var t,l,a,h;e&&this.multiple?this.selectedOptions.find(o=>o.value===e.value)?this.selectedOptions=this.selectedOptions.filter(o=>o.value!==e.value):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=this.getAllOptions().filter(o=>o.selected),this.multiple?(this.value=this.selectedOptions.map(o=>o.value),this.useTags||this.value.length===0?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(l=(t=this.selectedOptions[0])==null?void 0:t.value)!=null?l:"",this.displayLabel=(h=(a=this.selectedOptions[0])==null?void 0:a.getTextLabel())!=null?h:""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((e,t)=>{if(t<this.maxOptionsVisible||this.maxOptionsVisible<=0){let l=this.getTag(e,t);return d`<div @sd-remove="${a=>this.handleTagRemove(a,e)}">${typeof l=="string"?E(l):l}</div>`}return[d``]}):[d`<sd-4-0-9-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
6
6
|
base:tag__base,
|
7
7
|
content:tag__content,
|
8
8
|
removable-indicator:tag__removable-indicator,
|
9
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagMaxOptionsKeyDown(e)}" @sd-remove="${e=>this.handleTagRemove(e)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-4-0-
|
9
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagMaxOptionsKeyDown(e)}" @sd-remove="${e=>this.handleTagRemove(e)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-4-0-9-tag>`]}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(e){let t=e.detail;t&&(this.currentPlacement=t)}handleUseTagsChange(){let e=this.getAllOptions();customElements.get("sd-4-0-9-option")&&e.forEach(t=>{t.checkbox=this.multiple})}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.multiple||this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:e,options:t}=O(this,"select.show",{dir:this.localize.dir()});await g(this.popup.popup,e,t),this.currentOption&&A(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:e,options:t}=O(this,"select.hide",{dir:this.localize.dir()});await g(this.popup.popup,e,t),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(e=>{e.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let e=this.getAllOptions(),t=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(e.filter(l=>t.includes(l.value)))}async show(){if(this.open||this.disabled){this.open=!1;return}return this.open=!0,w(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,w(this,"sd-after-hide")}checkValidity(){var e;return(e=this.valueInput)==null?void 0:e.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(e){this.valueInput.setCustomValidity(e),this.formControlController.updateValidity()}focus(e){this.displayInput.focus(e)}blur(){this.displayInput.blur()}render(){let e={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text")},t=this.label?!0:!!e.label,l=this.helpText?!0:!!e.helpText,a=this.clearable&&!this.disabled,h=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",o=this.disabled?"cursor-not-allowed":"cursor-pointer",r={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],c={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return d`<div part="form-control" class="${p("relative text-left",o,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" role="alert" aria-live="assertive">${this.deletedTagLabel}</span><div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${t&&"inline-block"}" aria-hidden="${t?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${p("relative w-full bg-white",h==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${p("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[h],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-4-0-9-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${p("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
10
10
|
popup:popup__content,
|
11
|
-
"><div part="combobox" class="${p("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${p("appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",o,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?d`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(b=>b==null?void 0:b.getTextLabel()).join(", ")}</div><input class="${p("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",o)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${a?d`<button part="clear-button" class="${p("select__clear flex justify-center",r,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-4-0-
|
11
|
+
"><div part="combobox" class="${p("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${p("appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",o,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?d`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(b=>b==null?void 0:b.getTextLabel()).join(", ")}</div><input class="${p("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",o)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${a?d`<button part="clear-button" class="${p("select__clear flex justify-center",r,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-4-0-9-icon class="${p("text-icon-fill-neutral-800",c)}" library="system" name="closing-round"></sd-4-0-9-icon></slot></button>`:""} ${this.showInvalidStyle?d`<sd-4-0-9-icon part="invalid-icon" class="${p(r,c,"text-error")}" library="system" name="risk"></sd-4-0-9-icon>`:""} ${this.styleOnValid&&this.showValidStyle?d`<sd-4-0-9-icon part="valid-icon" class="${p("flex-shrink-0 text-success",r,c)}" library="system" name="status-check"></sd-4-0-9-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${p("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",this.disabled?"text-neutral-500":"text-primary",c)}"><sd-4-0-9-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-4-0-9-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${p("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-4-0-9-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${l?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};s.dependencies={"sd-4-0-9-icon":k,"sd-4-0-9-popup":z,"sd-4-0-9-tag":F},s.styles=[...v.styles,C`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-4-0-9-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-4-0-9-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-4-0-9-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-4-0-9-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-4-0-9-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}`],i([$({selector:"sd-4-0-9-option"})],s.prototype,"_optionsInDefaultSlot",2),i([m("sd-4-0-9-popup")],s.prototype,"popup",2),i([m('[part="combobox"]')],s.prototype,"combobox",2),i([m('[part="display-input"]')],s.prototype,"displayInput",2),i([m(".value-input")],s.prototype,"valueInput",2),i([m('[part="listbox"]')],s.prototype,"listbox",2),i([m("#invalid-message")],s.prototype,"invalidMessage",2),i([u()],s.prototype,"hasHover",2),i([u()],s.prototype,"displayLabel",2),i([u()],s.prototype,"deletedTagLabel",2),i([u()],s.prototype,"hasFocus",2),i([u()],s.prototype,"currentOption",2),i([u()],s.prototype,"selectedOptions",2),i([u()],s.prototype,"showValidStyle",2),i([u()],s.prototype,"showInvalidStyle",2),i([M()],s.prototype,"defaultValue",2),i([n({type:Boolean,reflect:!0})],s.prototype,"open",2),i([n({reflect:!0})],s.prototype,"size",2),i([n({reflect:!0})],s.prototype,"placement",2),i([n()],s.prototype,"label",2),i([n()],s.prototype,"placeholder",2),i([n({attribute:"max-options-tag-label"})],s.prototype,"maxOptionsTagLabel",2),i([n({type:Boolean,reflect:!0})],s.prototype,"disabled",2),i([n({attribute:"help-text"})],s.prototype,"helpText",2),i([u()],s.prototype,"currentPlacement",2),i([n({type:Boolean})],s.prototype,"clearable",2),i([n({type:Boolean,reflect:!0})],s.prototype,"multiple",2),i([n({type:Boolean,reflect:!0})],s.prototype,"useTags",2),i([n({attribute:"max-options-visible",type:Number})],s.prototype,"maxOptionsVisible",2),i([n({reflect:!0})],s.prototype,"form",2),i([n()],s.prototype,"name",2),i([n({converter:{fromAttribute:e=>e.split(" "),toAttribute:e=>e.join(" ")}})],s.prototype,"value",2),i([n({type:Boolean,reflect:!0})],s.prototype,"required",2),i([n({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),i([n({type:Boolean})],s.prototype,"hoist",2),i([n()],s.prototype,"getTag",2),i([f("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),i([f("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),i([f("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),i([f("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),i([f("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),s=i([T("sd-4-0-9-select")],s);x("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}});x("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{s as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a}from"./chunk.DCOFYPWX.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.GQU4LYQ6.js";import{b as l,e as t}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var r=class extends n{constructor(){super(...arguments);this.variant="primary";this.shapes=["top","middle","bottom"];this.componentBreakpoint=0}getSvg(e,s){return{0:this.smallSvg(s),414:this.mediumSvg(s),640:this.largeSvg(s)}[e]}largeSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setBreakpoint()),this.updateComplete.then(()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return t`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return t`<div class="${a({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="${a("z-10 relative",this.variant==="image"&&"invisible opacity-0")}" part="content"><slot>${this.variant==="image"?"":t`<div class="h-8"></div>`}</slot></div></div>`}renderBottomBrandshape(){return t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return t`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${a(this.variant!=="image"&&"hidden")}" name="image"></slot></div>`}renderShapes(){return t`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){let e=this.variant.startsWith("border-")||this.variant==="image";return t`<div class="${a({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${e?this.renderStylizedVariant():""} ${this.renderShapes()}</div>`}};r.styles=[...n.styles,l`:host{container-type:inline-size;display:block;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan)*var(--adjacent));--curve:calc((var(--opposite) - (var(--radius)/3))*0.5)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{border-radius:0 var(--radius);height:calc(100% - var(--curve)*2);left:var(--sd-spacing-0,0);margin-top:calc(var(--curve));position:absolute;top:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle)*-1))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:calc(100% + var(--curve)*2)!important;-o-object-fit:cover;object-fit:cover;position:absolute!important;transform:translateY(calc(var(--curve)*-1)) skewY(var(--angle));width:100%}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{height:100%;margin-top:0;transform:unset}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:100%!important;transform:unset}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary,0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white,#fff)}:host([variant^=border-]) [part=stylized-container]:before{border-color:var(--internal-border-color,#000);border-style:solid;border-width:2px;content:"";right:var(--sd-spacing-0,0)}`],i([v("[part=base]")],r.prototype,"containerElem",2),i([o({type:String})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-4-0-
|
1
|
+
import{a}from"./chunk.DCOFYPWX.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.GQU4LYQ6.js";import{b as l,e as t}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var r=class extends n{constructor(){super(...arguments);this.variant="primary";this.shapes=["top","middle","bottom"];this.componentBreakpoint=0}getSvg(e,s){return{0:this.smallSvg(s),414:this.mediumSvg(s),640:this.largeSvg(s)}[e]}largeSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setBreakpoint()),this.updateComplete.then(()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return t`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return t`<div class="${a({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="${a("z-10 relative",this.variant==="image"&&"invisible opacity-0")}" part="content"><slot>${this.variant==="image"?"":t`<div class="h-8"></div>`}</slot></div></div>`}renderBottomBrandshape(){return t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return t`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${a(this.variant!=="image"&&"hidden")}" name="image"></slot></div>`}renderShapes(){return t`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){let e=this.variant.startsWith("border-")||this.variant==="image";return t`<div class="${a({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${e?this.renderStylizedVariant():""} ${this.renderShapes()}</div>`}};r.styles=[...n.styles,l`:host{container-type:inline-size;display:block;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan)*var(--adjacent));--curve:calc((var(--opposite) - (var(--radius)/3))*0.5)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{border-radius:0 var(--radius);height:calc(100% - var(--curve)*2);left:var(--sd-spacing-0,0);margin-top:calc(var(--curve));position:absolute;top:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle)*-1))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:calc(100% + var(--curve)*2)!important;-o-object-fit:cover;object-fit:cover;position:absolute!important;transform:translateY(calc(var(--curve)*-1)) skewY(var(--angle));width:100%}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{height:100%;margin-top:0;transform:unset}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:100%!important;transform:unset}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary,0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white,#fff)}:host([variant^=border-]) [part=stylized-container]:before{border-color:var(--internal-border-color,#000);border-style:solid;border-width:2px;content:"";right:var(--sd-spacing-0,0)}`],i([v("[part=base]")],r.prototype,"containerElem",2),i([o({type:String})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-4-0-9-brandshape")],r);export{r as a};
|
@@ -1 +1 @@
|
|
1
|
-
function w(n,{setValueOnSelection:p,scrollSelectionIntoView:c}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){let r=n?typeof n=="string"?document.querySelector(n):n:document.querySelector("#autoComplete"),i=r.shadowRoot.querySelector("input"),l=o=>o[0];return i.addEventListener("init",()=>{var a,s;let o=(a=r.shadowRoot)==null?void 0:a.querySelector("ul");o==null||o.setAttribute("part","listbox");let t=document.createElement("sd-4-0-
|
1
|
+
function w(n,{setValueOnSelection:p,scrollSelectionIntoView:c}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){let r=n?typeof n=="string"?document.querySelector(n):n:document.querySelector("#autoComplete"),i=r.shadowRoot.querySelector("input"),l=o=>o[0];return i.addEventListener("init",()=>{var a,s;let o=(a=r.shadowRoot)==null?void 0:a.querySelector("ul");o==null||o.setAttribute("part","listbox");let t=document.createElement("sd-4-0-9-popup");t.appendChild(o),(s=r.shadowRoot)==null||s.appendChild(t),t==null||t.setAttribute("exportparts","popup__content"),t&&(t.active=!1,t.autoSize="vertical",t.autoSizePadding=16,t.placement="bottom-start",t.anchor=r,t.sync="width");let d=l`sd-4-0-9-popup::part(popup){border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-width:0 2px 2px;overflow-y:scroll;z-index:var(--sd-z-index-dropdown,900);--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-2,.5rem);--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-4-0-9-popup li{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}sd-4-0-9-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--tw-bg-opacity,1))}sd-4-0-9-popup li{list-style-type:""}sd-4-0-9-popup li mark{background-color:transparent;font-weight:700}sd-4-0-9-popup li:not(:has(sd-4-0-9-option)){cursor:pointer;font-size:var(--sd-font-size-base,1rem);padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-4,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity,1))}sd-4-0-9-popup li:not(:has(sd-4-0-9-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}sd-4-0-9-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}`,e=new CSSStyleSheet;e.replaceSync(d),r.shadowRoot.adoptedStyleSheets=[...r.shadowRoot.adoptedStyleSheets,e]}),p&&i.addEventListener("selection",o=>{var t;r.value=(t=o==null?void 0:o.detail)==null?void 0:t.selection.value}),i.addEventListener("open",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-4-0-9-popup"))==null||t.setAttribute("active","true"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.add("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.add("z-50")}),i.addEventListener("close",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-4-0-9-popup"))==null||t.removeAttribute("active"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.remove("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.remove("z-50")}),c&&i.addEventListener("navigate",()=>{let o=r.shadowRoot.querySelector('[aria-selected="true"]');o==null||o.scrollIntoView({block:"nearest"})}),{config:{selector:()=>i,resultsList:{tag:"ul"},wrapper:!1}}}export{w as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as i}from"./chunk.DCOFYPWX.js";import{a as l,b as r,h as s}from"./chunk.GQU4LYQ6.js";import{b as n,e as o}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends s{constructor(){super(...arguments);this.size="lg";this.variant="blue";this.inverted=!1}render(){return o`<span role="status" part="base" aria-labelledby="content" class="${i("inline-flex items-center justify-center gap-x-[1px] text-center font-bold whitespace-nowrap border rounded-full select-none cursor-[inherit]",{blue:this.inverted?"text-primary bg-primary-100 border-primary":"text-white bg-primary-500 border-white",green:this.inverted?"text-white bg-success border-primary":"text-white bg-success border-white",red:this.inverted?"text-white bg-error border-primary":"text-white bg-error border-white"}[this.variant],{sm:"h-2 min-w-2",md:"h-4 px-1 min-w-4",lg:"h-5 min-w-5"}[this.size])}"><span id="content" part="content" class="${i(this.size==="sm"&&"sr-only")}"><slot></slot></span></span>`}};e.styles=[...s.styles,n`:host{align-items:center;display:inline-flex;justify-content:center}:host([size=md]){font-size:.625rem}:host([size=lg]){font-size:.75rem}:host([size=lg])::part(base){padding-left:.313rem;padding-right:.313rem}`],t([r({reflect:!0})],e.prototype,"size",2),t([r({reflect:!0})],e.prototype,"variant",2),t([r({type:Boolean,reflect:!0})],e.prototype,"inverted",2),e=t([l("sd-4-0-
|
1
|
+
import{a as i}from"./chunk.DCOFYPWX.js";import{a as l,b as r,h as s}from"./chunk.GQU4LYQ6.js";import{b as n,e as o}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends s{constructor(){super(...arguments);this.size="lg";this.variant="blue";this.inverted=!1}render(){return o`<span role="status" part="base" aria-labelledby="content" class="${i("inline-flex items-center justify-center gap-x-[1px] text-center font-bold whitespace-nowrap border rounded-full select-none cursor-[inherit]",{blue:this.inverted?"text-primary bg-primary-100 border-primary":"text-white bg-primary-500 border-white",green:this.inverted?"text-white bg-success border-primary":"text-white bg-success border-white",red:this.inverted?"text-white bg-error border-primary":"text-white bg-error border-white"}[this.variant],{sm:"h-2 min-w-2",md:"h-4 px-1 min-w-4",lg:"h-5 min-w-5"}[this.size])}"><span id="content" part="content" class="${i(this.size==="sm"&&"sr-only")}"><slot></slot></span></span>`}};e.styles=[...s.styles,n`:host{align-items:center;display:inline-flex;justify-content:center}:host([size=md]){font-size:.625rem}:host([size=lg]){font-size:.75rem}:host([size=lg])::part(base){padding-left:.313rem;padding-right:.313rem}`],t([r({reflect:!0})],e.prototype,"size",2),t([r({reflect:!0})],e.prototype,"variant",2),t([r({type:Boolean,reflect:!0})],e.prototype,"inverted",2),e=t([l("sd-4-0-9-badge")],e);export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as Dt}from"./chunk.DCOFYPWX.js";import{a as kt,b as E,d as Et,h as Rt}from"./chunk.GQU4LYQ6.js";import{b as Mt,e as Ot}from"./chunk.IRWHG2Q4.js";import{a as C,b as W,c as dt,e as b}from"./chunk.TJOCV4DC.js";var V=Math.min,T=Math.max,at=Math.round,ft=Math.floor,B=t=>({x:t,y:t}),ue={left:"right",right:"left",bottom:"top",top:"bottom"},he={start:"end",end:"start"};function pt(t,e,n){return T(t,V(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function Q(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function G(t){return["top","bottom"].includes(I(t))?"y":"x"}function wt(t){return Ct(G(t))}function Bt(t,e,n){n===void 0&&(n=!1);let i=Q(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ct(r)),[r,ct(r)]}function Ft(t){let e=ct(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>he[e])}function de(t,e,n){let i=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?s:r;default:return[]}}function $t(t,e,n,i){let o=Q(t),s=de(I(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function ct(t){return t.replace(/left|right|bottom|top/g,e=>ue[e])}function me(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?me(t):{top:t,right:t,bottom:t,left:t}}function Z(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Nt(t,e,n){let{reference:i,floating:o}=t,s=G(e),r=wt(e),l=gt(r),a=I(e),c=s==="y",f=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,h;switch(a){case"top":h={x:f,y:i.y-o.height};break;case"bottom":h={x:f,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:u};break;case"left":h={x:i.x-o.width,y:u};break;default:h={x:i.x,y:i.y}}switch(Q(e)){case"start":h[r]-=m*(n&&c?-1:1);break;case"end":h[r]+=m*(n&&c?-1:1);break}return h}var Ht=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(e)),c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=Nt(c,i,a),m=i,h={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x,y:v,data:A,reset:O}=await g({x:f,y:u,initialPlacement:i,placement:m,strategy:o,middlewareData:h,rects:c,platform:r,elements:{reference:t,floating:e}});f=x!=null?x:f,u=v!=null?v:u,h=W(C({},h),{[w]:C(C({},h[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:f,y:u}=Nt(c,m,a)),p=-1)}return{x:f,y:u,placement:m,strategy:o,middlewareData:h}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:h=0}=J(e,t),d=Tt(h),w=l[m?u==="floating"?"reference":"floating":u],g=Z(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),x=u==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},O=Z(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:v,strategy:a}):x);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var Wt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=e,{element:c,padding:f=0}=J(t,e)||{};if(c==null)return{};let u=Tt(f),m={x:n,y:i},h=wt(o),d=gt(h),p=await r.getDimensions(c),w=h==="y",g=w?"top":"left",x=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[h]-m[h]-s.floating[d],O=m[h]-s.reference[h],M=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),R=M?M[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(M)))&&(R=l.floating[v]||s.floating[d]);let j=A/2-O/2,N=R/2-p[d]/2-1,k=V(u[g],N),q=V(u[x],N),H=k,X=R-p[d]-q,L=R/2-p[d]/2+j,D=pt(H,L,X),it=!a.arrow&&Q(o)!=null&&L!==D&&s.reference[d]/2-(L<H?k:q)-p[d]/2<0,_=it?L<H?L-H:L-X:0;return{[h]:m[h]+_,data:C({[h]:D,centerOffset:L-D-_},it&&{alignmentOffset:_}),reset:it}}});var Vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=e,L=J(t,e),{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=L,w=dt(L,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=I(o),x=G(l),v=I(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),O=m||(v||!p?[ct(l)]:Ft(l)),M=d!=="none";!m&&M&&O.push(...$t(l,p,d,A));let R=[l,...O],j=await yt(e,w),N=[],k=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&N.push(j[g]),u){let D=Bt(o,r,A);N.push(j[D[0]],j[D[1]])}if(k=[...k,{placement:o,overflows:N}],!N.every(D=>D<=0)){var q,H;let D=(((q=s.flip)==null?void 0:q.index)||0)+1,it=R[D];if(it)return{data:{index:D,overflows:k},reset:{placement:it}};let _=(H=k.filter(ot=>ot.overflows[0]<=0).sort((ot,U)=>ot.overflows[1]-U.overflows[1])[0])==null?void 0:H.placement;if(!_)switch(h){case"bestFit":{var X;let ot=(X=k.filter(U=>{if(M){let K=G(U.placement);return K===x||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,fe)=>K+fe,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:X[0];ot&&(_=ot);break}case"initialPlacement":_=l;break}if(o!==_)return{reset:{placement:_}}}return{}}}};async function pe(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=I(n),l=Q(n),a=G(n)==="y",c=["left","top"].includes(r)?-1:1,f=s&&a?-1:1,u=J(e,t),{mainAxis:m,crossAxis:h,alignmentAxis:d}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof d=="number"&&(h=l==="end"?d*-1:d),a?{x:h*f,y:m*c}:{x:m*c,y:h*f}}var jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:l}=e,a=await pe(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:W(C({},a),{placement:r})}}}},_t=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=J(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x,y:v}=g;return{x,y:v}}}}=w,a=dt(w,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},f=await yt(e,a),u=G(I(o)),m=Ct(u),h=c[m],d=c[u];if(s){let g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",v=h+f[g],A=h-f[x];h=pt(v,h,A)}if(r){let g=u==="y"?"top":"left",x=u==="y"?"bottom":"right",v=d+f[g],A=d-f[x];d=pt(v,d,A)}let p=l.fn(W(C({},e),{[m]:h,[u]:d}));return W(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[u]:r}}})}}};var It=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:l}=e,k=J(t,e),{apply:a=()=>{}}=k,c=dt(k,["apply"]),f=await yt(e,c),u=I(o),m=Q(o),h=G(o)==="y",{width:d,height:p}=s.floating,w,g;u==="top"||u==="bottom"?(w=u,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,w=m==="end"?"top":"bottom");let x=p-f.top-f.bottom,v=d-f.left-f.right,A=V(p-f[w],x),O=V(d-f[g],v),M=!e.middlewareData.shift,R=A,j=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=x),M&&!m){let q=T(f.left,0),H=T(f.right,0),X=T(f.top,0),L=T(f.bottom,0);h?j=d-2*(q!==0||H!==0?q+H:T(f.left,f.right)):R=p-2*(X!==0||L!==0?X+L:T(f.top,f.bottom))}await a(W(C({},e),{availableWidth:j,availableHeight:R}));let N=await r.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function tt(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function F(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return xt()?t instanceof Node||t instanceof P(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof P(t).Element:!1}function $(t){return xt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Yt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=S(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xt(t){return["table","td","th"].includes(tt(t))}function ut(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function vt(t){let e=bt(),n=z(t)?S(t):t;return["transform","translate","scale","rotate","perspective"].some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function Ut(t){let e=Y(t);for(;$(e)&&!et(e);){if(vt(e))return e;if(ut(e))return null;e=Y(e)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function et(t){return["html","body","#document"].includes(tt(t))}function S(t){return P(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Y(t){if(tt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Yt(t)&&t.host||F(t);return Yt(e)?e.host:e}function Kt(t){let e=Y(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&st(e)?e:Kt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Kt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=P(o);if(s){let l=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){let e=S(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=$(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=at(n)!==s||at(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function Lt(t){return z(t)?t:t.contextElement}function lt(t){let e=Lt(t);if(!$(e))return B(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Qt(e),r=(s?at(n.width):n.width)/i,l=(s?at(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var ge=B(0);function Zt(t){let e=P(t);return!bt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function we(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function nt(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=Lt(t),r=B(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=we(s,n,i)?Zt(s):B(0),a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,f=o.width/r.x,u=o.height/r.y;if(s){let m=P(s),h=i&&z(i)?P(i):i,d=m,p=At(d);for(;p&&i&&h!==d;){let w=lt(p),g=p.getBoundingClientRect(),x=S(p),v=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,u*=w.y,a+=v,c+=A,d=P(p),p=At(d)}}return Z({width:f,height:u,x:a,y:c})}function zt(t,e){let n=ht(t).scrollLeft;return e?e.left+n:nt(F(t)).left+n}function te(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:zt(t,i)),s=i.top+e.scrollTop;return{x:o,y:s}}function ye(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=F(i),l=e?ut(e.floating):!1;if(i===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=B(1),f=B(0),u=$(i);if((u||!u&&!s)&&((tt(i)!=="body"||st(r))&&(a=ht(i)),$(i))){let h=nt(i);c=lt(i),f.x=h.x+i.clientLeft,f.y=h.y+i.clientTop}let m=r&&!u&&!s?te(r,a,!0):B(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-a.scrollTop*c.y+f.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){let e=F(t),n=ht(t),i=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=T(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+zt(t),l=-n.scrollTop;return S(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}function be(t,e){let n=P(t),i=F(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;let c=bt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function Ae(t,e){let n=nt(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=$(t)?lt(t):B(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,a=o*s.x,c=i*s.y;return{width:r,height:l,x:a,y:c}}function Gt(t,e,n){let i;if(e==="viewport")i=be(t,n);else if(e==="document")i=ve(F(t));else if(z(e))i=Ae(e,n);else{let o=Zt(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Z(i)}function ee(t,e){let n=Y(t);return n===e||!z(n)||et(n)?!1:S(n).position==="fixed"||ee(n,e)}function Oe(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&tt(l)!=="body"),o=null,s=S(t).position==="fixed",r=s?Y(t):t;for(;z(r)&&!et(r);){let l=S(r),a=vt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(r)&&!a&&ee(t,r))?i=i.filter(f=>f!==r):o=l,r=Y(r)}return e.set(t,i),i}function Ee(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:Oe(e,this._c):[].concat(n),i],l=r[0],a=r.reduce((c,f)=>{let u=Gt(e,f,o);return c.top=T(u.top,c.top),c.right=V(u.right,c.right),c.bottom=V(u.bottom,c.bottom),c.left=T(u.left,c.left),c},Gt(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){let{width:e,height:n}=Qt(t);return{width:e,height:n}}function Ce(t,e,n){let i=$(e),o=F(e),s=n==="fixed",r=nt(t,!0,s,e),l={scrollLeft:0,scrollTop:0},a=B(0);if(i||!i&&!s)if((tt(e)!=="body"||st(o))&&(l=ht(e)),i){let m=nt(e,!0,s,e);a.x=m.x+e.clientLeft,a.y=m.y+e.clientTop}else o&&(a.x=zt(o));let c=o&&!i&&!s?te(o,l):B(0),f=r.left+l.scrollLeft-a.x-c.x,u=r.top+l.scrollTop-a.y-c.y;return{x:f,y:u,width:r.width,height:r.height}}function Pt(t){return S(t).position==="static"}function Jt(t,e){if(!$(t)||S(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return F(t)===n&&(n=n.ownerDocument.body),n}function ne(t,e){let n=P(t);if(ut(t))return n;if(!$(t)){let o=Y(t);for(;o&&!et(o);){if(z(o)&&!Pt(o))return o;o=Y(o)}return n}let i=Jt(t,e);for(;i&&Xt(i)&&Pt(i);)i=Jt(i,e);return i&&et(i)&&Pt(i)&&!vt(i)?n:i||Ut(t)||n}var Te=async function(t){let e=this.getOffsetParent||ne,n=this.getDimensions,i=await n(t.floating);return{reference:Ce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Pe(t){return S(t).direction==="rtl"}var Le={convertOffsetParentRelativeRectToViewportRelativeRect:ye,getDocumentElement:F,getClippingRect:Ee,getOffsetParent:ne,getElementRects:Te,getClientRects:xe,getDimensions:Re,getScale:lt,isElement:z,isRTL:Pe};function ie(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ze(t,e){let n=null,i,o=F(t);function s(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();let c=t.getBoundingClientRect(),{left:f,top:u,width:m,height:h}=c;if(l||e(),!m||!h)return;let d=ft(u),p=ft(o.clientWidth-(f+m)),w=ft(o.clientHeight-(u+h)),g=ft(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,V(1,a))||1},A=!0;function O(M){let R=M[0].intersectionRatio;if(R!==a){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!ie(c,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,W(C({},v),{root:o.ownerDocument}))}catch(M){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function oe(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,c=Lt(t),f=o||s?[...c?rt(c):[],...rt(e)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let u=c&&l?ze(c,n):null,m=-1,h=null;r&&(h=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),c&&!a&&h.observe(c),h.observe(e));let d,p=a?nt(t):null;a&&w();function w(){let g=nt(t);p&&!ie(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u==null||u(),(g=h)==null||g.disconnect(),h=null,a&&cancelAnimationFrame(d)}}var re=jt;var se=_t,le=Vt,St=It;var ce=Wt;var ae=(t,e,n)=>{let i=new Map,o=C({platform:Le},n),s=W(C({},o.platform),{_c:i});return Ht(t,e,W(C({},o),{platform:s}))};var y=class extends Rt{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=oe(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[re({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(St({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(le({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(se({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(St({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(ce({element:this.arrowEl,padding:this.arrowPadding})),ae(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let l=getComputedStyle(this).direction==="rtl",a={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let c=s.arrow.x,f=s.arrow.y,u="",m="",h="",d="";if(this.arrowPlacement==="start"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";u=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=l?p:"",d=l?"":p}else if(this.arrowPlacement==="end"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=l?"":p,d=l?p:"",h=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof c=="number"?"calc(50% - var(--arrow-size-diagonal))":"",u=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof c=="number"?`${c}px`:"",u=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:u,right:m,bottom:h,left:d,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Ot`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Ot`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};y.styles=[...Rt.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],b([Et('[part="popup"]')],y.prototype,"popup",2),b([Et('[part="arrow"]')],y.prototype,"arrowEl",2),b([E()],y.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],y.prototype,"active",2),b([E({reflect:!0})],y.prototype,"placement",2),b([E({reflect:!0})],y.prototype,"strategy",2),b([E({type:Number})],y.prototype,"distance",2),b([E({type:Number})],y.prototype,"skidding",2),b([E({type:Boolean})],y.prototype,"arrow",2),b([E({attribute:"arrow-placement"})],y.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number})],y.prototype,"arrowPadding",2),b([E({type:Boolean})],y.prototype,"flip",2),b([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],y.prototype,"flipFallbackPlacements",2),b([E({attribute:"flip-fallback-strategy"})],y.prototype,"flipFallbackStrategy",2),b([E({type:Object})],y.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],y.prototype,"flipPadding",2),b([E({type:Boolean})],y.prototype,"shift",2),b([E({type:Object})],y.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],y.prototype,"shiftPadding",2),b([E({attribute:"auto-size"})],y.prototype,"autoSize",2),b([E()],y.prototype,"sync",2),b([E({type:Object})],y.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],y.prototype,"autoSizePadding",2),y=b([kt("sd-4-0-8-popup")],y);export{y as a};
|
1
|
+
import{a as Dt}from"./chunk.DCOFYPWX.js";import{a as kt,b as E,d as Et,h as Rt}from"./chunk.GQU4LYQ6.js";import{b as Mt,e as Ot}from"./chunk.IRWHG2Q4.js";import{a as C,b as W,c as dt,e as b}from"./chunk.TJOCV4DC.js";var V=Math.min,T=Math.max,at=Math.round,ft=Math.floor,B=t=>({x:t,y:t}),ue={left:"right",right:"left",bottom:"top",top:"bottom"},he={start:"end",end:"start"};function pt(t,e,n){return T(t,V(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function Q(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function G(t){return["top","bottom"].includes(I(t))?"y":"x"}function wt(t){return Ct(G(t))}function Bt(t,e,n){n===void 0&&(n=!1);let i=Q(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ct(r)),[r,ct(r)]}function Ft(t){let e=ct(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>he[e])}function de(t,e,n){let i=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?s:r;default:return[]}}function $t(t,e,n,i){let o=Q(t),s=de(I(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function ct(t){return t.replace(/left|right|bottom|top/g,e=>ue[e])}function me(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?me(t):{top:t,right:t,bottom:t,left:t}}function Z(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Nt(t,e,n){let{reference:i,floating:o}=t,s=G(e),r=wt(e),l=gt(r),a=I(e),c=s==="y",f=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,h;switch(a){case"top":h={x:f,y:i.y-o.height};break;case"bottom":h={x:f,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:u};break;case"left":h={x:i.x-o.width,y:u};break;default:h={x:i.x,y:i.y}}switch(Q(e)){case"start":h[r]-=m*(n&&c?-1:1);break;case"end":h[r]+=m*(n&&c?-1:1);break}return h}var Ht=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(e)),c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=Nt(c,i,a),m=i,h={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x,y:v,data:A,reset:O}=await g({x:f,y:u,initialPlacement:i,placement:m,strategy:o,middlewareData:h,rects:c,platform:r,elements:{reference:t,floating:e}});f=x!=null?x:f,u=v!=null?v:u,h=W(C({},h),{[w]:C(C({},h[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:f,y:u}=Nt(c,m,a)),p=-1)}return{x:f,y:u,placement:m,strategy:o,middlewareData:h}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:h=0}=J(e,t),d=Tt(h),w=l[m?u==="floating"?"reference":"floating":u],g=Z(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),x=u==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},O=Z(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:v,strategy:a}):x);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var Wt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=e,{element:c,padding:f=0}=J(t,e)||{};if(c==null)return{};let u=Tt(f),m={x:n,y:i},h=wt(o),d=gt(h),p=await r.getDimensions(c),w=h==="y",g=w?"top":"left",x=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[h]-m[h]-s.floating[d],O=m[h]-s.reference[h],M=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),R=M?M[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(M)))&&(R=l.floating[v]||s.floating[d]);let j=A/2-O/2,N=R/2-p[d]/2-1,k=V(u[g],N),q=V(u[x],N),H=k,X=R-p[d]-q,L=R/2-p[d]/2+j,D=pt(H,L,X),it=!a.arrow&&Q(o)!=null&&L!==D&&s.reference[d]/2-(L<H?k:q)-p[d]/2<0,_=it?L<H?L-H:L-X:0;return{[h]:m[h]+_,data:C({[h]:D,centerOffset:L-D-_},it&&{alignmentOffset:_}),reset:it}}});var Vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=e,L=J(t,e),{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=L,w=dt(L,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=I(o),x=G(l),v=I(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),O=m||(v||!p?[ct(l)]:Ft(l)),M=d!=="none";!m&&M&&O.push(...$t(l,p,d,A));let R=[l,...O],j=await yt(e,w),N=[],k=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&N.push(j[g]),u){let D=Bt(o,r,A);N.push(j[D[0]],j[D[1]])}if(k=[...k,{placement:o,overflows:N}],!N.every(D=>D<=0)){var q,H;let D=(((q=s.flip)==null?void 0:q.index)||0)+1,it=R[D];if(it)return{data:{index:D,overflows:k},reset:{placement:it}};let _=(H=k.filter(ot=>ot.overflows[0]<=0).sort((ot,U)=>ot.overflows[1]-U.overflows[1])[0])==null?void 0:H.placement;if(!_)switch(h){case"bestFit":{var X;let ot=(X=k.filter(U=>{if(M){let K=G(U.placement);return K===x||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,fe)=>K+fe,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:X[0];ot&&(_=ot);break}case"initialPlacement":_=l;break}if(o!==_)return{reset:{placement:_}}}return{}}}};async function pe(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=I(n),l=Q(n),a=G(n)==="y",c=["left","top"].includes(r)?-1:1,f=s&&a?-1:1,u=J(e,t),{mainAxis:m,crossAxis:h,alignmentAxis:d}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof d=="number"&&(h=l==="end"?d*-1:d),a?{x:h*f,y:m*c}:{x:m*c,y:h*f}}var jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:l}=e,a=await pe(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:W(C({},a),{placement:r})}}}},_t=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=J(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x,y:v}=g;return{x,y:v}}}}=w,a=dt(w,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},f=await yt(e,a),u=G(I(o)),m=Ct(u),h=c[m],d=c[u];if(s){let g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",v=h+f[g],A=h-f[x];h=pt(v,h,A)}if(r){let g=u==="y"?"top":"left",x=u==="y"?"bottom":"right",v=d+f[g],A=d-f[x];d=pt(v,d,A)}let p=l.fn(W(C({},e),{[m]:h,[u]:d}));return W(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[u]:r}}})}}};var It=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:l}=e,k=J(t,e),{apply:a=()=>{}}=k,c=dt(k,["apply"]),f=await yt(e,c),u=I(o),m=Q(o),h=G(o)==="y",{width:d,height:p}=s.floating,w,g;u==="top"||u==="bottom"?(w=u,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,w=m==="end"?"top":"bottom");let x=p-f.top-f.bottom,v=d-f.left-f.right,A=V(p-f[w],x),O=V(d-f[g],v),M=!e.middlewareData.shift,R=A,j=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=x),M&&!m){let q=T(f.left,0),H=T(f.right,0),X=T(f.top,0),L=T(f.bottom,0);h?j=d-2*(q!==0||H!==0?q+H:T(f.left,f.right)):R=p-2*(X!==0||L!==0?X+L:T(f.top,f.bottom))}await a(W(C({},e),{availableWidth:j,availableHeight:R}));let N=await r.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function tt(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function F(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return xt()?t instanceof Node||t instanceof P(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof P(t).Element:!1}function $(t){return xt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Yt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=S(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xt(t){return["table","td","th"].includes(tt(t))}function ut(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function vt(t){let e=bt(),n=z(t)?S(t):t;return["transform","translate","scale","rotate","perspective"].some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function Ut(t){let e=Y(t);for(;$(e)&&!et(e);){if(vt(e))return e;if(ut(e))return null;e=Y(e)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function et(t){return["html","body","#document"].includes(tt(t))}function S(t){return P(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Y(t){if(tt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Yt(t)&&t.host||F(t);return Yt(e)?e.host:e}function Kt(t){let e=Y(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&st(e)?e:Kt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Kt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=P(o);if(s){let l=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){let e=S(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=$(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=at(n)!==s||at(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function Lt(t){return z(t)?t:t.contextElement}function lt(t){let e=Lt(t);if(!$(e))return B(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Qt(e),r=(s?at(n.width):n.width)/i,l=(s?at(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var ge=B(0);function Zt(t){let e=P(t);return!bt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function we(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function nt(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=Lt(t),r=B(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=we(s,n,i)?Zt(s):B(0),a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,f=o.width/r.x,u=o.height/r.y;if(s){let m=P(s),h=i&&z(i)?P(i):i,d=m,p=At(d);for(;p&&i&&h!==d;){let w=lt(p),g=p.getBoundingClientRect(),x=S(p),v=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,u*=w.y,a+=v,c+=A,d=P(p),p=At(d)}}return Z({width:f,height:u,x:a,y:c})}function zt(t,e){let n=ht(t).scrollLeft;return e?e.left+n:nt(F(t)).left+n}function te(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:zt(t,i)),s=i.top+e.scrollTop;return{x:o,y:s}}function ye(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=F(i),l=e?ut(e.floating):!1;if(i===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=B(1),f=B(0),u=$(i);if((u||!u&&!s)&&((tt(i)!=="body"||st(r))&&(a=ht(i)),$(i))){let h=nt(i);c=lt(i),f.x=h.x+i.clientLeft,f.y=h.y+i.clientTop}let m=r&&!u&&!s?te(r,a,!0):B(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-a.scrollTop*c.y+f.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){let e=F(t),n=ht(t),i=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=T(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+zt(t),l=-n.scrollTop;return S(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}function be(t,e){let n=P(t),i=F(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;let c=bt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function Ae(t,e){let n=nt(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=$(t)?lt(t):B(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,a=o*s.x,c=i*s.y;return{width:r,height:l,x:a,y:c}}function Gt(t,e,n){let i;if(e==="viewport")i=be(t,n);else if(e==="document")i=ve(F(t));else if(z(e))i=Ae(e,n);else{let o=Zt(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Z(i)}function ee(t,e){let n=Y(t);return n===e||!z(n)||et(n)?!1:S(n).position==="fixed"||ee(n,e)}function Oe(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&tt(l)!=="body"),o=null,s=S(t).position==="fixed",r=s?Y(t):t;for(;z(r)&&!et(r);){let l=S(r),a=vt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(r)&&!a&&ee(t,r))?i=i.filter(f=>f!==r):o=l,r=Y(r)}return e.set(t,i),i}function Ee(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:Oe(e,this._c):[].concat(n),i],l=r[0],a=r.reduce((c,f)=>{let u=Gt(e,f,o);return c.top=T(u.top,c.top),c.right=V(u.right,c.right),c.bottom=V(u.bottom,c.bottom),c.left=T(u.left,c.left),c},Gt(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){let{width:e,height:n}=Qt(t);return{width:e,height:n}}function Ce(t,e,n){let i=$(e),o=F(e),s=n==="fixed",r=nt(t,!0,s,e),l={scrollLeft:0,scrollTop:0},a=B(0);if(i||!i&&!s)if((tt(e)!=="body"||st(o))&&(l=ht(e)),i){let m=nt(e,!0,s,e);a.x=m.x+e.clientLeft,a.y=m.y+e.clientTop}else o&&(a.x=zt(o));let c=o&&!i&&!s?te(o,l):B(0),f=r.left+l.scrollLeft-a.x-c.x,u=r.top+l.scrollTop-a.y-c.y;return{x:f,y:u,width:r.width,height:r.height}}function Pt(t){return S(t).position==="static"}function Jt(t,e){if(!$(t)||S(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return F(t)===n&&(n=n.ownerDocument.body),n}function ne(t,e){let n=P(t);if(ut(t))return n;if(!$(t)){let o=Y(t);for(;o&&!et(o);){if(z(o)&&!Pt(o))return o;o=Y(o)}return n}let i=Jt(t,e);for(;i&&Xt(i)&&Pt(i);)i=Jt(i,e);return i&&et(i)&&Pt(i)&&!vt(i)?n:i||Ut(t)||n}var Te=async function(t){let e=this.getOffsetParent||ne,n=this.getDimensions,i=await n(t.floating);return{reference:Ce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Pe(t){return S(t).direction==="rtl"}var Le={convertOffsetParentRelativeRectToViewportRelativeRect:ye,getDocumentElement:F,getClippingRect:Ee,getOffsetParent:ne,getElementRects:Te,getClientRects:xe,getDimensions:Re,getScale:lt,isElement:z,isRTL:Pe};function ie(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ze(t,e){let n=null,i,o=F(t);function s(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();let c=t.getBoundingClientRect(),{left:f,top:u,width:m,height:h}=c;if(l||e(),!m||!h)return;let d=ft(u),p=ft(o.clientWidth-(f+m)),w=ft(o.clientHeight-(u+h)),g=ft(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,V(1,a))||1},A=!0;function O(M){let R=M[0].intersectionRatio;if(R!==a){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!ie(c,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,W(C({},v),{root:o.ownerDocument}))}catch(M){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function oe(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,c=Lt(t),f=o||s?[...c?rt(c):[],...rt(e)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let u=c&&l?ze(c,n):null,m=-1,h=null;r&&(h=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),c&&!a&&h.observe(c),h.observe(e));let d,p=a?nt(t):null;a&&w();function w(){let g=nt(t);p&&!ie(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u==null||u(),(g=h)==null||g.disconnect(),h=null,a&&cancelAnimationFrame(d)}}var re=jt;var se=_t,le=Vt,St=It;var ce=Wt;var ae=(t,e,n)=>{let i=new Map,o=C({platform:Le},n),s=W(C({},o.platform),{_c:i});return Ht(t,e,W(C({},o),{platform:s}))};var y=class extends Rt{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=oe(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[re({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(St({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(le({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(se({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(St({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(ce({element:this.arrowEl,padding:this.arrowPadding})),ae(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let l=getComputedStyle(this).direction==="rtl",a={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let c=s.arrow.x,f=s.arrow.y,u="",m="",h="",d="";if(this.arrowPlacement==="start"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";u=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=l?p:"",d=l?"":p}else if(this.arrowPlacement==="end"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=l?"":p,d=l?p:"",h=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof c=="number"?"calc(50% - var(--arrow-size-diagonal))":"",u=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof c=="number"?`${c}px`:"",u=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:u,right:m,bottom:h,left:d,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Ot`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Ot`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};y.styles=[...Rt.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],b([Et('[part="popup"]')],y.prototype,"popup",2),b([Et('[part="arrow"]')],y.prototype,"arrowEl",2),b([E()],y.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],y.prototype,"active",2),b([E({reflect:!0})],y.prototype,"placement",2),b([E({reflect:!0})],y.prototype,"strategy",2),b([E({type:Number})],y.prototype,"distance",2),b([E({type:Number})],y.prototype,"skidding",2),b([E({type:Boolean})],y.prototype,"arrow",2),b([E({attribute:"arrow-placement"})],y.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number})],y.prototype,"arrowPadding",2),b([E({type:Boolean})],y.prototype,"flip",2),b([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],y.prototype,"flipFallbackPlacements",2),b([E({attribute:"flip-fallback-strategy"})],y.prototype,"flipFallbackStrategy",2),b([E({type:Object})],y.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],y.prototype,"flipPadding",2),b([E({type:Boolean})],y.prototype,"shift",2),b([E({type:Object})],y.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],y.prototype,"shiftPadding",2),b([E({attribute:"auto-size"})],y.prototype,"autoSize",2),b([E()],y.prototype,"sync",2),b([E({type:Object})],y.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],y.prototype,"autoSizePadding",2),y=b([kt("sd-4-0-9-popup")],y);export{y as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as z}from"./chunk.64UNKF45.js";import{c as O}from"./chunk.3L472FD4.js";import{a as c,c as m}from"./chunk.A3DKF5BY.js";import{a as h,d as p}from"./chunk.RQYP7MH5.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as K}from"./chunk.E2DRD2OX.js";import{a as D}from"./chunk.26YUWEYR.js";import{a as I}from"./chunk.DCOFYPWX.js";import{a as C,b as o,d as l,h as d}from"./chunk.GQU4LYQ6.js";import{b as M,e as A}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var n=class extends d{constructor(){super(...arguments);this.localize=new D(this);this.open=!1;this.rounded=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.noAutoSize=!1;this.noFlip=!1;this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}getAccessibleTrigger(){let t=this.trigger.assignedElements({flatten:!0}).find(a=>z(a).start),s=null;if(t)switch(t.tagName.toLowerCase()){case"sd-4-0-
|
1
|
+
import{a as z}from"./chunk.64UNKF45.js";import{c as O}from"./chunk.3L472FD4.js";import{a as c,c as m}from"./chunk.A3DKF5BY.js";import{a as h,d as p}from"./chunk.RQYP7MH5.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as K}from"./chunk.E2DRD2OX.js";import{a as D}from"./chunk.26YUWEYR.js";import{a as I}from"./chunk.DCOFYPWX.js";import{a as C,b as o,d as l,h as d}from"./chunk.GQU4LYQ6.js";import{b as M,e as A}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var n=class extends d{constructor(){super(...arguments);this.localize=new D(this);this.open=!1;this.rounded=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.noAutoSize=!1;this.noFlip=!1;this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}getAccessibleTrigger(){let t=this.trigger.assignedElements({flatten:!0}).find(a=>z(a).start),s=null;if(t)switch(t.tagName.toLowerCase()){case"sd-4-0-9-button":case"sd-4-0-9-icon-button":s=t.button;break;case"sd-4-0-9-navigation-item":s=t.button;break;default:s=t}return s}updateAccessibleTrigger(){let e=this.getAccessibleTrigger();e&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded",this.open?"true":"false"))}focusOnTrigger(){let e=this.getAccessibleTrigger();typeof(e==null?void 0:e.focus)=="function"&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find(e=>e.tagName.toLowerCase()==="sd-menu")}handleKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if(e.key==="Tab"){if(this.open&&((t=document.activeElement)==null?void 0:t.tagName.toLowerCase())==="sd-menu-item"){e.preventDefault(),this.hide(),this.focusOnTrigger();return}setTimeout(()=>{var a,r,g,f,y,w,b,E,v,k,T,L;let s=((y=(f=(g=(r=(a=document.activeElement)==null?void 0:a.shadowRoot)==null?void 0:r.activeElement)==null?void 0:g.shadowRoot)==null?void 0:f.activeElement)==null?void 0:y.getRootNode())instanceof ShadowRoot?(v=(E=(b=(w=document.activeElement)==null?void 0:w.shadowRoot)==null?void 0:b.activeElement)==null?void 0:E.shadowRoot)==null?void 0:v.activeElement:((k=this.containingElement)==null?void 0:k.getRootNode())instanceof ShadowRoot?(L=(T=document.activeElement)==null?void 0:T.shadowRoot)==null?void 0:L.activeElement:document.activeElement;(!this.containingElement||(s==null?void 0:s.closest(this.containingElement.tagName.toLowerCase()))!==this.containingElement)&&this.hide()})}}handleDocumentMouseDown(e){let t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){let t=e.target;O(t,this.panel)}handlePanelSelect(e){let t=e.target;!this.stayOpenOnSelect&&t.tagName.toLowerCase()==="sd-menu"&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if(e.key==="Escape"&&this.open){e.stopPropagation(),this.focusOnTrigger(),this.hide();return}if([" ","Enter"].includes(e.key)){e.preventDefault(),this.handleTriggerClick();return}let t=this.getMenu();if(t){let s=t.defaultSlot.assignedElements({flatten:!0}),a=s[0],r=s[s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),s.length>0&&requestAnimationFrame(()=>{(e.key==="ArrowDown"||e.key==="Home")&&(t.setCurrentItem(a),a.focus()),(e.key==="ArrowUp"||e.key==="End")&&(t.setCurrentItem(r),r.focus())}))}}handleTriggerKeyUp(e){e.key===" "&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-4-0-9-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-4-0-9-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled){this.open=!1;return}if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await p(this),this.panel.hidden=!1,this.popup.active=!0;let{keyframes:e,options:t}=m(this,"dropdown.show",{dir:this.localize.dir()});await h(this.popup.popup,e,t),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await p(this);let{keyframes:e,options:t}=m(this,"dropdown.hide",{dir:this.localize.dir()});await h(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return A`<sd-4-0-9-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${I("shadow bg-white",this.open?"block pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-4-0-9-popup>`}};n.styles=[...d.styles,M`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown,900)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important;overflow:auto}`],i([l("#dropdown")],n.prototype,"popup",2),i([l("[part=trigger]")],n.prototype,"trigger",2),i([l("[part=panel]")],n.prototype,"panel",2),i([o({type:Boolean,reflect:!0})],n.prototype,"open",2),i([o({type:Boolean,reflect:!0})],n.prototype,"rounded",2),i([o({reflect:!0})],n.prototype,"placement",2),i([o({type:Boolean,reflect:!0})],n.prototype,"disabled",2),i([o({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],n.prototype,"stayOpenOnSelect",2),i([o({attribute:!1})],n.prototype,"containingElement",2),i([o({type:Number})],n.prototype,"distance",2),i([o({type:Number})],n.prototype,"skidding",2),i([o({type:Boolean,reflect:!0,attribute:"no-auto-size"})],n.prototype,"noAutoSize",2),i([o({type:Boolean,reflect:!0,attribute:"no-flip"})],n.prototype,"noFlip",2),i([o({type:Boolean})],n.prototype,"hoist",2),i([K("open",{waitUntilFirstUpdate:!0})],n.prototype,"handleOpenChange",1),n=i([C("sd-4-0-9-dropdown")],n);c("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}});c("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{n as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as g,b as m,c as b,d as h,h as i}from"./chunk.GQU4LYQ6.js";import{b as d,e as c}from"./chunk.IRWHG2Q4.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends i{constructor(){super(...arguments);this.disableRole=!1;this.label=""}handleFocus(e){let t=a(e.target);t==null||t.classList.add("sd-4-0-
|
1
|
+
import{a as g,b as m,c as b,d as h,h as i}from"./chunk.GQU4LYQ6.js";import{b as d,e as c}from"./chunk.IRWHG2Q4.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends i{constructor(){super(...arguments);this.disableRole=!1;this.label=""}handleFocus(e){let t=a(e.target);t==null||t.classList.add("sd-4-0-9-button-group__button--focus")}handleBlur(e){let t=a(e.target);t==null||t.classList.remove("sd-4-0-9-button-group__button--focus")}handleMouseOver(e){let t=a(e.target);t==null||t.classList.add("sd-4-0-9-button-group__button--hover")}handleMouseOut(e){let t=a(e.target);t==null||t.classList.remove("sd-4-0-9-button-group__button--hover")}handleSlotChange(){let e=[...this.defaultSlot.assignedElements({flatten:!0})];e.forEach(t=>{let n=e.indexOf(t),o=a(t);o!==null&&(o.classList.add("sd-4-0-9-button-group__button"),o.classList.toggle("sd-4-0-9-button-group__button--first",n===0),o.classList.toggle("sd-4-0-9-button-group__button--inner",n>0&&n<e.length-1),o.classList.toggle("sd-4-0-9-button-group__button--last",n===e.length-1),o.classList.toggle("sd-4-0-9-button-group__button--radio",o.tagName.toLowerCase()==="sd-4-0-9-radio-button"))})}render(){return c`<slot part="base" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}" @slotchange="${this.handleSlotChange}"></slot>`}};s.styles=[...i.styles,d`:host{display:inline-block}[part=base]{display:flex;flex-wrap:nowrap}`],l([h("slot")],s.prototype,"defaultSlot",2),l([b()],s.prototype,"disableRole",2),l([m()],s.prototype,"label",2),s=l([g("sd-4-0-9-button-group")],s);function a(r){var e;let u="sd-4-0-9-button, sd-4-0-9-radio-button";return(e=r.closest(u))!=null?e:r.querySelector(u)}export{s as a};
|