@luzmo/lucero 0.0.38 → 0.0.40

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.
Files changed (52) hide show
  1. package/components/action-menu/index.cjs +1 -1
  2. package/components/action-menu/index.js +1 -1
  3. package/components/button/index.cjs +1 -1
  4. package/components/button/index.js +17 -17
  5. package/components/color-area/color-area.d.ts +44 -6
  6. package/components/color-area/index.cjs +5 -5
  7. package/components/color-area/index.js +70 -62
  8. package/components/color-controller-DTp1juRz.js +3198 -0
  9. package/components/color-controller-_ZwyhvaU.cjs +18 -0
  10. package/components/color-field/color-field.d.ts +3 -3
  11. package/components/color-field/index.cjs +5 -5
  12. package/components/color-field/index.js +25 -28
  13. package/components/color-menu/color-menu.d.ts +5 -3
  14. package/components/color-menu/index.cjs +6 -6
  15. package/components/color-menu/index.js +11 -8
  16. package/components/color-picker/index.cjs +2 -3
  17. package/components/color-picker/index.js +22 -22
  18. package/components/color-slider/index.cjs +1 -40
  19. package/components/color-slider/index.js +6 -296
  20. package/components/index-BwxgAdzi.cjs +57 -0
  21. package/components/index-HjQa8tew.js +1174 -0
  22. package/components/index.cjs +1 -1
  23. package/components/index.js +58 -56
  24. package/components/menu/index.cjs +1 -1
  25. package/components/menu/index.js +1 -1
  26. package/components/overlay/hover-controller.d.ts +2 -0
  27. package/components/overlay/index.cjs +7 -7
  28. package/components/overlay/index.js +114 -110
  29. package/components/overlay/interaction-controller.d.ts +11 -5
  30. package/components/overlay/overlay-stack.d.ts +1 -0
  31. package/components/overlay/overlay-trigger.d.ts +25 -2
  32. package/components/{overlay-BBNyvs8F.js → overlay-BtZCJ2M0.js} +421 -386
  33. package/components/overlay-DTCm3y_-.cjs +47 -0
  34. package/components/picker/index.cjs +1 -1
  35. package/components/picker/index.js +2 -2
  36. package/components/{picker-daUT4cUN.js → picker-BmoXv1jt.js} +1 -1
  37. package/components/{picker-0tQg3Aob.cjs → picker-DWsBWdPN.cjs} +1 -1
  38. package/components/select/index.cjs +1 -1
  39. package/components/select/index.js +1 -1
  40. package/components/strategies-BACP6MhR.cjs +18 -0
  41. package/custom-elements.json +1 -1
  42. package/package.json +1 -1
  43. package/utils/button-interaction-controllers/interaction-controller.d.ts +1 -0
  44. package/utils/button-interaction-controllers/mobile-controller.d.ts +0 -1
  45. package/utils/reactive-controllers/color-controller.d.ts +224 -0
  46. package/components/color-Bg3tYsAQ.js +0 -178
  47. package/components/color-DphK4hwx.cjs +0 -18
  48. package/components/index-C1chwzNp.js +0 -727
  49. package/components/index-DCKCHDTt.cjs +0 -18
  50. package/components/overlay-o0tLxsk-.cjs +0 -47
  51. package/components/strategies-DGwsR7Xf.cjs +0 -18
  52. package/components/{strategies-Bc3hG-HA.js → strategies-9indNIEb.js} +1 -1
