@solid-design-system/components 5.4.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{cdn-versioned/chunks/chunk.RKKBKOOP.js → cdn/chunks/chunk.TL3NETIH.js} +1 -1
- package/cdn/components/header/header.js +1 -1
- package/cdn/custom-elements.json +181 -181
- package/cdn/solid-components.bundle.js +11 -11
- package/cdn/solid-components.iife.js +11 -11
- 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.2GZJLMSG.js +1 -1
- package/cdn-versioned/chunks/chunk.2QJJ2GGX.js +1 -1
- package/cdn-versioned/chunks/chunk.3CLAHKN2.js +1 -1
- package/cdn-versioned/chunks/chunk.3V26CQAC.js +1 -1
- package/cdn-versioned/chunks/chunk.4TOZCRMQ.js +4 -4
- package/cdn-versioned/chunks/chunk.5RTTEWNK.js +1 -1
- package/cdn-versioned/chunks/chunk.5ZCX6DQM.js +1 -1
- package/cdn-versioned/chunks/chunk.6HLS5XU2.js +1 -1
- package/cdn-versioned/chunks/chunk.6IZHLO4O.js +1 -1
- package/cdn-versioned/chunks/chunk.7ADT7GXT.js +1 -1
- package/cdn-versioned/chunks/chunk.7MCN5637.js +1 -1
- package/cdn-versioned/chunks/chunk.A6OAPRBG.js +1 -1
- package/cdn-versioned/chunks/chunk.AXH5NVYQ.js +1 -1
- package/cdn-versioned/chunks/chunk.BMIYMDOW.js +1 -1
- package/cdn-versioned/chunks/chunk.BRGDAQJS.js +1 -1
- package/cdn-versioned/chunks/chunk.CDTSUOUW.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.D7A25CW2.js +4 -4
- package/cdn-versioned/chunks/chunk.FJY2VDLX.js +1 -1
- package/cdn-versioned/chunks/chunk.FJYTESL5.js +1 -1
- package/cdn-versioned/chunks/chunk.G5QO6WGI.js +1 -1
- package/cdn-versioned/chunks/chunk.GEABNT3R.js +2 -2
- package/cdn-versioned/chunks/chunk.H3HCI6UK.js +1 -1
- package/cdn-versioned/chunks/chunk.HB34ZH5G.js +1 -1
- package/cdn-versioned/chunks/chunk.J4OXKWHD.js +1 -1
- package/cdn-versioned/chunks/chunk.JFRL5PI6.js +1 -1
- package/cdn-versioned/chunks/chunk.JHLXS4RE.js +1 -1
- package/cdn-versioned/chunks/chunk.KPL3RJW5.js +1 -1
- package/cdn-versioned/chunks/chunk.LCFGG3XQ.js +1 -1
- package/cdn-versioned/chunks/chunk.M7XV42AN.js +1 -1
- package/cdn-versioned/chunks/chunk.MWXZG4SC.js +1 -1
- package/cdn-versioned/chunks/chunk.N55MQWVK.js +1 -1
- package/cdn-versioned/chunks/chunk.NV6YZ464.js +1 -1
- package/cdn-versioned/chunks/chunk.OEXEP6H5.js +1 -1
- package/cdn-versioned/chunks/chunk.OHXAZE3D.js +1 -1
- package/cdn-versioned/chunks/chunk.P5JSPSW7.js +1 -1
- package/cdn-versioned/chunks/chunk.P64YQW6Z.js +1 -1
- package/cdn-versioned/chunks/chunk.P6LTY5WA.js +1 -1
- package/cdn-versioned/chunks/chunk.PDIUVN5U.js +1 -1
- package/cdn-versioned/chunks/chunk.PVLTPG2G.js +1 -1
- package/cdn-versioned/chunks/chunk.QP52PXLO.js +3 -3
- package/cdn-versioned/chunks/chunk.RBZIMQA5.js +1 -1
- package/cdn-versioned/chunks/chunk.SLIDD3LU.js +1 -1
- package/{cdn/chunks/chunk.RKKBKOOP.js → cdn-versioned/chunks/chunk.TL3NETIH.js} +1 -1
- package/cdn-versioned/chunks/chunk.TLLNLQPN.js +1 -1
- package/cdn-versioned/chunks/chunk.TSI5Q2JI.js +1 -1
- package/cdn-versioned/chunks/chunk.TTZGP3EJ.js +1 -1
- package/cdn-versioned/chunks/chunk.UAUT4G77.js +2 -2
- package/cdn-versioned/chunks/chunk.VT5F2LC2.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.YK3BL7Z2.js +1 -1
- package/cdn-versioned/chunks/chunk.YYONUP4L.js +1 -1
- package/cdn-versioned/chunks/chunk.ZAHVXNIZ.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 +1 -1
- 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/header/header.js +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/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 +1 -1
- 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 +1 -1
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +1 -1
- 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 +385 -385
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +19 -19
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +19 -19
- 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.VVDUCRRF.js → chunk.TVLE7NUT.js} +1 -1
- package/dist/components/header/header.js +1 -1
- package/dist/custom-elements.json +181 -181
- 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.23SXULLQ.js +3 -3
- package/dist-versioned/chunks/chunk.2WN7YMGY.js +6 -6
- package/dist-versioned/chunks/chunk.3AY4ZE3B.js +1 -1
- package/dist-versioned/chunks/chunk.3OJHLEDR.js +4 -4
- package/dist-versioned/chunks/chunk.4BOVS5IV.js +3 -3
- package/dist-versioned/chunks/chunk.4KY6NI4T.js +9 -9
- package/dist-versioned/chunks/chunk.55WKP7T3.js +24 -24
- package/dist-versioned/chunks/chunk.5FFIE4YZ.js +2 -2
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.6JJ6VBYS.js +2 -2
- package/dist-versioned/chunks/chunk.74LNGOSZ.js +1 -1
- package/dist-versioned/chunks/chunk.7P374LCS.js +2 -2
- package/dist-versioned/chunks/chunk.AH4JSEVL.js +1 -1
- package/dist-versioned/chunks/chunk.AQ33SHN7.js +5 -5
- package/dist-versioned/chunks/chunk.CV47NCMS.js +4 -4
- package/dist-versioned/chunks/chunk.DNIODML7.js +1 -1
- package/dist-versioned/chunks/chunk.E2HV423L.js +2 -2
- package/dist-versioned/chunks/chunk.EX6L6CQ3.js +1 -1
- package/dist-versioned/chunks/chunk.F7CEWVTD.js +2 -2
- package/dist-versioned/chunks/chunk.HO2HFXMJ.js +1 -1
- package/dist-versioned/chunks/chunk.HTULDNAU.js +11 -11
- package/dist-versioned/chunks/chunk.JWORONFM.js +1 -1
- package/dist-versioned/chunks/chunk.JWS37SX3.js +3 -3
- package/dist-versioned/chunks/chunk.KLMMEDV3.js +2 -2
- package/dist-versioned/chunks/chunk.KMM7NCFU.js +2 -2
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.L7EUFNUL.js +5 -5
- package/dist-versioned/chunks/chunk.LA3LK5U7.js +8 -8
- package/dist-versioned/chunks/chunk.LIZZEBBC.js +5 -5
- package/dist-versioned/chunks/chunk.MKGGWQBV.js +1 -1
- package/dist-versioned/chunks/chunk.N5ISGLPU.js +1 -1
- package/dist-versioned/chunks/chunk.O5OO4ZYT.js +1 -1
- package/dist-versioned/chunks/chunk.OGZQTS5F.js +4 -4
- package/dist-versioned/chunks/chunk.OSVHP3IT.js +2 -2
- package/dist-versioned/chunks/chunk.PBPSZJYK.js +2 -2
- package/dist-versioned/chunks/chunk.PFIUB53L.js +5 -5
- package/dist-versioned/chunks/chunk.RPLU56MF.js +2 -2
- package/dist-versioned/chunks/chunk.S5CIECBU.js +2 -2
- package/dist-versioned/chunks/chunk.TBUESXVZ.js +1 -1
- package/dist-versioned/chunks/chunk.TPMPCCRV.js +3 -3
- package/dist-versioned/chunks/chunk.TQ4DIMUW.js +2 -2
- package/dist-versioned/chunks/chunk.TR7F4J6K.js +14 -14
- package/dist-versioned/chunks/{chunk.VVDUCRRF.js → chunk.TVLE7NUT.js} +2 -2
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.VCDQPSR5.js +2 -2
- package/dist-versioned/chunks/chunk.WJ3R5TMO.js +1 -1
- package/dist-versioned/chunks/chunk.XNNCGTSI.js +26 -26
- package/dist-versioned/chunks/chunk.XR4CBBMX.js +1 -1
- package/dist-versioned/chunks/chunk.XVF5EILY.js +12 -12
- package/dist-versioned/chunks/chunk.Y6OGZSS6.js +2 -2
- package/dist-versioned/chunks/chunk.YLAUIXEA.js +2 -2
- package/dist-versioned/chunks/chunk.ZLD7GEOS.js +3 -3
- package/dist-versioned/chunks/chunk.ZRSPZUZY.js +6 -6
- 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 +1 -1
- 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/header/header.js +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/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 +1 -1
- 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 +1 -1
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +1 -1
- 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 +385 -385
- 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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Bt}from"./chunk.26V4EXHB.js";import{a as Dt,b as E,d as Rt,h as Ct}from"./chunk.ZAHVXNIZ.js";import{b as kt,e as Et}from"./chunk.UWPDCU52.js";import{a as C,b as V,c as mt,e as b}from"./chunk.TJOCV4DC.js";var j=Math.min,T=Math.max,ft=Math.round,ut=Math.floor,B=t=>({x:t,y:t}),he={left:"right",right:"left",bottom:"top",top:"bottom"},de={start:"end",end:"start"};function gt(t,e,n){return T(t,j(e,n))}function Q(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function Tt(t){return t==="x"?"y":"x"}function wt(t){return t==="y"?"height":"width"}function Y(t){return["top","bottom"].includes(I(t))?"y":"x"}function yt(t){return Tt(Y(t))}function Ft(t,e,n){n===void 0&&(n=!1);let i=Z(t),o=yt(t),s=wt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=at(r)),[r,at(r)]}function $t(t){let e=at(t);return[pt(t),e,pt(e)]}function pt(t){return t.replace(/start|end/g,e=>de[e])}function me(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 Nt(t,e,n,i){let o=Z(t),s=me(I(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(pt)))),s}function at(t){return t.replace(/left|right|bottom|top/g,e=>he[e])}function pe(t){return C({top:0,right:0,bottom:0,left:0},t)}function Lt(t){return typeof t!="number"?pe(t):{top:t,right:t,bottom:t,left:t}}function tt(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 Ht(t,e,n){let{reference:i,floating:o}=t,s=Y(e),r=yt(e),l=wt(r),a=I(e),c=s==="y",f=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,u;switch(a){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(Z(e)){case"start":u[r]-=m*(n&&c?-1:1);break;case"end":u[r]+=m*(n&&c?-1:1);break}return u}var Wt=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:h}=Ht(c,i,a),m=i,u={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x:y,y:v,data:A,reset:O}=await g({x:f,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:c,platform:r,elements:{reference:t,floating:e}});f=y!=null?y:f,h=v!=null?v:h,u=V(C({},u),{[w]:C(C({},u[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:h}=Ht(c,m,a)),p=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:u}};async function xt(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:h="floating",altBoundary:m=!1,padding:u=0}=Q(e,t),d=Lt(u),w=l[m?h==="floating"?"reference":"floating":h],g=tt(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})),y=h==="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=tt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);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 Vt=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}=Q(t,e)||{};if(c==null)return{};let h=Lt(f),m={x:n,y:i},u=yt(o),d=wt(u),p=await r.getDimensions(c),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),R=k?k[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=l.floating[v]||s.floating[d]);let _=A/2-O/2,N=R/2-p[d]/2-1,S=j(h[g],N),X=j(h[y],N),H=S,U=R-p[d]-X,P=R/2-p[d]/2+_,ot=gt(H,P,U),D=!a.arrow&&Z(o)!=null&&P!==ot&&s.reference[d]/2-(P<H?S:X)-p[d]/2<0,J=D?P<H?P-H:P-U:0;return{[u]:m[u]+J,data:C({[u]:ot,centerOffset:P-ot-J},D&&{alignmentOffset:J}),reset:D}}});var jt=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,ot=Q(t,e),{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=ot,w=mt(ot,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=I(o),y=Y(l),v=I(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),O=m||(v||!p?[at(l)]:$t(l)),k=d!=="none";!m&&k&&O.push(...Nt(l,p,d,A));let R=[l,...O],_=await xt(e,w),N=[],S=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&N.push(_[g]),h){let D=Ft(o,r,A);N.push(_[D[0]],_[D[1]])}if(S=[...S,{placement:o,overflows:N}],!N.every(D=>D<=0)){var X,H;let D=(((X=s.flip)==null?void 0:X.index)||0)+1,J=R[D];if(J){var U;let K=h==="alignment"?y!==Y(J):!1,W=((U=S[0])==null?void 0:U.overflows[0])>0;if(!K||W)return{data:{index:D,overflows:S},reset:{placement:J}}}let ct=(H=S.filter(K=>K.overflows[0]<=0).sort((K,W)=>K.overflows[1]-W.overflows[1])[0])==null?void 0:H.placement;if(!ct)switch(u){case"bestFit":{var P;let K=(P=S.filter(W=>{if(k){let G=Y(W.placement);return G===y||G==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(G=>G>0).reduce((G,ue)=>G+ue,0)]).sort((W,G)=>W[1]-G[1])[0])==null?void 0:P[0];K&&(ct=K);break}case"initialPlacement":ct=l;break}if(o!==ct)return{reset:{placement:ct}}}return{}}}};async function ge(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=Z(n),a=Y(n)==="y",c=["left","top"].includes(r)?-1:1,f=s&&a?-1:1,h=Q(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),a?{x:u*f,y:m*c}:{x:m*c,y:u*f}}var _t=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 ge(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:V(C({},a),{placement:r})}}}},It=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Q(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}}}=w,a=mt(w,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},f=await xt(e,a),h=Y(I(o)),m=Tt(h),u=c[m],d=c[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=u+f[g],A=u-f[y];u=gt(v,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],A=d-f[y];d=gt(v,d,A)}let p=l.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var Yt=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,S=Q(t,e),{apply:a=()=>{}}=S,c=mt(S,["apply"]),f=await xt(e,c),h=I(o),m=Z(o),u=Y(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-f.top-f.bottom,v=d-f.left-f.right,A=j(p-f[w],y),O=j(d-f[g],v),k=!e.middlewareData.shift,R=A,_=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(_=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let X=T(f.left,0),H=T(f.right,0),U=T(f.top,0),P=T(f.bottom,0);u?_=d-2*(X!==0||H!==0?X+H:T(f.left,f.right)):R=p-2*(U!==0||P!==0?U+P:T(f.top,f.bottom))}await a(V(C({},e),{availableWidth:_,availableHeight:R}));let N=await r.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function vt(){return typeof window!="undefined"}function et(t){return Xt(t)?(t.nodeName||"").toLowerCase():"#document"}function L(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function F(t){var e;return(e=(Xt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xt(t){return vt()?t instanceof Node||t instanceof L(t).Node:!1}function z(t){return vt()?t instanceof Element||t instanceof L(t).Element:!1}function $(t){return vt()?t instanceof HTMLElement||t instanceof L(t).HTMLElement:!1}function qt(t){return!vt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof L(t).ShadowRoot}function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function Ut(t){return["table","td","th"].includes(et(t))}function ht(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function bt(t){let e=At(),n=z(t)?M(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 Kt(t){let e=q(t);for(;$(e)&&!nt(e);){if(bt(e))return e;if(ht(e))return null;e=q(e)}return null}function At(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(t){return["html","body","#document"].includes(et(t))}function M(t){return L(t).getComputedStyle(t)}function dt(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(et(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qt(t)&&t.host||F(t);return qt(e)?e.host:e}function Gt(t){let e=q(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&st(e)?e:Gt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Gt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=L(o);if(s){let l=Ot(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function Ot(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zt(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=$(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=ft(n)!==s||ft(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function St(t){return z(t)?t:t.contextElement}function lt(t){let e=St(t);if(!$(e))return B(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Zt(e),r=(s?ft(n.width):n.width)/i,l=(s?ft(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var we=B(0);function te(t){let e=L(t);return!At()||!e.visualViewport?we:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==L(t)?!1:e}function it(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=St(t),r=B(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=ye(s,n,i)?te(s):B(0),a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,f=o.width/r.x,h=o.height/r.y;if(s){let m=L(s),u=i&&z(i)?L(i):i,d=m,p=Ot(d);for(;p&&i&&u!==d;){let w=lt(p),g=p.getBoundingClientRect(),y=M(p),v=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,h*=w.y,a+=v,c+=A,d=L(p),p=Ot(d)}}return tt({width:f,height:h,x:a,y:c})}function zt(t,e){let n=dt(t).scrollLeft;return e?e.left+n:it(F(t)).left+n}function ee(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 xe(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=F(i),l=e?ht(e.floating):!1;if(i===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=B(1),f=B(0),h=$(i);if((h||!h&&!s)&&((et(i)!=="body"||st(r))&&(a=dt(i)),$(i))){let u=it(i);c=lt(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let m=r&&!h&&!s?ee(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 ve(t){return Array.from(t.getClientRects())}function be(t){let e=F(t),n=dt(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 M(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}function Ae(t,e){let n=L(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=At();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function Oe(t,e){let n=it(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 Jt(t,e,n){let i;if(e==="viewport")i=Ae(t,n);else if(e==="document")i=be(F(t));else if(z(e))i=Oe(e,n);else{let o=te(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return tt(i)}function ne(t,e){let n=q(t);return n===e||!z(n)||nt(n)?!1:M(n).position==="fixed"||ne(n,e)}function Ee(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&et(l)!=="body"),o=null,s=M(t).position==="fixed",r=s?q(t):t;for(;z(r)&&!nt(r);){let l=M(r),a=bt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(r)&&!a&&ne(t,r))?i=i.filter(f=>f!==r):o=l,r=q(r)}return e.set(t,i),i}function Re(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ht(e)?[]:Ee(e,this._c):[].concat(n),i],l=r[0],a=r.reduce((c,f)=>{let h=Jt(e,f,o);return c.top=T(h.top,c.top),c.right=j(h.right,c.right),c.bottom=j(h.bottom,c.bottom),c.left=T(h.left,c.left),c},Jt(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ce(t){let{width:e,height:n}=Zt(t);return{width:e,height:n}}function Te(t,e,n){let i=$(e),o=F(e),s=n==="fixed",r=it(t,!0,s,e),l={scrollLeft:0,scrollTop:0},a=B(0);function c(){a.x=zt(o)}if(i||!i&&!s)if((et(e)!=="body"||st(o))&&(l=dt(e)),i){let u=it(e,!0,s,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else o&&c();s&&!i&&o&&c();let f=o&&!i&&!s?ee(o,l):B(0),h=r.left+l.scrollLeft-a.x-f.x,m=r.top+l.scrollTop-a.y-f.y;return{x:h,y:m,width:r.width,height:r.height}}function Pt(t){return M(t).position==="static"}function Qt(t,e){if(!$(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return F(t)===n&&(n=n.ownerDocument.body),n}function ie(t,e){let n=L(t);if(ht(t))return n;if(!$(t)){let o=q(t);for(;o&&!nt(o);){if(z(o)&&!Pt(o))return o;o=q(o)}return n}let i=Qt(t,e);for(;i&&Ut(i)&&Pt(i);)i=Qt(i,e);return i&&nt(i)&&Pt(i)&&!bt(i)?n:i||Kt(t)||n}var Le=async function(t){let e=this.getOffsetParent||ie,n=this.getDimensions,i=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Pe(t){return M(t).direction==="rtl"}var Se={convertOffsetParentRelativeRectToViewportRelativeRect:xe,getDocumentElement:F,getClippingRect:Re,getOffsetParent:ie,getElementRects:Le,getClientRects:ve,getDimensions:Ce,getScale:lt,isElement:z,isRTL:Pe};function oe(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:h,width:m,height:u}=c;if(l||e(),!m||!u)return;let d=ut(h),p=ut(o.clientWidth-(f+m)),w=ut(o.clientHeight-(h+u)),g=ut(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,j(1,a))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==a){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!oe(c,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},v),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function re(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=St(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 h=c&&l?ze(c,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),c&&!a&&u.observe(c),u.observe(e));let d,p=a?it(t):null;a&&w();function w(){let g=it(t);p&&!oe(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(d)}}var se=_t;var le=It,ce=jt,Mt=Yt;var ae=Vt;var fe=(t,e,n)=>{let i=new Map,o=C({platform:Se},n),s=V(C({},o.platform),{_c:i});return Wt(t,e,V(C({},o),{platform:s}))};var x=class extends Ct{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=re(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=[se({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(Mt({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(ce({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(le({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(Mt({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(ae({element:this.arrowEl,padding:this.arrowPadding})),fe(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,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=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:"",u=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))":"",h=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof c=="number"?`${c}px`:"",h=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Et`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Bt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Et`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Ct.styles,kt`: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([Rt('[part="popup"]')],x.prototype,"popup",2),b([Rt('[part="arrow"]')],x.prototype,"arrowEl",2),b([E({reflect:!0})],x.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],x.prototype,"active",2),b([E({type:String,reflect:!0})],x.prototype,"placement",2),b([E({type:String,reflect:!0})],x.prototype,"strategy",2),b([E({type:Number,reflect:!0})],x.prototype,"distance",2),b([E({type:Number,reflect:!0})],x.prototype,"skidding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),b([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),b([E({type:Boolean,reflect:!0})],x.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(" ")}})],x.prototype,"flipFallbackPlacements",2),b([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),b([E({type:Object})],x.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),b([E({type:Boolean})],x.prototype,"shift",2),b([E({type:Object})],x.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),b([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),b([E()],x.prototype,"sync",2),b([E({type:Object})],x.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=b([Dt("sd-5-4-0-popup")],x);export{x as a};
|
|
1
|
+
import{a as Bt}from"./chunk.26V4EXHB.js";import{a as Dt,b as E,d as Rt,h as Ct}from"./chunk.ZAHVXNIZ.js";import{b as kt,e as Et}from"./chunk.UWPDCU52.js";import{a as C,b as V,c as mt,e as b}from"./chunk.TJOCV4DC.js";var j=Math.min,T=Math.max,ft=Math.round,ut=Math.floor,B=t=>({x:t,y:t}),he={left:"right",right:"left",bottom:"top",top:"bottom"},de={start:"end",end:"start"};function gt(t,e,n){return T(t,j(e,n))}function Q(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function Tt(t){return t==="x"?"y":"x"}function wt(t){return t==="y"?"height":"width"}function Y(t){return["top","bottom"].includes(I(t))?"y":"x"}function yt(t){return Tt(Y(t))}function Ft(t,e,n){n===void 0&&(n=!1);let i=Z(t),o=yt(t),s=wt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=at(r)),[r,at(r)]}function $t(t){let e=at(t);return[pt(t),e,pt(e)]}function pt(t){return t.replace(/start|end/g,e=>de[e])}function me(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 Nt(t,e,n,i){let o=Z(t),s=me(I(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(pt)))),s}function at(t){return t.replace(/left|right|bottom|top/g,e=>he[e])}function pe(t){return C({top:0,right:0,bottom:0,left:0},t)}function Lt(t){return typeof t!="number"?pe(t):{top:t,right:t,bottom:t,left:t}}function tt(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 Ht(t,e,n){let{reference:i,floating:o}=t,s=Y(e),r=yt(e),l=wt(r),a=I(e),c=s==="y",f=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,u;switch(a){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(Z(e)){case"start":u[r]-=m*(n&&c?-1:1);break;case"end":u[r]+=m*(n&&c?-1:1);break}return u}var Wt=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:h}=Ht(c,i,a),m=i,u={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x:y,y:v,data:A,reset:O}=await g({x:f,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:c,platform:r,elements:{reference:t,floating:e}});f=y!=null?y:f,h=v!=null?v:h,u=V(C({},u),{[w]:C(C({},u[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:h}=Ht(c,m,a)),p=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:u}};async function xt(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:h="floating",altBoundary:m=!1,padding:u=0}=Q(e,t),d=Lt(u),w=l[m?h==="floating"?"reference":"floating":h],g=tt(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})),y=h==="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=tt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);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 Vt=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}=Q(t,e)||{};if(c==null)return{};let h=Lt(f),m={x:n,y:i},u=yt(o),d=wt(u),p=await r.getDimensions(c),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),R=k?k[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=l.floating[v]||s.floating[d]);let _=A/2-O/2,N=R/2-p[d]/2-1,S=j(h[g],N),X=j(h[y],N),H=S,U=R-p[d]-X,P=R/2-p[d]/2+_,ot=gt(H,P,U),D=!a.arrow&&Z(o)!=null&&P!==ot&&s.reference[d]/2-(P<H?S:X)-p[d]/2<0,J=D?P<H?P-H:P-U:0;return{[u]:m[u]+J,data:C({[u]:ot,centerOffset:P-ot-J},D&&{alignmentOffset:J}),reset:D}}});var jt=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,ot=Q(t,e),{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=ot,w=mt(ot,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=I(o),y=Y(l),v=I(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),O=m||(v||!p?[at(l)]:$t(l)),k=d!=="none";!m&&k&&O.push(...Nt(l,p,d,A));let R=[l,...O],_=await xt(e,w),N=[],S=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&N.push(_[g]),h){let D=Ft(o,r,A);N.push(_[D[0]],_[D[1]])}if(S=[...S,{placement:o,overflows:N}],!N.every(D=>D<=0)){var X,H;let D=(((X=s.flip)==null?void 0:X.index)||0)+1,J=R[D];if(J){var U;let K=h==="alignment"?y!==Y(J):!1,W=((U=S[0])==null?void 0:U.overflows[0])>0;if(!K||W)return{data:{index:D,overflows:S},reset:{placement:J}}}let ct=(H=S.filter(K=>K.overflows[0]<=0).sort((K,W)=>K.overflows[1]-W.overflows[1])[0])==null?void 0:H.placement;if(!ct)switch(u){case"bestFit":{var P;let K=(P=S.filter(W=>{if(k){let G=Y(W.placement);return G===y||G==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(G=>G>0).reduce((G,ue)=>G+ue,0)]).sort((W,G)=>W[1]-G[1])[0])==null?void 0:P[0];K&&(ct=K);break}case"initialPlacement":ct=l;break}if(o!==ct)return{reset:{placement:ct}}}return{}}}};async function ge(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=Z(n),a=Y(n)==="y",c=["left","top"].includes(r)?-1:1,f=s&&a?-1:1,h=Q(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),a?{x:u*f,y:m*c}:{x:m*c,y:u*f}}var _t=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 ge(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:V(C({},a),{placement:r})}}}},It=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Q(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}}}=w,a=mt(w,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},f=await xt(e,a),h=Y(I(o)),m=Tt(h),u=c[m],d=c[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=u+f[g],A=u-f[y];u=gt(v,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],A=d-f[y];d=gt(v,d,A)}let p=l.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var Yt=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,S=Q(t,e),{apply:a=()=>{}}=S,c=mt(S,["apply"]),f=await xt(e,c),h=I(o),m=Z(o),u=Y(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-f.top-f.bottom,v=d-f.left-f.right,A=j(p-f[w],y),O=j(d-f[g],v),k=!e.middlewareData.shift,R=A,_=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(_=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let X=T(f.left,0),H=T(f.right,0),U=T(f.top,0),P=T(f.bottom,0);u?_=d-2*(X!==0||H!==0?X+H:T(f.left,f.right)):R=p-2*(U!==0||P!==0?U+P:T(f.top,f.bottom))}await a(V(C({},e),{availableWidth:_,availableHeight:R}));let N=await r.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function vt(){return typeof window!="undefined"}function et(t){return Xt(t)?(t.nodeName||"").toLowerCase():"#document"}function L(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function F(t){var e;return(e=(Xt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xt(t){return vt()?t instanceof Node||t instanceof L(t).Node:!1}function z(t){return vt()?t instanceof Element||t instanceof L(t).Element:!1}function $(t){return vt()?t instanceof HTMLElement||t instanceof L(t).HTMLElement:!1}function qt(t){return!vt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof L(t).ShadowRoot}function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function Ut(t){return["table","td","th"].includes(et(t))}function ht(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function bt(t){let e=At(),n=z(t)?M(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 Kt(t){let e=q(t);for(;$(e)&&!nt(e);){if(bt(e))return e;if(ht(e))return null;e=q(e)}return null}function At(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(t){return["html","body","#document"].includes(et(t))}function M(t){return L(t).getComputedStyle(t)}function dt(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(et(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qt(t)&&t.host||F(t);return qt(e)?e.host:e}function Gt(t){let e=q(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&st(e)?e:Gt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Gt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=L(o);if(s){let l=Ot(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function Ot(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zt(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=$(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=ft(n)!==s||ft(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function St(t){return z(t)?t:t.contextElement}function lt(t){let e=St(t);if(!$(e))return B(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Zt(e),r=(s?ft(n.width):n.width)/i,l=(s?ft(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var we=B(0);function te(t){let e=L(t);return!At()||!e.visualViewport?we:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==L(t)?!1:e}function it(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=St(t),r=B(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=ye(s,n,i)?te(s):B(0),a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,f=o.width/r.x,h=o.height/r.y;if(s){let m=L(s),u=i&&z(i)?L(i):i,d=m,p=Ot(d);for(;p&&i&&u!==d;){let w=lt(p),g=p.getBoundingClientRect(),y=M(p),v=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,h*=w.y,a+=v,c+=A,d=L(p),p=Ot(d)}}return tt({width:f,height:h,x:a,y:c})}function zt(t,e){let n=dt(t).scrollLeft;return e?e.left+n:it(F(t)).left+n}function ee(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 xe(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=F(i),l=e?ht(e.floating):!1;if(i===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=B(1),f=B(0),h=$(i);if((h||!h&&!s)&&((et(i)!=="body"||st(r))&&(a=dt(i)),$(i))){let u=it(i);c=lt(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let m=r&&!h&&!s?ee(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 ve(t){return Array.from(t.getClientRects())}function be(t){let e=F(t),n=dt(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 M(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}function Ae(t,e){let n=L(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=At();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function Oe(t,e){let n=it(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 Jt(t,e,n){let i;if(e==="viewport")i=Ae(t,n);else if(e==="document")i=be(F(t));else if(z(e))i=Oe(e,n);else{let o=te(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return tt(i)}function ne(t,e){let n=q(t);return n===e||!z(n)||nt(n)?!1:M(n).position==="fixed"||ne(n,e)}function Ee(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&et(l)!=="body"),o=null,s=M(t).position==="fixed",r=s?q(t):t;for(;z(r)&&!nt(r);){let l=M(r),a=bt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(r)&&!a&&ne(t,r))?i=i.filter(f=>f!==r):o=l,r=q(r)}return e.set(t,i),i}function Re(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ht(e)?[]:Ee(e,this._c):[].concat(n),i],l=r[0],a=r.reduce((c,f)=>{let h=Jt(e,f,o);return c.top=T(h.top,c.top),c.right=j(h.right,c.right),c.bottom=j(h.bottom,c.bottom),c.left=T(h.left,c.left),c},Jt(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ce(t){let{width:e,height:n}=Zt(t);return{width:e,height:n}}function Te(t,e,n){let i=$(e),o=F(e),s=n==="fixed",r=it(t,!0,s,e),l={scrollLeft:0,scrollTop:0},a=B(0);function c(){a.x=zt(o)}if(i||!i&&!s)if((et(e)!=="body"||st(o))&&(l=dt(e)),i){let u=it(e,!0,s,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else o&&c();s&&!i&&o&&c();let f=o&&!i&&!s?ee(o,l):B(0),h=r.left+l.scrollLeft-a.x-f.x,m=r.top+l.scrollTop-a.y-f.y;return{x:h,y:m,width:r.width,height:r.height}}function Pt(t){return M(t).position==="static"}function Qt(t,e){if(!$(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return F(t)===n&&(n=n.ownerDocument.body),n}function ie(t,e){let n=L(t);if(ht(t))return n;if(!$(t)){let o=q(t);for(;o&&!nt(o);){if(z(o)&&!Pt(o))return o;o=q(o)}return n}let i=Qt(t,e);for(;i&&Ut(i)&&Pt(i);)i=Qt(i,e);return i&&nt(i)&&Pt(i)&&!bt(i)?n:i||Kt(t)||n}var Le=async function(t){let e=this.getOffsetParent||ie,n=this.getDimensions,i=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Pe(t){return M(t).direction==="rtl"}var Se={convertOffsetParentRelativeRectToViewportRelativeRect:xe,getDocumentElement:F,getClippingRect:Re,getOffsetParent:ie,getElementRects:Le,getClientRects:ve,getDimensions:Ce,getScale:lt,isElement:z,isRTL:Pe};function oe(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:h,width:m,height:u}=c;if(l||e(),!m||!u)return;let d=ut(h),p=ut(o.clientWidth-(f+m)),w=ut(o.clientHeight-(h+u)),g=ut(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,j(1,a))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==a){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!oe(c,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},v),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function re(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=St(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 h=c&&l?ze(c,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),c&&!a&&u.observe(c),u.observe(e));let d,p=a?it(t):null;a&&w();function w(){let g=it(t);p&&!oe(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(d)}}var se=_t;var le=It,ce=jt,Mt=Yt;var ae=Vt;var fe=(t,e,n)=>{let i=new Map,o=C({platform:Se},n),s=V(C({},o.platform),{_c:i});return Wt(t,e,V(C({},o),{platform:s}))};var x=class extends Ct{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=re(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=[se({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(Mt({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(ce({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(le({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(Mt({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(ae({element:this.arrowEl,padding:this.arrowPadding})),fe(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,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=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:"",u=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))":"",h=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof c=="number"?`${c}px`:"",h=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Et`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Bt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Et`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Ct.styles,kt`: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([Rt('[part="popup"]')],x.prototype,"popup",2),b([Rt('[part="arrow"]')],x.prototype,"arrowEl",2),b([E({reflect:!0})],x.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],x.prototype,"active",2),b([E({type:String,reflect:!0})],x.prototype,"placement",2),b([E({type:String,reflect:!0})],x.prototype,"strategy",2),b([E({type:Number,reflect:!0})],x.prototype,"distance",2),b([E({type:Number,reflect:!0})],x.prototype,"skidding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),b([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),b([E({type:Boolean,reflect:!0})],x.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(" ")}})],x.prototype,"flipFallbackPlacements",2),b([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),b([E({type:Object})],x.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),b([E({type:Boolean})],x.prototype,"shift",2),b([E({type:Object})],x.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),b([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),b([E()],x.prototype,"sync",2),b([E({type:Object})],x.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=b([Dt("sd-5-4-1-popup")],x);export{x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk.YTG5BN3U.js";import{a as d}from"./chunk.6HO6CE4A.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as h,b as s,d as u,h as o}from"./chunk.ZAHVXNIZ.js";import{b as a,e as n}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.hasSlotController=new d(this,"[default]","icon-left","icon-right");this.standalone=!1;this.size="inherit";this.inverted=!1;this.href="";this.visuallyDisabled=!1}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(l){this.visuallyDisabled&&(l.preventDefault(),l.stopPropagation())}focus(l){this.button.focus(l)}blur(){this.button.blur()}render(){let l={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return n`<a part="base" class="${r("inline",this.href&&!this.visuallyDisabled?"cursor-pointer":"",this.visuallyDisabled?"cursor-not-allowed focus-visible:focus-outline":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline",visuallyDisabled:this.inverted?"text-neutral-600":"text-neutral-500"}[this.href&&!this.visuallyDisabled?"enabled":this.visuallyDisabled?"visuallyDisabled":"disabled"],this.standalone&&"flex items-start")}" href="${i(this.href||void 0)}" target="${i(this.target||void 0)}" download="${i(this.download)}" rel="${i(this.target?"noreferrer noopener":void 0)}" aria-disabled="${!this.href||this.visuallyDisabled?"true":"false"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${r("inline",l["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${r("inline",l["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};e.styles=[...o.styles,a`::slotted(sd-5-4-
|
|
1
|
+
import{a as i}from"./chunk.YTG5BN3U.js";import{a as d}from"./chunk.6HO6CE4A.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as h,b as s,d as u,h as o}from"./chunk.ZAHVXNIZ.js";import{b as a,e as n}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.hasSlotController=new d(this,"[default]","icon-left","icon-right");this.standalone=!1;this.size="inherit";this.inverted=!1;this.href="";this.visuallyDisabled=!1}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(l){this.visuallyDisabled&&(l.preventDefault(),l.stopPropagation())}focus(l){this.button.focus(l)}blur(){this.button.blur()}render(){let l={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return n`<a part="base" class="${r("inline",this.href&&!this.visuallyDisabled?"cursor-pointer":"",this.visuallyDisabled?"cursor-not-allowed focus-visible:focus-outline":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline",visuallyDisabled:this.inverted?"text-neutral-600":"text-neutral-500"}[this.href&&!this.visuallyDisabled?"enabled":this.visuallyDisabled?"visuallyDisabled":"disabled"],this.standalone&&"flex items-start")}" href="${i(this.href||void 0)}" target="${i(this.target||void 0)}" download="${i(this.download)}" rel="${i(this.target?"noreferrer noopener":void 0)}" aria-disabled="${!this.href||this.visuallyDisabled?"true":"false"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${r("inline",l["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${r("inline",l["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};e.styles=[...o.styles,a`::slotted(sd-5-4-1-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-5-4-1-icon){font-size:var(--sd-font-size-base,1rem)}:host([size=lg][standalone]) ::slotted(sd-5-4-1-icon){font-size:var(--sd-font-size-xl,1.5rem)}`],t([u("a")],e.prototype,"button",2),t([s({type:Boolean,reflect:!0})],e.prototype,"standalone",2),t([s({type:String,reflect:!0})],e.prototype,"size",2),t([s({type:Boolean,reflect:!0})],e.prototype,"inverted",2),t([s({type:String,reflect:!0})],e.prototype,"href",2),t([s({type:Boolean,attribute:"visually-disabled",reflect:!0})],e.prototype,"visuallyDisabled",2),t([s({type:String,reflect:!0})],e.prototype,"target",2),t([s({reflect:!0})],e.prototype,"download",2),e=t([h("sd-5-4-1-link")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,b as f,c as a}from"./chunk.D5IOD6QB.js";import{a as v}from"./chunk.TWZDCIM2.js";import{b as y}from"./chunk.N2OPZHJV.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as p,b as s,c as d,h as c}from"./chunk.ZAHVXNIZ.js";import{b as g,e as b}from"./chunk.UWPDCU52.js";import{e}from"./chunk.TJOCV4DC.js";var n,t=class extends c{constructor(){super(...arguments);this.svg="";this.label="";this.library="default";this.color="currentColor"}connectedCallback(){super.connectedCallback(),u(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),f(this)}getUrl(){let r=a(this.library);return this.name&&r?r.resolver(this.name):this.src}handleLabelChange(){typeof this.label=="string"&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var m;let r=a(this.library),i=this.getUrl();if(n||(n=new DOMParser),i)try{let l=await v(i);if(i===this.getUrl())if(l.ok){let o=n.parseFromString(l.svg,"text/html").body.querySelector("svg");o!==null?((m=r==null?void 0:r.mutator)==null||m.call(r,o),this.svg=o.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch(l){this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return b`${y(this.svg)}`}};t.styles=[...c.styles,g`:host{box-sizing:content-box!important;display:inline-block;height:1em;width:1em}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity,1))}:host([color=white]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity,1))}`],e([d()],t.prototype,"svg",2),e([s({reflect:!0})],t.prototype,"name",2),e([s()],t.prototype,"src",2),e([s()],t.prototype,"label",2),e([s({reflect:!0})],t.prototype,"library",2),e([s({reflect:!0})],t.prototype,"color",2),e([h("label")],t.prototype,"handleLabelChange",1),e([h(["name","src","library"])],t.prototype,"setIcon",1),t=e([p("sd-5-4-
|
|
1
|
+
import{a as u,b as f,c as a}from"./chunk.D5IOD6QB.js";import{a as v}from"./chunk.TWZDCIM2.js";import{b as y}from"./chunk.N2OPZHJV.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as p,b as s,c as d,h as c}from"./chunk.ZAHVXNIZ.js";import{b as g,e as b}from"./chunk.UWPDCU52.js";import{e}from"./chunk.TJOCV4DC.js";var n,t=class extends c{constructor(){super(...arguments);this.svg="";this.label="";this.library="default";this.color="currentColor"}connectedCallback(){super.connectedCallback(),u(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),f(this)}getUrl(){let r=a(this.library);return this.name&&r?r.resolver(this.name):this.src}handleLabelChange(){typeof this.label=="string"&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var m;let r=a(this.library),i=this.getUrl();if(n||(n=new DOMParser),i)try{let l=await v(i);if(i===this.getUrl())if(l.ok){let o=n.parseFromString(l.svg,"text/html").body.querySelector("svg");o!==null?((m=r==null?void 0:r.mutator)==null||m.call(r,o),this.svg=o.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch(l){this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return b`${y(this.svg)}`}};t.styles=[...c.styles,g`:host{box-sizing:content-box!important;display:inline-block;height:1em;width:1em}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity,1))}:host([color=white]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity,1))}`],e([d()],t.prototype,"svg",2),e([s({reflect:!0})],t.prototype,"name",2),e([s()],t.prototype,"src",2),e([s()],t.prototype,"label",2),e([s({reflect:!0})],t.prototype,"library",2),e([s({reflect:!0})],t.prototype,"color",2),e([h("label")],t.prototype,"handleLabelChange",1),e([h(["name","src","library"])],t.prototype,"setIcon",1),t=e([p("sd-5-4-1-icon")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,c as b}from"./chunk.SKUMYG4O.js";import{a as v}from"./chunk.DEXOQON7.js";import{a as o}from"./chunk.26V4EXHB.js";import{a as y}from"./chunk.KLRPP4NQ.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as g,b as s,d,h as p}from"./chunk.ZAHVXNIZ.js";import{b as w,e as n}from"./chunk.UWPDCU52.js";import{b as u,e as m}from"./chunk.6OTM3PE5.js";import{e}from"./chunk.TJOCV4DC.js";var l={"top-right":null,"bottom-center":null},k=()=>{Object.entries(l).forEach(([a])=>{let r=document.querySelector(`#sd-toast-stack--${a}`);if(r){r.setAttribute("role","region"),l[a]=r;return}l[a]=Object.assign(document.createElement("div"),{role:"region",id:`sd-toast-stack--${a}`,className:`sd-toast-stack sd-toast-stack--${a}`})})};k();var t=class extends p{constructor(){super(...arguments);this.localize=new v(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now()}get stack(){return l[this.toastStack]}connectedCallback(){super.connectedCallback(),this.stack.parentElement||(document.body.append(this.stack),this.stack.ariaLabel=this.localize.term("notifications"))}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}handleKeyDown(i){this.closable&&i.key==="Escape"&&this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await m(this.base),this.base.hidden=!1;let{keyframes:i,options:c}=b(this,"notification.show",{dir:this.localize.dir()});await u(this.base,i,c),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await m(this.base);let{keyframes:i,options:c}=b(this,"notification.hide",{dir:this.localize.dir()});await u(this.base,i,c),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,y(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,y(this,"sd-after-hide")}async toast(){return new Promise(i=>{this.stack.parentElement===null&&document.body.append(this.stack),this.stack.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{this.stack.removeChild(this),i()},{once:!0})})}render(){return n`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2 focus-visible:focus-outline")}" id="notification" tabindex="0" role="alert" aria-labelledby="message" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}" @keydown="${this.handleKeyDown}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-5-4-
|
|
1
|
+
import{a as f,c as b}from"./chunk.SKUMYG4O.js";import{a as v}from"./chunk.DEXOQON7.js";import{a as o}from"./chunk.26V4EXHB.js";import{a as y}from"./chunk.KLRPP4NQ.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as g,b as s,d,h as p}from"./chunk.ZAHVXNIZ.js";import{b as w,e as n}from"./chunk.UWPDCU52.js";import{b as u,e as m}from"./chunk.6OTM3PE5.js";import{e}from"./chunk.TJOCV4DC.js";var l={"top-right":null,"bottom-center":null},k=()=>{Object.entries(l).forEach(([a])=>{let r=document.querySelector(`#sd-toast-stack--${a}`);if(r){r.setAttribute("role","region"),l[a]=r;return}l[a]=Object.assign(document.createElement("div"),{role:"region",id:`sd-toast-stack--${a}`,className:`sd-toast-stack sd-toast-stack--${a}`})})};k();var t=class extends p{constructor(){super(...arguments);this.localize=new v(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now()}get stack(){return l[this.toastStack]}connectedCallback(){super.connectedCallback(),this.stack.parentElement||(document.body.append(this.stack),this.stack.ariaLabel=this.localize.term("notifications"))}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}handleKeyDown(i){this.closable&&i.key==="Escape"&&this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await m(this.base),this.base.hidden=!1;let{keyframes:i,options:c}=b(this,"notification.show",{dir:this.localize.dir()});await u(this.base,i,c),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await m(this.base);let{keyframes:i,options:c}=b(this,"notification.hide",{dir:this.localize.dir()});await u(this.base,i,c),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,y(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,y(this,"sd-after-hide")}async toast(){return new Promise(i=>{this.stack.parentElement===null&&document.body.append(this.stack),this.stack.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{this.stack.removeChild(this),i()},{once:!0})})}render(){return n`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2 focus-visible:focus-outline")}" id="notification" tabindex="0" role="alert" aria-labelledby="message" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}" @keydown="${this.handleKeyDown}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-5-4-1-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="_internal" class="h-6 w-6 text-white"></sd-5-4-1-icon></slot><div part="content" class="${o("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot id="message" part="message" class="block w-full pl-3 py-2"></slot>${this.closable?n`<sd-5-4-1-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-5-4-1-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-5-4-1-icon></sd-5-4-1-button>`:""}</div>${this.durationIndicator?n`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${o("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div>`}};t.styles=[...p.styles,w`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],e([d('[part~="base"]')],t.prototype,"base",2),e([d('[part~="close-button"]')],t.prototype,"close",2),e([s({type:String,reflect:!0})],t.prototype,"variant",2),e([s({type:Boolean,reflect:!0})],t.prototype,"open",2),e([s({type:Boolean,reflect:!0})],t.prototype,"closable",2),e([s({type:Number,reflect:!0})],t.prototype,"duration",2),e([s({type:Boolean,reflect:!0,attribute:"duration-indicator"})],t.prototype,"durationIndicator",2),e([s({type:String,reflect:!0,attribute:"toast-stack"})],t.prototype,"toastStack",2),e([h("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),e([h("duration")],t.prototype,"handleDurationChange",1),t=e([g("sd-5-4-1-notification")],t);f("notification.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}});f("notification.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,b as i,g as c,h as o}from"./chunk.ZAHVXNIZ.js";import{b as a,e as l}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return l`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`:host{display:block}::slotted(sd-5-4-
|
|
1
|
+
import{a as n,b as i,g as c,h as o}from"./chunk.ZAHVXNIZ.js";import{b as a,e as l}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return l`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`:host{display:block}::slotted(sd-5-4-1-accordion:not(:first-of-type)){margin-top:-1px}`],t([c({selector:"sd-5-4-1-accordion"})],e.prototype,"_accordionsInDefaultSlot",2),t([i({attribute:"close-others",type:Boolean,reflect:!0})],e.prototype,"closeOthers",2),e=t([n("sd-5-4-1-accordion-group")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk.6HO6CE4A.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as h,b as a,c as d,d as m,h as s}from"./chunk.ZAHVXNIZ.js";import{b as l,e as n}from"./chunk.UWPDCU52.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends s{constructor(){super(...arguments);this.variant="white";this.breakpoint=448;this.inset=!1;this.hasSlotController=new p(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),this.breakpoint===0?this._orientation="horizontal":this.breakpoint===9999?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.updateOrientation()),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(e){super.updated(e),e.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){let e=this.variant==="white border-neutral-400"||this.inset,o={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline")};return n`<div class="${r("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],this._orientation==="vertical"&&"flex-col",this._orientation==="horizontal"&&"flex-row gap-8",this._orientation==="horizontal"&&e&&"py-8 px-10")}" part="base"><div style="${this._orientation==="horizontal"?`width: var(--distribution-content, 100%); ${e?"width: var(--distribution-content, calc(100% - 2rem));":""}`:""}" class="${r("flex flex-col text-left order-2",this._orientation==="horizontal"&&"flex flex-col",this._orientation==="vertical"&&e&&"m-4")}" part="content"><div class="flex flex-col-reverse"><div part="headline" class="${r("text-lg font-bold m-0",this.variant==="primary"?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4",!o["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div part="main" class="${r(!o["teaser-has-default"]&&"hidden")}" role="group" aria-labelledby="headline"><slot></slot></div></div><div part="media" id="media" style="${this._orientation==="horizontal"?"width: var(--distribution-media, 100%);":""}" class="${r("order-1",!e&&this._orientation==="vertical"&&"mb-4",!o["teaser-has-media"]&&"hidden",this.variant==="white border-neutral-400"&&this._orientation==="vertical"&&"mx-[-1px] mt-[-1px]")}"><slot name="media"></slot></div></div>`}};t.styles=[...s.styles,l`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:var(--sd-spacing-0,0)!important}`],i([a({type:String,reflect:!0})],t.prototype,"variant",2),i([a({reflect:!0,type:Number})],t.prototype,"breakpoint",2),i([a({type:Boolean,reflect:!0})],t.prototype,"inset",2),i([m('[part="base"]')],t.prototype,"teaser",2),i([d()],t.prototype,"_orientation",2),t=i([h("sd-5-4-
|
|
1
|
+
import{a as p}from"./chunk.6HO6CE4A.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as h,b as a,c as d,d as m,h as s}from"./chunk.ZAHVXNIZ.js";import{b as l,e as n}from"./chunk.UWPDCU52.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends s{constructor(){super(...arguments);this.variant="white";this.breakpoint=448;this.inset=!1;this.hasSlotController=new p(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),this.breakpoint===0?this._orientation="horizontal":this.breakpoint===9999?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.updateOrientation()),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(e){super.updated(e),e.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){let e=this.variant==="white border-neutral-400"||this.inset,o={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline")};return n`<div class="${r("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],this._orientation==="vertical"&&"flex-col",this._orientation==="horizontal"&&"flex-row gap-8",this._orientation==="horizontal"&&e&&"py-8 px-10")}" part="base"><div style="${this._orientation==="horizontal"?`width: var(--distribution-content, 100%); ${e?"width: var(--distribution-content, calc(100% - 2rem));":""}`:""}" class="${r("flex flex-col text-left order-2",this._orientation==="horizontal"&&"flex flex-col",this._orientation==="vertical"&&e&&"m-4")}" part="content"><div class="flex flex-col-reverse"><div part="headline" class="${r("text-lg font-bold m-0",this.variant==="primary"?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4",!o["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div part="main" class="${r(!o["teaser-has-default"]&&"hidden")}" role="group" aria-labelledby="headline"><slot></slot></div></div><div part="media" id="media" style="${this._orientation==="horizontal"?"width: var(--distribution-media, 100%);":""}" class="${r("order-1",!e&&this._orientation==="vertical"&&"mb-4",!o["teaser-has-media"]&&"hidden",this.variant==="white border-neutral-400"&&this._orientation==="vertical"&&"mx-[-1px] mt-[-1px]")}"><slot name="media"></slot></div></div>`}};t.styles=[...s.styles,l`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:var(--sd-spacing-0,0)!important}`],i([a({type:String,reflect:!0})],t.prototype,"variant",2),i([a({reflect:!0,type:Number})],t.prototype,"breakpoint",2),i([a({type:Boolean,reflect:!0})],t.prototype,"inset",2),i([m('[part="base"]')],t.prototype,"teaser",2),i([d()],t.prototype,"_orientation",2),t=i([h("sd-5-4-1-teaser")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m}from"./chunk.H2TKMIFR.js";import{a as b}from"./chunk.DEXOQON7.js";import{a as s}from"./chunk.26V4EXHB.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as d,b as a,d as n,h as o}from"./chunk.ZAHVXNIZ.js";import{b as r}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.localize=new b(this);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:l}=this;this.defaultSlot.assignedElements().filter(i=>i.tagName.toLowerCase()==="sd-5-4-
|
|
1
|
+
import{b as m}from"./chunk.H2TKMIFR.js";import{a as b}from"./chunk.DEXOQON7.js";import{a as s}from"./chunk.26V4EXHB.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as d,b as a,d as n,h as o}from"./chunk.ZAHVXNIZ.js";import{b as r}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.localize=new b(this);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:l}=this;this.defaultSlot.assignedElements().filter(i=>i.tagName.toLowerCase()==="sd-5-4-1-option").forEach(i=>{i.disabled=l})}handleDisabledChange(){this.handleDisableOptions()}render(){let{disabled:l}=this;return m`<div role="${l?"presentation":"group"}" class="${s(this.disabled?"text-neutral-500":"")}" part="base" aria-labelledby="group-label"><sd-5-4-1-divider id="divider" class="pt-2 pb-4" part="divider"></sd-5-4-1-divider><div part="label-container" class="${s(this.disabled?"text-neutral-500":"text-black")} px-4 font-bold text-left" role="presentation" id="group-label"><slot name="label"><span>${this.label}</span></slot></div><div role="listbox" part="options" aria-label="${this.localize.term("optionGroup")}"><slot @slotchange="${this.handleDisableOptions}"></slot></div></div>`}};e.styles=[...o.styles,r`:host{--display-divider:block}#divider{display:var(--display-divider)}`],t([n("slot:not([name])")],e.prototype,"defaultSlot",2),t([a({reflect:!0,type:Boolean})],e.prototype,"disabled",2),t([a({type:String,reflect:!0})],e.prototype,"label",2),t([p("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([d("sd-5-4-1-optgroup")],e);export{e 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-5-4-
|
|
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-5-4-1-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-5-4-1-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-5-4-1-popup li{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}sd-5-4-1-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-5-4-1-popup li{list-style-type:""}sd-5-4-1-popup li mark{background-color:transparent;font-weight:700}sd-5-4-1-popup li:not(:has(sd-5-4-1-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-5-4-1-popup li:not(:has(sd-5-4-1-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}sd-5-4-1-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-5-4-1-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-5-4-1-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,11 +1,11 @@
|
|
|
1
|
-
import{a as M}from"./chunk.CDC46OKY.js";import{c as I}from"./chunk.3L472FD4.js";import{b as L}from"./chunk.6HLS5XU2.js";import{a as z}from"./chunk.6HO6CE4A.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as k}from"./chunk.N2OPZHJV.js";import{a as D}from"./chunk.DEXOQON7.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as r,c as u,d as c,g as E,h as x}from"./chunk.ZAHVXNIZ.js";import{b as T,e as p}from"./chunk.UWPDCU52.js";import{b as g,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new L(this,{assumeInteractionOn:["sd-blur","sd-5-4-
|
|
1
|
+
import{a as M}from"./chunk.CDC46OKY.js";import{c as I}from"./chunk.3L472FD4.js";import{b as L}from"./chunk.6HLS5XU2.js";import{a as z}from"./chunk.6HO6CE4A.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as k}from"./chunk.N2OPZHJV.js";import{a as D}from"./chunk.DEXOQON7.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as r,c as u,d as c,g as E,h as x}from"./chunk.ZAHVXNIZ.js";import{b as T,e as p}from"./chunk.UWPDCU52.js";import{b as g,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new L(this,{assumeInteractionOn:["sd-blur","sd-5-4-1-input"]});this.hasSlotController=new z(this,"help-text","label");this.localize=new D(this);this.typeToSelectString="";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.visuallyDisabled=!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=t=>p`<sd-5-4-1-tag class="relative z-10" ?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="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-4-
|
|
5
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-4-1-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,l=e.closest(".select__clear")!==null,o=e.closest("sd-5-4-1-icon-button")!==null;if(!(l||o)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);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.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),a=h.indexOf(this.currentOption),n=Math.max(0,a);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(n=a+1,n>h.length-1&&(n=0)):t.key==="ArrowUp"?(n=a-1,n<0&&(n=h.length-1)):t.key==="Home"?n=0:t.key==="End"&&(n=h.length-1),this.setCurrentOption(h[n],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let a of h)if(a.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(a);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.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(t,e){var l,o,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let a=(l=t.currentTarget)==null?void 0:l.parentElement,n=(o=a==null?void 0:a.previousElementSibling)==null?void 0:o.querySelector("sd-5-4-1-tag"),m=(h=a==null?void 0:a.nextElementSibling)==null?void 0:h.querySelector("sd-5-4-1-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():n?n.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var l;let e=(l=this.shadowRoot)==null?void 0:l.querySelectorAll("sd-5-4-1-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let l=t.composedPath().some(o=>o instanceof HTMLSlotElement&&o.name==="removable-indicator");this.disabled||l||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let l=t.target.closest("sd-5-4-1-option"),o=this.value;l&&!l.disabled&&(this.multiple?this.toggleOptionSelection(l):this.setSelectedOptions(l),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==o&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],l=[];customElements.get("sd-5-4-1-option")?(t.forEach(o=>{this.multiple&&(o.checkbox=!0),l.push(o.value)}),this.setSelectedOptions(t.filter(o=>e.includes(o.value)))):customElements.whenDefined("sd-5-4-1-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-4-1-option")]}getFirstOption(){return this.querySelector("sd-5-4-1-option")}setCurrentOption(t,e){this.getAllOptions().forEach(o=>{o.current=!1,o.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(o.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),l=Array.isArray(t)?t:[t];e.forEach(o=>o.selected=!1),l.length&&l.forEach(o=>o.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}selectionChanged(t){var e,l,o,h;t&&this.multiple?this.selectedOptions.find(a=>a.value===t.value)?this.selectedOptions=this.selectedOptions.filter(a=>a.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(a=>a.selected),this.multiple?(this.value=this.selectedOptions.map(a=>a.value),this.useTags||this.value.length===0?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(l=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?l:"",this.displayLabel=(h=(o=this.selectedOptions[0])==null?void 0:o.getTextLabel())!=null?h:""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let l=this.getTag(t,e);return p`<div @sd-remove="${o=>this.handleTagRemove(o,t)}">${typeof l=="string"?k(l):l}</div>`}return[p``]}):[p`<sd-5-4-1-tag class="z-10" ?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="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-4-
|
|
9
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-4-1-tag>`]}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-4-1-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){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:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(l=>e.includes(l.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={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"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,l=this.helpText?!0:!!t.helpText,o=this.clearable&&!this.disabled,h=!!t.tooltip,a=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",n=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",n,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",a==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"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"}[a],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-4-1-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("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 class="${d("relative w-full h-full grid grid-cols-1 rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",n,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||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<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(v=>v==null?void 0:v.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" 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}"> ${o?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,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-5-4-
|
|
11
|
+
"><div class="${d("relative w-full h-full grid grid-cols-1 rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",n,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||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<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(v=>v==null?void 0:v.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" 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}"> ${o?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,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-5-4-1-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-4-1-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-4-1-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-4-1-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-4-1-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="status-check"></sd-5-4-1-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-4-1-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-4-1-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",n,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",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-5-4-1-popup></div><div class="text-sm text-neutral-700 mt-2" 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()}`}};i.styles=[...x.styles,T`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-4-1-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-4-1-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-5-4-1-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-4-1-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-4-1-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))}`],s([E({selector:"sd-5-4-1-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-4-1-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"displayLabel",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([r({type:Boolean,reflect:!0})],i.prototype,"open",2),s([r({type:String,reflect:!0})],i.prototype,"size",2),s([r({type:String,reflect:!0})],i.prototype,"placement",2),s([r({type:String,reflect:!0})],i.prototype,"label",2),s([r({type:String,reflect:!0})],i.prototype,"placeholder",2),s([r({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([r({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([r({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([r({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([r({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([r({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([r({reflect:!0})],i.prototype,"form",2),s([r({reflect:!0})],i.prototype,"name",2),s([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([r({type:Boolean,reflect:!0})],i.prototype,"required",2),s([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([r({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([r()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-4-1-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,h as e}from"./chunk.ZAHVXNIZ.js";import{b as l,e as o}from"./chunk.UWPDCU52.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends e{static isCarouselItem(s){return s instanceof Element&&s.getAttribute("aria-roledescription")==="slide"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return o`<slot></slot>`}};t.styles=[...e.styles,l`:host{align-items:center;aspect-ratio:var(--aspect-ratio);display:flex;flex-direction:column;height:100%;justify-content:center;scroll-snap-align:start;scroll-snap-stop:always;width:100%}::slotted(img){height:100%;-o-object-fit:cover;object-fit:cover;width:100%}`],t=i([r("sd-5-4-
|
|
1
|
+
import{a as r,h as e}from"./chunk.ZAHVXNIZ.js";import{b as l,e as o}from"./chunk.UWPDCU52.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends e{static isCarouselItem(s){return s instanceof Element&&s.getAttribute("aria-roledescription")==="slide"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return o`<slot></slot>`}};t.styles=[...e.styles,l`:host{align-items:center;aspect-ratio:var(--aspect-ratio);display:flex;flex-direction:column;height:100%;justify-content:center;scroll-snap-align:start;scroll-snap-stop:always;width:100%}::slotted(img){height:100%;-o-object-fit:cover;object-fit:cover;width:100%}`],t=i([r("sd-5-4-1-carousel-item")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,b as m,c as b,d as h,h as i}from"./chunk.ZAHVXNIZ.js";import{b as d,e as c}from"./chunk.UWPDCU52.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-5-4-
|
|
1
|
+
import{a as g,b as m,c as b,d as h,h as i}from"./chunk.ZAHVXNIZ.js";import{b as d,e as c}from"./chunk.UWPDCU52.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-5-4-1-button-group__button--focus")}handleBlur(e){let t=a(e.target);t==null||t.classList.remove("sd-5-4-1-button-group__button--focus")}handleMouseOver(e){let t=a(e.target);t==null||t.classList.add("sd-5-4-1-button-group__button--hover")}handleMouseOut(e){let t=a(e.target);t==null||t.classList.remove("sd-5-4-1-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-5-4-1-button-group__button"),o.classList.toggle("sd-5-4-1-button-group__button--first",n===0),o.classList.toggle("sd-5-4-1-button-group__button--inner",n>0&&n<e.length-1),o.classList.toggle("sd-5-4-1-button-group__button--last",n===e.length-1),o.classList.toggle("sd-5-4-1-button-group__button--radio",o.tagName.toLowerCase()==="sd-5-4-1-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({type:String,reflect:!0})],s.prototype,"label",2),s=l([g("sd-5-4-1-button-group")],s);function a(r){var e;let u="sd-5-4-1-button, sd-5-4-1-radio-button";return(e=r.closest(u))!=null?e:r.querySelector(u)}export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk.26V4EXHB.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.ZAHVXNIZ.js";import{b as l,e as t}from"./chunk.UWPDCU52.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,reflect:!0})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-5-4-
|
|
1
|
+
import{a}from"./chunk.26V4EXHB.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.ZAHVXNIZ.js";import{b as l,e as t}from"./chunk.UWPDCU52.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,reflect:!0})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-5-4-1-brandshape")],r);export{r as a};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as k}from"./chunk.CBQWVOOS.js";import{a as T}from"./chunk.C577EOP7.js";import{a as _}from"./chunk.FJY2VDLX.js";import{a as M}from"./chunk.DEXOQON7.js";import{a as n}from"./chunk.26V4EXHB.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as v,c as f,d as g,e as $,h as w}from"./chunk.ZAHVXNIZ.js";import{b as x,e as b}from"./chunk.UWPDCU52.js";import{d as A}from"./chunk.6OTM3PE5.js";import{e as o}from"./chunk.TJOCV4DC.js";function C(h,d,e){let i=t=>Object.is(t,-0)?0:t;return h<d?i(d):h>e?i(e):i(h)}function*L(h,d){if(h!==void 0){let e=0;for(let i of h)yield d(i,e++)}}function*B(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 w{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-5-4-
|
|
1
|
+
import{a as k}from"./chunk.CBQWVOOS.js";import{a as T}from"./chunk.C577EOP7.js";import{a as _}from"./chunk.FJY2VDLX.js";import{a as M}from"./chunk.DEXOQON7.js";import{a as n}from"./chunk.26V4EXHB.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as v,c as f,d as g,e as $,h as w}from"./chunk.ZAHVXNIZ.js";import{b as x,e as b}from"./chunk.UWPDCU52.js";import{d as A}from"./chunk.6OTM3PE5.js";import{e as o}from"./chunk.TJOCV4DC.js";function C(h,d,e){let i=t=>Object.is(t,-0)?0:t;return h<d?i(d):h>e?i(e):i(h)}function*L(h,d){if(h!==void 0){let e=0;for(let i of h)yield d(i,e++)}}function*B(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 w{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-5-4-1-carousel-item");this.intersectionObserverEntries=new Map;this.localize=new M(this);this.userInteracted=!1;this.handleUserInteraction=()=>{this.userInteracted=!0};this.handleSlotChange=e=>{e.some(t=>[...t.addedNodes,...t.removedNodes].some(s=>_.isCarouselItem(s)&&!s.hasAttribute("data-clone")))&&this.initializeSlides(),this.requestUpdate()};this.unblockAutoplay=(e,i)=>{e.detail&&i.blur()}}connectedCallback(){super.connectedCallback(),["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))}handleFocus(){this.autoplay&&this.scrollContainer.setAttribute("aria-live","polite")}handleBlur(){this.autoplay&&this.scrollContainer.setAttribute("aria-live","off")}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=C(e+(s?t:0),0,u.length+1),y=u[p],P=l.getBoundingClientRect(),S=y.getBoundingClientRect();if(l.scrollTo({left:S.left-P.left+l.scrollLeft,top:S.top-P.top+l.scrollTop,behavior:A()?"auto":i}),this.userInteracted&&!this.loop){let I=this.activeSlide===c.length-1||this.activeSlide===this.slides.length-this.slidesPerPage,O=this.activeSlide===0;I?this.previousButton.focus({preventScroll:!0}):O&&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"}" aria-label="${this.localize.term("carouselContainer",this.slides.length)}" aria-live="${this.autoplay?"off":"polite"}" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><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 transition-colors duration-fast ease-in-out",!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"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-5-4-
|
|
3
|
+
snap-x snap-mandatory overflow-y-hidden`)}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" aria-label="${this.localize.term("carouselContainer",this.slides.length)}" aria-live="${this.autoplay?"off":"polite"}" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><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 transition-colors duration-fast ease-in-out",!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"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-5-4-1-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="_internal" name="${u?"chevron-down":"chevron-up"}"></sd-5-4-1-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">${L(B(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 transition-colors duration-slow hover:duration-fast ease-in-out",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 transition-colors duration-fast ease-in-out",!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"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${c?a=>{this.next(),this.unblockAutoplay(a,this.nextButton)}:null}"><slot name="next-icon"><sd-5-4-1-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="_internal" name="${u?"chevron-up":"chevron-down"}"></sd-5-4-1-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-5-4-1-icon class="h-6 w-6 grid place-items-center" library="_internal" name="start"></sd-5-4-1-icon></slot><slot name="autoplay-pause" class="${n(this.pausedAutoplay?"hidden":"")}"><sd-5-4-1-icon class="h-6 w-6 grid place-items-center" library="_internal" name="pause"></sd-5-4-1-icon></slot></button></div></div>`}};r.styles=[...w.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-5-4-1-button::part(label){align-items:center;display:flex;flex:1 1 auto;pointer-events:none}`],o([g('[part~="autoplay-controls"]')],r.prototype,"autoplayControls",2),o([g('[part~="navigation-button--previous"]')],r.prototype,"previousButton",2),o([g('[part~="navigation-button--next"]')],r.prototype,"nextButton",2),o([$('[part~="pagination-item"]')],r.prototype,"paginationItems",2),o([v({type:String,reflect:!0})],r.prototype,"variant",2),o([v({type:Boolean,reflect:!0})],r.prototype,"inverted",2),o([v({type:Boolean,reflect:!0})],r.prototype,"loop",2),o([v({type:Boolean,reflect:!0})],r.prototype,"autoplay",2),o([v({type:Number,attribute:"slides-per-page",reflect:!0})],r.prototype,"slidesPerPage",2),o([v({type:Number,attribute:"slides-per-move",reflect:!0})],r.prototype,"slidesPerMove",2),o([g("slot:not([name])")],r.prototype,"defaultSlot",2),o([g(".carousel__slides")],r.prototype,"scrollContainer",2),o([g(".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-5-4-1-carousel")],r);export{r as a};
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
lit-html/directives/map.js:
|