@vanelsas/baredom 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +3 -3
- package/dist/base.js +75 -73
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.js +13 -14
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +12 -12
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +28 -28
- package/dist/x-chart.js +46 -46
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +40 -40
- package/dist/x-command-palette.js +25 -25
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +18 -18
- package/dist/x-copy.js +20 -20
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.js +16 -16
- package/dist/x-grid.js +6 -6
- package/dist/x-icon.js +9 -0
- package/dist/x-image.js +20 -0
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.js +37 -37
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.js +40 -40
- package/dist/x-liquid-glass.js +33 -33
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +25 -25
- package/dist/x-modal.js +11 -11
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.js +12 -12
- package/dist/x-neural-glow.js +30 -30
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.js +15 -15
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-particle-button.js +46 -46
- package/dist/x-popover.js +14 -14
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +10 -10
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +33 -33
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton.js +4 -4
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +19 -19
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-theme.js +24 -24
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +8 -8
- package/package.json +9 -1
package/dist/x-checkbox.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.getAttribute("aria-describedby")]);var b=$APP.M(a);a=$APP.D(b,$APP.
|
|
4
|
-
$APP.k(a,"__xCheckboxRefs");if($APP.n(b)){var c=$APP.k(b,"control");b=
|
|
5
|
-
h=$APP.
|
|
6
|
-
d=$APP.
|
|
7
|
-
composed:!0,cancelable:!1}))):null},
|
|
8
|
-
b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return
|
|
9
|
-
"checked","checked");
|
|
10
|
-
e.setAttribute("part","control");e.setAttribute("type","button");e.setAttribute("role","checkbox");g.setAttribute("part","box");h.setAttribute("part","check");g.appendChild(h);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xCheckboxRefs={root:c,control:e,box:g,check:h};$APP.n(this.attachInternals)&&(this.__xCheckboxInternals=this.attachInternals())}
|
|
11
|
-
d),c.addEventListener("keydown",e),this.__xCheckboxHandlers=g);d=this.getAttribute("id");$APP.n(d)&&(c=document.querySelector("label[for\x3d'"+$APP.T.g(d)+"']"),$APP.n(c)&&(e=c.getAttribute("id"),$APP.n(e)?c=e:(d="x-cb-lbl-"+$APP.T.g(d),c.setAttribute("id",d),c=d),d=$APP.k(this,"__xCheckboxRefs"),$APP.n(d)&&(d=$APP.k(d,"control"),$APP.n(this.hasAttribute("aria-labelledby"))||d.setAttribute("aria-labelledby",c))));return
|
|
12
|
-
function(){return
|
|
2
|
+
var uA=function(a,b,c){return a.setAttribute(b,c)},vA=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},xA=function(a){a=$APP.xf([$APP.Uk,$APP.gl,$APP.uh,$APP.Gh,$APP.Ui,wA,$APP.mj,$APP.Wl,$APP.vj,$APP.dj],[a.getAttribute("name"),$APP.Gg(a.getAttribute("disabled")),$APP.Gg(a.getAttribute("required")),a.getAttribute("aria-labelledby"),$APP.Gg(a.getAttribute("checked")),$APP.Gg(a.getAttribute("indeterminate")),$APP.Gg(a.getAttribute("readonly")),a.getAttribute("value"),a.getAttribute("aria-label"),
|
|
3
|
+
a.getAttribute("aria-describedby")]);var b=$APP.M(a);a=$APP.D(b,$APP.vj);var c=$APP.D(b,$APP.dj),d=$APP.D(b,$APP.Uk),e=$APP.D(b,$APP.gl),g=$APP.D(b,$APP.uh),h=$APP.D(b,$APP.Gh),l=$APP.D(b,$APP.Ui),m=$APP.D(b,wA),p=$APP.D(b,$APP.mj);b=$APP.D(b,$APP.Wl);l=$APP.F(l);m=$APP.F(m);g=$APP.F(g);return $APP.xf([$APP.rl,$APP.Vh,$APP.Ph,$APP.um,$APP.fj,$APP.Ah,$APP.bj,$APP.Bi,$APP.Hj,$APP.qm,$APP.il,$APP.W],[m,g,m?"mixed":l?"true":"false",$APP.F(p),l,$APP.n(g)?l:!0,d,b!=null?b:"on",h,c,a,$APP.F(e)])},yA=function(a){var b=
|
|
4
|
+
$APP.k(a,"__xCheckboxRefs");if($APP.n(b)){var c=$APP.k(b,"control");b=xA(a);var d=$APP.W.g(b),e=$APP.fj.g(b),g=$APP.rl.g(b);uA(c,"aria-checked",$APP.Ph.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");uA(c,"aria-required",$APP.n($APP.Vh.g(b))?"true":"false");uA(c,"aria-readonly",$APP.n($APP.um.g(b))?"true":"false");var h=$APP.il.g(b);$APP.n(h)?c.setAttribute("aria-label",h):c.removeAttribute("aria-label");h=$APP.Hj.g(b);$APP.n(h)?c.setAttribute("aria-labelledby",h):c.removeAttribute("aria-labelledby");
|
|
5
|
+
h=$APP.qm.g(b);$APP.n(h)?c.setAttribute("aria-describedby",h):c.removeAttribute("aria-describedby");c.tabIndex=$APP.n(d)?-1:0;$APP.n(d)?c.setAttribute("disabled",""):c.removeAttribute("disabled");vA(a,"data-checked",e);vA(a,"data-indeterminate",g);vA(a,"data-disabled",d);a=$APP.k(a,"__xCheckboxInternals");if($APP.n(a))return b=$APP.n(e)?$APP.Bi.g(b):null,a.setFormValue($APP.n(b)?b:null)}return null},zA=function(a){var b=xA(a),c=$APP.W.g(b),d=$APP.um.g(b);if($APP.n($APP.n(c)?c:d))return null;c=$APP.fj.g(b);
|
|
6
|
+
d=$APP.rl.g(b);d=$APP.n(d)?new $APP.R(null,2,[$APP.fj,!0,$APP.rl,!1],null):new $APP.R(null,2,[$APP.fj,$APP.r(c),$APP.rl,!1],null);var e=$APP.fj.g(d);b=$APP.Bi.g(b);c=new CustomEvent("x-checkbox-change-request",{detail:{value:b,previousChecked:c,nextChecked:e},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(c);return $APP.r(c.defaultPrevented)?(vA(a,"checked",e),vA(a,"indeterminate",$APP.rl.g(d)),yA(a),a.dispatchEvent(new CustomEvent("x-checkbox-change",{detail:{value:b,checked:e},bubbles:!0,
|
|
7
|
+
composed:!0,cancelable:!1}))):null},AA=function(a){return function(){return zA(a)}},BA=function(a){return function(b){var c=b.key;return $APP.C.i(c," ")||$APP.C.i(c,"Enter")?(b.preventDefault(),zA(a)):null}},CA=function(a){var b=$APP.k(a,"__xCheckboxRefs");if($APP.n(b)){var c=$APP.k(a,"__xCheckboxHandlers");if($APP.n(c)){b=$APP.k(b,"control");b.removeEventListener("click",$APP.k(c,"click"));b.removeEventListener("keydown",$APP.k(c,"keydown"));a.__xCheckboxHandlers=null;return}}return null},DA=function(a,
|
|
8
|
+
b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return vA(this,c,$APP.F(d))}})},EA=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?uA(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},GA=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;a.observedAttributes=FA;DA(b,
|
|
9
|
+
"checked","checked");DA(b,"indeterminate","indeterminate");DA(b,"disabled","disabled");DA(b,"readOnly","readonly");DA(b,"required","required");EA(b,"name","name");EA(b,"value","value");b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xCheckboxRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("button"),g=document.createElement("span"),h=document.createElement("span");d.textContent=":host{display:inline-block;vertical-align:middle;color-scheme:light dark;--x-checkbox-size:16px;--x-checkbox-border-width:2px;--x-checkbox-border-color:var(--x-color-border,#6b7280);--x-checkbox-border-radius:4px;--x-checkbox-bg:var(--x-color-surface,#ffffff);--x-checkbox-bg-checked:var(--x-color-primary,#2563eb);--x-checkbox-bg-indeterminate:var(--x-color-primary,#2563eb);--x-checkbox-border-checked:var(--x-color-primary,#2563eb);--x-checkbox-border-indeterminate:var(--x-color-primary,#2563eb);--x-checkbox-check-color:var(--x-color-surface,#ffffff);--x-checkbox-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-checkbox-disabled-opacity:0.45;--x-checkbox-transition:background var(--x-transition-duration,120ms) var(--x-transition-easing,ease),border-color var(--x-transition-duration,120ms) var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-checkbox-border-color:var(--x-color-border,#9ca3af);--x-checkbox-bg:var(--x-color-surface,#1f2937);--x-checkbox-bg-checked:var(--x-color-primary,#3b82f6);--x-checkbox-bg-indeterminate:var(--x-color-primary,#3b82f6);--x-checkbox-border-checked:var(--x-color-primary,#3b82f6);--x-checkbox-border-indeterminate:var(--x-color-primary,#3b82f6);--x-checkbox-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3dcontrol]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;}[part\x3dcontrol][disabled]{cursor:default;opacity:var(--x-checkbox-disabled-opacity);}[part\x3dcontrol]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--x-checkbox-focus-ring);border-radius:calc(var(--x-checkbox-border-radius) + 2px);}[part\x3dbox]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-checkbox-size);height:var(--x-checkbox-size);border:var(--x-checkbox-border-width) solid var(--x-checkbox-border-color);border-radius:var(--x-checkbox-border-radius);background:var(--x-checkbox-bg);transition:var(--x-checkbox-transition);position:relative;flex-shrink:0;}:host([data-checked]) [part\x3dbox]{background:var(--x-checkbox-bg-checked);border-color:var(--x-checkbox-border-checked);}:host([data-indeterminate]) [part\x3dbox]{background:var(--x-checkbox-bg-indeterminate);border-color:var(--x-checkbox-border-indeterminate);}[part\x3dcheck]{display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;}[part\x3dcheck]::before{content:'\\2713';color:var(--x-checkbox-check-color);font-size:10px;font-weight:700;line-height:1;opacity:0;transition:opacity 100ms ease;position:absolute;}:host([data-checked]) [part\x3dcheck]::before{opacity:1;}[part\x3dcheck]::after{content:'';display:block;width:8px;height:2px;background:var(--x-checkbox-check-color);border-radius:1px;opacity:0;transition:opacity 100ms ease;position:absolute;}:host([data-indeterminate]) [part\x3dcheck]::after{opacity:1;}@media (prefers-reduced-motion:reduce){[part\x3dbox]{transition:none;}[part\x3dcheck]::before{transition:none;}[part\x3dcheck]::after{transition:none;}}";
|
|
10
|
+
e.setAttribute("part","control");e.setAttribute("type","button");e.setAttribute("role","checkbox");g.setAttribute("part","box");h.setAttribute("part","check");g.appendChild(h);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xCheckboxRefs={root:c,control:e,box:g,check:h};$APP.n(this.attachInternals)&&(this.__xCheckboxInternals=this.attachInternals())}CA(this);c=$APP.k(this,"__xCheckboxRefs");$APP.n(c)&&(c=$APP.k(c,"control"),d=AA(this),e=BA(this),g={click:d,keydown:e},c.addEventListener("click",
|
|
11
|
+
d),c.addEventListener("keydown",e),this.__xCheckboxHandlers=g);d=this.getAttribute("id");$APP.n(d)&&(c=document.querySelector("label[for\x3d'"+$APP.T.g(d)+"']"),$APP.n(c)&&(e=c.getAttribute("id"),$APP.n(e)?c=e:(d="x-cb-lbl-"+$APP.T.g(d),c.setAttribute("id",d),c=d),d=$APP.k(this,"__xCheckboxRefs"),$APP.n(d)&&(d=$APP.k(d,"control"),$APP.n(this.hasAttribute("aria-labelledby"))||d.setAttribute("aria-labelledby",c))));return yA(this)};b.disconnectedCallback=function(){return CA(this)};b.attributeChangedCallback=
|
|
12
|
+
function(){return yA(this)};b.formDisabledCallback=function(c){vA(this,"disabled",$APP.F(c));return yA(this)};b.formResetCallback=function(){this.removeAttribute("checked");this.removeAttribute("indeterminate");return yA(this)};return a},HA=function(){return $APP.n(customElements.get("x-checkbox"))?null:customElements.define("x-checkbox",GA())},wA=new $APP.K(null,"indeterminate-present?","indeterminate-present?",-1714683438);var FA="checked indeterminate disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.Pd(["x-checkbox-change-request",new $APP.R(null,2,[$APP.Dl,!0,$APP.Cj,new $APP.R(null,3,[$APP.Bi,$APP.X,$APP.Vj,$APP.Fj,$APP.nl,$APP.Fj],null)],null),"x-checkbox-change",new $APP.R(null,2,[$APP.Dl,!1,$APP.Cj,new $APP.R(null,2,[$APP.Bi,$APP.X,$APP.im,$APP.Fj],null)],null)]);$APP.fa("baredom.exports.x_checkbox.init",HA);export const init=HA;
|
package/dist/x-chip.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.removeEventListener("animationend",d);return a.remove()});return a.setAttribute("data-exiting","")},
|
|
4
|
-
|
|
5
|
-
"true"):a.removeAttribute("aria-disabled");$APP.n(b)?a.setAttribute("aria-keyshortcuts","Backspace Delete"):a.removeAttribute("aria-keyshortcuts");$APP.n(g)&&($APP.n(c)?g.setAttribute("disabled",""):g.removeAttribute("disabled"));return null},
|
|
6
|
-
b);$APP.ia(a,"__xChipHandlers",{click:c,keydown:b})},
|
|
7
|
-
enumerable:!0,configurable:!0})},
|
|
2
|
+
var Hr=function(a){var b=$APP.M(a),c=$APP.D(b,$APP.Yh);a=$APP.D(b,$APP.Wl);var d=$APP.D(b,Fr);b=$APP.D(b,$APP.gl);c=$APP.n(c)?c:"";d=d==null?!0:!($APP.C.i(d,"false")||$APP.C.i(d,"0"));return new $APP.R(null,4,[$APP.U,c,$APP.Bi,typeof a==="string"&&a.length>0?a:c,Gr,d,$APP.W,$APP.F(b)],null)},Ir=function(a){var b=$APP.M(a);a=$APP.D(b,Gr);b=$APP.D(b,$APP.W);return $APP.n(a)?$APP.r(b):a},Jr=function(a){var b=setTimeout(function(){return a.remove()},400);a.addEventListener("animationend",function d(){clearTimeout(b);
|
|
3
|
+
a.removeEventListener("animationend",d);return a.remove()});return a.setAttribute("data-exiting","")},Kr=function(a){var b=Hr(new $APP.R(null,4,[$APP.Yh,a.getAttribute("label"),$APP.Wl,a.getAttribute("value"),Fr,a.getAttribute("removable"),$APP.gl,a.hasAttribute("disabled")],null));if($APP.n(Ir(b))){var c=$APP.M(b);b=$APP.D(c,$APP.Bi);c=$APP.D(c,$APP.U);b=new CustomEvent("x-chip-remove",{detail:{value:b,label:c},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);a=$APP.r(b.defaultPrevented)?
|
|
4
|
+
Jr(a):null}else a=null;return a},Mr=function(a){var b=Hr(new $APP.R(null,4,[$APP.Yh,a.getAttribute("label"),$APP.Wl,a.getAttribute("value"),Fr,a.getAttribute("removable"),$APP.gl,a.hasAttribute("disabled")],null)),c=$APP.M(b),d=$APP.D(c,$APP.U),e=$APP.D(c,Gr);c=$APP.D(c,$APP.W);var g=$APP.k(a,"__xChipRefs"),h=$APP.hm.g(g);g=Lr.g(g);b=Ir(b);$APP.n(h)&&(h.textContent=d);$APP.n(e)?a.setAttribute("data-removable",""):a.removeAttribute("data-removable");a.tabIndex=$APP.n(b)?0:-1;$APP.n(c)?a.setAttribute("aria-disabled",
|
|
5
|
+
"true"):a.removeAttribute("aria-disabled");$APP.n(b)?a.setAttribute("aria-keyshortcuts","Backspace Delete"):a.removeAttribute("aria-keyshortcuts");$APP.n(g)&&($APP.n(c)?g.setAttribute("disabled",""):g.removeAttribute("disabled"));return null},Nr=function(a){function b(e){var g=e.key;return $APP.C.i(g,"Backspace")||$APP.C.i(g,"Delete")?(e.preventDefault(),Kr(a)):null}function c(){return Kr(a)}var d=Lr.g($APP.k(a,"__xChipRefs"));$APP.n(d)&&d.addEventListener("click",c);a.addEventListener("keydown",
|
|
6
|
+
b);$APP.ia(a,"__xChipHandlers",{click:c,keydown:b})},Or=function(a){var b=$APP.k(a,"__xChipHandlers");if($APP.n(b)){var c=$APP.k(a,"__xChipRefs"),d=$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n($APP.n(c)?d:c)&&(c=Lr.g(c),$APP.n(c)&&c.removeEventListener("click",d));$APP.n(b)&&a.removeEventListener("keydown",b)}return a.__xChipHandlers=null},Pr=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return c!=null?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},
|
|
7
|
+
enumerable:!0,configurable:!0})},Qr=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Rr=function(a){Pr(a,"label");Pr(a,"value");Qr(a,"removable");Qr(a,"disabled")},Tr=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Sr}});b.connectedCallback=function(){if(!$APP.n($APP.k(this,
|
|
8
8
|
"__xChipRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("span"),g=document.createElement("span"),h=document.createElement("button"),l=document.createElement("span");d.textContent=":host{--x-chip-bg:var(--x-color-surface,rgba(0,0,0,0.08));--x-chip-color:var(--x-color-text,rgba(0,0,0,0.80));--x-chip-border:var(--x-color-border,rgba(0,0,0,0.12));--x-chip-radius:var(--x-radius-full, 9999px);--x-chip-font-size:var(--x-font-size-sm, 0.875rem);--x-chip-padding-x:0.625rem;--x-chip-padding-y:0.25rem;--x-chip-remove-size:1rem;--x-chip-exit-duration:300ms;display:inline-flex;align-items:center;vertical-align:middle;color-scheme:light dark;font-family:inherit;font-size:var(--x-chip-font-size);line-height:1;border-radius:var(--x-chip-radius);background:var(--x-chip-bg);border:1px solid var(--x-chip-border);color:var(--x-chip-color);padding:var(--x-chip-padding-y) var(--x-chip-padding-x);gap:0.25rem;box-sizing:border-box;cursor:default;user-select:none;outline:none;}@media (prefers-color-scheme:dark){:host{--x-chip-bg:var(--x-color-surface,rgba(255,255,255,0.10));--x-chip-border:var(--x-color-border,rgba(255,255,255,0.16));--x-chip-color:var(--x-color-text,rgba(255,255,255,0.88));}}:host(:focus-visible){outline:2px solid var(--x-color-focus-ring,currentColor);outline-offset:2px;}:host([disabled]){opacity:0.55;pointer-events:none;}[part\x3dcontainer]{display:inline-flex;align-items:center;gap:0.25rem;}[part\x3dlabel]{display:inline;font-size:inherit;color:inherit;}[part\x3dremove]{display:none;align-items:center;justify-content:center;width:var(--x-chip-remove-size);height:var(--x-chip-remove-size);border:none;background:none;color:inherit;cursor:pointer;padding:0;border-radius:50%;font-size:1rem;line-height:1;opacity:0.7;flex-shrink:0;}[part\x3dremove]:hover{opacity:1;}[part\x3dremove]:focus-visible{outline:2px solid currentColor;outline-offset:1px;}:host([data-removable]) [part\x3dremove]{display:inline-flex;}@keyframes x-chip-exit{to{opacity:0;transform:scale(0.85);}}:host([data-exiting]){animation:x-chip-exit var(--x-chip-exit-duration) forwards;}@media (prefers-reduced-motion:reduce){:host([data-exiting]){animation-duration:0ms;}}";
|
|
9
|
-
e.setAttribute("part","container");g.setAttribute("part","label");h.setAttribute("part","remove");h.setAttribute("type","button");h.setAttribute("aria-label","Remove");l.setAttribute("aria-hidden","true");l.textContent="×";h.appendChild(l);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xChipRefs=new $APP.R(null,4,[$APP.
|
|
10
|
-
d,e){return $APP.N(d,e)?$APP.n($APP.k(this,"__xChipRefs"))?
|
|
9
|
+
e.setAttribute("part","container");g.setAttribute("part","label");h.setAttribute("part","remove");h.setAttribute("type","button");h.setAttribute("aria-label","Remove");l.setAttribute("aria-hidden","true");l.textContent="×";h.appendChild(l);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xChipRefs=new $APP.R(null,4,[$APP.li,c,$APP.ij,e,$APP.hm,g,Lr,h],null)}Or(this);Nr(this);return Mr(this)};b.disconnectedCallback=function(){return Or(this)};b.attributeChangedCallback=function(c,
|
|
10
|
+
d,e){return $APP.N(d,e)?$APP.n($APP.k(this,"__xChipRefs"))?Mr(this):null:null};Rr(b);return a},Ur=function(){$APP.n(customElements.get("x-chip"))||customElements.define("x-chip",Tr());return null},Fr=new $APP.K(null,"removable-raw","removable-raw",1718453796),Lr=new $APP.K(null,"remove-btn","remove-btn",843430290),Gr=new $APP.K(null,"removable?","removable?",1886800649);var Sr=["label","value","removable","disabled"];$APP.Pd(["x-chip-remove",new $APP.R(null,2,[$APP.Cj,new $APP.R(null,2,[$APP.Bi,$APP.X,$APP.U,$APP.X],null),$APP.Dl,!0],null)]);$APP.fa("baredom.exports.x_chip.init",Ur);export const init=Ur;
|
package/dist/x-collapse.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b.offsetHeight;var d=""+$APP.T.g(b.scrollHeight)+"px";b.style.transition="height "+$APP.T.g(a)+"ms ease";b.style.height=d;var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),g={fn:null};g.fn=c;return b.addEventListener("transitionend",c)},
|
|
4
|
-
"px";a=
|
|
5
|
-
$APP.n(d)?"true":"false");if($APP.n(e))return c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true");c.removeAttribute("disabled");return c.removeAttribute("aria-disabled")}return null},
|
|
6
|
-
a.dispatchEvent(new CustomEvent("x-collapse-change",{detail:{open:c},bubbles:!0,composed:!0,cancelable:!1}))):null},
|
|
7
|
-
$APP.k(c,"keydown"));a.__xCollapseHandlers=null;return}}return null},
|
|
8
|
-
b)):b=this.removeAttribute("header");return b}})},
|
|
9
|
-
"observedAttributes",{get:function(){return
|
|
2
|
+
var K3=function(){var a=window.matchMedia;return $APP.n(a)?window.matchMedia("(prefers-reduced-motion: reduce)").matches:a},L3=function(a){a=a.getAttribute("duration-ms");return $APP.n(a)?(a=parseInt(a,10),$APP.n(isNaN(a))?300:$APP.$g.i(0,$APP.ah.i(2E3,a))):300},M3=function(a,b){function c(){clearTimeout(e);b.style.height="";b.style.transition="";return b.removeEventListener("transitionend",$APP.k(g,"fn"))}if($APP.n(K3()))return b.style.height="",b.style.transition="";a=L3(a);b.style.height="0px";
|
|
3
|
+
b.offsetHeight;var d=""+$APP.T.g(b.scrollHeight)+"px";b.style.transition="height "+$APP.T.g(a)+"ms ease";b.style.height=d;var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),g={fn:null};g.fn=c;return b.addEventListener("transitionend",c)},N3=function(a,b){function c(){clearTimeout(e);b.style.height="";b.style.transition="";return b.removeEventListener("transitionend",$APP.k(g,"fn"))}if($APP.n(K3()))return b.style.height="0px",b.style.transition="";var d=""+$APP.T.g(b.offsetHeight)+
|
|
4
|
+
"px";a=L3(a);b.style.height=d;b.offsetHeight;b.style.transition="height "+$APP.T.g(a)+"ms ease";b.style.height="0px";var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),g={fn:null};g.fn=c;return b.addEventListener("transitionend",c)},O3=function(a){var b=$APP.k(a,"__xCollapseRefs");if($APP.n(b)){var c=$APP.k(b,"trigger");b=$APP.k(b,"header-text");var d=a.hasAttribute("open"),e=a.hasAttribute("disabled");a=a.getAttribute("header");b.textContent=$APP.n(a)?a:"";c.setAttribute("aria-expanded",
|
|
5
|
+
$APP.n(d)?"true":"false");if($APP.n(e))return c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true");c.removeAttribute("disabled");return c.removeAttribute("aria-disabled")}return null},P3=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=$APP.r(a.hasAttribute("open"));b=new CustomEvent("x-collapse-toggle",{detail:{open:c,source:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);return $APP.r(b.defaultPrevented)?(c?a.setAttribute("open",""):a.removeAttribute("open"),
|
|
6
|
+
a.dispatchEvent(new CustomEvent("x-collapse-change",{detail:{open:c},bubbles:!0,composed:!0,cancelable:!1}))):null},Q3=function(a){return function(){return P3(a,"pointer")}},R3=function(a){return function(b){var c=b.key;return $APP.C.i(c," ")||$APP.C.i(c,"Enter")?(b.preventDefault(),P3(a,"keyboard")):null}},S3=function(a){var b=$APP.k(a,"__xCollapseRefs");if($APP.n(b)){var c=$APP.k(a,"__xCollapseHandlers");if($APP.n(c)){b=$APP.k(b,"trigger");b.removeEventListener("click",$APP.k(c,"click"));b.removeEventListener("keydown",
|
|
7
|
+
$APP.k(c,"keydown"));a.__xCollapseHandlers=null;return}}return null},T3=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n($APP.F(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},U3=function(a){Object.defineProperty(a,"header",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("header");return $APP.n(b)?b:""},set:function(b){b!=null&&$APP.N(b)?(b=""+$APP.T.g(b),b=this.setAttribute("header",
|
|
8
|
+
b)):b=this.removeAttribute("header");return b}})},V3=function(a){Object.defineProperty(a,"durationMs",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("duration-ms");return $APP.n(b)?(b=parseInt(b,10),$APP.n(isNaN(b))?300:b):300},set:function(b){typeof b==="number"&&$APP.r(isNaN(b))?(b=""+$APP.T.g(Math.round(b)),b=this.setAttribute("duration-ms",b)):b=this.removeAttribute("duration-ms");return b}})},X3=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,
|
|
9
|
+
"observedAttributes",{get:function(){return W3}});T3(b,"open","open");T3(b,"disabled","disabled");U3(b);V3(b);b.toggle=function(){return P3(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xCollapseRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("button"),h=document.createElement("span"),l=document.createElement("span"),m=document.createElement("div"),p=document.createElement("div"),
|
|
10
10
|
q=document.createElement("slot");d.textContent=":host{display:block;color-scheme:light dark;--x-collapse-border-radius:var(--x-radius-md, 8px);--x-collapse-border:1px solid var(--x-color-border,#e2e8f0);--x-collapse-bg:var(--x-color-surface, #ffffff);--x-collapse-trigger-bg:var(--x-color-surface-hover, #f8fafc);--x-collapse-trigger-bg-hover:var(--x-color-surface-active,#f1f5f9);--x-collapse-trigger-color:var(--x-color-text, #0f172a);--x-collapse-trigger-padding:0.75rem 1rem;--x-collapse-content-padding:1rem;--x-collapse-font-size:0.9375rem;--x-collapse-font-weight:600;--x-collapse-chevron-color:var(--x-color-text-muted, #64748b);--x-collapse-focus-ring:var(--x-color-focus-ring, #60a5fa);}@media (prefers-color-scheme:dark){:host{--x-collapse-border:1px solid var(--x-color-border,#334155);--x-collapse-bg:var(--x-color-surface,#1e293b);--x-collapse-trigger-bg:var(--x-color-surface-hover,#0f172a);--x-collapse-trigger-bg-hover:var(--x-color-surface-active,#1e293b);--x-collapse-trigger-color:var(--x-color-text,#e2e8f0);--x-collapse-chevron-color:var(--x-color-text-muted, #94a3b8);--x-collapse-focus-ring:var(--x-color-focus-ring, #93c5fd);}}[part\x3dcontainer]{box-sizing:border-box;border:var(--x-collapse-border);border-radius:var(--x-collapse-border-radius);background:var(--x-collapse-bg);overflow:hidden;}[part\x3dtrigger]{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--x-collapse-trigger-padding);background:var(--x-collapse-trigger-bg);color:var(--x-collapse-trigger-color);font-size:var(--x-collapse-font-size);font-weight:var(--x-collapse-font-weight);cursor:pointer;user-select:none;}[part\x3dtrigger][disabled]{cursor:default;opacity:0.55;}[part\x3dtrigger]:hover:not([disabled]){background:var(--x-collapse-trigger-bg-hover);}[part\x3dtrigger]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--x-collapse-focus-ring);}[part\x3dheader-text]{flex:1;text-align:start;}[part\x3dchevron]{display:inline-block;margin-inline-start:0.5rem;color:var(--x-collapse-chevron-color);transition:transform 200ms ease;flex-shrink:0;}:host([open]) [part\x3dchevron]{transform:rotate(180deg);}[part\x3dcontent]{overflow:hidden;height:0;}:host([open]) [part\x3dcontent]{height:auto;}[part\x3dcontent-inner]{padding:var(--x-collapse-content-padding);}@media (prefers-reduced-motion:reduce){[part\x3dcontent]{transition:none !important;}[part\x3dchevron]{transition:none !important;}}";
|
|
11
11
|
e.setAttribute("part","container");g.setAttribute("part","trigger");g.setAttribute("type","button");g.setAttribute("id","trigger");g.setAttribute("aria-controls","panel");h.setAttribute("part","header-text");l.setAttribute("part","chevron");l.setAttribute("aria-hidden","true");m.setAttribute("part","content");m.setAttribute("id","panel");m.setAttribute("role","region");m.setAttribute("aria-labelledby","trigger");p.setAttribute("part","content-inner");q.setAttribute("name","content");l.textContent=
|
|
12
|
-
"▼";g.appendChild(h);g.appendChild(l);p.appendChild(q);m.appendChild(p);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xCollapseRefs={root:c,trigger:g,"header-text":h,content:m}}
|
|
13
|
-
function(c){a:{if($APP.n($APP.k(this,"__xCollapseRefs"))&&(
|
|
12
|
+
"▼";g.appendChild(h);g.appendChild(l);p.appendChild(q);m.appendChild(p);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xCollapseRefs={root:c,trigger:g,"header-text":h,content:m}}S3(this);c=$APP.k(this,"__xCollapseRefs");$APP.n(c)&&(c=$APP.k(c,"trigger"),d=Q3(this),e=R3(this),g={click:d,keydown:e},c.addEventListener("click",d),c.addEventListener("keydown",e),this.__xCollapseHandlers=g);return O3(this)};b.disconnectedCallback=function(){return S3(this)};b.attributeChangedCallback=
|
|
13
|
+
function(c){a:{if($APP.n($APP.k(this,"__xCollapseRefs"))&&(O3(this),$APP.C.i(c,"open"))){c=$APP.k(this,"__xCollapseRefs");c=$APP.n(c)?$APP.k(c,"content"):null;var d=this.hasAttribute("open");c=$APP.n(c)?$APP.n(d)?M3(this,c):N3(this,c):null;break a}c=null}return c};return a},Y3=function(){return $APP.n(customElements.get("x-collapse"))?null:customElements.define("x-collapse",X3())};var W3=["open","disabled","header","duration-ms"];$APP.Pd(["x-collapse-toggle",new $APP.R(null,2,[$APP.Dl,!0,$APP.Cj,new $APP.R(null,2,[$APP.Al,$APP.Fj,$APP.Nk,$APP.X],null)],null),"x-collapse-change",new $APP.R(null,2,[$APP.Dl,!1,$APP.Cj,new $APP.R(null,1,[$APP.Al,$APP.Fj],null)],null)]);$APP.fa("baredom.exports.x_collapse.init",Y3);export const init=Y3;
|
package/dist/x-color-picker.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.T.g($APP.oc(a,1))+$APP.T.g($APP.oc(a,1)),16),d=parseInt(""+$APP.T.g($APP.oc(a,2))+$APP.T.g($APP.oc(a,2)),16);return new $APP.R(null,4,[
|
|
4
|
-
8),16)/255],null);default:return null}else return null;else return null},
|
|
5
|
-
b,c){a=
|
|
6
|
-
255).toString(16);return $APP.z(g)<2?"0"+$APP.T.g(g):g}return"#"+$APP.T.g(e(a))+$APP.T.g(e(b))+$APP.T.g(e(c))+$APP.T.g(e(
|
|
7
|
-
|
|
8
|
-
$APP.M(a),c=$APP.D(b,$APP.
|
|
9
|
-
v=$APP.n(A)?v:1;A=
|
|
10
|
-
", Opacity "+$APP.T.g(Math.round(d*100))+"%":a},
|
|
11
|
-
a.getAttribute("label"),a.getAttribute("alpha")]))}
|
|
12
|
-
|
|
13
|
-
h);l.setAttribute("data-color",h);l.style.backgroundColor=h;b.appendChild(l);g+=1}else if(a=$APP.t(a))$APP.Nc(a)?(e=$APP.xb(a),a=$APP.yb(a),c=e,e=$APP.z(e)):(c=$APP.u(a),e=
|
|
14
|
-
$APP.C.i(m.getAttribute("data-color"),d)?"true":"false")})},
|
|
15
|
-
$APP.k(b,"preview-color"),I=$APP.k(b,"hex-input"),Q=$APP.k(b,"trigger-swatch");b=$APP.k(b,"swatches");a.setAttribute("data-mode",m);a.style.setProperty("--_x-cp-hue",""+$APP.T.g(Math.round(A)));q.style.setProperty("--_x-cp-area-x",""+$APP.T.g($APP.
|
|
16
|
-
"%");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var d=$APP.n(b.shiftKey)?10:1,e=zy
|
|
20
|
-
$APP.J(
|
|
21
|
-
d);case "ArrowLeft":return
|
|
22
|
-
if($APP.n(a)){var b=$APP.k(a,"area");return setTimeout(function(){return b.focus()},0)}return null},
|
|
23
|
-
"trigger");b=$APP.k(b,"panel");var q=function(ca){var pa=
|
|
24
|
-
|
|
25
|
-
var La=$APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip");La.setPointerCapture(ca.pointerId);a.__xColorPickerDragging="hue";ca=
|
|
26
|
-
null;var ca=
|
|
27
|
-
"alpha-strip"),ca);
|
|
28
|
-
|
|
29
|
-
jb=function(ca){$APP.C.i("Escape",ca.key)&&$APP.C.i("popover",$APP.
|
|
30
|
-
d.addEventListener("pointermove",B);d.addEventListener("pointerup",E);d.addEventListener("keydown",H);e.addEventListener("pointerdown",G);e.addEventListener("pointermove",I);e.addEventListener("pointerup",Q);e.addEventListener("keydown",
|
|
31
|
-
bb,!0);$APP.Ag(a,"__xColorPickerHandlers",{"area-move":v,copy:$a,"panel-key":jb,"alpha-up":Q,"hue-up":E,"alpha-key":
|
|
2
|
+
var oy=function(a){return(0,$APP.Pg)(a)},py=function(a,b){return $APP.ah.i($APP.$g.i(a,0),b)},qy=function(a){return $APP.ed(a,360)},ry=function(a){return py(a,100)},sy=function(a){return py(a,1)},uy=function(a){var b=typeof a==="string";a=b?$APP.cg(ty,a.trim()):b;return $APP.F(a)},yy=function(a){if(typeof a==="string")if(a=$APP.cg(ty,a.trim()),$APP.n(a))switch($APP.zc(a,0,null),a=$APP.zc(a,1,null),$APP.z(a)){case 3:var b=parseInt(""+$APP.T.g($APP.oc(a,0))+$APP.T.g($APP.oc(a,0)),16),c=parseInt(""+
|
|
3
|
+
$APP.T.g($APP.oc(a,1))+$APP.T.g($APP.oc(a,1)),16),d=parseInt(""+$APP.T.g($APP.oc(a,2))+$APP.T.g($APP.oc(a,2)),16);return new $APP.R(null,4,[vy,b,$APP.jl,c,wy,d,xy,1],null);case 6:return b=parseInt(a.substring(0,2),16),c=parseInt(a.substring(2,4),16),d=parseInt(a.substring(4,6),16),new $APP.R(null,4,[vy,b,$APP.jl,c,wy,d,xy,1],null);case 8:return b=parseInt(a.substring(0,2),16),c=parseInt(a.substring(2,4),16),d=parseInt(a.substring(4,6),16),new $APP.R(null,4,[vy,b,$APP.jl,c,wy,d,xy,parseInt(a.substring(6,
|
|
4
|
+
8),16)/255],null);default:return null}else return null;else return null},Cy=function(a,b,c){a/=255;b/=255;c/=255;var d=$APP.$g.C(a,b,$APP.tc([c])),e=$APP.ah.C(a,b,$APP.tc([c])),g=(d+e)/2,h=d-e;return h===0?new $APP.R(null,3,[zy,0,Ay,0,By,g*100],null):new $APP.R(null,3,[zy,(d===a?((b-c)/h+(b<c?6:0))/6:d===b?((c-a)/h+2)/6:((a-b)/h+4)/6)*360,Ay,(g>.5?h/(2-d-e):h/(d+e))*100,By,g*100],null)},Dy=function(a,b,c){c=c<0?c+1:c>1?c-1:c;return c<1/6?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},Ey=function(a,
|
|
5
|
+
b,c){a=qy(a)/360;b=ry(b)/100;c=ry(c)/100;if(b===0)return a=Math.round(c*255),new $APP.R(null,3,[vy,a,$APP.jl,a,wy,a],null);b=c<.5?c*(1+b):c+b-c*b;c=2*c-b;return new $APP.R(null,3,[vy,Math.round(Dy(c,b,a+1/3)*255),$APP.jl,Math.round(Dy(c,b,a)*255),wy,Math.round(Dy(c,b,a-1/3)*255)],null)},Fy=function(a,b,c){function d(e){e=py(Math.round(e),255).toString(16);return $APP.z(e)<2?"0"+$APP.T.g(e):e}return"#"+$APP.T.g(d(a))+$APP.T.g(d(b))+$APP.T.g(d(c))},Gy=function(a,b,c,d){function e(g){g=py(Math.round(g),
|
|
6
|
+
255).toString(16);return $APP.z(g)<2?"0"+$APP.T.g(g):g}return"#"+$APP.T.g(e(a))+$APP.T.g(e(b))+$APP.T.g(e(c))+$APP.T.g(e(sy(d)*255))},Iy=function(a,b,c){b=ry(b)/100;c=ry(c)/100;b=c+b*$APP.ah.i(c,1-c);return new $APP.R(null,3,[zy,qy(a),Ay,(b===0?0:2*(1-c/b))*100,Hy,b*100],null)},Jy=function(a,b,c){b=ry(b)/100;c=ry(c)/100;b=c*(1-b/2);c=b===0||b===1?0:(c-b)/$APP.ah.i(b,1-b);return new $APP.R(null,3,[zy,qy(a),Ay,c*100,By,b*100],null)},Ky=function(a,b){return new $APP.R(null,2,[$APP.dl,ry(a),$APP.cl,100-
|
|
7
|
+
ry(b)],null)},Ly=function(a){return typeof a==="string"&&uy(a)?(a=yy(a),$APP.n(a)?Fy(vy.g(a),$APP.jl.g(a),wy.g(a)):null):"#000000"},Ny=function(a){return typeof a==="string"&&$APP.J(My,a.trim().toLowerCase())?a.trim().toLowerCase():"inline"},Oy=function(a){return typeof a==="string"&&$APP.Hg(a)?$APP.Ue.m($APP.ee,$APP.bh.m($APP.$d.g(oy),$APP.be(uy),$APP.$d.g(function(b){b=yy(b);var c=$APP.M(b);b=$APP.D(c,vy);var d=$APP.D(c,$APP.jl);c=$APP.D(c,wy);return Fy(b,d,c)})),$APP.Fg(a,/,/)):$APP.ee},Uy=function(a){var b=
|
|
8
|
+
$APP.M(a),c=$APP.D(b,$APP.Al),d=$APP.D(b,$APP.qj),e=$APP.D(b,$APP.Bi);a=$APP.D(b,$APP.bj);var g=$APP.D(b,$APP.cj),h=$APP.D(b,$APP.Zi),l=$APP.D(b,Py),m=$APP.D(b,$APP.U),p=$APP.D(b,Qy);b=Ly(e);var q=function(){var H=yy(e);return $APP.n(H)?H:yy("#000000")}(),v=$APP.M(q);q=$APP.D(v,vy);var x=$APP.D(v,$APP.jl),y=$APP.D(v,wy);v=$APP.D(v,xy);var A=function(){var H=typeof e==="string";if(H){H=e.trim();var G=$APP.cg(ty,H);$APP.n(G)?(H=$APP.cg(ty,H),H=$APP.u($APP.w(H)),H=8===$APP.z(H)):H=G;return H}return H}();
|
|
9
|
+
v=$APP.n(A)?v:1;A=Cy(q,x,y);var B=$APP.M(A);A=$APP.D(B,zy);var E=$APP.D(B,Ay);B=$APP.D(B,By);d=$APP.Gg(d);g=$APP.Gg(g);p=p!=null;c=c!=null;h=Ny(h);return $APP.xf([$APP.um,Ry,$APP.bj,$APP.Zi,Py,Ay,By,Sy,zy,$APP.U,$APP.em,Ty,$APP.W,xy],[g,p,$APP.Hg(a)?a:null,h,Oy(l),E,B,b,A,$APP.Hg(m)?m:null,$APP.C.i(h,"popover")&&c,p&&v<1?Gy(q,x,y,v):b,d,v])},Vy=function(a,b,c,d){a="Hue "+$APP.T.g(Math.round(a))+", Saturation "+$APP.T.g(Math.round(b))+"%, Lightness "+$APP.T.g(Math.round(c))+"%";return d<1?""+$APP.T.g(a)+
|
|
10
|
+
", Opacity "+$APP.T.g(Math.round(d*100))+"%":a},Wy=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.W);b=$APP.D(b,$APP.um);return $APP.r(a)&&$APP.r(b)},Xy=function(a){return document.createElement(a)},Yy=function(a,b,c){return a.setAttribute(b,c)},Zy=function(a){return Uy($APP.xf([$APP.Al,$APP.qj,$APP.bj,$APP.Bi,$APP.cj,$APP.Zi,Py,$APP.U,Qy],[a.getAttribute("open"),a.getAttribute("disabled"),a.getAttribute("name"),a.getAttribute("value"),a.getAttribute("readonly"),a.getAttribute("mode"),a.getAttribute("swatches"),
|
|
11
|
+
a.getAttribute("label"),a.getAttribute("alpha")]))},$y=function(a,b,c,d){b=new CustomEvent(b,{detail:$APP.ph(d),bubbles:!0,composed:!0,cancelable:$APP.F(c)});return a.dispatchEvent(b)},az=function(a,b){var c=Ty.g(b),d=zy.g(b),e=Ay.g(b),g=By.g(b);b=xy.g(b);return $y(a,"x-color-picker-input",!1,new $APP.R(null,5,[$APP.Bi,c,zy,d,Ay,e,By,g,xy,b],null))},bz=function(a,b){var c=Ty.g(b),d=zy.g(b),e=Ay.g(b),g=By.g(b);b=xy.g(b);return $y(a,"x-color-picker-change",!0,new $APP.R(null,5,[$APP.Bi,c,zy,d,Ay,e,
|
|
12
|
+
By,g,xy,b],null))},cz=function(a,b,c,d,e,g){b=Ey(b,c,d);d=$APP.M(b);b=$APP.D(d,vy);c=$APP.D(d,$APP.jl);d=$APP.D(d,wy);e=$APP.n($APP.n(g)?e<1:g)?Gy(b,c,d,e):Fy(b,c,d);a.setAttribute("value",e)},dz=function(a,b,c,d){if($APP.N($APP.k(a,"__xColorPickerSwatchesCache"),c)){a.__xColorPickerSwatchesCache=c;b.innerHTML="";a=$APP.t(c);c=null;for(var e=0,g=0;;)if(g<e){var h=c.G(null,g),l=Xy("button");l.setAttribute("part","swatch");l.setAttribute("type","button");l.setAttribute("role","option");l.setAttribute("aria-label",
|
|
13
|
+
h);l.setAttribute("data-color",h);l.style.backgroundColor=h;b.appendChild(l);g+=1}else if(a=$APP.t(a))$APP.Nc(a)?(e=$APP.xb(a),a=$APP.yb(a),c=e,e=$APP.z(e)):(c=$APP.u(a),e=Xy("button"),e.setAttribute("part","swatch"),e.setAttribute("type","button"),e.setAttribute("role","option"),e.setAttribute("aria-label",c),e.setAttribute("data-color",c),e.style.backgroundColor=c,b.appendChild(e),a=$APP.w(a),c=null,e=0),g=0;else break}b.querySelectorAll("[part\x3dswatch]").forEach(function(m){return Yy(m,"aria-selected",
|
|
14
|
+
$APP.C.i(m.getAttribute("data-color"),d)?"true":"false")})},ez=function(a){var b=$APP.k(a,"__xColorPickerRefs");if($APP.n(b)){var c=Zy(a),d=$APP.M(c);c=$APP.D(d,Ty);var e=$APP.D(d,$APP.W),g=$APP.D(d,xy),h=$APP.D(d,$APP.um),l=$APP.D(d,Ry),m=$APP.D(d,$APP.Zi),p=$APP.D(d,Py),q=$APP.D(d,Ay),v=$APP.D(d,By),x=$APP.D(d,Sy),y=$APP.D(d,$APP.U),A=$APP.D(d,zy);d=Iy(A,q,v);d=$APP.M(d);var B=$APP.D(d,Ay);q=$APP.D(d,Hy);d=Ky(Ay.g(d),q);q=$APP.k(b,"area");var E=$APP.k(b,"hue-strip"),H=$APP.k(b,"alpha-strip"),G=
|
|
15
|
+
$APP.k(b,"preview-color"),I=$APP.k(b,"hex-input"),Q=$APP.k(b,"trigger-swatch");b=$APP.k(b,"swatches");a.setAttribute("data-mode",m);a.style.setProperty("--_x-cp-hue",""+$APP.T.g(Math.round(A)));q.style.setProperty("--_x-cp-area-x",""+$APP.T.g($APP.dl.g(d).toFixed(2))+"%");q.style.setProperty("--_x-cp-area-y",""+$APP.T.g($APP.cl.g(d).toFixed(2))+"%");Yy(q,"aria-valuetext",Vy(A,B,v,g));$APP.n(y)&&q.setAttribute("aria-label",y);E.style.setProperty("--_x-cp-hue-pos",""+$APP.T.g((qy(A)/360*100).toFixed(2))+
|
|
16
|
+
"%");Yy(E,"aria-valuenow",""+$APP.T.g(Math.round(A)));$APP.n(l)?(H.style.display="",a.style.setProperty("--_x-cp-alpha-color","hsl("+$APP.T.g(Math.round(A))+","+$APP.T.g(Math.round(B))+"%,"+$APP.T.g(Math.round(v))+"%)"),H.style.setProperty("--_x-cp-alpha-pos",""+$APP.T.g((sy(g)*100).toFixed(2))+"%"),Yy(H,"aria-valuenow",""+$APP.T.g(Math.round(g*100)))):H.style.display="none";G.style.backgroundColor=$APP.n(l)?function(){var Z=Ey(A,B,v),la=$APP.M(Z);Z=$APP.D(la,vy);var za=$APP.D(la,$APP.jl);la=$APP.D(la,
|
|
17
|
+
wy);return"rgba("+$APP.T.g(Z)+","+$APP.T.g(za)+","+$APP.T.g(la)+","+$APP.T.g(g.toFixed(2))+")"}():x;a.shadowRoot.activeElement!==I&&(I.value=c);Q.style.backgroundColor=$APP.n(l)?function(){var Z=Ey(A,B,v),la=$APP.M(Z);Z=$APP.D(la,vy);var za=$APP.D(la,$APP.jl);la=$APP.D(la,wy);return"rgba("+$APP.T.g(Z)+","+$APP.T.g(za)+","+$APP.T.g(la)+","+$APP.T.g(g.toFixed(2))+")"}():x;I.disabled=$APP.n(e)?e:h;dz(a,b,p,x);a=$APP.k(a,"__xColorPickerInternals");return $APP.n(a)?a.setFormValue(c):null}return null},
|
|
18
|
+
gz=function(a,b){var c=a.getBoundingClientRect();a=b.clientY-c.top;var d=c.width,e=c.height;b=100*(py(b.clientX-c.left,d)/d);a=100*(py(a,e)/e);return new $APP.R(null,2,[fz,ry(b),$APP.sj,100-ry(a)],null)},hz=function(a,b){a=a.getBoundingClientRect();var c=a.width;b=100*(py(b.clientX-a.left,c)/c);return ry(b)/100*360},iz=function(a,b){a=a.getBoundingClientRect();var c=a.width;b=100*(py(b.clientX-a.left,c)/c);return ry(b)/100},kz=function(a,b){var c=Zy(a);if(Wy(c)&&$APP.J(jz,b.key)){b.preventDefault();
|
|
19
|
+
var d=$APP.n(b.shiftKey)?10:1,e=Iy(zy.g(c),Ay.g(c),By.g(c)),g=function(){switch(b.key){case "ArrowRight":return ry(Ay.g(e)+d);case "ArrowLeft":return ry(Ay.g(e)-d);default:return Ay.g(e)}}(),h=function(){switch(b.key){case "ArrowUp":return ry(Hy.g(e)+d);case "ArrowDown":return ry(Hy.g(e)-d);default:return Hy.g(e)}}();g=Jy(zy.g(c),g,h);var l=$APP.M(g);g=$APP.D(l,zy);h=$APP.D(l,Ay);l=$APP.D(l,By);cz(a,g,h,l,xy.g(c),Ry.g(c));az(a,Zy(a));return bz(a,Zy(a))}return null},mz=function(a,b){var c=Zy(a);if(Wy(c)&&
|
|
20
|
+
$APP.J(lz,b.key)){b.preventDefault();var d=$APP.n(b.shiftKey)?10:1,e=function(){switch(b.key){case "ArrowRight":return qy(zy.g(c)+d);case "ArrowLeft":return qy(zy.g(c)-d);case "Home":return 0;case "End":return 360;default:return zy.g(c)}}();cz(a,e,Ay.g(c),By.g(c),xy.g(c),Ry.g(c));az(a,Zy(a));return bz(a,Zy(a))}return null},nz=function(a,b){var c=Zy(a);if($APP.n(function(){var g=Wy(c);return g?(g=Ry.g(c),$APP.n(g)?$APP.J(lz,b.key):g):g}())){b.preventDefault();var d=$APP.n(b.shiftKey)?.1:.01,e=function(){switch(b.key){case "ArrowRight":return sy(xy.g(c)+
|
|
21
|
+
d);case "ArrowLeft":return sy(xy.g(c)-d);case "Home":return 0;case "End":return 1;default:return xy.g(c)}}();cz(a,zy.g(c),Ay.g(c),By.g(c),e,!0);az(a,Zy(a));return bz(a,Zy(a))}return null},oz=function(a){var b=Zy(a);return Wy(b)&&typeof EyeDropper!=="undefined"?(new EyeDropper).open().then(function(c){a.setAttribute("value",c.sRGBHex);return bz(a,Zy(a))}).catch(function(){return null}):null},pz=function(a){if($APP.n(a.hasAttribute("open")))return null;a.setAttribute("open","");a=$APP.k(a,"__xColorPickerRefs");
|
|
22
|
+
if($APP.n(a)){var b=$APP.k(a,"area");return setTimeout(function(){return b.focus()},0)}return null},qz=function(a){return $APP.n(a.hasAttribute("open"))?(a.removeAttribute("open"),a=$APP.k(a,"__xColorPickerRefs"),$APP.n(a)?$APP.k(a,"trigger").focus():null):null},rz=function(a){var b=$APP.k(a,"__xColorPickerRefs");if($APP.n(b)){var c=$APP.k(b,"area"),d=$APP.k(b,"hue-strip"),e=$APP.k(b,"alpha-strip"),g=$APP.k(b,"hex-input"),h=$APP.k(b,"swatches"),l=$APP.k(b,"eyedropper"),m=$APP.k(b,"copy"),p=$APP.k(b,
|
|
23
|
+
"trigger");b=$APP.k(b,"panel");var q=function(ca){var pa=Zy(a);if(Wy(pa)){ca.preventDefault();var La=$APP.k($APP.k(a,"__xColorPickerRefs"),"area");La.setPointerCapture(ca.pointerId);a.__xColorPickerDragging="area";ca=gz(La,ca);La=$APP.M(ca);ca=$APP.D(La,fz);La=$APP.D(La,$APP.sj);ca=Jy(zy.g(pa),ca,La);var Vb=$APP.M(ca);ca=$APP.D(Vb,zy);La=$APP.D(Vb,Ay);Vb=$APP.D(Vb,By);cz(a,ca,La,Vb,xy.g(pa),Ry.g(pa));pa=az(a,Zy(a))}else pa=null;return pa},v=function(ca){if($APP.C.i("area",$APP.k(a,"__xColorPickerDragging"))){var pa=
|
|
24
|
+
Zy(a);ca=gz($APP.k($APP.k(a,"__xColorPickerRefs"),"area"),ca);var La=$APP.M(ca);ca=$APP.D(La,fz);La=$APP.D(La,$APP.sj);ca=Jy(zy.g(pa),ca,La);var Vb=$APP.M(ca);ca=$APP.D(Vb,zy);La=$APP.D(Vb,Ay);Vb=$APP.D(Vb,By);cz(a,ca,La,Vb,xy.g(pa),Ry.g(pa));pa=az(a,Zy(a))}else pa=null;return pa},x=function(){if($APP.C.i("area",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=null;var ca=bz(a,Zy(a))}else ca=null;return ca},y=function(ca){return kz(a,ca)},A=function(ca){var pa=Zy(a);if(Wy(pa)){ca.preventDefault();
|
|
25
|
+
var La=$APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip");La.setPointerCapture(ca.pointerId);a.__xColorPickerDragging="hue";ca=hz(La,ca);cz(a,ca,Ay.g(pa),By.g(pa),xy.g(pa),Ry.g(pa));pa=az(a,Zy(a))}else pa=null;return pa},B=function(ca){if($APP.C.i("hue",$APP.k(a,"__xColorPickerDragging"))){var pa=Zy(a);ca=hz($APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip"),ca);cz(a,ca,Ay.g(pa),By.g(pa),xy.g(pa),Ry.g(pa));pa=az(a,Zy(a))}else pa=null;return pa},E=function(){if($APP.C.i("hue",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=
|
|
26
|
+
null;var ca=bz(a,Zy(a))}else ca=null;return ca},H=function(ca){return mz(a,ca)},G=function(ca){var pa=Zy(a);var La=(La=Wy(pa))?Ry.g(pa):La;$APP.n(La)?(ca.preventDefault(),La=$APP.k($APP.k(a,"__xColorPickerRefs"),"alpha-strip"),La.setPointerCapture(ca.pointerId),a.__xColorPickerDragging="alpha",ca=iz(La,ca),cz(a,zy.g(pa),Ay.g(pa),By.g(pa),ca,!0),pa=az(a,Zy(a))):pa=null;return pa},I=function(ca){if($APP.C.i("alpha",$APP.k(a,"__xColorPickerDragging"))){var pa=Zy(a);ca=iz($APP.k($APP.k(a,"__xColorPickerRefs"),
|
|
27
|
+
"alpha-strip"),ca);cz(a,zy.g(pa),Ay.g(pa),By.g(pa),ca,!0);pa=az(a,Zy(a))}else pa=null;return pa},Q=function(){if($APP.C.i("alpha",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=null;var ca=bz(a,Zy(a))}else ca=null;return ca},Z=function(ca){return nz(a,ca)},la=function(ca){a:{if($APP.C.i("Enter",ca.key)){ca.preventDefault();ca=$APP.k($APP.k(a,"__xColorPickerRefs"),"hex-input");var pa=ca.value,La=Zy(a);if(Wy(La)){if(uy(pa)){a.setAttribute("value",pa);ca=bz(a,Zy(a));break a}ca=ca.value=
|
|
28
|
+
Ty.g(La);break a}}ca=null}return ca},za=function(ca){a:{var pa=Zy(a);if(Wy(pa)&&(ca=ca.target,$APP.n(ca.hasAttribute("data-color")))){ca=ca.getAttribute("data-color");a.setAttribute("value",ca);ca=bz(a,Zy(a));break a}ca=null}return ca},Ka=function(){return oz(a)},$a=function(){var ca=Zy(a);return $APP.n(navigator.clipboard)?navigator.clipboard.writeText(Ty.g(ca)):null},ab=function(){var ca=Zy(a);return $APP.C.i("popover",$APP.Zi.g(ca))&&$APP.r($APP.W.g(ca))?$APP.n($APP.em.g(ca))?qz(a):pz(a):null},
|
|
29
|
+
jb=function(ca){$APP.C.i("Escape",ca.key)&&$APP.C.i("popover",$APP.Zi.g(Zy(a)))?(ca.preventDefault(),ca.stopPropagation(),ca=qz(a)):ca=null;return ca},Ib=function(ca){return ca.stopPropagation()},bb=function(ca){return $APP.n(a.hasAttribute("open"))?$APP.n(ca.composedPath().some(function(pa){return pa===a}))?null:qz(a):null};c.addEventListener("pointerdown",q);c.addEventListener("pointermove",v);c.addEventListener("pointerup",x);c.addEventListener("keydown",y);d.addEventListener("pointerdown",A);
|
|
30
|
+
d.addEventListener("pointermove",B);d.addEventListener("pointerup",E);d.addEventListener("keydown",H);e.addEventListener("pointerdown",G);e.addEventListener("pointermove",I);e.addEventListener("pointerup",Q);e.addEventListener("keydown",Z);g.addEventListener("keydown",la);h.addEventListener("click",za);l.addEventListener("click",Ka);m.addEventListener("click",$a);p.addEventListener("click",ab);b.addEventListener("keydown",jb);b.addEventListener("pointerdown",Ib);document.addEventListener("pointerdown",
|
|
31
|
+
bb,!0);$APP.Ag(a,"__xColorPickerHandlers",{"area-move":v,copy:$a,"panel-key":jb,"alpha-up":Q,"hue-up":E,"alpha-key":Z,"alpha-move":I,"hex-key":la,swatch:za,"area-up":x,"alpha-down":G,"area-key":y,"hue-down":A,"hue-key":H,"hue-move":B,eyedrop:Ka,"panel-pd":Ib,trigger:ab,"doc-click":bb,"area-down":q})}},sz=function(a){var b=$APP.k(a,"__xColorPickerRefs"),c=$APP.k(a,"__xColorPickerHandlers");if($APP.n($APP.n(b)?c:b)){var d=$APP.k(b,"area"),e=$APP.k(b,"hue-strip"),g=$APP.k(b,"alpha-strip"),h=$APP.k(b,
|
|
32
32
|
"hex-input"),l=$APP.k(b,"swatches"),m=$APP.k(b,"eyedropper"),p=$APP.k(b,"copy"),q=$APP.k(b,"trigger");b=$APP.k(b,"panel");d.removeEventListener("pointerdown",$APP.k(c,"area-down"));d.removeEventListener("pointermove",$APP.k(c,"area-move"));d.removeEventListener("pointerup",$APP.k(c,"area-up"));d.removeEventListener("keydown",$APP.k(c,"area-key"));e.removeEventListener("pointerdown",$APP.k(c,"hue-down"));e.removeEventListener("pointermove",$APP.k(c,"hue-move"));e.removeEventListener("pointerup",$APP.k(c,
|
|
33
33
|
"hue-up"));e.removeEventListener("keydown",$APP.k(c,"hue-key"));g.removeEventListener("pointerdown",$APP.k(c,"alpha-down"));g.removeEventListener("pointermove",$APP.k(c,"alpha-move"));g.removeEventListener("pointerup",$APP.k(c,"alpha-up"));g.removeEventListener("keydown",$APP.k(c,"alpha-key"));h.removeEventListener("keydown",$APP.k(c,"hex-key"));l.removeEventListener("click",$APP.k(c,"swatch"));m.removeEventListener("click",$APP.k(c,"eyedrop"));p.removeEventListener("click",$APP.k(c,"copy"));q.removeEventListener("click",
|
|
34
|
-
$APP.k(c,"trigger"));b.removeEventListener("keydown",$APP.k(c,"panel-key"));b.removeEventListener("pointerdown",$APP.k(c,"panel-pd"));document.removeEventListener("pointerdown",$APP.k(c,"doc-click"),!0);a.__xColorPickerHandlers=null}else return null},
|
|
35
|
-
this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?
|
|
36
|
-
b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xColorPickerRefs"))){var c=this.attachShadow({mode:"open"}),d=
|
|
34
|
+
$APP.k(c,"trigger"));b.removeEventListener("keydown",$APP.k(c,"panel-key"));b.removeEventListener("pointerdown",$APP.k(c,"panel-pd"));document.removeEventListener("pointerdown",$APP.k(c,"doc-click"),!0);a.__xColorPickerHandlers=null}else return null},tz=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.Cg(this,c,$APP.F(d))}})},uz=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=
|
|
35
|
+
this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?Yy(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},wz=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return vz}});tz(b,"disabled","disabled");tz(b,"readOnly","readonly");tz(b,"alpha","alpha");tz(b,"open","open");uz(b,"value","value");uz(b,"swatches","swatches");uz(b,"name","name");uz(b,"mode","mode");uz(b,"label","label");
|
|
36
|
+
b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xColorPickerRefs"))){var c=this.attachShadow({mode:"open"}),d=Xy("style"),e=Xy("div"),g=Xy("button"),h=Xy("span"),l=Xy("div"),m=Xy("div"),p=Xy("div"),q=Xy("div"),v=Xy("div"),x=Xy("div"),y=Xy("div"),A=Xy("div"),B=Xy("div"),E=Xy("div"),H=Xy("div"),G=Xy("span"),I=Xy("input"),Q=Xy("button"),Z=Xy("button"),la=Xy("div");d.textContent=":host{display:inline-block;color-scheme:light dark;position:relative;--x-color-picker-width:240px;--x-color-picker-area-height:160px;--x-color-picker-strip-height:14px;--x-color-picker-swatch-size:28px;--x-color-picker-radius:var(--x-radius-md,8px);--x-color-picker-gap:10px;--x-color-picker-bg:var(--x-color-bg,#ffffff);--x-color-picker-border:var(--x-color-border,#cbd5e1);--x-color-picker-text:var(--x-color-text,#1e293b);--x-color-picker-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-color-picker-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-color-picker-bg:var(--x-color-bg,#1e293b);--x-color-picker-border:var(--x-color-border,#475569);--x-color-picker-text:var(--x-color-text,#f1f5f9);--x-color-picker-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3dcontainer]{position:relative;width:var(--x-color-picker-width);max-width:calc(100vw - 2rem);}[part\x3dtrigger]{all:unset;display:none;box-sizing:border-box;width:36px;height:36px;border-radius:var(--x-color-picker-radius);border:2px solid var(--x-color-picker-border);cursor:pointer;overflow:hidden;}[part\x3dtrigger]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}:host([data-mode\x3dpopover]) [part\x3dtrigger]{display:block;}[part\x3dtrigger-swatch]{display:block;width:100%;height:100%;}[part\x3dpanel]{box-sizing:border-box;background:var(--x-color-picker-bg);border:1px solid var(--x-color-picker-border);border-radius:var(--x-color-picker-radius);padding:var(--x-color-picker-gap);display:flex;flex-direction:column;gap:var(--x-color-picker-gap);box-shadow:var(--x-shadow-md,0 4px 12px rgba(0,0,0,0.1));}:host([data-mode\x3dpopover]) [part\x3dpanel]{display:none;position:absolute;z-index:1000;top:calc(100% + 8px);left:0;max-width:calc(100vw - 1rem);}:host([data-mode\x3dpopover][open]) [part\x3dpanel]{display:flex;}[part\x3darea]{position:relative;width:100%;height:var(--x-color-picker-area-height);border-radius:calc(var(--x-color-picker-radius) - 2px);cursor:crosshair;touch-action:none;overflow:hidden;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--_x-cp-hue,0),100%,50%));}[part\x3darea]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}[part\x3darea-thumb]{position:absolute;width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,0.3),inset 0 0 0 1px rgba(0,0,0,0.3);pointer-events:none;left:var(--_x-cp-area-x,0%);top:var(--_x-cp-area-y,0%);transform:translate(-50%,-50%);}[part\x3dstrips]{display:flex;flex-direction:column;gap:8px;}[part\x3dhue-strip]{position:relative;width:100%;height:var(--x-color-picker-strip-height);border-radius:var(--x-color-picker-strip-height);cursor:pointer;touch-action:none;background:linear-gradient(to right,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100%);}[part\x3dhue-strip]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}[part\x3dhue-thumb]{position:absolute;width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,0.3);pointer-events:none;top:50%;left:var(--_x-cp-hue-pos,0%);transform:translate(-50%,-50%);}[part\x3dalpha-strip]{position:relative;width:100%;height:var(--x-color-picker-strip-height);border-radius:var(--x-color-picker-strip-height);cursor:pointer;touch-action:none;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0;}[part\x3dalpha-strip]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}[part\x3dalpha-gradient]{position:absolute;inset:0;border-radius:inherit;background:linear-gradient(to right,transparent,var(--_x-cp-alpha-color,#000));}[part\x3dalpha-thumb]{position:absolute;width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,0.3);pointer-events:none;top:50%;left:var(--_x-cp-alpha-pos,100%);transform:translate(-50%,-50%);z-index:1;}[part\x3dcontrols]{display:flex;align-items:center;gap:6px;}[part\x3dpreview]{width:32px;height:32px;border-radius:var(--x-color-picker-radius);border:1px solid var(--x-color-picker-border);flex-shrink:0;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0;overflow:hidden;}[part\x3dpreview-color]{display:block;width:100%;height:100%;}[part\x3dhex-input]{flex:1;min-width:0;box-sizing:border-box;padding:4px 8px;border:1px solid var(--x-color-picker-border);border-radius:calc(var(--x-color-picker-radius) - 2px);background:transparent;color:var(--x-color-picker-text);font-family:var(--x-font-family,inherit);font-size:var(--x-font-size-sm,0.8125rem);outline:none;}[part\x3dhex-input]:focus-visible{border-color:var(--x-color-picker-focus-ring);box-shadow:0 0 0 2px var(--x-color-picker-focus-ring);}[part\x3deyedropper],[part\x3dcopy]{all:unset;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:calc(var(--x-color-picker-radius) - 2px);cursor:pointer;color:var(--x-color-picker-text);flex-shrink:0;}[part\x3deyedropper]:hover,[part\x3dcopy]:hover{background:rgba(0,0,0,0.06);}@media (prefers-color-scheme:dark){[part\x3deyedropper]:hover,[part\x3dcopy]:hover{background:rgba(255,255,255,0.1);}}[part\x3deyedropper]:focus-visible,[part\x3dcopy]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:1px;}[part\x3dswatches]{display:grid;grid-template-columns:repeat(auto-fill,var(--x-color-picker-swatch-size));gap:4px;}[part\x3dswatches]:empty{display:none;}[part\x3dswatch]{all:unset;width:var(--x-color-picker-swatch-size);height:var(--x-color-picker-swatch-size);border-radius:4px;cursor:pointer;border:1px solid rgba(0,0,0,0.1);box-sizing:border-box;}[part\x3dswatch]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:1px;}[part\x3dswatch][aria-selected\x3dtrue]{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:1px;}:host([disabled]){opacity:var(--x-color-picker-disabled-opacity);pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3darea-thumb],[part\x3dhue-thumb],[part\x3dalpha-thumb]{transition:none;}}@media (pointer:coarse){[part\x3darea-thumb],[part\x3dhue-thumb],[part\x3dalpha-thumb]{width:24px;height:24px;}[part\x3dtrigger]{width:44px;height:44px;}[part\x3deyedropper],[part\x3dcopy]{width:44px;height:44px;}[part\x3dswatch]{min-width:44px;min-height:44px;}}";
|
|
37
37
|
e.setAttribute("part","container");g.setAttribute("part","trigger");g.setAttribute("type","button");g.setAttribute("aria-label","Pick color");h.setAttribute("part","trigger-swatch");l.setAttribute("part","panel");m.setAttribute("part","area");m.setAttribute("role","slider");m.setAttribute("tabindex","0");m.setAttribute("aria-label","Color");p.setAttribute("part","area-thumb");q.setAttribute("part","strips");v.setAttribute("part","hue-strip");v.setAttribute("role","slider");v.setAttribute("tabindex",
|
|
38
38
|
"0");v.setAttribute("aria-label","Hue");v.setAttribute("aria-valuemin","0");v.setAttribute("aria-valuemax","360");x.setAttribute("part","hue-thumb");y.setAttribute("part","alpha-strip");y.setAttribute("role","slider");y.setAttribute("tabindex","0");y.setAttribute("aria-label","Opacity");y.setAttribute("aria-valuemin","0");y.setAttribute("aria-valuemax","100");A.setAttribute("part","alpha-gradient");B.setAttribute("part","alpha-thumb");E.setAttribute("part","controls");H.setAttribute("part","preview");
|
|
39
39
|
G.setAttribute("part","preview-color");I.setAttribute("part","hex-input");I.setAttribute("type","text");I.setAttribute("spellcheck","false");I.setAttribute("autocomplete","off");I.setAttribute("aria-label","Hex color value");Q.setAttribute("part","eyedropper");Q.setAttribute("type","button");Q.setAttribute("aria-label","Pick color from screen");Q.innerHTML='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"1.5" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"\x3e\x3cpath d\x3d"M13.5 2.5a2.12 2.12 0 0 0-3 0L9 4l-.5-.5L6 6l4 4 2.5-2.5L12 7l1.5-1.5a2.12 2.12 0 0 0 0-3zM6 6L2.5 9.5a1.5 1.5 0 0 0-.4.8L1.5 14l3.7-.6a1.5 1.5 0 0 0 .8-.4L10 10"/\x3e\x3c/svg\x3e';
|
|
40
|
-
|
|
41
|
-
"swatches");la.setAttribute("role","listbox");la.setAttribute("aria-label","Preset colors");g.appendChild(h);m.appendChild(p);v.appendChild(x);y.appendChild(A);y.appendChild(B);q.appendChild(v);q.appendChild(y);H.appendChild(G);E.appendChild(H);E.appendChild(I);E.appendChild(Q);E.appendChild(
|
|
42
|
-
{"alpha-thumb":B,copy:
|
|
43
|
-
"disabled",$APP.F(c));return
|
|
44
|
-
"r","r",-471384190),
|
|
45
|
-
$APP.xf([$APP.
|
|
46
|
-
$APP.
|
|
40
|
+
Z.setAttribute("part","copy");Z.setAttribute("type","button");Z.setAttribute("aria-label","Copy color value");Z.innerHTML='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"1.5" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"\x3e\x3crect x\x3d"5" y\x3d"5" width\x3d"9" height\x3d"9" rx\x3d"1.5"/\x3e\x3cpath d\x3d"M5 11H3.5A1.5 1.5 0 0 1 2 9.5v-6A1.5 1.5 0 0 1 3.5 2h6A1.5 1.5 0 0 1 11 3.5V5"/\x3e\x3c/svg\x3e';la.setAttribute("part",
|
|
41
|
+
"swatches");la.setAttribute("role","listbox");la.setAttribute("aria-label","Preset colors");g.appendChild(h);m.appendChild(p);v.appendChild(x);y.appendChild(A);y.appendChild(B);q.appendChild(v);q.appendChild(y);H.appendChild(G);E.appendChild(H);E.appendChild(I);E.appendChild(Q);E.appendChild(Z);l.appendChild(m);l.appendChild(q);l.appendChild(E);l.appendChild(la);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);typeof EyeDropper==="undefined"&&(Q.style.display="none");this.__xColorPickerRefs=
|
|
42
|
+
{"alpha-thumb":B,copy:Z,swatches:la,"hue-strip":v,controls:E,"alpha-gradient":A,panel:l,preview:H,"area-thumb":p,"preview-color":G,container:e,area:m,"hue-thumb":x,"trigger-swatch":h,trigger:g,"alpha-strip":y,eyedropper:Q,"hex-input":I};$APP.n(this.attachInternals)&&(this.__xColorPickerInternals=this.attachInternals())}sz(this);rz(this);return ez(this)};b.disconnectedCallback=function(){return sz(this)};b.attributeChangedCallback=function(){return ez(this)};b.formDisabledCallback=function(c){$APP.Cg(this,
|
|
43
|
+
"disabled",$APP.F(c));return ez(this)};b.formResetCallback=function(){this.setAttribute("value","#000000");return ez(this)};return a},xz=function(){return $APP.n(customElements.get("x-color-picker"))?null:customElements.define("x-color-picker",wz())},Qy=new $APP.K(null,"alpha","alpha",-1574982441),Ty=new $APP.K(null,"hex-full","hex-full",-1466644518),Py=new $APP.K(null,"swatches","swatches",2033601707),Hy=new $APP.K(null,"v","v",21465059),Ay=new $APP.K(null,"s","s",1705939918),vy=new $APP.K(null,
|
|
44
|
+
"r","r",-471384190),Ry=new $APP.K(null,"alpha?","alpha?",1329751525),By=new $APP.K(null,"l","l",1395893423),zy=new $APP.K(null,"h","h",1109658740),wy=new $APP.K(null,"b","b",1482224470),fz=new $APP.K(null,"sat","sat",1064662667),xy=new $APP.K(null,"a","a",-2123407586),Sy=new $APP.K(null,"hex","hex",41691346);var My=new $APP.S(null,new $APP.R(null,2,["inline",null,"popover",null],null),null),vz="value alpha swatches disabled readonly name mode open label".split(" ");
|
|
45
|
+
$APP.xf([$APP.Al,$APP.qj,$APP.bj,$APP.Bi,$APP.Zi,Py,$APP.Fl,$APP.U,Qy],[new $APP.R(null,2,[$APP.Y,$APP.Fj,$APP.ik,"open"],null),new $APP.R(null,2,[$APP.Y,$APP.Fj,$APP.ik,"disabled"],null),new $APP.R(null,2,[$APP.Y,$APP.X,$APP.ik,"name"],null),new $APP.R(null,2,[$APP.Y,$APP.X,$APP.ik,"value"],null),new $APP.R(null,2,[$APP.Y,$APP.X,$APP.ik,"mode"],null),new $APP.R(null,2,[$APP.Y,$APP.X,$APP.ik,"swatches"],null),new $APP.R(null,2,[$APP.Y,$APP.Fj,$APP.ik,"readonly"],null),new $APP.R(null,2,[$APP.Y,$APP.X,
|
|
46
|
+
$APP.ik,"label"],null),new $APP.R(null,2,[$APP.Y,$APP.Fj,$APP.ik,"alpha"],null)]);$APP.Pd(["x-color-picker-input",new $APP.R(null,2,[$APP.Cj,new $APP.R(null,5,[$APP.Bi,$APP.X,zy,$APP.V,Ay,$APP.V,By,$APP.V,xy,$APP.V],null),$APP.Dl,!1],null),"x-color-picker-change",new $APP.R(null,2,[$APP.Cj,new $APP.R(null,5,[$APP.Bi,$APP.X,zy,$APP.V,Ay,$APP.V,By,$APP.V,xy,$APP.V],null),$APP.Dl,!0],null)]);var ty=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;var jz=new $APP.S(null,new $APP.R(null,4,["ArrowUp",null,"ArrowDown",null,"ArrowRight",null,"ArrowLeft",null],null),null),lz=new $APP.S(null,new $APP.R(null,4,["End",null,"ArrowRight",null,"ArrowLeft",null,"Home",null],null),null);$APP.fa("baredom.exports.x_color_picker.init",xz);export const init=xz;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e.label;return $APP.n(A)?A:""}()),l
|
|
4
|
-
$APP.Xd(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$APP.k(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=$APP.k(b,"list"),d=$APP.k(b,"empty");b=$APP.k(b,"input");var e=function(){var q=$APP.k(a,"__xCommandPaletteQuery");return $APP.n(q)?q:""}(),g=
|
|
8
|
-
"");d=$APP.Wd($APP.fh,g);for(var h=null;;)if(g=$APP.u(d),$APP.n(g)){var l=g;g=$APP.zc(l,0,null);l=$APP.zc(l,1,null);var m=
|
|
9
|
-
""+$APP.T.g(g));p.setAttribute("tabindex","-1");$APP.n($APP.W.g(l))&&p.setAttribute("aria-disabled","true");p.textContent=$APP.U.g(l);$APP.C.i(g,e)&&p.setAttribute("aria-selected","true");c.appendChild(p);d=$APP.Yb(d);h=g=function(){var q=m;return $APP.n(q)?q:h}()}else break;return $APP.n(b)?b.setAttribute("aria-activedescendant","x-cp-item-"+$APP.T.g(e)):null}return null},
|
|
10
|
-
"overlay");b=$APP.k(b,"empty");var h=$APP.U.g(c),l=$APP.Kl.g(c),m=
|
|
11
|
-
b.textContent=m;return
|
|
12
|
-
b=$APP.k(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.k(b,"input"):null,$APP.n(b)&&b.removeAttribute("aria-activedescendant"),
|
|
13
|
-
0):(b=$APP.z(c),c=
|
|
14
|
-
b=$APP.zc(b,$APP.n(c)?c:0,null),$APP.n($APP.n(b)?$APP.r($APP.W.g(b)):b)?(c=
|
|
15
|
-
"");a.__xCommandPaletteQuery="";a.__xCommandPaletteActiveIdx=0;
|
|
16
|
-
q=
|
|
17
|
-
v:""});return
|
|
18
|
-
$APP.k(b,"input"),d=$APP.k(b,"overlay"),e=$APP.k(b,"list");b=$APP.k(b,"clear-btn");c.removeEventListener("input",$APP.k(a,"input"));c.removeEventListener("keydown",$APP.k(a,"keydown"));d.removeEventListener("click",$APP.k(a,"scrim"));e.removeEventListener("click",$APP.k(a,"list"));return b.removeEventListener("click",$APP.k(a,"clear"))}return null},
|
|
19
|
-
this.setAttribute(c,""):this.removeAttribute(c)}})},
|
|
20
|
-
Object.defineProperty(a,"toggle",{configurable:!0,writable:!0,value:function(){return $APP.n(this.hasAttribute("open"))?
|
|
21
|
-
q=
|
|
2
|
+
var gt=function(a,b){return $APP.Ad($APP.Wc(function(c,d){return $APP.n(a.g?a.g(d):a.call(null,d))?$APP.rb(c,d):c},$APP.qb($APP.ee),b))},ht=function(a){return a==null?!0:$APP.N(a,"false")},it=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},lt=function(a){if(a==null||$APP.r($APP.ma(a)))return $APP.ee;for(var b=a.length,c=0,d=$APP.qb($APP.ee);;){if($APP.C.i(c,b))return $APP.sb(d);var e=a[c],g=""+$APP.T.g(function(){var A=e.id;return $APP.n(A)?A:c}()),h=""+$APP.T.g(function(){var A=
|
|
3
|
+
e.label;return $APP.n(A)?A:""}()),l=it(e.group),m=e.value,p=e.icon,q=$APP.C.i(!0,e.disabled),v=e.keywords;v=$APP.n($APP.ma(v))?v.join(" "):typeof v==="string"?v:"";var x=function(){var A=l;return $APP.n(A)?A:""}(),y=typeof m==="string"?m:"";x=(""+$APP.T.g(h)+" "+$APP.T.g(v)+" "+$APP.T.g(x)+" "+$APP.T.g(y)).toLowerCase();v=c+1;d=$APP.Bd(d,new $APP.R(null,7,[$APP.Tk,g,$APP.U,h,jt,l,$APP.Bi,m,$APP.qk,p,$APP.W,q,kt,x],null));c=v}},nt=function(a,b){b=typeof b==="string"?b.trim():"";var c=$APP.N(b,"")?
|
|
4
|
+
$APP.Xd(it,$APP.Fg(b,/\s+/)):null;if($APP.Gc(c))return new $APP.R(null,2,[$APP.el,a,mt,$APP.Ue.i($APP.Rf,$APP.Xd(jt,a))],null);a=gt(function(d){return $APP.Sd(function(e){return $APP.N(-1,kt.g(d).indexOf(e.toLowerCase()))},c)},a);return new $APP.R(null,2,[$APP.el,a,mt,$APP.Ue.i($APP.Rf,$APP.Xd(jt,a))],null)},ot=function(a,b,c){var d=$APP.z(a);if(d>0)for(var e=1;;)if(e<=d){var g=$APP.ed(b+e*c,d),h=$APP.zc(a,g,null),l=h;h=$APP.n(l)?$APP.r($APP.W.g(h)):l;if($APP.n(h))return g;e+=1}else return null;else return null},
|
|
5
|
+
Bt=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.ki);var c=$APP.D(b,$APP.si),d=$APP.D(b,$APP.Yh),e=$APP.D(b,pt),g=$APP.D(b,qt),h=$APP.D(b,rt),l=$APP.D(b,st),m=$APP.D(b,tt),p=$APP.D(b,ut);b=$APP.D(b,vt);b=ht(b);p=ht(p);m=$APP.Gg(m);m=b&&!m;g=g!=null?$APP.Gg(g):m;l=ht(l);return $APP.xf([$APP.Kl,$APP.ri,wt,xt,yt,zt,$APP.U,$APP.em,At,$APP.W],[function(){var q=it(c);return $APP.n(q)?q:"Search…"}(),p,function(){var q=it(e);return $APP.n(q)?q:"No results"}(),g,l,m,it(d),$APP.F(a),b,$APP.Gg(h)])},Ct=function(a){return document.createElement(a)},
|
|
6
|
+
Dt=function(a){return Bt($APP.xf([$APP.Yh,pt,qt,rt,st,tt,ut,vt,$APP.ki,$APP.si],[a.getAttribute("label"),a.getAttribute("empty-text"),a.getAttribute("close-on-scrim"),a.getAttribute("disabled"),a.getAttribute("close-on-escape"),a.getAttribute("no-scrim"),a.getAttribute("dismissible"),a.getAttribute("modal"),a.hasAttribute("open"),a.getAttribute("placeholder")]))},Et=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.F(c)});a.dispatchEvent(b);return b},Ft=function(a){var b=
|
|
7
|
+
$APP.k(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=$APP.k(b,"list"),d=$APP.k(b,"empty");b=$APP.k(b,"input");var e=function(){var q=$APP.k(a,"__xCommandPaletteQuery");return $APP.n(q)?q:""}(),g=lt($APP.k(a,"__xCommandPaletteItems"));e=nt(g,e);e=$APP.M(e);g=$APP.D(e,$APP.el);e=function(){var q=$APP.k(a,"__xCommandPaletteActiveIdx");return $APP.n(q)?q:0}();c.textContent="";if($APP.Gc(g))return d.removeAttribute("hidden"),$APP.n(b)?b.removeAttribute("aria-activedescendant"):null;d.setAttribute("hidden",
|
|
8
|
+
"");d=$APP.Wd($APP.fh,g);for(var h=null;;)if(g=$APP.u(d),$APP.n(g)){var l=g;g=$APP.zc(l,0,null);l=$APP.zc(l,1,null);var m=jt.g(l);if($APP.n(function(){var q=m;return $APP.n(q)?$APP.N(m,h):q}())){var p=Ct("div");p.setAttribute("part","group-header");p.setAttribute("aria-hidden","true");p.textContent=m;c.appendChild(p)}p=Ct("div");p.setAttribute("part","item");p.setAttribute("role","option");p.setAttribute("id","x-cp-item-"+$APP.T.g(g));p.setAttribute("data-id",""+$APP.T.g($APP.Tk.g(l)));p.setAttribute("data-idx",
|
|
9
|
+
""+$APP.T.g(g));p.setAttribute("tabindex","-1");$APP.n($APP.W.g(l))&&p.setAttribute("aria-disabled","true");p.textContent=$APP.U.g(l);$APP.C.i(g,e)&&p.setAttribute("aria-selected","true");c.appendChild(p);d=$APP.Yb(d);h=g=function(){var q=m;return $APP.n(q)?q:h}()}else break;return $APP.n(b)?b.setAttribute("aria-activedescendant","x-cp-item-"+$APP.T.g(e)):null}return null},Gt=function(a){var b=$APP.k(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=Dt(a),d=$APP.k(b,"panel"),e=$APP.k(b,"input"),g=$APP.k(b,
|
|
10
|
+
"overlay");b=$APP.k(b,"empty");var h=$APP.U.g(c),l=$APP.Kl.g(c),m=wt.g(c);$APP.n(h)?d.setAttribute("aria-label",h):d.setAttribute("aria-label","Command palette");$APP.n(zt.g(c))?g.removeAttribute("hidden"):g.setAttribute("hidden","");e.setAttribute("placeholder",l);e.setAttribute("aria-expanded",$APP.n($APP.em.g(c))?"true":"false");$APP.n($APP.W.g(c))&&(e.setAttribute("disabled",""),e.setAttribute("aria-disabled","true"));$APP.n($APP.W.g(c))||(e.removeAttribute("disabled"),e.removeAttribute("aria-disabled"));
|
|
11
|
+
b.textContent=m;return Ft(a)}return null},Ht=function(a){if($APP.n(a.hasAttribute("open")))return null;var b=Et(a,"x-command-palette-open-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.setAttribute("open",""),b=$APP.k(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.k(b,"input"):null,$APP.n(b)&&b.focus(),Gt(a),a=Et(a,"x-command-palette-open",!1,{}));return a},It=function(a){if($APP.n(a.hasAttribute("open"))){var b=Et(a,"x-command-palette-close-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.removeAttribute("open"),
|
|
12
|
+
b=$APP.k(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.k(b,"input"):null,$APP.n(b)&&b.removeAttribute("aria-activedescendant"),Gt(a),a=Et(a,"x-command-palette-close",!1,{}));return a}return null},Jt=function(a){var b=$APP.k(a,"__xCommandPaletteQuery");b=$APP.n(b)?b:"";a=lt($APP.k(a,"__xCommandPaletteItems"));a=nt(a,b);a=$APP.M(a);return $APP.D(a,$APP.el)},Lt=function(a,b){var c=Jt(a);var d=$APP.k(a,"__xCommandPaletteActiveIdx");d=$APP.n(d)?d:0;$APP.C.i(b,Kt)?(c=ot(c,$APP.n(d)?d:-1,1),c=$APP.n(c)?c:
|
|
13
|
+
0):(b=$APP.z(c),c=ot(c,$APP.n(d)?d:b,-1),c=$APP.n(c)?c:0);a.__xCommandPaletteActiveIdx=c;Ft(a);a=$APP.k(a,"__xCommandPaletteRefs");a=$APP.n(a)?$APP.k(a,"list"):null;a=$APP.n(a)?a.querySelector("[data-idx\x3d'"+$APP.T.g(c)+"']"):null;return $APP.n(a)?a.scrollIntoView({block:"nearest"}):null},Nt=function(a,b){var c=b.key;return $APP.C.i(c,"ArrowDown")?(b.preventDefault(),Lt(a,Kt)):$APP.C.i(c,"ArrowUp")?(b.preventDefault(),Lt(a,Mt)):$APP.C.i(c,"Enter")?(b.preventDefault(),b=Jt(a),c=$APP.k(a,"__xCommandPaletteActiveIdx"),
|
|
14
|
+
b=$APP.zc(b,$APP.n(c)?c:0,null),$APP.n($APP.n(b)?$APP.r($APP.W.g(b)):b)?(c=Et(a,"x-command-palette-select-request",!0,{item:$APP.ph(b)}),$APP.n(c.defaultPrevented)?a=null:(Et(a,"x-command-palette-select",!1,{item:$APP.ph(b)}),a=It(a))):a=null,a):$APP.C.i(c,"Escape")?(b=Dt(a),$APP.n(yt.g(b))?It(a):null):null},Ot=function(a){function b(){var q=$APP.k(a,"__xCommandPaletteRefs"),v=$APP.n(q)?$APP.k(q,"input"):null;q=$APP.n(q)?$APP.k(q,"clear-btn"):null;$APP.n(v)&&(v.value="");$APP.n(q)&&q.setAttribute("hidden",
|
|
15
|
+
"");a.__xCommandPaletteQuery="";a.__xCommandPaletteActiveIdx=0;Et(a,"x-command-palette-query-change",!1,{query:""});Ft(a);return $APP.n(v)?v.focus():null}function c(q){a:{q=q.target.closest("[part\x3ditem]");if($APP.n(q)){q=parseInt(q.getAttribute("data-idx"),10);var v=Jt(a);q=$APP.zc(v,q,null);if($APP.n($APP.n(q)?$APP.r($APP.W.g(q)):q)){v=Et(a,"x-command-palette-select-request",!0,{item:$APP.ph(q)});if($APP.n(v.defaultPrevented)){q=null;break a}Et(a,"x-command-palette-select",!1,{item:$APP.ph(q)});
|
|
16
|
+
q=It(a);break a}}q=null}return q}function d(){var q=Dt(a);return $APP.n(xt.g(q))?It(a):null}function e(q){return Nt(a,q)}function g(){var q=$APP.k(a,"__xCommandPaletteRefs"),v=$APP.n(q)?$APP.k(q,"input"):null;q=$APP.n(q)?$APP.k(q,"clear-btn"):null;v=$APP.n(v)?v.value:null;a.__xCommandPaletteQuery=$APP.n(v)?v:"";a.__xCommandPaletteActiveIdx=0;$APP.n(q)&&($APP.n($APP.n(v)?$APP.N(v,""):v)?q.removeAttribute("hidden"):q.setAttribute("hidden",""));Et(a,"x-command-palette-query-change",!1,{query:$APP.n(v)?
|
|
17
|
+
v:""});return Ft(a)}var h=$APP.k(a,"__xCommandPaletteRefs"),l=$APP.k(h,"input"),m=$APP.k(h,"overlay"),p=$APP.k(h,"list");h=$APP.k(h,"clear-btn");l.addEventListener("input",g);l.addEventListener("keydown",e);m.addEventListener("click",d);p.addEventListener("click",c);h.addEventListener("click",b);$APP.ia(a,"__xCommandPaletteHandlers",{input:g,keydown:e,scrim:d,list:c,clear:b})},Pt=function(a){var b=$APP.k(a,"__xCommandPaletteRefs");a=$APP.k(a,"__xCommandPaletteHandlers");if($APP.n($APP.n(b)?a:b)){var c=
|
|
18
|
+
$APP.k(b,"input"),d=$APP.k(b,"overlay"),e=$APP.k(b,"list");b=$APP.k(b,"clear-btn");c.removeEventListener("input",$APP.k(a,"input"));c.removeEventListener("keydown",$APP.k(a,"keydown"));d.removeEventListener("click",$APP.k(a,"scrim"));e.removeEventListener("click",$APP.k(a,"list"));return b.removeEventListener("click",$APP.k(a,"clear"))}return null},Qt=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?
|
|
19
|
+
this.setAttribute(c,""):this.removeAttribute(c)}})},Rt=function(a){Object.defineProperty(a,"items",{configurable:!0,enumerable:!0,get:function(){var b=$APP.k(this,"__xCommandPaletteItems");return $APP.n(b)?b:[]},set:function(b){this.__xCommandPaletteItems=b;this.__xCommandPaletteActiveIdx=0;return Ft(this)}})},St=function(a){Object.defineProperty(a,"open",{configurable:!0,writable:!0,value:function(){return Ht(this)}});Object.defineProperty(a,"close",{configurable:!0,writable:!0,value:function(){return It(this)}});
|
|
20
|
+
Object.defineProperty(a,"toggle",{configurable:!0,writable:!0,value:function(){return $APP.n(this.hasAttribute("open"))?It(this):Ht(this)}})},Ut=function(){var a=class extends HTMLElement{};a.observedAttributes=Tt;var b=a.prototype;Qt(b,"open","open");Qt(b,"disabled","disabled");Rt(b);St(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xCommandPaletteRefs"))){var c=this.attachShadow({mode:"open"}),d=Ct("style"),e=Ct("div"),g=Ct("div"),h=Ct("div"),l=Ct("span"),m=Ct("input"),p=Ct("button"),
|
|
21
|
+
q=Ct("div"),v=Ct("div"),x=Ct("div");d.textContent=":host{display:contents;}[part\x3doverlay]{display:none;position:fixed;inset:0;background:var(--x-command-palette-backdrop,rgba(0,0,0,0.45));z-index:var(--x-command-palette-z,800);}[part\x3dpanel]{display:none;position:fixed;top:20vh;left:50%;transform:translateX(-50%);width:var(--x-command-palette-width,560px);max-width:calc(100vw - 2rem);max-height:60dvh;z-index:calc(var(--x-command-palette-z,800) + 1);flex-direction:column;border-radius:var(--x-command-palette-radius,var(--x-radius-lg,12px));background:var(--x-command-palette-bg,var(--x-color-bg,#fff));box-shadow:var(--x-command-palette-shadow,var(--x-shadow-lg,0 20px 60px rgba(0,0,0,0.25),0 4px 16px rgba(0,0,0,0.12)));overflow:hidden;}:host([open]) [part\x3doverlay]{display:block;}:host([open]) [part\x3dpanel]{display:flex;}[part\x3dsearch-wrap]{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--x-command-palette-divider,rgba(0,0,0,0.08));}[part\x3dsearch-icon]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;color:var(--x-command-palette-icon-color,var(--x-color-text-muted,#64748b));}[part\x3dinput]{flex:1;border:none;outline:none;background:transparent;font-size:1rem;line-height:1.5;color:var(--x-command-palette-text,inherit);}[part\x3dinput]::placeholder{color:var(--x-command-palette-placeholder,var(--x-color-text-muted,#94a3b8));}[part\x3dclear-btn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;color:var(--x-command-palette-icon-color,var(--x-color-text-muted,#64748b));}[part\x3dclear-btn]:focus-visible{outline:2px solid var(--x-command-palette-focus-ring,var(--x-color-focus-ring,#60a5fa));}[part\x3dclear-btn][hidden]{display:none;}[part\x3dlist-wrap]{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:8px 0;}[part\x3dlist]{display:flex;flex-direction:column;}[part\x3ditem]{padding:10px 16px;cursor:default;font-size:var(--x-font-size-sm,0.9375rem);line-height:1.4;color:var(--x-command-palette-item-text,inherit);border-radius:0;outline:none;}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,var(--x-color-surface-active,#f1f5f9));}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#e0e7ff);color:var(--x-command-palette-item-active-text,#3730a3);}[part\x3ditem][aria-disabled\x3dtrue]{opacity:0.45;cursor:default;pointer-events:none;}[part\x3dgroup-header]{padding:8px 16px 4px;font-size:0.75rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--x-command-palette-group-text,var(--x-color-text-muted,#94a3b8));}[part\x3dempty]{padding:32px 16px;text-align:center;color:var(--x-command-palette-empty-text,var(--x-color-text-muted,#94a3b8));font-size:0.9375rem;}[part\x3dempty][hidden]{display:none;}@media (prefers-color-scheme:dark){[part\x3dpanel]{background:var(--x-command-palette-bg,var(--x-color-bg,#1e293b));box-shadow:var(--x-command-palette-shadow,var(--x-shadow-lg,0 20px 60px rgba(0,0,0,0.6),0 4px 16px rgba(0,0,0,0.4)));}[part\x3dsearch-wrap]{border-bottom-color:var(--x-command-palette-divider,rgba(255,255,255,0.08));}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,var(--x-color-text-muted,#334155));}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#312e81);color:var(--x-command-palette-item-active-text,#c7d2fe);}}@media (prefers-reduced-motion:reduce){[part\x3dpanel],[part\x3doverlay]{transition:none;}}";
|
|
22
22
|
e.setAttribute("part","overlay");g.setAttribute("part","panel");g.setAttribute("role","dialog");g.setAttribute("aria-modal","true");h.setAttribute("part","search-wrap");l.setAttribute("part","search-icon");l.setAttribute("aria-hidden","true");l.textContent="\ud83d\udd0d";m.setAttribute("part","input");m.setAttribute("type","search");m.setAttribute("role","combobox");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("spellcheck","false");m.setAttribute("aria-autocomplete",
|
|
23
23
|
"list");m.setAttribute("aria-expanded","false");m.setAttribute("aria-controls","x-cp-list");p.setAttribute("part","clear-btn");p.setAttribute("type","button");p.setAttribute("aria-label","Clear");p.setAttribute("hidden","");q.setAttribute("part","list-wrap");v.setAttribute("part","list");v.setAttribute("id","x-cp-list");v.setAttribute("role","listbox");v.setAttribute("aria-label","Results");x.setAttribute("part","empty");x.setAttribute("hidden","");h.appendChild(l);h.appendChild(m);h.appendChild(p);
|
|
24
|
-
q.appendChild(v);q.appendChild(x);g.appendChild(h);g.appendChild(q);c.appendChild(d);c.appendChild(e);c.appendChild(g);this.__xCommandPaletteRefs={overlay:e,panel:g,input:m,"clear-btn":p,list:v,empty:x}}
|
|
25
|
-
"empty-text",1554384594),
|
|
26
|
-
"scrim?",744210580),
|
|
27
|
-
$APP.Pd(["x-command-palette-open-request",new $APP.R(null,2,[$APP.
|
|
28
|
-
[$APP.
|
|
24
|
+
q.appendChild(v);q.appendChild(x);g.appendChild(h);g.appendChild(q);c.appendChild(d);c.appendChild(e);c.appendChild(g);this.__xCommandPaletteRefs={overlay:e,panel:g,input:m,"clear-btn":p,list:v,empty:x}}Pt(this);Ot(this);return Gt(this)};b.disconnectedCallback=function(){return Pt(this)};b.attributeChangedCallback=function(){return Gt(this)};return a},Vt=function(){return $APP.n(customElements.get("x-command-palette"))?null:customElements.define("x-command-palette",Ut())},wt=new $APP.K(null,"empty-text",
|
|
25
|
+
"empty-text",1554384594),qt=new $APP.K(null,"close-on-scrim-raw","close-on-scrim-raw",159828234),pt=new $APP.K(null,"empty-text-raw","empty-text-raw",1477406757),ut=new $APP.K(null,"dismissible-raw","dismissible-raw",947680658),vt=new $APP.K(null,"modal-raw","modal-raw",-263722282),yt=new $APP.K(null,"close-on-escape?","close-on-escape?",-1559868909),mt=new $APP.K(null,"groups","groups",-136896102),st=new $APP.K(null,"close-on-escape-raw","close-on-escape-raw",-1942646255),zt=new $APP.K(null,"scrim?",
|
|
26
|
+
"scrim?",744210580),tt=new $APP.K(null,"no-scrim-raw","no-scrim-raw",-1344365743),xt=new $APP.K(null,"close-on-scrim?","close-on-scrim?",-367113965),Wt=new $APP.Rb(null,"object","object",-1179821820,null),jt=new $APP.K(null,"group","group",582596132),Kt=new $APP.K(null,"down","down",1565245570),kt=new $APP.K(null,"search-str","search-str",-821246171),Mt=new $APP.K(null,"up","up",-269712113),At=new $APP.K(null,"modal?","modal?",2146094679),rt=new $APP.K(null,"disabled-raw","disabled-raw",498098381);var Tt="open modal dismissible disabled no-scrim close-on-scrim close-on-escape label placeholder empty-text".split(" ");
|
|
27
|
+
$APP.Pd(["x-command-palette-open-request",new $APP.R(null,2,[$APP.Dl,!0,$APP.Cj,$APP.Qd],null),"x-command-palette-open",new $APP.R(null,2,[$APP.Dl,!1,$APP.Cj,$APP.Qd],null),"x-command-palette-close-request",new $APP.R(null,2,[$APP.Dl,!0,$APP.Cj,$APP.Qd],null),"x-command-palette-close",new $APP.R(null,2,[$APP.Dl,!1,$APP.Cj,$APP.Qd],null),"x-command-palette-select-request",new $APP.R(null,2,[$APP.Dl,!0,$APP.Cj,new $APP.R(null,1,[$APP.Uj,Wt],null)],null),"x-command-palette-select",new $APP.R(null,2,
|
|
28
|
+
[$APP.Dl,!1,$APP.Cj,new $APP.R(null,1,[$APP.Uj,Wt],null)],null),"x-command-palette-query-change",new $APP.R(null,2,[$APP.Dl,!1,$APP.Cj,new $APP.R(null,1,[new $APP.K(null,"query","query",-1288509510),$APP.X],null)],null)]);$APP.fa("baredom.exports.x_command_palette.init",Vt);export const init=Vt;
|