@@ -1,18 +0,0 @@
1
- /*! * Lucero - The design system for Luzmo.
2
- *
3
- * Copyright © 2025 Luzmo
4
- * All rights reserved.
5
- * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
- * This license allows users with a current active Luzmo account to use Lucero.
7
- * This license terminates automatically if a user no longer has an active Luzmo account.
8
- * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
- * SOFTWARE.
17
- * */
18
- "use strict";function u(r,e){E(r)&&(r="100%");const t=I(r);return r=e===360?r:Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(String(r*e),10)/100),Math.abs(r-e)<1e-6?1:(e===360?r=(r<0?r%e+e:r%e)/parseFloat(String(e)):r=r%e/parseFloat(String(e)),r)}function m(r){return Math.min(1,Math.max(0,r))}function E(r){return typeof r=="string"&&r.indexOf(".")!==-1&&parseFloat(r)===1}function I(r){return typeof r=="string"&&r.indexOf("%")!==-1}function F(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function p(r){return Number(r)<=1?`${Number(r)*100}%`:r}function l(r){return r.length===1?"0"+r:String(r)}function B(r,e,t){return{r:u(r,255)*255,g:u(e,255)*255,b:u(t,255)*255}}function v(r,e,t){r=u(r,255),e=u(e,255),t=u(t,255);const n=Math.max(r,e,t),s=Math.min(r,e,t);let a=0,i=0;const h=(n+s)/2;if(n===s)i=0,a=0;else{const o=n-s;switch(i=h>.5?o/(2-n-s):o/(n+s),n){case r:a=(e-t)/o+(e<t?6:0);break;case e:a=(t-r)/o+2;break;case t:a=(r-e)/o+4;break}a/=6}return{h:a,s:i,l:h}}function w(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*(6*t):t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function q(r,e,t){let n,s,a;if(r=u(r,360),e=u(e,100),t=u(t,100),e===0)s=t,a=t,n=t;else{const i=t<.5?t*(1+e):t+e-t*e,h=2*t-i;n=w(h,i,r+1/3),s=w(h,i,r),a=w(h,i,r-1/3)}return{r:n*255,g:s*255,b:a*255}}function A(r,e,t){r=u(r,255),e=u(e,255),t=u(t,255);const n=Math.max(r,e,t),s=Math.min(r,e,t);let a=0;const i=n,h=n-s,o=n===0?0:h/n;if(n===s)a=0;else{switch(n){case r:a=(e-t)/h+(e<t?6:0);break;case e:a=(t-r)/h+2;break;case t:a=(r-e)/h+4;break}a/=6}return{h:a,s:o,v:i}}function P(r,e,t){r=u(r,360)*6,e=u(e,100),t=u(t,100);const n=Math.floor(r),s=r-n,a=t*(1-e),i=t*(1-s*e),h=t*(1-(1-s)*e),o=n%6,x=[t,i,a,a,h,t][o],M=[h,t,t,i,a,a][o],N=[a,a,h,t,t,i][o];return{r:x*255,g:M*255,b:N*255}}function H(r,e,t,n){const s=[l(Math.round(r).toString(16)),l(Math.round(e).toString(16)),l(Math.round(t).toString(16))];return n&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function j(r,e,t,n,s){const a=[l(Math.round(r).toString(16)),l(Math.round(e).toString(16)),l(Math.round(t).toString(16)),l(W(n))];return s&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function O(r,e,t,n){const s=r/100,a=e/100,i=t/100,h=n/100,o=255*(1-s)*(1-h),x=255*(1-a)*(1-h),M=255*(1-i)*(1-h);return{r:o,g:x,b:M}}function R(r,e,t){let n=1-r/255,s=1-e/255,a=1-t/255,i=Math.min(n,s,a);return i===1?(n=0,s=0,a=0):(n=(n-i)/(1-i)*100,s=(s-i)/(1-i)*100,a=(a-i)/(1-i)*100),i*=100,{c:Math.round(n),m:Math.round(s),y:Math.round(a),k:Math.round(i)}}function W(r){return Math.round(parseFloat(r)*255).toString(16)}function $(r){return c(r)/255}function c(r){return parseInt(r,16)}function G(r){return{r:r>>16,g:(r&65280)>>8,b:r&255}}const y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function T(r){let e={r:0,g:0,b:0},t=1,n=null,s=null,a=null,i=!1,h=!1;return typeof r=="string"&&(r=V(r)),typeof r=="object"&&(g(r.r)&&g(r.g)&&g(r.b)?(e=B(r.r,r.g,r.b),i=!0,h=String(r.r).substr(-1)==="%"?"prgb":"rgb"):g(r.h)&&g(r.s)&&g(r.v)?(n=p(r.s),s=p(r.v),e=P(r.h,n,s),i=!0,h="hsv"):g(r.h)&&g(r.s)&&g(r.l)?(n=p(r.s),a=p(r.l),e=q(r.h,n,a),i=!0,h="hsl"):g(r.c)&&g(r.m)&&g(r.y)&&g(r.k)&&(e=O(r.c,r.m,r.y,r.k),i=!0,h="cmyk"),Object.prototype.hasOwnProperty.call(r,"a")&&(t=r.a)),t=F(t),{ok:i,format:r.format||h,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}const U="[-\\+]?\\d+%?",D="[-\\+]?\\d*\\.\\d+%?",b="(?:"+D+")|(?:"+U+")",S="[\\s|\\(]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")\\s*\\)?",k="[\\s|\\(]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")\\s*\\)?",d={CSS_UNIT:new RegExp(b),rgb:new RegExp("rgb"+S),rgba:new RegExp("rgba"+k),hsl:new RegExp("hsl"+S),hsla:new RegExp("hsla"+k),hsv:new RegExp("hsv"+S),hsva:new RegExp("hsva"+k),cmyk:new RegExp("cmyk"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function V(r){if(r=r.trim().toLowerCase(),r.length===0)return!1;let e=!1;if(y[r])r=y[r],e=!0;else if(r==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let t=d.rgb.exec(r);return t?{r:t[1],g:t[2],b:t[3]}:(t=d.rgba.exec(r),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=d.hsl.exec(r),t?{h:t[1],s:t[2],l:t[3]}:(t=d.hsla.exec(r),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=d.hsv.exec(r),t?{h:t[1],s:t[2],v:t[3]}:(t=d.hsva.exec(r),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=d.cmyk.exec(r),t?{c:t[1],m:t[2],y:t[3],k:t[4]}:(t=d.hex8.exec(r),t?{r:c(t[1]),g:c(t[2]),b:c(t[3]),a:$(t[4]),format:e?"name":"hex8"}:(t=d.hex6.exec(r),t?{r:c(t[1]),g:c(t[2]),b:c(t[3]),format:e?"name":"hex"}:(t=d.hex4.exec(r),t?{r:c(t[1]+t[1]),g:c(t[2]+t[2]),b:c(t[3]+t[3]),a:$(t[4]+t[4]),format:e?"name":"hex8"}:(t=d.hex3.exec(r),t?{r:c(t[1]+t[1]),g:c(t[2]+t[2]),b:c(t[3]+t[3]),format:e?"name":"hex"}:!1))))))))))}function g(r){return typeof r=="number"?!Number.isNaN(r):d.CSS_UNIT.test(r)}class f{constructor(e="",t={}){if(e instanceof f)return e;typeof e=="number"&&(e=G(e)),this.originalInput=e;const n=T(e);this.originalInput=e,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=t.format??n.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){const e=this.toRgb();let t,n,s;const a=e.r/255,i=e.g/255,h=e.b/255;return a<=.03928?t=a/12.92:t=Math.pow((a+.055)/1.055,2.4),i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),h<=.03928?s=h/12.92:s=Math.pow((h+.055)/1.055,2.4),.2126*t+.7152*n+.0722*s}getAlpha(){return this.a}setAlpha(e){return this.a=F(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:e}=this.toHsl();return e===0}toHsv(){const e=A(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){const e=A(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),s=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${s}%)`:`hsva(${t}, ${n}%, ${s}%, ${this.roundA})`}toHsl(){const e=v(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){const e=v(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),s=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${s}%)`:`hsla(${t}, ${n}%, ${s}%, ${this.roundA})`}toHex(e=!1){return H(this.r,this.g,this.b,e)}toHexString(e=!1){return"#"+this.toHex(e)}toHex8(e=!1){return j(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return"#"+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`}toPercentageRgb(){const e=t=>`${Math.round(u(t,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){const e=t=>Math.round(u(t,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toCmyk(){return{...R(this.r,this.g,this.b)}}toCmykString(){const{c:e,m:t,y:n,k:s}=R(this.r,this.g,this.b);return`cmyk(${e}, ${t}, ${n}, ${s})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const e="#"+H(this.r,this.g,this.b,!1);for(const[t,n]of Object.entries(y))if(e===n)return t;return!1}toString(e){const t=!!e;e=e??this.format;let n=!1;const s=this.a<1&&this.a>=0;return!t&&s&&(e.startsWith("hex")||e==="name")?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),e==="cmyk"&&(n=this.toCmykString()),n||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new f(this.toString())}lighten(e=10){const t=this.toHsl();return t.l+=e/100,t.l=m(t.l),new f(t)}brighten(e=10){const t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new f(t)}darken(e=10){const t=this.toHsl();return t.l-=e/100,t.l=m(t.l),new f(t)}tint(e=10){return this.mix("white",e)}shade(e=10){return this.mix("black",e)}desaturate(e=10){const t=this.toHsl();return t.s-=e/100,t.s=m(t.s),new f(t)}saturate(e=10){const t=this.toHsl();return t.s+=e/100,t.s=m(t.s),new f(t)}greyscale(){return this.desaturate(100)}spin(e){const t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new f(t)}mix(e,t=50){const n=this.toRgb(),s=new f(e).toRgb(),a=t/100,i={r:(s.r-n.r)*a+n.r,g:(s.g-n.g)*a+n.g,b:(s.b-n.b)*a+n.b,a:(s.a-n.a)*a+n.a};return new f(i)}analogous(e=6,t=30){const n=this.toHsl(),s=360/t,a=[this];for(n.h=(n.h-(s*e>>1)+720)%360;--e;)n.h=(n.h+s)%360,a.push(new f(n));return a}complement(){const e=this.toHsl();return e.h=(e.h+180)%360,new f(e)}monochromatic(e=6){const t=this.toHsv(),{h:n}=t,{s}=t;let{v:a}=t;const i=[],h=1/e;for(;e--;)i.push(new f({h:n,s,v:a})),a=(a+h)%1;return i}splitcomplement(){const e=this.toHsl(),{h:t}=e;return[this,new f({h:(t+72)%360,s:e.s,l:e.l}),new f({h:(t+216)%360,s:e.s,l:e.l})]}onBackground(e){const t=this.toRgb(),n=new f(e).toRgb(),s=t.a+n.a*(1-t.a);return new f({r:(t.r*t.a+n.r*n.a*(1-t.a))/s,g:(t.g*t.a+n.g*n.a*(1-t.a))/s,b:(t.b*t.a+n.b*n.a*(1-t.a))/s,a:s})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(e){const t=this.toHsl(),{h:n}=t,s=[this],a=360/e;for(let i=1;i<e;i++)s.push(new f({h:(n+i*a)%360,s:t.s,l:t.l}));return s}equals(e){const t=new f(e);return this.format==="cmyk"||t.format==="cmyk"?this.toCmykString()===t.toCmykString():this.toRgbString()===t.toRgbString()}}exports.TinyColor=f;
@@ -1,47 +0,0 @@
1
- /*! * Lucero - The design system for Luzmo.
2
- *
3
- * Copyright © 2025 Luzmo
4
- * All rights reserved.
5
- * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
- * This license allows users with a current active Luzmo account to use Lucero.
7
- * This license terminates automatically if a user no longer has an active Luzmo account.
8
- * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
- * SOFTWARE.
17
- * */
18
- "use strict";const E=require("./base-CBCg3yyw.cjs"),xe=require("./state-D8JEtYqe.cjs"),ie=require("./query-BL-TJj7K.cjs"),Ee=require("./query-assigned-elements-DsKsfk7G.cjs"),Tt=require("./if-defined-C9YGdo33.cjs"),Vt=require("./style-map-CeilmSgs.cjs"),kt=require("./random-id-CqvckpWe.cjs"),Ut=require("./element-resolution-BvRLGqIU.cjs"),ct=require("./focusable-selectors-BgFlyFcY.cjs"),jt=require("./slottable-request-event-BfUUt1Mh.cjs"),Rt=require("./condition-attribute-with-id-DrQYZzFS.cjs"),Kt=require("./platform-BiXhwqk3.cjs");function Ce(e,t,i=[]){for(const[n,o]of t.entries()){const s=e[n],r=s.parentElement||s.getRootNode();i[n]&&i[n](o),r&&r!==s&&s.replaceWith(o),delete e[n]}return t}const Pe=(e,t,{position:i,prepareCallback:n}={position:"beforeend"})=>{let{length:o}=e;if(o===0)return()=>e;let s=1,r=0;(i==="afterbegin"||i==="afterend")&&(s=-1,r=o-1);const l=new Array(o),a=new Array(o),h=document.createComment("placeholder for reparented element");do{const c=e[r];n&&(a[r]=n(c)),l[r]=h.cloneNode();const d=c.parentElement||c.getRootNode();d&&d!==c&&d.replaceChild(l[r],c),t.insertAdjacentElement(i,c),r+=s}while(--o>0);return function(){return Ce(l,e,a)}},Oe=1e3,Te=1e3;class Ae{constructor(t={}){this.warmUpDelay=Oe,this.coolDownDelay=Te,this.isWarm=!1,this.timeout=0,Object.assign(this,t)}openTimer(t){if(this.cancelCooldownTimer(),!this.component||t!==this.component)return this.component&&(this.close(this.component),this.cancelCooldownTimer()),this.component=t,this.isWarm?Promise.resolve(!1):(this.promise=new Promise(i=>{this.resolve=i,this.timeout=window.setTimeout(()=>{this.resolve&&(this.resolve(!1),this.isWarm=!0)},this.warmUpDelay)}),this.promise);if(this.promise)return this.promise;throw new Error("Inconsistent state")}close(t){this.component&&this.component===t&&(this.resetCooldownTimer(),this.timeout>0&&(clearTimeout(this.timeout),this.timeout=0),this.resolve&&(this.resolve(!0),delete this.resolve),delete this.promise,delete this.component)}resetCooldownTimer(){this.isWarm&&(this.cooldownTimeout&&window.clearTimeout(this.cooldownTimeout),this.cooldownTimeout=window.setTimeout(()=>{this.isWarm=!1,delete this.cooldownTimeout},this.coolDownDelay))}cancelCooldownTimer(){this.cooldownTimeout&&window.clearTimeout(this.cooldownTimeout),delete this.cooldownTimeout}}const lt=new Ae,Y=()=>{},xt=(e,t,i)=>{const n=new AbortController,o=new Map,s=()=>{n.abort(),i()};let r,l;const a=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{l=requestAnimationFrame(()=>{s()})})}),h=d=>{d.target===e&&(o.set(d.propertyName,o.get(d.propertyName)-1),o.get(d.propertyName)||o.delete(d.propertyName),o.size===0&&s())},c=d=>{d.target===e&&(o.has(d.propertyName)||o.set(d.propertyName,0),o.set(d.propertyName,o.get(d.propertyName)+1),cancelAnimationFrame(a),cancelAnimationFrame(r),cancelAnimationFrame(l))};e.addEventListener("transitionrun",c,{signal:n.signal}),e.addEventListener("transitionend",h,{signal:n.signal}),e.addEventListener("transitioncancel",h,{signal:n.signal}),t()};function R(){return new Promise(e=>requestAnimationFrame(()=>e()))}class it extends E.LuzmoElement{constructor(){super(...arguments),this.dispose=Y,this.offset=0,this.willPreventClose=!1}applyFocus(t,i){}get delayed(){return!1}set delayed(t){}get disabled(){return!1}set disabled(t){}get elementResolver(){return this._elementResolver}set elementResolver(t){this._elementResolver=t}ensureOnDOM(t){}makeTransition(t){return null}manageDelay(t){}manageDialogOpen(){}managePopoverOpen(){}managePosition(){}get open(){return!1}set open(t){}get placementController(){return this._placementController}set placementController(t){this._placementController=t}requestSlottable(){}returnFocus(){}get state(){return"closed"}set state(t){}manuallyKeepOpen(){}static update(){const t=new CustomEvent("luzmo-update-overlays",{bubbles:!0,composed:!0,cancelable:!0});document.dispatchEvent(t)}static async open(t,i,n,o){await Promise.resolve().then(()=>bt);const s=arguments.length===2,r=n||t,l=new this;let a=!1;const h=Pe([r],l,{position:"beforeend",prepareCallback:f=>{const u=f.slot;return f.removeAttribute("slot"),()=>{f.slot=u}}});if(l.dispose=()=>{l.addEventListener("luzmo-closed",()=>{a||(h(),a=!0),requestAnimationFrame(()=>{l.remove()})}),l.open=!1,l.dispose=Y},!s&&r&&o){const f=t,u=i,p=o;return it.applyOptions(l,{...p,delayed:p.delayed||r.hasAttribute("delayed"),trigger:p.virtualTrigger||f,type:u==="modal"?"modal":u==="hover"?"hint":"auto"}),f.after(l),await l.updateComplete,l.open=!0,l.dispose}const d=i;return l.append(r),it.applyOptions(l,{...d,delayed:d.delayed||r.hasAttribute("delayed")}),l.updateComplete.then(()=>{l.open=!0}),l}static applyOptions(t,i){t.delayed=!!i.delayed,t.receivesFocus=i.receivesFocus??"auto",t.triggerElement=i.trigger||null,t.type=i.type||"modal",t.offset=i.offset??0,t.placement=i.placement,t.willPreventClose=!!i.notImmediatelyClosable}}const Ft=e=>e.querySelector(ct.userFocusableSelector),zt=e=>e.assignedElements().find(i=>i.matches(ct.userFocusableSelector));class Nt extends Event{constructor(){super("beforetoggle",{bubbles:!1,composed:!1}),this.currentState="open",this.newState="closed"}}class _t extends Event{constructor(){super("beforetoggle",{bubbles:!1,composed:!1}),this.currentState="closed",this.newState="open"}}class k extends Event{constructor(t,i,{publish:n,interaction:o,reason:s}){super(t,{bubbles:n,composed:n}),this.overlay=i,this.detail={interaction:o,reason:s}}}class ht{constructor(t,i){this.x=0,this.y=0,this.x=t,this.y=i}updateBoundingClientRect(t,i){this.x=t,this.y=i,it.update()}getBoundingClientRect(){return{width:0,height:0,top:this.y,right:this.x,y:this.y,x:this.x,bottom:this.y,left:this.x,toJSON(){}}}}function Re(e){class t extends e{async manageDialogOpen(){const n=this.open;if(await R(),await this.managePosition(),this.open!==n)return;const o=await this.dialogMakeTransition(n);this.open===n&&await this.dialogApplyFocus(n,o)}dialogMakeTransition(n){let o=null;const s=(l,a)=>()=>{if(l.open=n,!n){const c=()=>{l.removeEventListener("close",c)};l.addEventListener("close",c)}if(a>0)return;const h=n?_t:Nt;this.dispatchEvent(new h),n&&(l.matches(ct.userFocusableSelector)&&(o=l),o=o||Ft(l),o||l.querySelectorAll("slot").forEach(d=>{o||(o=zt(d))}),!(!this.isConnected||this.dialogEl.open)&&this.dialogEl.showModal())},r=(l,a)=>()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(a>0){l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1}));return}if(!this.isConnected||n!==this.open)return;const c=async()=>{const d=this.triggerElement instanceof ht;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:d})),l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1})),this.triggerElement&&!d&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await R(),await R(),n===this.open&&n===!1&&this.requestSlottable()};!n&&this.dialogEl.open?(this.dialogEl.addEventListener("close",()=>{c()},{once:!0}),this.dialogEl.close()):c()};return this.elements.forEach((l,a)=>{xt(l,s(l,a),r(l,a))}),o}dialogApplyFocus(n,o){this.applyFocus(n,o)}}return t}function De(e){class t extends e{async managePopoverOpen(){await this.managePosition()}async manageDelay(n){if(n===!1||n!==this.open){lt.close(this);return}this.delayed&&await lt.openTimer(this)&&(this.open=!n)}ensureOnDOM(n){document.body.offsetHeight}makeTransition(n){if(this.open!==n)return null;let o=null;const s=(l,a)=>()=>{if(n!==this.open)return;if(l.open=n,a===0){const c=n?_t:Nt;this.dispatchEvent(new c)}if(n!==!0||(l.matches(ct.userFocusableSelector)&&(o=l),o=o||Ft(l),o))return;l.querySelectorAll("slot").forEach(c=>{o||(o=zt(c))})},r=(l,a)=>async()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(l.dispatchEvent(new k(h,this,{interaction:this.type})),a>0)return;const c=this.triggerElement instanceof ht;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:c})),this.triggerElement&&!c&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await R(),await R(),n===this.open&&n===!1&&this.requestSlottable()};return this.elements.forEach((l,a)=>{xt(l,s(l,a),r(l,a))}),o}}return t}const Le=CSS.supports("(overlay: auto)");function Yt(e){let t=!1;try{t=e.matches(":popover-open")}catch{}let i=!1;try{i=e.matches(":open")}catch{}return t||i}function Se(e){class t extends e{async manageDelay(n){if(n===!1||n!==this.open){lt.close(this);return}this.delayed&&await lt.openTimer(this)&&(this.open=!n)}shouldHidePopover(n){if(n&&this.open!==n)return;const o=async({newState:s}={})=>{s!=="open"&&await this.placementController.resetOverlayPosition()};if(!Yt(this.dialogEl)){o();return}this.dialogEl.addEventListener("toggle",o,{once:!0})}shouldShowPopover(n){let o=!1;try{o=this.dialogEl.matches(":popover-open")}catch{}let s=!1;try{s=this.dialogEl.matches(":open")}catch{}n&&this.open===n&&!o&&!s&&this.isConnected&&(this.dialogEl.showPopover(),this.managePosition())}async ensureOnDOM(n){await R(),Le||await this.shouldHidePopover(n),this.shouldShowPopover(n),await R()}makeTransition(n){if(this.open!==n)return null;let o=null;const s=(l,a)=>()=>{if(l.open=n,a===0){const c=n?_t:Nt;this.dispatchEvent(new c)}if(!n||(l.matches(ct.userFocusableSelector)&&(o=l),o=o||Ft(l),o))return;l.querySelectorAll("slot").forEach(c=>{o||(o=zt(c))})},r=(l,a)=>()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(a>0){l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1}));return}const c=async()=>{if(this.open!==n)return;await R();const f=this.triggerElement instanceof ht;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:f})),l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1})),this.triggerElement&&!f&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await R(),await R(),n===this.open&&n===!1&&this.requestSlottable()};if(this.open!==n)return;const d=Yt(this.dialogEl);n!==!0&&d&&this.isConnected?(this.dialogEl.addEventListener("beforetoggle",()=>{c()},{once:!0}),this.dialogEl.hidePopover()):c()};return this.elements.forEach((l,a)=>{xt(l,s(l,a),r(l,a))}),o}}return t}const ke="showPopover"in document.createElement("div");class Fe{constructor(){this.root=document.body,this.stack=[],this.handlePointerdown=t=>{this.pointerdownPath=t.composedPath(),this.lastOverlay=this.stack.at(-1)},this.handlePointerup=()=>{const t=this.pointerdownPath;if(this.pointerdownPath=void 0,this.stack.length===0||!(t!=null&&t.length))return;const i=this.lastOverlay;this.lastOverlay=void 0;const n=this.stack.length-1,o=this.stack.filter((s,r)=>!t.find(a=>a===s||a===(s==null?void 0:s.triggerElement)&&(s==null?void 0:s.type)==="hint"||r===n&&s!==i&&s.triggerInteraction==="longpress")&&!s.shouldPreventClose()&&s.type!=="manual"&&!(s.type==="modal"&&i!==s));o.reverse(),o.forEach(s=>{this.closeOverlay(s);let r=s.parentOverlayToForceClose;for(;r;)this.closeOverlay(r),r=r.parentOverlayToForceClose})},this.handleBeforetoggle=t=>{const{target:i,newState:n}=t;n!=="open"&&this.closeOverlay(i)},this.handleKeydown=t=>{if(t.code!=="Escape"||this.stack.length===0)return;const i=this.stack.at(-1);if((i==null?void 0:i.type)==="page"){t.preventDefault();return}ke||(i==null?void 0:i.type)!=="manual"&&i&&this.closeOverlay(i)},this.bindEvents()}get document(){return this.root.ownerDocument||document}bindEvents(){this.document.addEventListener("pointerdown",this.handlePointerdown),this.document.addEventListener("pointerup",this.handlePointerup),this.document.addEventListener("keydown",this.handleKeydown)}closeOverlay(t){const i=this.stack.indexOf(t);i!==-1&&this.stack.splice(i,1),t.open=!1}overlaysByTriggerElement(t){return this.stack.filter(i=>i.triggerElement===t)}add(t){if(this.stack.includes(t)){const i=this.stack.indexOf(t);i!==-1&&(this.stack.splice(i,1),this.stack.push(t));return}if(t.type==="auto"||t.type==="modal"||t.type==="page"){const i="luzmo-overlay-query-path",n=new Event(i,{composed:!0,bubbles:!0});t.addEventListener(i,o=>{const s=o.composedPath();this.stack.forEach(r=>{!s.find(a=>a===r)&&r.type!=="manual"&&r.type!=="modal"&&this.closeOverlay(r)})},{once:!0}),t.dispatchEvent(n)}else if(t.type==="hint"){if(this.stack.some(n=>n.type!=="manual"&&n.triggerElement&&n.triggerElement===t.triggerElement)){t.open=!1;return}this.stack.forEach(n=>{n.type==="hint"&&this.closeOverlay(n)})}requestAnimationFrame(()=>{this.stack.push(t),t.addEventListener("beforetoggle",this.handleBeforetoggle,{once:!0})})}remove(t){this.closeOverlay(t)}}const Gt=new Fe,ze=':host{display:contents;pointer-events:none;--luzmo-overlay-animation-distance: .5rem}:host(:has(> luzmo-tooltip)){--luzmo-overlay-animation-distance: var( --luzmo-tooltip-animation-distance, 4px )}.dialog{margin:0;border:0;background:none;padding:0;position:fixed;overflow:visible;opacity:1!important;box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;inset:auto;top:0;left:0;display:flex;--luzmo-overlay-open: true}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}:host(:not([open])) .dialog{--luzmo-overlay-open: false}.dialog::backdrop{display:none}.dialog:before{position:absolute;top:-999em;right:-999em;bottom:-999em;left:-999em;content:"";pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(luzmo-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports (overlay: auto){.dialog{display:none;transition:all var(--luzmo-overlay-animation-duration, .13s),translate 0s,display var(--luzmo-overlay-animation-duration, .13s);transition-behavior:allow-discrete}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--luzmo-overlay-z-index-base, 1000) + var(--luzmo-overlay-open-count))}}',G=Math.min,A=Math.max,vt=Math.round,pt=Math.floor,M=e=>({x:e,y:e}),Ne={left:"right",right:"left",bottom:"top",top:"bottom"},_e={start:"end",end:"start"};function Dt(e,t,i){return A(e,G(t,i))}function ot(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function st(e){return e.split("-")[1]}function ne(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}function Q(e){return["top","bottom"].includes(X(e))?"y":"x"}function Mt(e){return ne(Q(e))}function qe(e,t,i){i===void 0&&(i=!1);const n=st(e),o=Mt(e),s=qt(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=yt(r)),[r,yt(r)]}function Me(e){const t=yt(e);return[Lt(e),t,Lt(t)]}function Lt(e){return e.replace(/start|end/g,t=>_e[t])}function $e(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function We(e,t,i,n){const o=st(e);let s=$e(X(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(Lt)))),s}function yt(e){return e.replace(/left|right|bottom|top/g,t=>Ne[t])}function He(e){return{top:0,right:0,bottom:0,left:0,...e}}function oe(e){return typeof e!="number"?He(e):{top:e,right:e,bottom:e,left:e}}function wt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Xt(e,t,i){let{reference:n,floating:o}=e;const s=Q(t),r=Mt(t),l=qt(r),a=X(t),h=s==="y",c=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[l]/2-o[l]/2;let u;switch(a){case"top":u={x:c,y:n.y-o.height};break;case"bottom":u={x:c,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:d};break;case"left":u={x:n.x-o.width,y:d};break;default:u={x:n.x,y:n.y}}switch(st(t)){case"start":u[r]-=f*(i&&h?-1:1);break;case"end":u[r]+=f*(i&&h?-1:1);break}return u}const Ie=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(t));let h=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Xt(h,n,a),f=n,u={},p=0;for(let m=0;m<l.length;m++){const{name:v,fn:g}=l[m],{x:y,y:w,data:x,reset:b}=await g({x:c,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:u,rects:h,platform:r,elements:{reference:e,floating:t}});c=y??c,d=w??d,u={...u,[v]:{...u[v],...x}},b&&p<=50&&(p++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(h=b.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:c,y:d}=Xt(h,f,a)),m=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:u}};async function $t(e,t){var i;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:r,elements:l,strategy:a}=e,{boundary:h="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:u=0}=ot(t,e),p=oe(u),v=l[f?d==="floating"?"reference":"floating":d],g=wt(await s.getClippingRect({element:(i=await(s.isElement==null?void 0:s.isElement(v)))==null||i?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:h,rootBoundary:c,strategy:a})),y=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},b=wt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-b.top+p.top)/x.y,bottom:(b.bottom-g.bottom+p.bottom)/x.y,left:(g.left-b.left+p.left)/x.x,right:(b.right-g.right+p.right)/x.x}}const Be=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=t,{element:h,padding:c=0}=ot(e,t)||{};if(h==null)return{};const d=oe(c),f={x:i,y:n},u=Mt(o),p=qt(u),m=await r.getDimensions(h),v=u==="y",g=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=s.reference[p]+s.reference[u]-f[u]-s.floating[p],b=f[u]-s.reference[u],L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(h));let C=L?L[w]:0;(!C||!await(r.isElement==null?void 0:r.isElement(L)))&&(C=l.floating[w]||s.floating[p]);const H=x/2-b/2,N=C/2-m[p]/2-1,S=G(d[g],N),V=G(d[y],N),_=S,U=C-m[p]-V,O=C/2-m[p]/2+H,tt=Dt(_,O,U),I=!a.arrow&&st(o)!=null&&O!==tt&&s.reference[p]/2-(O<_?S:V)-m[p]/2<0,q=I?O<_?O-_:O-U:0;return{[u]:f[u]+q,data:{[u]:tt,centerOffset:O-tt-q,...I&&{alignmentOffset:q}},reset:I}}}),Ve=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:h}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=ot(e,t);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const g=X(o),y=Q(l),w=X(l)===l,x=await(a.isRTL==null?void 0:a.isRTL(h.floating)),b=f||(w||!m?[yt(l)]:Me(l)),L=p!=="none";!f&&L&&b.push(...We(l,m,p,x));const C=[l,...b],H=await $t(t,v),N=[];let S=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&N.push(H[g]),d){const O=qe(o,r,x);N.push(H[O[0]],H[O[1]])}if(S=[...S,{placement:o,overflows:N}],!N.every(O=>O<=0)){var V,_;const O=(((V=s.flip)==null?void 0:V.index)||0)+1,tt=C[O];if(tt)return{data:{index:O,overflows:S},reset:{placement:tt}};let I=(_=S.filter(q=>q.overflows[0]<=0).sort((q,j)=>q.overflows[1]-j.overflows[1])[0])==null?void 0:_.placement;if(!I)switch(u){case"bestFit":{var U;const q=(U=S.filter(j=>{if(L){const K=Q(j.placement);return K===y||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,be)=>K+be,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:U[0];q&&(I=q);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};async function Ue(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=X(i),l=st(i),a=Q(i)==="y",h=["left","top"].includes(r)?-1:1,c=s&&a?-1:1,d=ot(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),a?{x:u*c,y:f*h}:{x:f*h,y:u*c}}const je=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:l}=t,a=await Ue(t,e);return r===((i=l.offset)==null?void 0:i.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:r}}}}},Ke=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:v=>{let{x:g,y}=v;return{x:g,y}}},...a}=ot(e,t),h={x:i,y:n},c=await $t(t,a),d=Q(X(o)),f=ne(d);let u=h[f],p=h[d];if(s){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=u+c[v],w=u-c[g];u=Dt(y,u,w)}if(r){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=p+c[v],w=p-c[g];p=Dt(y,p,w)}const m=l.fn({...t,[f]:u,[d]:p});return{...m,data:{x:m.x-i,y:m.y-n,enabled:{[f]:s,[d]:r}}}}}},Ye=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var i,n;const{placement:o,rects:s,platform:r,elements:l}=t,{apply:a=()=>{},...h}=ot(e,t),c=await $t(t,h),d=X(o),f=st(o),u=Q(o)==="y",{width:p,height:m}=s.floating;let v,g;d==="top"||d==="bottom"?(v=d,g=f===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,v=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,w=p-c.left-c.right,x=G(m-c[v],y),b=G(p-c[g],w),L=!t.middlewareData.shift;let C=x,H=b;if((i=t.middlewareData.shift)!=null&&i.enabled.x&&(H=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=y),L&&!f){const S=A(c.left,0),V=A(c.right,0),_=A(c.top,0),U=A(c.bottom,0);u?H=p-2*(S!==0||V!==0?S+V:A(c.left,c.right)):C=m-2*(_!==0||U!==0?_+U:A(c.top,c.bottom))}await a({...t,availableWidth:H,availableHeight:C});const N=await r.getDimensions(l.floating);return p!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function Et(){return typeof window<"u"}function rt(e){return se(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){var t;return(t=(se(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function se(e){return Et()?e instanceof Node||e instanceof D(e).Node:!1}function F(e){return Et()?e instanceof Element||e instanceof D(e).Element:!1}function $(e){return Et()?e instanceof HTMLElement||e instanceof D(e).HTMLElement:!1}function Jt(e){return!Et()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof D(e).ShadowRoot}function dt(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Ge(e){return["table","td","th"].includes(rt(e))}function Ct(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Wt(e){const t=Ht(),i=F(e)?z(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>i[n]?i[n]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function Xe(e){let t=J(e);for(;$(t)&&!nt(t);){if(Wt(t))return t;if(Ct(t))return null;t=J(t)}return null}function Ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(e){return["html","body","#document"].includes(rt(e))}function z(e){return D(e).getComputedStyle(e)}function Pt(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(rt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jt(e)&&e.host||W(e);return Jt(t)?t.host:t}function re(e){const t=J(e);return nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:$(t)&&dt(t)?t:re(t)}function at(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=re(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=D(o);if(s){const l=St(r);return t.concat(r,r.visualViewport||[],dt(o)?o:[],l&&i?at(l):[])}return t.concat(o,at(o,[],i))}function St(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function le(e){const t=z(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=$(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,l=vt(i)!==s||vt(n)!==r;return l&&(i=s,n=r),{width:i,height:n,$:l}}function It(e){return F(e)?e:e.contextElement}function et(e){const t=It(e);if(!$(t))return M(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=le(t);let r=(s?vt(i.width):i.width)/n,l=(s?vt(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Je=M(0);function ae(e){const t=D(e);return!Ht()||!t.visualViewport?Je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qe(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==D(e)?!1:t}function Z(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=It(e);let r=M(1);t&&(n?F(n)&&(r=et(n)):r=et(e));const l=Qe(s,i,n)?ae(s):M(0);let a=(o.left+l.x)/r.x,h=(o.top+l.y)/r.y,c=o.width/r.x,d=o.height/r.y;if(s){const f=D(s),u=n&&F(n)?D(n):n;let p=f,m=St(p);for(;m&&n&&u!==p;){const v=et(m),g=m.getBoundingClientRect(),y=z(m),w=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*v.x,x=g.top+(m.clientTop+parseFloat(y.paddingTop))*v.y;a*=v.x,h*=v.y,c*=v.x,d*=v.y,a+=w,h+=x,p=D(m),m=St(p)}}return wt({width:c,height:d,x:a,y:h})}function Bt(e,t){const i=Pt(e).scrollLeft;return t?t.left+i:Z(W(e)).left+i}function ce(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(i?0:Bt(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function Ze(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=W(n),l=t?Ct(t.floating):!1;if(n===r||l&&s)return i;let a={scrollLeft:0,scrollTop:0},h=M(1);const c=M(0),d=$(n);if((d||!d&&!s)&&((rt(n)!=="body"||dt(r))&&(a=Pt(n)),$(n))){const u=Z(n);h=et(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}const f=r&&!d&&!s?ce(r,a,!0):M(0);return{width:i.width*h.x,height:i.height*h.y,x:i.x*h.x-a.scrollLeft*h.x+c.x+f.x,y:i.y*h.y-a.scrollTop*h.y+c.y+f.y}}function ti(e){return Array.from(e.getClientRects())}function ei(e){const t=W(e),i=Pt(e),n=e.ownerDocument.body,o=A(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=A(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Bt(e);const l=-i.scrollTop;return z(n).direction==="rtl"&&(r+=A(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}function ii(e,t){const i=D(e),n=W(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;const h=Ht();(!h||h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function ni(e,t){const i=Z(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=$(e)?et(e):M(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,h=n*s.y;return{width:r,height:l,x:a,y:h}}function Qt(e,t,i){let n;if(t==="viewport")n=ii(e,i);else if(t==="document")n=ei(W(e));else if(F(t))n=ni(t,i);else{const o=ae(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wt(n)}function he(e,t){const i=J(e);return i===t||!F(i)||nt(i)?!1:z(i).position==="fixed"||he(i,t)}function oi(e,t){const i=t.get(e);if(i)return i;let n=at(e,[],!1).filter(l=>F(l)&&rt(l)!=="body"),o=null;const s=z(e).position==="fixed";let r=s?J(e):e;for(;F(r)&&!nt(r);){const l=z(r),a=Wt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||dt(r)&&!a&&he(e,r))?n=n.filter(c=>c!==r):o=l,r=J(r)}return t.set(e,n),n}function si(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const r=[...i==="clippingAncestors"?Ct(t)?[]:oi(t,this._c):[].concat(i),n],l=r[0],a=r.reduce((h,c)=>{const d=Qt(t,c,o);return h.top=A(d.top,h.top),h.right=G(d.right,h.right),h.bottom=G(d.bottom,h.bottom),h.left=A(d.left,h.left),h},Qt(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ri(e){const{width:t,height:i}=le(e);return{width:t,height:i}}function li(e,t,i){const n=$(t),o=W(t),s=i==="fixed",r=Z(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=M(0);if(n||!n&&!s)if((rt(t)!=="body"||dt(o))&&(l=Pt(t)),n){const f=Z(t,!0,s,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else o&&(a.x=Bt(o));const h=o&&!n&&!s?ce(o,l):M(0),c=r.left+l.scrollLeft-a.x-h.x,d=r.top+l.scrollTop-a.y-h.y;return{x:c,y:d,width:r.width,height:r.height}}function At(e){return z(e).position==="static"}function Zt(e,t){if(!$(e)||z(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return W(e)===i&&(i=i.ownerDocument.body),i}function de(e,t){const i=D(e);if(Ct(e))return i;if(!$(e)){let o=J(e);for(;o&&!nt(o);){if(F(o)&&!At(o))return o;o=J(o)}return i}let n=Zt(e,t);for(;n&&Ge(n)&&At(n);)n=Zt(n,t);return n&&nt(n)&&At(n)&&!Wt(n)?i:n||Xe(e)||i}const ai=async function(e){const t=this.getOffsetParent||de,i=this.getDimensions,n=await i(e.floating);return{reference:li(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ci(e){return z(e).direction==="rtl"}const hi={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:W,getClippingRect:si,getOffsetParent:de,getElementRects:ai,getClientRects:ti,getDimensions:ri,getScale:et,isElement:F,isRTL:ci};function ue(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function di(e,t){let i=null,n;const o=W(e);function s(){var l;clearTimeout(n),(l=i)==null||l.disconnect(),i=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const h=e.getBoundingClientRect(),{left:c,top:d,width:f,height:u}=h;if(l||t(),!f||!u)return;const p=pt(d),m=pt(o.clientWidth-(c+f)),v=pt(o.clientHeight-(d+u)),g=pt(c),w={rootMargin:-p+"px "+-m+"px "+-v+"px "+-g+"px",threshold:A(0,G(1,a))||1};let x=!0;function b(L){const C=L[0].intersectionRatio;if(C!==a){if(!x)return r();C?r(!1,C):n=setTimeout(()=>{r(!1,1e-7)},1e3)}C===1&&!ue(h,e.getBoundingClientRect())&&r(),x=!1}try{i=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{i=new IntersectionObserver(b,w)}i.observe(e)}return r(!0),s}function te(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,h=It(e),c=o||s?[...h?at(h):[],...at(t)]:[];c.forEach(g=>{o&&g.addEventListener("scroll",i,{passive:!0}),s&&g.addEventListener("resize",i)});const d=h&&l?di(h,i):null;let f=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===h&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=u)==null||w.observe(t)})),i()}),h&&!a&&u.observe(h),u.observe(t));let p,m=a?Z(e):null;a&&v();function v(){const g=Z(e);m&&!ue(m,g)&&i(),m=g,p=requestAnimationFrame(v)}return i(),()=>{var g;c.forEach(y=>{o&&y.removeEventListener("scroll",i),s&&y.removeEventListener("resize",i)}),d==null||d(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(p)}}const ui=je,pi=Ke,ee=Ve,fi=Ye,mi=Be,gi=(e,t,i)=>{const n=new Map,o={platform:hi,...i},s={...o.platform,_c:n};return Ie(e,t,{...o,platform:s})};function ft(e){if(e===void 0)return 0;const t=window.devicePixelRatio||1;return Math.round(e*t)/t}const mt=8,vi=100,yi=e=>({left:["right","bottom","top"],"left-start":["right-start","bottom","top"],"left-end":["right-end","bottom","top"],right:["left","bottom","top"],"right-start":["left-start","bottom","top"],"right-end":["left-end","bottom","top"],top:["bottom","left","right"],"top-start":["bottom-start","left","right"],"top-end":["bottom-end","left","right"],bottom:["top","left","right"],"bottom-start":["top-start","left","right"],"bottom-end":["top-end","left","right"]})[e]??[e],wi=Symbol("placement updated");class pe{constructor(t){this.originalPlacements=new WeakMap,this.allowPlacementUpdate=!1,this.closeForAncestorUpdate=()=>{!this.allowPlacementUpdate&&this.options.type!=="modal"&&this.cleanup&&this.target.dispatchEvent(new Event("close",{bubbles:!0})),this.allowPlacementUpdate=!1},this.updatePlacement=()=>{this.computePlacement()},this.resetOverlayPosition=()=>{!this.target||!this.options||(this.clearOverlayPosition(),this.host.offsetHeight,this.computePlacement())},this.host=t,this.host.addController(this)}placeOverlay(t=this.target,i=this.options){if(this.target=t,this.options=i,!t||!i)return;const n=te(i.trigger,t,this.closeForAncestorUpdate,{ancestorResize:!1,elementResize:!1,layoutShift:!1}),o=te(i.trigger,t,this.updatePlacement,{ancestorScroll:!1});this.cleanup=()=>{var s;(s=this.host.elements)==null||s.forEach(r=>{r.addEventListener("luzmo-closed",()=>{const l=this.originalPlacements.get(r);l&&r.setAttribute("placement",l),this.originalPlacements.delete(r)},{once:!0})}),n(),o()}}async computePlacement(){var f,u;const{options:t,target:i}=this;await(document.fonts?document.fonts.ready:Promise.resolve());const n=t.trigger instanceof HTMLElement?ee():ee({padding:mt,fallbackPlacements:yi(t.placement)}),[o=0,s=0]=Array.isArray(t==null?void 0:t.offset)?t.offset:[t.offset,0],r=(f=this.host.elements.find(p=>p.tipElement))==null?void 0:f.tipElement,l=[ui({mainAxis:o,crossAxis:s}),pi({padding:mt}),n,fi({padding:mt,apply:({availableWidth:p,availableHeight:m,rects:{floating:v}})=>{const g=Math.max(vi,Math.floor(m)),y=v.height;this.initialHeight=this.isConstrained&&this.initialHeight||y,this.isConstrained=y<this.initialHeight||g<=y;const w=this.isConstrained?`${g}px`:"";Object.assign(i.style,{maxWidth:`${Math.floor(p)}px`,maxHeight:w})}}),...r?[mi({element:r,padding:t.tipPadding||mt})]:[]],{x:a,y:h,placement:c,middlewareData:d}=await gi(t.trigger,i,{placement:t.placement,middleware:l,strategy:"fixed"});if(Object.assign(i.style,{top:"0px",left:"0px",translate:`${ft(a)}px ${ft(h)}px`}),i.setAttribute("actual-placement",c),(u=this.host.elements)==null||u.forEach(p=>{this.originalPlacements.has(p)||this.originalPlacements.set(p,p.getAttribute("placement")),p.setAttribute("placement",c)}),r&&d.arrow){const{x:p,y:m}=d.arrow;Object.assign(r.style,{top:c.startsWith("right")||c.startsWith("left")?"0px":"",left:c.startsWith("bottom")||c.startsWith("top")?"0px":"",translate:`${ft(p)}px ${ft(m)}px`})}}clearOverlayPosition(){this.target&&(this.target.style.removeProperty("max-height"),this.target.style.removeProperty("max-width"),this.initialHeight=void 0,this.isConstrained=!1)}hostConnected(){document.addEventListener("luzmo-update-overlays",this.resetOverlayPosition)}hostUpdated(){var t;this.host.open||((t=this.cleanup)==null||t.call(this),this.cleanup=void 0)}hostDisconnected(){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0,document.removeEventListener("luzmo-update-overlays",this.resetOverlayPosition)}}var ut=(e=>(e[e.click=0]="click",e[e.hover=1]="hover",e[e.longpress=2]="longpress",e))(ut||{});class Ot{constructor(t,{overlay:i,isPersistent:n,handleOverlayReady:o}){this.target=t,this.isLazilyOpen=!1,this.isPersistent=!1,this.isPersistent=!!n,this.handleOverlayReady=o,this.isPersistent&&this.init(),this.overlay=i}get activelyOpening(){return!1}get open(){var t;return((t=this.overlay)==null?void 0:t.open)??this.isLazilyOpen}set open(t){if(t!==this.open){if(this.isLazilyOpen=t,this.overlay){this.overlay.open=t;return}t&&(customElements.whenDefined("luzmo-overlay").then(async()=>{const{LuzmoOverlay:i}=await Promise.resolve().then(()=>bt);this.overlay=new i,this.overlay.open=!0}),Promise.resolve().then(()=>bt))}}get overlay(){return this._overlay}set overlay(t){var i;t&&this.overlay!==t&&(this.overlay&&this.overlay.removeController(this),this._overlay=t,this.overlay.addController(this),this.initOverlay(),this.prepareDescription(this.target),(i=this.handleOverlayReady)==null||i.call(this,this.overlay))}prepareDescription(t){}releaseDescription(){}shouldCompleteOpen(){}init(){}initOverlay(){}abort(){var t;this.releaseDescription(),(t=this.abortController)==null||t.abort()}hostConnected(){this.init()}hostDisconnected(){this.isPersistent||this.abort()}}class fe extends Ot{constructor(){super(...arguments),this.type=ut.click,this.preventNextToggle=!1}handleClick(){this.preventNextToggle||(this.open=!this.open),this.preventNextToggle=!1}handlePointerdown(){this.preventNextToggle=this.open}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("click",()=>this.handleClick(),{signal:t}),this.target.addEventListener("pointerdown",()=>this.handlePointerdown(),{signal:t})}}const bi=300;class me extends Ot{constructor(){super(...arguments),this.type=ut.hover,this.elementIds=[],this.focusedin=!1,this.pointerentered=!1}handleTargetFocusin(){this.target.matches(":focus-visible")&&(this.open=!0,this.focusedin=!0)}handleTargetFocusout(){this.focusedin=!1,!this.pointerentered&&(this.open=!1)}handleTargetPointerenter(){var t;this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=void 0),!((t=this.overlay)!=null&&t.disabled)&&(this.open=!0,this.pointerentered=!0)}handleTargetPointerleave(){this.doPointerleave()}handleHostPointerenter(){this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=void 0)}handleHostPointerleave(){this.doPointerleave()}prepareDescription(){if(this.overlay.elements.length===0)return;const t=this.target.getRootNode(),i=this.overlay.elements[0].getRootNode(),n=this.overlay.getRootNode();t===n?this.prepareOverlayRelativeDescription():t===i&&this.prepareContentRelativeDescription()}prepareOverlayRelativeDescription(){const t=Rt.conditionAttributeWithId(this.target,"aria-describedby",[this.overlay.id]);this.releaseDescription=()=>{t(),this.releaseDescription=Y}}prepareContentRelativeDescription(){const t=[],i=this.overlay.elements.map(o=>(t.push(o.id),o.id||(o.id=`${this.overlay.tagName.toLowerCase()}-helper-${kt.randomID()}`),o.id));this.elementIds=t;const n=Rt.conditionAttributeWithId(this.target,"aria-describedby",i);this.releaseDescription=()=>{n(),this.overlay.elements.map((o,s)=>{o.id=this.elementIds[s]}),this.releaseDescription=Y}}doPointerleave(){this.pointerentered=!1;const t=this.target;this.focusedin&&t.matches(":focus-visible")||(this.hoverTimeout=setTimeout(()=>{this.open=!1},bi))}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("focusin",()=>this.handleTargetFocusin(),{signal:t}),this.target.addEventListener("focusout",()=>this.handleTargetFocusout(),{signal:t}),this.target.addEventListener("pointerenter",()=>this.handleTargetPointerenter(),{signal:t}),this.target.addEventListener("pointerleave",()=>this.handleTargetPointerleave(),{signal:t}),this.overlay&&this.initOverlay()}initOverlay(){if(!this.abortController)return;const{signal:t}=this.abortController;this.overlay.addEventListener("pointerenter",()=>this.handleHostPointerenter(),{signal:t}),this.overlay.addEventListener("pointerleave",()=>this.handleHostPointerleave(),{signal:t})}}const xi=300,ge={touch:"Double tap and long press for additional options",keyboard:"Press Space or Alt+Down Arrow for additional options",mouse:"Click and hold for additional options"};class ve extends Ot{constructor(){super(...arguments),this.type=ut.longpress,this.longpressState=null,this.releaseDescription=Y,this.handlePointerup=()=>{var t;clearTimeout(this.timeout),this.target&&(this.longpressState=((t=this.overlay)==null?void 0:t.state)==="opening"?"pressed":null,document.removeEventListener("pointerup",this.handlePointerup),document.removeEventListener("pointercancel",this.handlePointerup))}}get activelyOpening(){return this.longpressState==="opening"||this.longpressState==="pressed"}handleLongpress(){this.open=!0,this.longpressState=this.longpressState==="potential"?"opening":"pressed"}handlePointerdown(t){!this.target||t.button!==0||(this.longpressState="potential",document.addEventListener("pointerup",this.handlePointerup),document.addEventListener("pointercancel",this.handlePointerup),"holdAffordance"in this.target)||(this.timeout=setTimeout(()=>{this.target&&this.target.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"pointer"}}))},xi))}handleKeydown(t){const{code:i,altKey:n}=t;n&&i==="ArrowDown"&&(t.stopPropagation(),t.stopImmediatePropagation())}handleKeyup(t){const{code:i,altKey:n}=t;if(i==="Space"||n&&i==="ArrowDown"){if(!this.target)return;t.stopPropagation(),this.target.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"keyboard"}})),setTimeout(()=>{this.longpressState=null})}}prepareDescription(t){if(this.releaseDescription!==Y||this.overlay.elements.length===0)return;const i=document.createElement("div");i.id=`longpress-describedby-descriptor-${kt.randomID()}`;const n=Kt.isIOS()||Kt.isAndroid()?"touch":"keyboard";i.textContent=ge[n],i.slot="longpress-describedby-descriptor";const o=t.getRootNode(),s=this.overlay.getRootNode();o===s?this.overlay.append(i):(i.hidden=!("host"in o),t.after(i));const r=Rt.conditionAttributeWithId(t,"aria-describedby",[i.id]);this.releaseDescription=()=>{r(),i.remove(),this.releaseDescription=Y}}shouldCompleteOpen(){this.longpressState=this.longpressState==="pressed"?null:this.longpressState}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("longpress",()=>this.handleLongpress(),{signal:t}),this.target.addEventListener("pointerdown",n=>this.handlePointerdown(n),{signal:t}),this.prepareDescription(this.target),!this.target.holdAffordance&&(this.target.addEventListener("keydown",n=>this.handleKeydown(n),{signal:t}),this.target.addEventListener("keyup",n=>this.handleKeyup(n),{signal:t}))}}const ye={click:fe,longpress:ve,hover:me};var Ei=Object.defineProperty,Ci=Object.getOwnPropertyDescriptor,T=(e,t,i,n)=>{for(var o=n>1?void 0:n?Ci(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Ei(t,i,o),o};const Pi="showPopover"in document.createElement("div");let gt=Re(it);gt=Pi?Se(gt):De(gt);var B;const P=(B=class extends gt{constructor(){super(...arguments),this._delayed=!1,this._disabled=!1,this.offset=0,this._open=!1,this.lastRequestSlottableState=!1,this.receivesFocus="auto",this._state="closed",this.triggerElement=null,this.type="auto",this.wasOpen=!1,this.closeOnFocusOut=t=>{if(!t.relatedTarget)return;const i=new Event("overlay-relation-query",{bubbles:!0,composed:!0});t.relatedTarget.addEventListener(i.type,n=>{n.composedPath().includes(this)||(this.open=!1)}),t.relatedTarget.dispatchEvent(i)}}get delayed(){var t;return((t=this.elements.at(-1))==null?void 0:t.hasAttribute("delayed"))||this._delayed}set delayed(t){this._delayed=t}get disabled(){return this._disabled}set disabled(t){var i;this._disabled=t,t?((i=this.strategy)==null||i.abort(),this.wasOpen=this.open,this.open=!1):(this.bindEvents(),this.open=this.open||this.wasOpen,this.wasOpen=!1)}get hasNonVirtualTrigger(){return!!this.triggerElement&&!(this.triggerElement instanceof ht)}get placementController(){return this._placementController||(this._placementController=new pe(this)),this._placementController}get open(){return this._open}set open(t){var i;t&&this.disabled||t!==this.open&&((i=this.strategy)!=null&&i.activelyOpening&&!t||(this._open=t,this.open&&(B.openCount+=1),this.requestUpdate("open",!this.open),this.open&&this.requestSlottable()))}get state(){return this._state}set state(t){var n;if(t===this.state)return;const i=this.state;this._state=t,(this.state==="opened"||this.state==="closed")&&((n=this.strategy)==null||n.shouldCompleteOpen()),this.requestUpdate("state",i)}get elementResolver(){return this._elementResolver||(this._elementResolver=new Ut.ElementResolutionController(this)),this._elementResolver}get usesDialog(){return this.type==="modal"||this.type==="page"}get popoverValue(){if("popover"in this)switch(this.type){case"modal":case"page":return;case"hint":return"manual";default:return this.type}}get requiresPositioning(){return!(this.type==="page"||!this.open||!this.triggerElement||!this.placement&&this.type!=="hint")}managePosition(){if(!this.requiresPositioning||!this.open)return;const t=this.offset||0,i=this.triggerElement,n=this.placement||"right",o=this.tipPadding;this.placementController.placeOverlay(this.dialogEl,{offset:t,placement:n,tipPadding:o,trigger:i,type:this.type})}async managePopoverOpen(){super.managePopoverOpen();const t=this.open;if(this.open!==t||(await this.manageDelay(t),this.open!==t)||(await this.ensureOnDOM(t),this.open!==t))return;const i=await this.makeTransition(t);this.open===t&&await this.applyFocus(t,i)}async applyFocus(t,i){if(!(this.receivesFocus==="false"||this.type==="hint")){if(await R(),await R(),t===this.open&&!this.open){this.hasNonVirtualTrigger&&this.contains(this.getRootNode().activeElement)&&this.triggerElement.focus();return}i==null||i.focus()}}returnFocus(){var i;if(this.open||this.type==="hint")return;const t=()=>{var s,r;const n=[];let o=document.activeElement;for(;(s=o==null?void 0:o.shadowRoot)!=null&&s.activeElement;)o=o.shadowRoot.activeElement;for(;o;){const l=o.assignedSlot||o.parentElement||((r=o.getRootNode())==null?void 0:r.host);l&&n.push(l),o=l}return n};this.receivesFocus!=="false"&&((i=this.triggerElement)!=null&&i.focus)&&(this.contains(this.getRootNode().activeElement)||t().includes(this)||document.activeElement===document.body)&&this.triggerElement.focus()}async manageOpen(t){if(!(!this.isConnected&&this.open)&&(this.hasUpdated||await this.updateComplete,this.open?(Gt.add(this),this.willPreventClose&&(document.addEventListener("pointerup",()=>{this.dialogEl.classList.toggle("not-immediately-closable",!1),this.willPreventClose=!1},{once:!0}),this.dialogEl.classList.toggle("not-immediately-closable",!0))):(t&&this.dispose(),Gt.remove(this)),this.open&&this.state!=="opened"?this.state="opening":!this.open&&this.state!=="closed"&&(this.state="closing"),this.usesDialog?this.manageDialogOpen():this.managePopoverOpen(),this.type==="auto")){const i=this.getRootNode();this.open?i.addEventListener("focusout",this.closeOnFocusOut,{capture:!0}):i.removeEventListener("focusout",this.closeOnFocusOut,{capture:!0})}}bindEvents(){var t;(t=this.strategy)==null||t.abort(),this.strategy=void 0,this.hasNonVirtualTrigger&&this.triggerInteraction&&(this.strategy=new ye[this.triggerInteraction](this.triggerElement,{overlay:this}))}handleBeforetoggle(t){t.newState!=="open"&&this.handleBrowserClose(t)}handleBrowserClose(t){var i;if(t.stopPropagation(),!((i=this.strategy)!=null&&i.activelyOpening)){this.open=!1;return}this.manuallyKeepOpen()}manuallyKeepOpen(){this.open=!0,this.placementController.allowPlacementUpdate=!0,this.manageOpen(!1)}handleSlotchange(){var t,i;this.elements.length===0?(t=this.strategy)==null||t.releaseDescription():this.hasNonVirtualTrigger&&((i=this.strategy)==null||i.prepareDescription(this.triggerElement))}shouldPreventClose(){const t=this.willPreventClose;return this.willPreventClose=!1,t}requestSlottable(){this.lastRequestSlottableState!==this.open&&(this.open||document.body.offsetHeight,this.dispatchEvent(new jt.SlottableRequestEvent("overlay-content",this.open?{}:jt.removeSlottableRequest)),this.lastRequestSlottableState=this.open)}willUpdate(t){var n;if(this.hasAttribute("id")||this.setAttribute("id",`${this.tagName.toLowerCase()}-${kt.randomID()}`),t.has("open")&&(this.hasUpdated||this.open)&&this.manageOpen(t.get("open")),t.has("trigger")){const[o,s]=((n=this.trigger)==null?void 0:n.split("@"))||[];this.elementResolver.selector=o?`#${o}`:"",this.triggerInteraction=s}let i=!1;t.has(Ut.elementResolverUpdatedSymbol)&&(i=this.triggerElement,this.triggerElement=this.elementResolver.element),t.has("triggerElement")&&(i=t.get("triggerElement")),i!==!1&&this.bindEvents()}updated(t){super.updated(t),t.has("placement")&&(this.placement?this.dialogEl.setAttribute("actual-placement",this.placement):this.dialogEl.removeAttribute("actual-placement"),this.open&&t.get("placement")!==void 0&&this.placementController.resetOverlayPosition()),t.has("state")&&this.state==="closed"&&t.get("state")!==void 0&&this.placementController.clearOverlayPosition()}renderContent(){return E.x` <slot @slotchange=${this.handleSlotchange}></slot> `}get dialogStyleMap(){return{"--luzmo-overlay-open-count":B.openCount.toString()}}renderDialog(){return E.x`
19
- <dialog
20
- class="dialog"
21
- part="dialog"
22
- placement=${Tt.o(this.requiresPositioning?this.placement||"right":void 0)}
23
- style=${Vt.o(this.dialogStyleMap)}
24
- @close=${this.handleBrowserClose}
25
- @cancel=${this.handleBrowserClose}
26
- @beforetoggle=${this.handleBeforetoggle}
27
- ?is-visible=${this.state!=="closed"}
28
- >
29
- ${this.renderContent()}
30
- </dialog>
31
- `}renderPopover(){return E.x`
32
- <div
33
- class="dialog"
34
- part="dialog"
35
- placement=${Tt.o(this.requiresPositioning?this.placement||"right":void 0)}
36
- popover=${Tt.o(this.popoverValue)}
37
- style=${Vt.o(this.dialogStyleMap)}
38
- @beforetoggle=${this.handleBeforetoggle}
39
- @close=${this.handleBrowserClose}
40
- ?is-visible=${this.state!=="closed"}
41
- >
42
- ${this.renderContent()}
43
- </div>
44
- `}render(){const t=this.type==="modal"||this.type==="page";return E.x`
45
- ${t?this.renderDialog():this.renderPopover()}
46
- <slot name="longpress-describedby-descriptor"></slot>
47
- `}connectedCallback(){super.connectedCallback(),this.addEventListener("close",()=>{this.open=!1}),this.hasUpdated&&this.bindEvents()}disconnectedCallback(){var t;(t=this.strategy)==null||t.releaseDescription(),this.open=!1,super.disconnectedCallback()}},B.styles=[E.r(ze)],B.openCount=1,B);T([E.n({type:Boolean})],P.prototype,"delayed",1);T([ie.e(".dialog")],P.prototype,"dialogEl",2);T([E.n({type:Boolean})],P.prototype,"disabled",1);T([Ee.o({flatten:!0,selector:':not([slot="longpress-describedby-descriptor"], slot)'})],P.prototype,"elements",2);T([E.n({type:Number})],P.prototype,"offset",2);T([E.n({type:Boolean,reflect:!0})],P.prototype,"open",1);T([E.n()],P.prototype,"placement",2);T([E.n({attribute:"receives-focus"})],P.prototype,"receivesFocus",2);T([ie.e("slot")],P.prototype,"slotEl",2);T([xe.r()],P.prototype,"state",1);T([E.n({type:Number,attribute:"tip-padding"})],P.prototype,"tipPadding",2);T([E.n()],P.prototype,"trigger",2);T([E.n({attribute:!1})],P.prototype,"triggerElement",2);T([E.n({attribute:!1})],P.prototype,"triggerInteraction",2);T([E.n()],P.prototype,"type",2);let we=P;const bt=Object.freeze(Object.defineProperty({__proto__:null,LuzmoOverlay:we},Symbol.toStringTag,{value:"Module"}));exports.ClickController=fe;exports.HoverController=me;exports.InteractionController=Ot;exports.InteractionTypes=ut;exports.LONGPRESS_INSTRUCTIONS=ge;exports.LongpressController=ve;exports.LuzmoAbstractOverlay=it;exports.LuzmoOverlay=we;exports.PlacementController=pe;exports.VirtualTrigger=ht;exports.guaranteedAllTransitionend=xt;exports.nextFrame=R;exports.noop=Y;exports.overlay=bt;exports.overlayTimer=lt;exports.placementUpdatedSymbol=wi;exports.strategies=ye;
@@ -1,18 +0,0 @@
1
- /*! * Lucero - The design system for Luzmo.
2
- *
3
- * Copyright © 2025 Luzmo
4
- * All rights reserved.
5
- * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
- * This license allows users with a current active Luzmo account to use Lucero.
7
- * This license terminates automatically if a user no longer has an active Luzmo account.
8
- * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
- * SOFTWARE.
17
- * */
18
- "use strict";const h=require("./platform-BiXhwqk3.cjs"),c="(max-width: 743px) and (hover: none) and (pointer: coarse)";class d{constructor(t,e){this.key=Symbol("match-media-key"),this.matches=!1,this.host=t,this.host.addController(this),this.media=window.matchMedia(e),this.matches=this.media.matches,this.onChange=this.onChange.bind(this),t.addController(this)}hostConnected(){var t;(t=this.media)==null||t.addEventListener("change",this.onChange)}hostDisconnected(){var t;(t=this.media)==null||t.removeEventListener("change",this.onChange)}onChange(t){this.matches!==t.matches&&(this.matches=t.matches,this.host.requestUpdate(this.key,!this.matches))}}var r=(o=>(o[o.desktop=0]="desktop",o[o.mobile=1]="mobile",o))(r||{});class l{constructor(t,e){this.target=t,this.host=e,this.preventNextToggle="no",this.pointerdownState=!1,this.enterKeydownOn=null,this._open=!1,this.target=t,this.host=e,this.host.addController(this),this.init()}get activelyOpening(){return!1}get open(){return this._open}set open(t){if(this._open!==t){if(this._open=t,this.overlay){this.host.open=t;return}customElements.whenDefined("luzmo-overlay").then(async()=>{const{LuzmoOverlay:e}=await Promise.resolve().then(()=>require("./overlay/index.cjs"));this.overlay=new e,this.host.open=!0,this.host.requestUpdate()}),Promise.resolve().then(()=>require("./overlay/index.cjs"))}}get overlay(){return this._overlay}set overlay(t){t&&this.overlay!==t&&(this._overlay=t,this.initOverlay())}releaseDescription(){}handleBeforetoggle(t){var e,s;t.composedPath()[0]===t.target&&(t.newState==="closed"&&(this.preventNextToggle==="no"?this.open=!1:this.pointerdownState||(e=this.overlay)==null||e.manuallyKeepOpen()),this.open||(this.host.optionsMenu.updateSelectedItemIndex(),typeof((s=this.host.optionsMenu)==null?void 0:s.closeDescendentOverlays)=="function"&&this.host.optionsMenu.closeDescendentOverlays()))}initOverlay(){this.overlay&&(this.overlay.addEventListener("beforetoggle",t=>{this.handleBeforetoggle(t)}),this.overlay.type=this.host.isMobile.matches?"modal":"auto",this.overlay.triggerElement=this.host,this.overlay.placement=this.host.isMobile.matches?void 0:this.host.placement,this.overlay.receivesFocus="true",this.overlay.willPreventClose=this.preventNextToggle!=="no"&&this.open,this.overlay.addEventListener("slottable-request",this.host.handleSlottableRequest))}handlePointerdown(t){}handleButtonFocus(t){this.preventNextToggle==="maybe"&&t.relatedTarget===this.host.optionsMenu&&(this.preventNextToggle="yes")}handleActivate(t){}init(){}abort(){var t;this.releaseDescription(),(t=this.abortController)==null||t.abort()}hostConnected(){this.init()}hostDisconnected(){var t;(t=this.abortController)==null||t.abort()}hostUpdated(){this.overlay&&this.host.dependencyManager.loaded&&this.host.open!==this.overlay.open&&(this.overlay.willPreventClose=this.preventNextToggle!=="no",this.overlay.open=this.host.open)}}class u extends l{constructor(){super(...arguments),this.type=r.desktop}handlePointerdown(t){if(t.target.closest(".clear-icon")||t.button!==0||t.pointerType==="touch")return;this.pointerdownState=this.open,this.preventNextToggle="maybe";let a=0;const n=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(()=>{document.removeEventListener("pointerup",n),document.removeEventListener("pointercancel",n),this.target.removeEventListener("click",n),requestAnimationFrame(()=>{this.preventNextToggle="no"})})};document.addEventListener("pointerup",n),document.addEventListener("pointercancel",n),this.target.addEventListener("click",n),this.handleActivate()}handleActivate(t){this.enterKeydownOn&&this.enterKeydownOn!==this.target||this.preventNextToggle!=="yes"&&((t==null?void 0:t.type)==="click"&&this.open!==this.pointerdownState||this.host.toggle())}init(){var e;(e=this.abortController)==null||e.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("click",s=>this.handleActivate(s),{signal:t}),this.target.addEventListener("pointerdown",s=>this.handlePointerdown(s),{signal:t}),this.target.addEventListener("focus",s=>this.handleButtonFocus(s),{signal:t})}}const i="remove-focus-ring-safari-hack";class g extends l{constructor(){super(...arguments),this.type=r.mobile}handleClick(t){t.target.closest(".clear-button")&&(this.preventNextToggle==="no"&&(this.open=!this.open),this.preventNextToggle="no")}handlePointerdown(t){t.target.closest(".clear-button")&&(this.preventNextToggle=this.open?"yes":"no",h.isWebKit()&&this.target.classList.add(i))}handleFocusOut(){this.host.open||h.isWebKit()&&this.target.classList.contains(i)&&this.target.classList.remove(i)}init(){var e;(e=this.abortController)==null||e.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("click",s=>this.handleClick(s),{signal:t}),this.target.addEventListener("pointerdown",s=>this.handlePointerdown(s),{signal:t}),this.target.addEventListener("focusout",()=>this.handleFocusOut(),{signal:t})}}const p={desktop:u,mobile:g};exports.IS_MOBILE=c;exports.MatchMediaController=d;exports.strategies=p;
@@ -34,6 +34,7 @@ class g {
34
34
  }
35
35
  }
36
36
  var r = /* @__PURE__ */ ((o) => (o[o.desktop = 0] = "desktop", o[o.mobile = 1] = "mobile", o))(r || {});
37
+ const i = "remove-focus-ring-safari-hack";
37
38
  class l {
38
39
  constructor(t, e) {
39
40
  this.target = t, this.host = e, this.preventNextToggle = "no", this.pointerdownState = !1, this.enterKeydownOn = null, this._open = !1, this.target = t, this.host = e, this.host.addController(this), this.init();
@@ -151,7 +152,6 @@ class c extends l {
151
152
  );
152
153
  }
153
154
  }
154
- const i = "remove-focus-ring-safari-hack";
155
155
  class d extends l {
156
156
  constructor() {
157
157
  super(...arguments), this.type = r.mobile;