@warp-ds/elements 2.2.0-next.16 → 2.2.0-next.17

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.
@@ -1,4 +1,4 @@
1
- var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{throw TypeError(a)};var s=(a,o,e,r)=>{for(var i=r>1?void 0:r?ke(o,e):o,c=a.length-1,m;c>=0;c--)(m=a[c])&&(i=(r?m(o,e,i):m(i))||i);return r&&i&&xe(o,e,i),i};var Q=(a,o,e)=>o.has(a)||ae("Cannot "+e);var ie=(a,o,e)=>(Q(a,o,"read from private field"),e?e.call(a):o.get(a)),j=(a,o,e)=>o.has(a)?ae("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(a):o.set(a,e),se=(a,o,e,r)=>(Q(a,o,"write to private field"),r?r.call(a,e):o.set(a,e),e),h=(a,o,e)=>(Q(a,o,"access private method"),e);import{html as de,LitElement as ce,nothing as _e}from"lit";var l=function(a,o,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?a!==o||!r:!o.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(a):r?r.value:o.get(a)},p=function(a,o,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?a!==o||!i:!o.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(a,e):i?i.value=e:o.set(a,e),e};function X(a){var o,e,r,i,c,m,x,E,C,_,D,U,L,P,A,F,B,H,G;class we extends a{constructor(...t){var n,b,u;super(...t),o.add(this),this.internals=this.attachInternals(),e.set(this,!1),r.set(this,!1),i.set(this,!1),c.set(this,void 0),m.set(this,void 0),x.set(this,!0),C.set(this,""),_.set(this,()=>{p(this,i,!0,"f"),p(this,e,!0,"f"),l(this,o,"m",F).call(this)}),D.set(this,()=>{p(this,e,!1,"f"),l(this,o,"m",B).call(this,this.shouldFormValueUpdate()?l(this,C,"f"):""),!this.validity.valid&&l(this,i,"f")&&p(this,r,!0,"f");let z=l(this,o,"m",F).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),U.set(this,()=>{var z;l(this,x,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),p(this,x,!1,"f")),p(this,i,!0,"f"),p(this,r,!0,"f"),l(this,o,"m",F).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),L.set(this,void 0),P.set(this,!1),A.set(this,Promise.resolve()),(n=this.addEventListener)===null||n===void 0||n.call(this,"focus",l(this,_,"f")),(b=this.addEventListener)===null||b===void 0||b.call(this,"blur",l(this,D,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"invalid",l(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let t=this.validators.map(u=>u.attribute).flat(),n=super.observedAttributes||[];return[...new Set([...n,...t])]}static getValidator(t){return this.validators.find(n=>n.attribute===t)||null}static getValidators(t){return this.validators.filter(n=>{var b;if(n.attribute===t||!((b=n.attribute)===null||b===void 0)&&b.includes(t))return!0})}get form(){return this.internals.form}get showError(){return l(this,o,"m",F).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(t,n,b){var u;(u=super.attributeChangedCallback)===null||u===void 0||u.call(this,t,n,b);let I=this.constructor.getValidators(t);I!=null&&I.length&&this.validationTarget&&this.setValue(l(this,C,"f"))}setValue(t){var n;p(this,r,!1,"f"),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,""),p(this,C,t,"f");let u=this.shouldFormValueUpdate()?t:null;this.internals.setFormValue(u),l(this,o,"m",B).call(this,u),this.valueChangedCallback&&this.valueChangedCallback(u),l(this,o,"m",F).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(t=>t(l(this,A,"f")))}formResetCallback(){var t,n;p(this,i,!1,"f"),p(this,r,!1,"f"),l(this,o,"m",F).call(this),(t=this.resetFormControl)===null||t===void 0||t.call(this),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,l(this,o,"m",F).call(this)?this.validationMessage:"")}}return e=new WeakMap,r=new WeakMap,i=new WeakMap,c=new WeakMap,m=new WeakMap,x=new WeakMap,C=new WeakMap,_=new WeakMap,D=new WeakMap,U=new WeakMap,L=new WeakMap,P=new WeakMap,A=new WeakMap,o=new WeakSet,E=function(){let t=this.getRootNode(),n=`${this.localName}[name="${this.getAttribute("name")}"]`;return t.querySelectorAll(n)},F=function(){if(this.hasAttribute("disabled"))return!1;let t=l(this,r,"f")||l(this,i,"f")&&!this.validity.valid&&!l(this,e,"f");return t&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),t},B=function(t){let n=this.constructor,b={},u=n.validators,z=[],I=u.some(w=>w.isValid instanceof Promise);l(this,P,"f")||(p(this,A,new Promise(w=>{p(this,L,w,"f")}),"f"),p(this,P,!0,"f")),l(this,c,"f")&&(l(this,c,"f").abort(),p(this,m,l(this,c,"f"),"f"));let N=new AbortController;p(this,c,N,"f");let S,te=!1;u.length&&(u.forEach(w=>{let J=w.key||"customError",$=w.isValid(this,t,N.signal);$ instanceof Promise?(z.push($),$.then(K=>{K!=null&&(b[J]=!K,S=l(this,o,"m",G).call(this,w,t),l(this,o,"m",H).call(this,b,S))})):(b[J]=!$,this.validity[J]!==!$&&(te=!0),!$&&!S&&(S=l(this,o,"m",G).call(this,w,t)))}),Promise.allSettled(z).then(()=>{var w;N!=null&&N.signal.aborted||(p(this,P,!1,"f"),(w=l(this,L,"f"))===null||w===void 0||w.call(this))}),(te||!I)&&l(this,o,"m",H).call(this,b,S))},H=function(t,n){if(this.validationTarget)this.internals.setValidity(t,n,this.validationTarget),p(this,x,!1,"f");else{if(this.internals.setValidity(t,n),this.internals.validity.valid)return;p(this,x,!0,"f")}},G=function(t,n){if(this.validityCallback){let b=this.validityCallback(t.key||"customError");if(b)return b}return t.message instanceof Function?t.message(this,n):t.message},we}import{property as y}from"lit/decorators.js";import{css as ne}from"lit";var R=ne`
1
+ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{throw TypeError(a)};var s=(a,o,e,r)=>{for(var i=r>1?void 0:r?ke(o,e):o,c=a.length-1,m;c>=0;c--)(m=a[c])&&(i=(r?m(o,e,i):m(i))||i);return r&&i&&xe(o,e,i),i};var Q=(a,o,e)=>o.has(a)||ae("Cannot "+e);var ie=(a,o,e)=>(Q(a,o,"read from private field"),e?e.call(a):o.get(a)),j=(a,o,e)=>o.has(a)?ae("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(a):o.set(a,e),se=(a,o,e,r)=>(Q(a,o,"write to private field"),r?r.call(a,e):o.set(a,e),e),h=(a,o,e)=>(Q(a,o,"access private method"),e);import{html as de,LitElement as ce,nothing as _e}from"lit";var l=function(a,o,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?a!==o||!r:!o.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(a):r?r.value:o.get(a)},p=function(a,o,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?a!==o||!i:!o.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(a,e):i?i.value=e:o.set(a,e),e};function R(a){var o,e,r,i,c,m,x,E,C,_,D,U,L,P,A,F,B,H,G;class we extends a{constructor(...t){var n,b,u;super(...t),o.add(this),this.internals=this.attachInternals(),e.set(this,!1),r.set(this,!1),i.set(this,!1),c.set(this,void 0),m.set(this,void 0),x.set(this,!0),C.set(this,""),_.set(this,()=>{p(this,i,!0,"f"),p(this,e,!0,"f"),l(this,o,"m",F).call(this)}),D.set(this,()=>{p(this,e,!1,"f"),l(this,o,"m",B).call(this,this.shouldFormValueUpdate()?l(this,C,"f"):""),!this.validity.valid&&l(this,i,"f")&&p(this,r,!0,"f");let z=l(this,o,"m",F).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),U.set(this,()=>{var z;l(this,x,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),p(this,x,!1,"f")),p(this,i,!0,"f"),p(this,r,!0,"f"),l(this,o,"m",F).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),L.set(this,void 0),P.set(this,!1),A.set(this,Promise.resolve()),(n=this.addEventListener)===null||n===void 0||n.call(this,"focus",l(this,_,"f")),(b=this.addEventListener)===null||b===void 0||b.call(this,"blur",l(this,D,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"invalid",l(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let t=this.validators.map(u=>u.attribute).flat(),n=super.observedAttributes||[];return[...new Set([...n,...t])]}static getValidator(t){return this.validators.find(n=>n.attribute===t)||null}static getValidators(t){return this.validators.filter(n=>{var b;if(n.attribute===t||!((b=n.attribute)===null||b===void 0)&&b.includes(t))return!0})}get form(){return this.internals.form}get showError(){return l(this,o,"m",F).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(t,n,b){var u;(u=super.attributeChangedCallback)===null||u===void 0||u.call(this,t,n,b);let I=this.constructor.getValidators(t);I!=null&&I.length&&this.validationTarget&&this.setValue(l(this,C,"f"))}setValue(t){var n;p(this,r,!1,"f"),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,""),p(this,C,t,"f");let u=this.shouldFormValueUpdate()?t:null;this.internals.setFormValue(u),l(this,o,"m",B).call(this,u),this.valueChangedCallback&&this.valueChangedCallback(u),l(this,o,"m",F).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(t=>t(l(this,A,"f")))}formResetCallback(){var t,n;p(this,i,!1,"f"),p(this,r,!1,"f"),l(this,o,"m",F).call(this),(t=this.resetFormControl)===null||t===void 0||t.call(this),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,l(this,o,"m",F).call(this)?this.validationMessage:"")}}return e=new WeakMap,r=new WeakMap,i=new WeakMap,c=new WeakMap,m=new WeakMap,x=new WeakMap,C=new WeakMap,_=new WeakMap,D=new WeakMap,U=new WeakMap,L=new WeakMap,P=new WeakMap,A=new WeakMap,o=new WeakSet,E=function(){let t=this.getRootNode(),n=`${this.localName}[name="${this.getAttribute("name")}"]`;return t.querySelectorAll(n)},F=function(){if(this.hasAttribute("disabled"))return!1;let t=l(this,r,"f")||l(this,i,"f")&&!this.validity.valid&&!l(this,e,"f");return t&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),t},B=function(t){let n=this.constructor,b={},u=n.validators,z=[],I=u.some(w=>w.isValid instanceof Promise);l(this,P,"f")||(p(this,A,new Promise(w=>{p(this,L,w,"f")}),"f"),p(this,P,!0,"f")),l(this,c,"f")&&(l(this,c,"f").abort(),p(this,m,l(this,c,"f"),"f"));let N=new AbortController;p(this,c,N,"f");let S,te=!1;u.length&&(u.forEach(w=>{let J=w.key||"customError",$=w.isValid(this,t,N.signal);$ instanceof Promise?(z.push($),$.then(K=>{K!=null&&(b[J]=!K,S=l(this,o,"m",G).call(this,w,t),l(this,o,"m",H).call(this,b,S))})):(b[J]=!$,this.validity[J]!==!$&&(te=!0),!$&&!S&&(S=l(this,o,"m",G).call(this,w,t)))}),Promise.allSettled(z).then(()=>{var w;N!=null&&N.signal.aborted||(p(this,P,!1,"f"),(w=l(this,L,"f"))===null||w===void 0||w.call(this))}),(te||!I)&&l(this,o,"m",H).call(this,b,S))},H=function(t,n){if(this.validationTarget)this.internals.setValidity(t,n,this.validationTarget),p(this,x,!1,"f");else{if(this.internals.setValidity(t,n),this.internals.validity.valid)return;p(this,x,!0,"f")}},G=function(t,n){if(this.validityCallback){let b=this.validityCallback(t.key||"customError");if(b)return b}return t.message instanceof Function?t.message(this,n):t.message},we}import{property as y}from"lit/decorators.js";import{css as ne}from"lit";var X=ne`
2
2
  *,
3
3
  :before,
4
4
  :after {
@@ -2553,7 +2553,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2553
2553
  bottom: 0;
2554
2554
  grid-area: slider;
2555
2555
  }
2556
- `;var T,g,V,he,be,W,pe,v=class extends X(ce){constructor(){super(...arguments);j(this,g);this.disabled=!1;this.invalid=!1;this.required=!1;j(this,T)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.style.setProperty("--min",this.min),this.style.setProperty("--max",this.max),this.markers&&this.style.setProperty("--markers",String(this.markers));let e=getComputedStyle(this.shadowRoot.querySelector(".w-slider"));se(this,T,Number.parseFloat(e.getPropertyValue("--w-slider-thumb-size").replace("px",""))),h(this,g,V).call(this)}updated(e){(e.has("disabled")||e.has("invalid")||e.has("required")||e.has("min")||e.has("step")||e.has("max")||e.has("suffix")||e.has("formatter"))&&h(this,g,V).call(this)}render(){return de`
2556
+ `;var T,g,V,he,be,W,pe,v=class extends R(ce){constructor(){super(...arguments);j(this,g);this.disabled=!1;this.invalid=!1;this.required=!1;j(this,T)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.style.setProperty("--min",this.min),this.style.setProperty("--max",this.max),this.markers&&this.style.setProperty("--markers",String(this.markers));let e=getComputedStyle(this.shadowRoot.querySelector(".w-slider"));se(this,T,Number.parseFloat(e.getPropertyValue("--w-slider-thumb-size").replace("px",""))),h(this,g,V).call(this)}updated(e){(e.has("disabled")||e.has("invalid")||e.has("required")||e.has("min")||e.has("step")||e.has("max")||e.has("suffix")||e.has("formatter"))&&h(this,g,V).call(this)}render(){return de`
2557
2557
  <fieldset id="fieldset" class="w-slider" @input="${h(this,g,he)}" @slidervalidity="${h(this,g,be)}">
2558
2558
  <legend class="w-slider__label">
2559
2559
  <slot id="label" name="label">${this.label}</slot>
@@ -2565,7 +2565,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2565
2565
  <slot class="w-slider__slider" name="from" @slotchange=${h(this,g,V)}></slot>
2566
2566
  <slot class="w-slider__slider" name="to" @slotchange=${h(this,g,V)}></slot>
2567
2567
  </fieldset>
2568
- `}};T=new WeakMap,g=new WeakSet,V=function(){let e=this.querySelectorAll("w-slider-thumb");for(let r of e.values())r.min=this.min,r.max=this.max,r.step=this.step,r.suffix=this.suffix,r.required=this.required,r.formatter=this.formatter,r.ariaLabel||(r.slot||(r.ariaLabel=this.label),r.slot==="from"&&(r.ariaLabel=`${this.label} min`),r.slot==="to"&&(r.ariaLabel=`${this.label} max`)),r.forceDisabled=this.disabled,r.forceInvalid=this.invalid,h(this,g,W).call(this,r)},he=function(e){let r=e.target;h(this,g,W).call(this,r)},be=function(e){e.stopPropagation(),this.invalid=e.detail.invalid},W=function(e){var i,c;let r=e.slot;if(r){let m=h(this,g,pe).call(this),x=ie(this,T),E=x-m;m<=x&&this.style.setProperty("--thumb-offset",String(E))}if(r||this.style.setProperty("--from","0"),r==="from"){let m=(i=e.value)!=null?i:e.value=this.min;this.style.setProperty("--from",m)}if(!r||r==="to"){let m=(c=e.value)!=null?c:e.value=this.max;this.style.setProperty("--to",m)}},pe=function(){let e=window.getComputedStyle(this.shadowRoot.querySelector(".w-slider__active-range"),"::before").width;return Number.parseFloat(e.replace("px",""))},v.shadowRootOptions={...ce.shadowRootOptions,delegatesFocus:!0},v.styles=[R,le],s([y()],v.prototype,"label",2),s([y({type:Boolean,reflect:!0})],v.prototype,"disabled",2),s([y({type:Boolean,reflect:!0})],v.prototype,"invalid",2),s([y({type:Boolean,reflect:!0})],v.prototype,"required",2),s([y({reflect:!0})],v.prototype,"min",2),s([y({reflect:!0})],v.prototype,"max",2),s([y({type:Number})],v.prototype,"markers",2),s([y({type:Number})],v.prototype,"step",2),s([y()],v.prototype,"suffix",2),s([y({attribute:!1})],v.prototype,"formatter",2);customElements.get("w-slider")||customElements.define("w-slider",v);import{html as q,LitElement as me,nothing as ee}from"lit";import{property as M,query as ve,state as k}from"lit/decorators.js";import{classMap as Fe}from"lit/directives/class-map.js";import{ifDefined as re}from"lit/directives/if-defined.js";import{css as ze}from"lit";var ue=ze`
2568
+ `}};T=new WeakMap,g=new WeakSet,V=function(){let e=this.querySelectorAll("w-slider-thumb");for(let r of e.values())r.min=this.min,r.max=this.max,r.step=this.step,r.suffix=this.suffix,r.required=this.required,r.formatter=this.formatter,r.ariaLabel||(r.slot||(r.ariaLabel=this.label),r.slot==="from"&&(r.ariaLabel=`${this.label} min`),r.slot==="to"&&(r.ariaLabel=`${this.label} max`)),r.forceDisabled=this.disabled,r.forceInvalid=this.invalid,h(this,g,W).call(this,r)},he=function(e){let r=e.target;h(this,g,W).call(this,r)},be=function(e){e.stopPropagation(),this.invalid=e.detail.invalid},W=function(e){var i,c;let r=e.slot;if(r){let m=h(this,g,pe).call(this),x=ie(this,T),E=x-m;m<=x&&this.style.setProperty("--thumb-offset",String(E))}if(r||this.style.setProperty("--from","0"),r==="from"){let m=(i=e.value)!=null?i:e.value=this.min;this.style.setProperty("--from",m)}if(!r||r==="to"){let m=(c=e.value)!=null?c:e.value=this.max;this.style.setProperty("--to",m)}},pe=function(){let e=window.getComputedStyle(this.shadowRoot.querySelector(".w-slider__active-range"),"::before").width;return Number.parseFloat(e.replace("px",""))},v.shadowRootOptions={...ce.shadowRootOptions,delegatesFocus:!0},v.styles=[X,le],s([y()],v.prototype,"label",2),s([y({type:Boolean,reflect:!0})],v.prototype,"disabled",2),s([y({type:Boolean,reflect:!0})],v.prototype,"invalid",2),s([y({type:Boolean,reflect:!0})],v.prototype,"required",2),s([y({reflect:!0})],v.prototype,"min",2),s([y({reflect:!0})],v.prototype,"max",2),s([y({type:Number})],v.prototype,"markers",2),s([y({type:Number})],v.prototype,"step",2),s([y()],v.prototype,"suffix",2),s([y({attribute:!1})],v.prototype,"formatter",2);customElements.get("w-slider")||customElements.define("w-slider",v);import{html as q,LitElement as me,nothing as ee}from"lit";import{property as M,query as ve,state as k}from"lit/decorators.js";import{classMap as Fe}from"lit/directives/class-map.js";import{ifDefined as re}from"lit/directives/if-defined.js";import{css as ze}from"lit";var ue=ze`
2569
2569
  .w-slider-thumb {
2570
2570
  position: relative;
2571
2571
  display: grid;
@@ -2694,7 +2694,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2694
2694
  :host([name='to']) .w-slider-thumb__range::-webkit-slider-thumb {
2695
2695
  margin-left: calc(1px * var(--thumb-offset) / 2);
2696
2696
  }
2697
- `;import{css as Ce}from"lit";var ge=Ce`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;var fe={};var f,Z,O,oe,d=class extends X(me){constructor(){super(...arguments);j(this,f);this._invalid=!1;this._showTooltip=!1;this.anchorPositioningStyleElement=null}async connectedCallback(){var e;if(super.connectedCallback(),"anchorName"in document.documentElement.style)await this.updateComplete;else{let r=fe.url.substring(0,fe.url.lastIndexOf("/"));try{let[{default:i}]=await Promise.all([import(`${r}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
2697
+ `;import{css as Ce}from"lit";var ge=Ce`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;var fe={};var f,Z,O,oe,d=class extends R(me){constructor(){super(...arguments);j(this,f);this._invalid=!1;this._showTooltip=!1;this.anchorPositioningStyleElement=null}async connectedCallback(){var e;if(super.connectedCallback(),"anchorName"in document.documentElement.style)await this.updateComplete;else{let r=fe.url.substring(0,fe.url.lastIndexOf("/"));try{let[{default:i}]=await Promise.all([import(`${r}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
2698
2698
  /*
2699
2699
  * The polyfill can only anchor to ::before and ::after pseudo elements.
2700
2700
  * We work around that by recreating a transparent version of the active range
@@ -2739,7 +2739,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2739
2739
  :host([name='from']) #target {
2740
2740
  left: anchor(--polyfilled-thumb left);
2741
2741
  }
2742
- `,await i.call(this,{elements:[this.anchorPositioningStyleElement]})}catch(i){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:i}))}}this.range.value=(e=this.value)!=null?e:this.max}updated(e){if(e.has("value")&&(this.setValue(this.value),!("anchorName"in document.documentElement.style))){let r=this.shadowRoot.querySelector("#target"),i=getComputedStyle(r).getPropertyValue("width"),c=Number.parseFloat(i.replace("px",""))/2;r.style.setProperty("margin-left",`-${c}px`)}e.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return q`
2742
+ `,await i({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(i){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:i}))}}this.range.value=(e=this.value)!=null?e:this.max}updated(e){if(e.has("value")&&(this.setValue(this.value),!("anchorName"in document.documentElement.style))){let r=this.shadowRoot.querySelector("#target"),i=getComputedStyle(r).getPropertyValue("width"),c=Number.parseFloat(i.replace("px",""))/2;r.style.setProperty("margin-left",`-${c}px`)}e.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return q`
2743
2743
  <div class="w-slider-thumb">
2744
2744
  <label for="range">${this.label}</label>
2745
2745
  ${"anchorName"in document.documentElement.style?ee:q`<div id="anchor"></div>`}
@@ -2787,5 +2787,5 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2787
2787
  <!-- aria-description is still not recommended for general use, so make a visually hidden element and refer to it with aria-describedby -->
2788
2788
  <span class="sr-only" id="aria-description">${this.ariaDescription}</span>
2789
2789
  </div>
2790
- `}};f=new WeakSet,Z=function(){this._showTooltip=!0},O=function(){this._showTooltip=!1},oe=function(e){let r=e.currentTarget.tagName==="W-TEXTFIELD";if(e instanceof CustomEvent)return;let i=e.currentTarget.value;if(i==="")return this.required&&(this._invalid=!0),!1;r&&this._invalid&&(this._invalid=!1);let c=Number.parseInt(i),m=Number.parseInt(this.max),x=Number.parseInt(this.min);(c>m||c<x)&&(this._invalid=!0);let E=!1;if(this.slot){let C=getComputedStyle(this);if(this.slot==="from"){let _=C.getPropertyValue("--to");if(c>Number.parseInt(_)){if(r)return this._invalid=!0,!1;E=!0,this.value=_}}else{let _=C.getPropertyValue("--from");if(c<Number.parseInt(_)){if(r)return this._invalid=!0,!1;E=!0,this.value=_}}}return E?(e.preventDefault(),this.range.value=this.value,!1):(this.value=i,!0)},d.shadowRootOptions={...me.shadowRootOptions,delegatesFocus:!0},d.styles=[R,ge,ue],s([M({attribute:"aria-label"})],d.prototype,"ariaLabel",2),s([M({attribute:"aria-description"})],d.prototype,"ariaDescription",2),s([M()],d.prototype,"label",2),s([M()],d.prototype,"name",2),s([M({reflect:!0})],d.prototype,"value",2),s([M({type:Boolean,reflect:!0})],d.prototype,"disabled",2),s([k()],d.prototype,"markers",2),s([k()],d.prototype,"required",2),s([k()],d.prototype,"step",2),s([k()],d.prototype,"min",2),s([k()],d.prototype,"max",2),s([k()],d.prototype,"suffix",2),s([k()],d.prototype,"forceDisabled",2),s([k()],d.prototype,"forceInvalid",2),s([k()],d.prototype,"formatter",2),s([ve('input[type="range"]')],d.prototype,"range",2),s([ve("w-textfield")],d.prototype,"textfield",2),s([k()],d.prototype,"_invalid",2),s([k()],d.prototype,"_showTooltip",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",d);export{v as WarpSlider,d as WarpSliderThumb};
2790
+ `}};f=new WeakSet,Z=function(){this._showTooltip=!0},O=function(){this._showTooltip=!1},oe=function(e){let r=e.currentTarget.tagName==="W-TEXTFIELD";if(e instanceof CustomEvent)return;let i=e.currentTarget.value;if(i==="")return this.required&&(this._invalid=!0),!1;r&&this._invalid&&(this._invalid=!1);let c=Number.parseInt(i),m=Number.parseInt(this.max),x=Number.parseInt(this.min);(c>m||c<x)&&(this._invalid=!0);let E=!1;if(this.slot){let C=getComputedStyle(this);if(this.slot==="from"){let _=C.getPropertyValue("--to");if(c>Number.parseInt(_)){if(r)return this._invalid=!0,!1;E=!0,this.value=_}}else{let _=C.getPropertyValue("--from");if(c<Number.parseInt(_)){if(r)return this._invalid=!0,!1;E=!0,this.value=_}}}return E?(e.preventDefault(),this.range.value=this.value,!1):(this.value=i,!0)},d.shadowRootOptions={...me.shadowRootOptions,delegatesFocus:!0},d.styles=[X,ge,ue],s([M({attribute:"aria-label"})],d.prototype,"ariaLabel",2),s([M({attribute:"aria-description"})],d.prototype,"ariaDescription",2),s([M()],d.prototype,"label",2),s([M()],d.prototype,"name",2),s([M({reflect:!0})],d.prototype,"value",2),s([M({type:Boolean,reflect:!0})],d.prototype,"disabled",2),s([k()],d.prototype,"markers",2),s([k()],d.prototype,"required",2),s([k()],d.prototype,"step",2),s([k()],d.prototype,"min",2),s([k()],d.prototype,"max",2),s([k()],d.prototype,"suffix",2),s([k()],d.prototype,"forceDisabled",2),s([k()],d.prototype,"forceInvalid",2),s([k()],d.prototype,"formatter",2),s([ve('input[type="range"]')],d.prototype,"range",2),s([ve("w-textfield")],d.prototype,"textfield",2),s([k()],d.prototype,"_invalid",2),s([k()],d.prototype,"_showTooltip",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",d);export{v as WarpSlider,d as WarpSliderThumb};
2791
2791
  //# sourceMappingURL=index.js.map