@m3e/slider 1.0.5 → 1.1.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/dist/index.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { LitElement, html, unsafeCSS, css } from 'lit';
7
7
  import { Dirty, Touched, FormAssociated, Focusable, Disabled, AttachInternals, Role, formValue, DesignToken, ResizeController, safeStyleMap, prefersReducedMotion } from '@m3e/core';
8
+ import { M3eDirectionality } from '@m3e/core/bidi';
8
9
 
9
10
  /******************************************************************************
10
11
  Copyright (c) Microsoft Corporation.
@@ -19,33 +20,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
20
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
21
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
22
  PERFORMANCE OF THIS SOFTWARE.
22
- ***************************************************************************** */
23
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
24
-
25
-
26
- function __decorate(decorators, target, key, desc) {
27
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30
- return c > 3 && r && Object.defineProperty(target, key, r), r;
31
- }
32
-
33
- function __classPrivateFieldGet(receiver, state, kind, f) {
34
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
35
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
36
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
37
- }
38
-
39
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
40
- if (kind === "m") throw new TypeError("Private method is not writable");
41
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
42
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
43
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
44
- }
45
-
46
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
47
- var e = new Error(message);
48
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
23
+ ***************************************************************************** */
24
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
25
+
26
+ function __decorate(decorators, target, key, desc) {
27
+ var c = arguments.length,
28
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
29
+ d;
30
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
31
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
32
+ }
33
+ function __classPrivateFieldGet(receiver, state, kind, f) {
34
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
35
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
36
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
37
+ }
38
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
39
+ if (kind === "m") throw new TypeError("Private method is not writable");
40
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
41
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
42
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
43
+ }
44
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
45
+ var e = new Error(message);
46
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
47
  };
50
48
 
51
49
  /**
@@ -53,58 +51,707 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
53
51
  * Copyright 2017 Google LLC
54
52
  * SPDX-License-Identifier: BSD-3-Clause
55
53
  */
56
- const t$2=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
54
+ const t$2 = t => (e, o) => {
55
+ void 0 !== o ? o.addInitializer(() => {
56
+ customElements.define(t, e);
57
+ }) : customElements.define(t, e);
58
+ };
57
59
 
58
60
  /**
59
61
  * @license
60
62
  * Copyright 2019 Google LLC
61
63
  * SPDX-License-Identifier: BSD-3-Clause
62
64
  */
63
- const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$1),S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
65
+ const t$1 = globalThis,
66
+ e$4 = t$1.ShadowRoot && (void 0 === t$1.ShadyCSS || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
67
+ s$1 = Symbol(),
68
+ o$4 = new WeakMap();
69
+ let n$3 = class n {
70
+ constructor(t, e, o) {
71
+ if (this._$cssResult$ = true, o !== s$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
72
+ this.cssText = t, this.t = e;
73
+ }
74
+ get styleSheet() {
75
+ let t = this.o;
76
+ const s = this.t;
77
+ if (e$4 && void 0 === t) {
78
+ const e = void 0 !== s && 1 === s.length;
79
+ e && (t = o$4.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$4.set(s, t));
80
+ }
81
+ return t;
82
+ }
83
+ toString() {
84
+ return this.cssText;
85
+ }
86
+ };
87
+ const r$4 = t => new n$3("string" == typeof t ? t : t + "", void 0, s$1),
88
+ S$1 = (s, o) => {
89
+ if (e$4) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
90
+ const o = document.createElement("style"),
91
+ n = t$1.litNonce;
92
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
93
+ }
94
+ },
95
+ c$2 = e$4 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
96
+ let e = "";
97
+ for (const s of t.cssRules) e += s.cssText;
98
+ return r$4(e);
99
+ })(t) : t;
64
100
 
65
101
  /**
66
102
  * @license
67
103
  * Copyright 2017 Google LLC
68
104
  * SPDX-License-Identifier: BSD-3-Clause
69
- */const{is:i$1,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$3(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d$1("elementProperties")]=new Map,y[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y}),(a$1.reactiveElementVersions??=[]).push("2.1.1");
105
+ */
106
+ const {
107
+ is: i$1,
108
+ defineProperty: e$3,
109
+ getOwnPropertyDescriptor: h$1,
110
+ getOwnPropertyNames: r$3,
111
+ getOwnPropertySymbols: o$3,
112
+ getPrototypeOf: n$2
113
+ } = Object,
114
+ a$1 = globalThis,
115
+ c$1 = a$1.trustedTypes,
116
+ l$1 = c$1 ? c$1.emptyScript : "",
117
+ p$1 = a$1.reactiveElementPolyfillSupport,
118
+ d$1 = (t, s) => t,
119
+ u$1 = {
120
+ toAttribute(t, s) {
121
+ switch (s) {
122
+ case Boolean:
123
+ t = t ? l$1 : null;
124
+ break;
125
+ case Object:
126
+ case Array:
127
+ t = null == t ? t : JSON.stringify(t);
128
+ }
129
+ return t;
130
+ },
131
+ fromAttribute(t, s) {
132
+ let i = t;
133
+ switch (s) {
134
+ case Boolean:
135
+ i = null !== t;
136
+ break;
137
+ case Number:
138
+ i = null === t ? null : Number(t);
139
+ break;
140
+ case Object:
141
+ case Array:
142
+ try {
143
+ i = JSON.parse(t);
144
+ } catch (t) {
145
+ i = null;
146
+ }
147
+ }
148
+ return i;
149
+ }
150
+ },
151
+ f$1 = (t, s) => !i$1(t, s),
152
+ b = {
153
+ attribute: true,
154
+ type: String,
155
+ converter: u$1,
156
+ reflect: false,
157
+ useDefault: false,
158
+ hasChanged: f$1
159
+ };
160
+ Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= new WeakMap();
161
+ class y extends HTMLElement {
162
+ static addInitializer(t) {
163
+ this._$Ei(), (this.l ??= []).push(t);
164
+ }
165
+ static get observedAttributes() {
166
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
167
+ }
168
+ static createProperty(t, s = b) {
169
+ if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
170
+ const i = Symbol(),
171
+ h = this.getPropertyDescriptor(t, i, s);
172
+ void 0 !== h && e$3(this.prototype, t, h);
173
+ }
174
+ }
175
+ static getPropertyDescriptor(t, s, i) {
176
+ const {
177
+ get: e,
178
+ set: r
179
+ } = h$1(this.prototype, t) ?? {
180
+ get() {
181
+ return this[s];
182
+ },
183
+ set(t) {
184
+ this[s] = t;
185
+ }
186
+ };
187
+ return {
188
+ get: e,
189
+ set(s) {
190
+ const h = e?.call(this);
191
+ r?.call(this, s), this.requestUpdate(t, h, i);
192
+ },
193
+ configurable: true,
194
+ enumerable: true
195
+ };
196
+ }
197
+ static getPropertyOptions(t) {
198
+ return this.elementProperties.get(t) ?? b;
199
+ }
200
+ static _$Ei() {
201
+ if (this.hasOwnProperty(d$1("elementProperties"))) return;
202
+ const t = n$2(this);
203
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
204
+ }
205
+ static finalize() {
206
+ if (this.hasOwnProperty(d$1("finalized"))) return;
207
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
208
+ const t = this.properties,
209
+ s = [...r$3(t), ...o$3(t)];
210
+ for (const i of s) this.createProperty(i, t[i]);
211
+ }
212
+ const t = this[Symbol.metadata];
213
+ if (null !== t) {
214
+ const s = litPropertyMetadata.get(t);
215
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
216
+ }
217
+ this._$Eh = new Map();
218
+ for (const [t, s] of this.elementProperties) {
219
+ const i = this._$Eu(t, s);
220
+ void 0 !== i && this._$Eh.set(i, t);
221
+ }
222
+ this.elementStyles = this.finalizeStyles(this.styles);
223
+ }
224
+ static finalizeStyles(s) {
225
+ const i = [];
226
+ if (Array.isArray(s)) {
227
+ const e = new Set(s.flat(1 / 0).reverse());
228
+ for (const s of e) i.unshift(c$2(s));
229
+ } else void 0 !== s && i.push(c$2(s));
230
+ return i;
231
+ }
232
+ static _$Eu(t, s) {
233
+ const i = s.attribute;
234
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
235
+ }
236
+ constructor() {
237
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
238
+ }
239
+ _$Ev() {
240
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
241
+ }
242
+ addController(t) {
243
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
244
+ }
245
+ removeController(t) {
246
+ this._$EO?.delete(t);
247
+ }
248
+ _$E_() {
249
+ const t = new Map(),
250
+ s = this.constructor.elementProperties;
251
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
252
+ t.size > 0 && (this._$Ep = t);
253
+ }
254
+ createRenderRoot() {
255
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
256
+ return S$1(t, this.constructor.elementStyles), t;
257
+ }
258
+ connectedCallback() {
259
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
260
+ }
261
+ enableUpdating(t) {}
262
+ disconnectedCallback() {
263
+ this._$EO?.forEach(t => t.hostDisconnected?.());
264
+ }
265
+ attributeChangedCallback(t, s, i) {
266
+ this._$AK(t, i);
267
+ }
268
+ _$ET(t, s) {
269
+ const i = this.constructor.elementProperties.get(t),
270
+ e = this.constructor._$Eu(t, i);
271
+ if (void 0 !== e && true === i.reflect) {
272
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u$1).toAttribute(s, i.type);
273
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
274
+ }
275
+ }
276
+ _$AK(t, s) {
277
+ const i = this.constructor,
278
+ e = i._$Eh.get(t);
279
+ if (void 0 !== e && this._$Em !== e) {
280
+ const t = i.getPropertyOptions(e),
281
+ h = "function" == typeof t.converter ? {
282
+ fromAttribute: t.converter
283
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u$1;
284
+ this._$Em = e;
285
+ const r = h.fromAttribute(s, t.type);
286
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
287
+ }
288
+ }
289
+ requestUpdate(t, s, i) {
290
+ if (void 0 !== t) {
291
+ const e = this.constructor,
292
+ h = this[t];
293
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f$1)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
294
+ this.C(t, s, i);
295
+ }
296
+ false === this.isUpdatePending && (this._$ES = this._$EP());
297
+ }
298
+ C(t, s, {
299
+ useDefault: i,
300
+ reflect: e,
301
+ wrapped: h
302
+ }, r) {
303
+ i && !(this._$Ej ??= new Map()).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), true !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), true === e && this._$Em !== t && (this._$Eq ??= new Set()).add(t));
304
+ }
305
+ async _$EP() {
306
+ this.isUpdatePending = true;
307
+ try {
308
+ await this._$ES;
309
+ } catch (t) {
310
+ Promise.reject(t);
311
+ }
312
+ const t = this.scheduleUpdate();
313
+ return null != t && (await t), !this.isUpdatePending;
314
+ }
315
+ scheduleUpdate() {
316
+ return this.performUpdate();
317
+ }
318
+ performUpdate() {
319
+ if (!this.isUpdatePending) return;
320
+ if (!this.hasUpdated) {
321
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
322
+ for (const [t, s] of this._$Ep) this[t] = s;
323
+ this._$Ep = void 0;
324
+ }
325
+ const t = this.constructor.elementProperties;
326
+ if (t.size > 0) for (const [s, i] of t) {
327
+ const {
328
+ wrapped: t
329
+ } = i,
330
+ e = this[s];
331
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
332
+ }
333
+ }
334
+ let t = false;
335
+ const s = this._$AL;
336
+ try {
337
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
338
+ } catch (s) {
339
+ throw t = false, this._$EM(), s;
340
+ }
341
+ t && this._$AE(s);
342
+ }
343
+ willUpdate(t) {}
344
+ _$AE(t) {
345
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
346
+ }
347
+ _$EM() {
348
+ this._$AL = new Map(), this.isUpdatePending = false;
349
+ }
350
+ get updateComplete() {
351
+ return this.getUpdateComplete();
352
+ }
353
+ getUpdateComplete() {
354
+ return this._$ES;
355
+ }
356
+ shouldUpdate(t) {
357
+ return true;
358
+ }
359
+ update(t) {
360
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
361
+ }
362
+ updated(t) {}
363
+ firstUpdated(t) {}
364
+ }
365
+ y.elementStyles = [], y.shadowRootOptions = {
366
+ mode: "open"
367
+ }, y[d$1("elementProperties")] = new Map(), y[d$1("finalized")] = new Map(), p$1?.({
368
+ ReactiveElement: y
369
+ }), (a$1.reactiveElementVersions ??= []).push("2.1.1");
70
370
 
71
371
  /**
72
372
  * @license
73
373
  * Copyright 2017 Google LLC
74
374
  * SPDX-License-Identifier: BSD-3-Clause
75
- */const o$2={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$2=(t=o$2,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$2(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
375
+ */
376
+ const o$2 = {
377
+ attribute: true,
378
+ type: String,
379
+ converter: u$1,
380
+ reflect: false,
381
+ hasChanged: f$1
382
+ },
383
+ r$2 = (t = o$2, e, r) => {
384
+ const {
385
+ kind: n,
386
+ metadata: i
387
+ } = r;
388
+ let s = globalThis.litPropertyMetadata.get(i);
389
+ if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map()), "setter" === n && ((t = Object.create(t)).wrapped = true), s.set(r.name, t), "accessor" === n) {
390
+ const {
391
+ name: o
392
+ } = r;
393
+ return {
394
+ set(r) {
395
+ const n = e.get.call(this);
396
+ e.set.call(this, r), this.requestUpdate(o, n, t);
397
+ },
398
+ init(e) {
399
+ return void 0 !== e && this.C(o, void 0, t, e), e;
400
+ }
401
+ };
402
+ }
403
+ if ("setter" === n) {
404
+ const {
405
+ name: o
406
+ } = r;
407
+ return function (r) {
408
+ const n = this[o];
409
+ e.call(this, r), this.requestUpdate(o, n, t);
410
+ };
411
+ }
412
+ throw Error("Unsupported decorator location: " + n);
413
+ };
414
+ function n$1(t) {
415
+ return (e, o) => "object" == typeof o ? r$2(t, e, o) : ((t, e, o) => {
416
+ const r = e.hasOwnProperty(o);
417
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
418
+ })(t, e, o);
419
+ }
76
420
 
77
421
  /**
78
422
  * @license
79
423
  * Copyright 2017 Google LLC
80
424
  * SPDX-License-Identifier: BSD-3-Clause
81
- */function r$1(r){return n$1({...r,state:true,attribute:false})}
425
+ */
426
+ function r$1(r) {
427
+ return n$1({
428
+ ...r,
429
+ state: true,
430
+ attribute: false
431
+ });
432
+ }
82
433
 
83
434
  /**
84
435
  * @license
85
436
  * Copyright 2017 Google LLC
86
437
  * SPDX-License-Identifier: BSD-3-Clause
87
438
  */
88
- const e$2=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
439
+ const e$2 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
89
440
 
90
441
  /**
91
442
  * @license
92
443
  * Copyright 2017 Google LLC
93
444
  * SPDX-License-Identifier: BSD-3-Clause
94
- */function e$1(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$2(n,s,{get(){return o(this)}})}}
445
+ */
446
+ function e$1(e, r) {
447
+ return (n, s, i) => {
448
+ const o = t => t.renderRoot?.querySelector(e) ?? null;
449
+ return e$2(n, s, {
450
+ get() {
451
+ return o(this);
452
+ }
453
+ });
454
+ };
455
+ }
95
456
 
96
457
  /**
97
458
  * @license
98
459
  * Copyright 2017 Google LLC
99
460
  * SPDX-License-Identifier: BSD-3-Clause
100
461
  */
101
- const t=globalThis,i=t.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$1="?"+h,n=`<${o$1}>`,r=document,l=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$1)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.3.1");
462
+ const t = globalThis,
463
+ i = t.trustedTypes,
464
+ s = i ? i.createPolicy("lit-html", {
465
+ createHTML: t => t
466
+ }) : void 0,
467
+ e = "$lit$",
468
+ h = `lit$${Math.random().toFixed(9).slice(2)}$`,
469
+ o$1 = "?" + h,
470
+ n = `<${o$1}>`,
471
+ r = document,
472
+ l = () => r.createComment(""),
473
+ c = t => null === t || "object" != typeof t && "function" != typeof t,
474
+ a = Array.isArray,
475
+ u = t => a(t) || "function" == typeof t?.[Symbol.iterator],
476
+ d = "[ \t\n\f\r]",
477
+ f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
478
+ v = /-->/g,
479
+ _ = />/g,
480
+ m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"),
481
+ p = /'/g,
482
+ g = /"/g,
483
+ $ = /^(?:script|style|textarea|title)$/i,
484
+ T = Symbol.for("lit-noChange"),
485
+ E = Symbol.for("lit-nothing"),
486
+ A = new WeakMap(),
487
+ C = r.createTreeWalker(r, 129);
488
+ function P(t, i) {
489
+ if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
490
+ return void 0 !== s ? s.createHTML(i) : i;
491
+ }
492
+ const V = (t, i) => {
493
+ const s = t.length - 1,
494
+ o = [];
495
+ let r,
496
+ l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "",
497
+ c = f;
498
+ for (let i = 0; i < s; i++) {
499
+ const s = t[i];
500
+ let a,
501
+ u,
502
+ d = -1,
503
+ y = 0;
504
+ for (; y < s.length && (c.lastIndex = y, u = c.exec(s), null !== u);) y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = r ?? f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
505
+ const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
506
+ l += c === f ? s + n : d >= 0 ? (o.push(a), s.slice(0, d) + e + s.slice(d) + h + x) : s + h + (-2 === d ? i : x);
507
+ }
508
+ return [P(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")), o];
509
+ };
510
+ class N {
511
+ constructor({
512
+ strings: t,
513
+ _$litType$: s
514
+ }, n) {
515
+ let r;
516
+ this.parts = [];
517
+ let c = 0,
518
+ a = 0;
519
+ const u = t.length - 1,
520
+ d = this.parts,
521
+ [f, v] = V(t, s);
522
+ if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
523
+ const t = this.el.content.firstChild;
524
+ t.replaceWith(...t.childNodes);
525
+ }
526
+ for (; null !== (r = C.nextNode()) && d.length < u;) {
527
+ if (1 === r.nodeType) {
528
+ if (r.hasAttributes()) for (const t of r.getAttributeNames()) if (t.endsWith(e)) {
529
+ const i = v[a++],
530
+ s = r.getAttribute(t).split(h),
531
+ e = /([.?@])?(.*)/.exec(i);
532
+ d.push({
533
+ type: 1,
534
+ index: c,
535
+ name: e[2],
536
+ strings: s,
537
+ ctor: "." === e[1] ? H : "?" === e[1] ? I : "@" === e[1] ? L : k
538
+ }), r.removeAttribute(t);
539
+ } else t.startsWith(h) && (d.push({
540
+ type: 6,
541
+ index: c
542
+ }), r.removeAttribute(t));
543
+ if ($.test(r.tagName)) {
544
+ const t = r.textContent.split(h),
545
+ s = t.length - 1;
546
+ if (s > 0) {
547
+ r.textContent = i ? i.emptyScript : "";
548
+ for (let i = 0; i < s; i++) r.append(t[i], l()), C.nextNode(), d.push({
549
+ type: 2,
550
+ index: ++c
551
+ });
552
+ r.append(t[s], l());
553
+ }
554
+ }
555
+ } else if (8 === r.nodeType) if (r.data === o$1) d.push({
556
+ type: 2,
557
+ index: c
558
+ });else {
559
+ let t = -1;
560
+ for (; -1 !== (t = r.data.indexOf(h, t + 1));) d.push({
561
+ type: 7,
562
+ index: c
563
+ }), t += h.length - 1;
564
+ }
565
+ c++;
566
+ }
567
+ }
568
+ static createElement(t, i) {
569
+ const s = r.createElement("template");
570
+ return s.innerHTML = t, s;
571
+ }
572
+ }
573
+ function S(t, i, s = t, e) {
574
+ if (i === T) return i;
575
+ let h = void 0 !== e ? s._$Co?.[e] : s._$Cl;
576
+ const o = c(i) ? void 0 : i._$litDirective$;
577
+ return h?.constructor !== o && (h?._$AO?.(false), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? (s._$Co ??= [])[e] = h : s._$Cl = h), void 0 !== h && (i = S(t, h._$AS(t, i.values), h, e)), i;
578
+ }
579
+ class M {
580
+ constructor(t, i) {
581
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
582
+ }
583
+ get parentNode() {
584
+ return this._$AM.parentNode;
585
+ }
586
+ get _$AU() {
587
+ return this._$AM._$AU;
588
+ }
589
+ u(t) {
590
+ const {
591
+ el: {
592
+ content: i
593
+ },
594
+ parts: s
595
+ } = this._$AD,
596
+ e = (t?.creationScope ?? r).importNode(i, true);
597
+ C.currentNode = e;
598
+ let h = C.nextNode(),
599
+ o = 0,
600
+ n = 0,
601
+ l = s[0];
602
+ for (; void 0 !== l;) {
603
+ if (o === l.index) {
604
+ let i;
605
+ 2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
606
+ }
607
+ o !== l?.index && (h = C.nextNode(), o++);
608
+ }
609
+ return C.currentNode = r, e;
610
+ }
611
+ p(t) {
612
+ let i = 0;
613
+ for (const s of this._$AV) void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
614
+ }
615
+ }
616
+ class R {
617
+ get _$AU() {
618
+ return this._$AM?._$AU ?? this._$Cv;
619
+ }
620
+ constructor(t, i, s, e) {
621
+ this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
622
+ }
623
+ get parentNode() {
624
+ let t = this._$AA.parentNode;
625
+ const i = this._$AM;
626
+ return void 0 !== i && 11 === t?.nodeType && (t = i.parentNode), t;
627
+ }
628
+ get startNode() {
629
+ return this._$AA;
630
+ }
631
+ get endNode() {
632
+ return this._$AB;
633
+ }
634
+ _$AI(t, i = this) {
635
+ t = S(this, t, i), c(t) ? t === E || null == t || "" === t ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u(t) ? this.k(t) : this._(t);
636
+ }
637
+ O(t) {
638
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
639
+ }
640
+ T(t) {
641
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
642
+ }
643
+ _(t) {
644
+ this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r.createTextNode(t)), this._$AH = t;
645
+ }
646
+ $(t) {
647
+ const {
648
+ values: i,
649
+ _$litType$: s
650
+ } = t,
651
+ e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
652
+ if (this._$AH?._$AD === e) this._$AH.p(i);else {
653
+ const t = new M(e, this),
654
+ s = t.u(this.options);
655
+ t.p(i), this.T(s), this._$AH = t;
656
+ }
657
+ }
658
+ _$AC(t) {
659
+ let i = A.get(t.strings);
660
+ return void 0 === i && A.set(t.strings, i = new N(t)), i;
661
+ }
662
+ k(t) {
663
+ a(this._$AH) || (this._$AH = [], this._$AR());
664
+ const i = this._$AH;
665
+ let s,
666
+ e = 0;
667
+ for (const h of t) e === i.length ? i.push(s = new R(this.O(l()), this.O(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
668
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
669
+ }
670
+ _$AR(t = this._$AA.nextSibling, i) {
671
+ for (this._$AP?.(false, true, i); t !== this._$AB;) {
672
+ const i = t.nextSibling;
673
+ t.remove(), t = i;
674
+ }
675
+ }
676
+ setConnected(t) {
677
+ void 0 === this._$AM && (this._$Cv = t, this._$AP?.(t));
678
+ }
679
+ }
680
+ class k {
681
+ get tagName() {
682
+ return this.element.tagName;
683
+ }
684
+ get _$AU() {
685
+ return this._$AM._$AU;
686
+ }
687
+ constructor(t, i, s, e, h) {
688
+ this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = E;
689
+ }
690
+ _$AI(t, i = this, s, e) {
691
+ const h = this.strings;
692
+ let o = false;
693
+ if (void 0 === h) t = S(this, t, i, 0), o = !c(t) || t !== this._$AH && t !== T, o && (this._$AH = t);else {
694
+ const e = t;
695
+ let n, r;
696
+ for (t = h[0], n = 0; n < h.length - 1; n++) r = S(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
697
+ }
698
+ o && !e && this.j(t);
699
+ }
700
+ j(t) {
701
+ t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
702
+ }
703
+ }
704
+ class H extends k {
705
+ constructor() {
706
+ super(...arguments), this.type = 3;
707
+ }
708
+ j(t) {
709
+ this.element[this.name] = t === E ? void 0 : t;
710
+ }
711
+ }
712
+ class I extends k {
713
+ constructor() {
714
+ super(...arguments), this.type = 4;
715
+ }
716
+ j(t) {
717
+ this.element.toggleAttribute(this.name, !!t && t !== E);
718
+ }
719
+ }
720
+ class L extends k {
721
+ constructor(t, i, s, e, h) {
722
+ super(t, i, s, e, h), this.type = 5;
723
+ }
724
+ _$AI(t, i = this) {
725
+ if ((t = S(this, t, i, 0) ?? E) === T) return;
726
+ const s = this._$AH,
727
+ e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive,
728
+ h = t !== E && (s === E || e);
729
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
730
+ }
731
+ handleEvent(t) {
732
+ "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
733
+ }
734
+ }
735
+ class z {
736
+ constructor(t, i, s) {
737
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
738
+ }
739
+ get _$AU() {
740
+ return this._$AM._$AU;
741
+ }
742
+ _$AI(t) {
743
+ S(this, t);
744
+ }
745
+ }
746
+ const j = t.litHtmlPolyfillSupport;
747
+ j?.(N, R), (t.litHtmlVersions ??= []).push("3.3.1");
102
748
 
103
749
  /**
104
750
  * @license
105
751
  * Copyright 2018 Google LLC
106
752
  * SPDX-License-Identifier: BSD-3-Clause
107
- */const o=o=>o??E;
753
+ */
754
+ const o = o => o ?? E;
108
755
 
109
756
  var _M3eSliderThumbElement_instances, _M3eSliderThumbElement_labelText_get;
110
757
  /**
@@ -157,168 +804,53 @@ var _M3eSliderThumbElement_instances, _M3eSliderThumbElement_labelText_get;
157
804
  * @cssprop --m3e-slider-label-tracking - Letter spacing of the label text.
158
805
  */
159
806
  let M3eSliderThumbElement = class M3eSliderThumbElement extends Dirty(Touched(FormAssociated(Focusable(Disabled(AttachInternals(Role(LitElement, "slider"))))))) {
160
- constructor() {
161
- super(...arguments);
162
- _M3eSliderThumbElement_instances.add(this);
163
- /**
164
- * The value of the thumb.
165
- * @default null
166
- */
167
- this.value = null;
168
- }
169
- /** @inheritdoc */
170
- get [(_M3eSliderThumbElement_instances = new WeakSet(), formValue)]() {
171
- return this.value?.toString() ?? null;
172
- }
173
- /** @inheritdoc */
174
- firstUpdated(_changedProperties) {
175
- super.firstUpdated(_changedProperties);
176
- this._focusRing?.attach(this);
177
- }
178
- /** @inheritdoc */
179
- update(changedProperties) {
180
- super.update(changedProperties);
181
- if (changedProperties.has("value")) {
182
- this.dispatchEvent(new Event("value-change", { bubbles: true }));
183
- }
184
- }
185
- /** @inheritdoc */
186
- render() {
187
- return html `<div class="label" aria-hidden="true">${__classPrivateFieldGet(this, _M3eSliderThumbElement_instances, "a", _M3eSliderThumbElement_labelText_get)}</div>
188
- <div class="base">
189
- <m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring>
190
- <div class="touch" aria-hidden="true"></div>
191
- <div class="wrapper">
192
- <div class="handle"></div>
193
- </div>
194
- </div>`;
807
+ constructor() {
808
+ super(...arguments);
809
+ _M3eSliderThumbElement_instances.add(this);
810
+ /**
811
+ * The value of the thumb.
812
+ * @default null
813
+ */
814
+ this.value = null;
815
+ }
816
+ /** @inheritdoc */
817
+ get [(_M3eSliderThumbElement_instances = new WeakSet(), formValue)]() {
818
+ return this.value?.toString() ?? null;
819
+ }
820
+ /** @inheritdoc */
821
+ firstUpdated(_changedProperties) {
822
+ super.firstUpdated(_changedProperties);
823
+ this._focusRing?.attach(this);
824
+ }
825
+ /** @inheritdoc */
826
+ update(changedProperties) {
827
+ super.update(changedProperties);
828
+ if (changedProperties.has("value")) {
829
+ this.dispatchEvent(new Event("value-change", {
830
+ bubbles: true
831
+ }));
195
832
  }
833
+ }
834
+ /** @inheritdoc */
835
+ render() {
836
+ return html`<div class="label" aria-hidden="true">${__classPrivateFieldGet(this, _M3eSliderThumbElement_instances, "a", _M3eSliderThumbElement_labelText_get)}</div><div class="base"><m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring><div class="touch" aria-hidden="true"></div><div class="wrapper"><div class="handle"></div></div></div>`;
837
+ }
196
838
  };
197
839
  _M3eSliderThumbElement_labelText_get = function _M3eSliderThumbElement_labelText_get() {
198
- return this.closest("m3e-slider")?.displayWith?.(this.value) ?? this.value?.toString() ?? "";
840
+ return this.closest("m3e-slider")?.displayWith?.(this.value) ?? this.value?.toString() ?? "";
199
841
  };
200
842
  /** The styles of the element. */
201
- M3eSliderThumbElement.styles = css `
202
- :host {
203
- display: block;
204
- box-sizing: border-box;
205
- position: absolute;
206
- outline: none;
207
- top: 0;
208
- bottom: 0;
209
- border-radius: var(--m3e-slider-thumb-shape, ${DesignToken.shape.corner.full});
210
- user-select: none;
211
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
212
- }
213
- .base {
214
- box-sizing: border-box;
215
- vertical-align: middle;
216
- display: inline-flex;
217
- align-items: center;
218
- justify-content: center;
219
- position: relative;
220
- width: 100%;
221
- height: 100%;
222
- border-radius: inherit;
223
- }
224
- .touch {
225
- position: absolute;
226
- height: 3rem;
227
- left: 0;
228
- right: 0;
229
- touch-action: none;
230
- }
231
- .wrapper {
232
- display: inline-flex;
233
- justify-content: center;
234
- height: 100%;
235
- border-radius: inherit;
236
- width: calc(var(--m3e-slider-thumb-width, 0.25rem) + calc(var(--m3e-slider-thumb-padding, 0.375em) * 2));
237
- }
238
- .focus-ring {
239
- --m3e-focus-ring-growth-factor: 1.5;
240
- top: calc(0px - var(--m3e-focus-ring-thickness, 0.1875rem));
241
- bottom: calc(0px - var(--m3e-focus-ring-thickness, 0.1875rem));
242
- left: var(--m3e-focus-ring-thickness, 0.1875rem);
243
- right: var(--m3e-focus-ring-thickness, 0.1875rem);
244
- }
245
- .label {
246
- user-select: none;
247
- position: absolute;
248
- display: flex;
249
- align-items: center;
250
- justify-content: center;
251
- visibility: var(--_slider-label-visibility, hidden);
252
- opacity: var(--_slider-label-opacity, 0);
253
- transform: var(--_slider-label-transform, scale(0));
254
- transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
255
- transform ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
256
- visibility ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard} allow-discrete`)};
257
- width: var(--m3e-slider-label-width, 3rem);
258
- height: var(--_m3e-slider-label-height, 2.75rem);
259
- top: calc(0px - var(--_m3e-slider-label-height, 2.75rem) - var(--_m3e-slider-label-margin, 0.25rem));
260
- left: calc(0px - 100%);
261
- border-radius: var(--m3e-slider-label-shape, ${DesignToken.shape.corner.full});
262
- background-color: var(--m3e-slider-label-container-color, ${DesignToken.color.inverseSurface});
263
- color: var(--m3e-slider-label-color, ${DesignToken.color.inverseOnSurface});
264
- font-size: var(--m3e-slider-label-font-size, ${DesignToken.typescale.standard.label.medium.fontSize});
265
- font-weight: var(--m3e-slider-label-font-weight, ${DesignToken.typescale.standard.label.medium.fontWeight});
266
- line-height: var(--m3e-slider-label-line-height, ${DesignToken.typescale.standard.label.medium.lineHeight});
267
- letter-spacing: var(--m3e-slider-label-tracking, ${DesignToken.typescale.standard.label.medium.tracking});
268
- }
269
- @starting-style {
270
- .label {
271
- opacity: 0;
272
- transform: scale(0);
273
- }
274
- }
275
- .handle {
276
- height: 100%;
277
- width: var(--m3e-slider-thumb-width, 0.25rem);
278
- border-radius: inherit;
279
- transition: ${unsafeCSS(`width ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};
280
- }
281
- :host(:active:not([aria-disabled="true"])) .handle {
282
- width: var(--m3e-slider-thumb-pressed-width, 0.125rem);
283
- }
284
- :host(:not([aria-disabled="true"])) .handle {
285
- background-color: var(--m3e-slider-thumb-color, ${DesignToken.color.primary});
286
- }
287
- :host([aria-disabled="true"]) .handle {
288
- opacity: var(--m3e-slider-thumb-disabled-opacity, 38%);
289
- background-color: var(--m3e-slider-thumb-disabled-color, ${DesignToken.color.onSurface});
290
- }
291
- @media (prefers-reduced-motion) {
292
- .label {
293
- transition: none;
294
- }
295
- }
296
- @media (forced-colors: active) {
297
- .label {
298
- forced-color-adjust: none;
299
- background-color: CanvasText;
300
- color: Canvas;
301
- }
302
- :host(:not([aria-disabled="true"])) .handle {
303
- background-color: CanvasText;
304
- }
305
- :host([aria-disabled="true"]) .handle {
306
- opacity: unset;
307
- background-color: GrayText;
308
- }
309
- }
310
- `;
311
- __decorate([
312
- e$1(".focus-ring")
313
- ], M3eSliderThumbElement.prototype, "_focusRing", void 0);
314
- __decorate([
315
- n$1({ type: Number, reflect: true })
316
- ], M3eSliderThumbElement.prototype, "value", void 0);
317
- M3eSliderThumbElement = __decorate([
318
- t$2("m3e-slider-thumb")
319
- ], M3eSliderThumbElement);
843
+ M3eSliderThumbElement.styles = css`:host { display: block; box-sizing: border-box; position: absolute; outline: none; top: 0; bottom: 0; border-radius: var(--m3e-slider-thumb-shape, ${DesignToken.shape.corner.full}); user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { box-sizing: border-box; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; position: relative; width: 100%; height: 100%; border-radius: inherit; } .touch { position: absolute; height: 3rem; left: 0; right: 0; touch-action: none; } .wrapper { display: inline-flex; justify-content: center; height: 100%; border-radius: inherit; width: calc(var(--m3e-slider-thumb-width, 0.25rem) + calc(var(--m3e-slider-thumb-padding, 0.375em) * 2)); } .focus-ring { --m3e-focus-ring-growth-factor: 1.5; top: calc(0px - var(--m3e-focus-ring-thickness, 0.1875rem)); bottom: calc(0px - var(--m3e-focus-ring-thickness, 0.1875rem)); left: var(--m3e-focus-ring-thickness, 0.1875rem); right: var(--m3e-focus-ring-thickness, 0.1875rem); } .label { user-select: none; position: absolute; display: flex; align-items: center; justify-content: center; visibility: var(--_slider-label-visibility, hidden); opacity: var(--_slider-label-opacity, 0); transform: var(--_slider-label-transform, scale(0)); transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
844
+ transform ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
845
+ visibility ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard} allow-discrete`)}; width: var(--m3e-slider-label-width, 3rem); height: var(--_m3e-slider-label-height, 2.75rem); top: calc(0px - var(--_m3e-slider-label-height, 2.75rem) - var(--_m3e-slider-label-margin, 0.25rem)); inset-inline-start: calc(0px - 100%); border-radius: var(--m3e-slider-label-shape, ${DesignToken.shape.corner.full}); background-color: var(--m3e-slider-label-container-color, ${DesignToken.color.inverseSurface}); color: var(--m3e-slider-label-color, ${DesignToken.color.inverseOnSurface}); font-size: var(--m3e-slider-label-font-size, ${DesignToken.typescale.standard.label.medium.fontSize}); font-weight: var(--m3e-slider-label-font-weight, ${DesignToken.typescale.standard.label.medium.fontWeight}); line-height: var(--m3e-slider-label-line-height, ${DesignToken.typescale.standard.label.medium.lineHeight}); letter-spacing: var(--m3e-slider-label-tracking, ${DesignToken.typescale.standard.label.medium.tracking}); } @starting-style { .label { opacity: 0; transform: scale(0); } } .handle { height: 100%; width: var(--m3e-slider-thumb-width, 0.25rem); border-radius: inherit; transition: ${unsafeCSS(`width ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)}; } :host(:active:not([aria-disabled="true"])) .handle { width: var(--m3e-slider-thumb-pressed-width, 0.125rem); } :host(:not([aria-disabled="true"])) .handle { background-color: var(--m3e-slider-thumb-color, ${DesignToken.color.primary}); } :host([aria-disabled="true"]) .handle { opacity: var(--m3e-slider-thumb-disabled-opacity, 38%); background-color: var(--m3e-slider-thumb-disabled-color, ${DesignToken.color.onSurface}); } @media (prefers-reduced-motion) { .label { transition: none; } } @media (forced-colors: active) { .label { forced-color-adjust: none; background-color: CanvasText; color: Canvas; } :host(:not([aria-disabled="true"])) .handle { background-color: CanvasText; } :host([aria-disabled="true"]) .handle { opacity: unset; background-color: GrayText; } }`;
846
+ __decorate([e$1(".focus-ring")], M3eSliderThumbElement.prototype, "_focusRing", void 0);
847
+ __decorate([n$1({
848
+ type: Number,
849
+ reflect: true
850
+ })], M3eSliderThumbElement.prototype, "value", void 0);
851
+ M3eSliderThumbElement = __decorate([t$2("m3e-slider-thumb")], M3eSliderThumbElement);
320
852
 
321
- var _M3eSliderElement_instances, _M3eSliderElement_thumbs, _M3eSliderElement_activeThumb, _M3eSliderElement_cachedWidth, _M3eSliderElement_cachedThumbWidth, _M3eSliderElement_cachedLeft, _M3eSliderElement_renderTick, _M3eSliderElement_handleSlotChange, _M3eSliderElement_updateThumbs, _M3eSliderElement_pointFromValue, _M3eSliderElement_valueFromPoint, _M3eSliderElement_updateCachedDimensions, _M3eSliderElement_updateDimensions, _M3eSliderElement_updateTicks, _M3eSliderElement_handlePointerDown, _M3eSliderElement_handlePointerMove, _M3eSliderElement_handlePointerUp, _M3eSliderElement_handleKeyDown, _M3eSliderElement_handleThumbChange, _M3eSliderElement_changeThumb;
853
+ var _M3eSliderElement_instances, _M3eSliderElement_directionalitySubscription, _M3eSliderElement_thumbs, _M3eSliderElement_activeThumb, _M3eSliderElement_cachedWidth, _M3eSliderElement_cachedThumbWidth, _M3eSliderElement_cachedLeft, _M3eSliderElement_renderTick, _M3eSliderElement_handleSlotChange, _M3eSliderElement_updateThumbs, _M3eSliderElement_pointFromValue, _M3eSliderElement_valueFromPoint, _M3eSliderElement_updateCachedDimensions, _M3eSliderElement_updateDimensions, _M3eSliderElement_updateTicks, _M3eSliderElement_handlePointerDown, _M3eSliderElement_handlePointerMove, _M3eSliderElement_handlePointerUp, _M3eSliderElement_handleKeyDown, _M3eSliderElement_handleThumbChange, _M3eSliderElement_changeThumb;
322
854
  /**
323
855
  * Allows for the selection of numeric values from a range.
324
856
  *
@@ -390,103 +922,110 @@ var _M3eSliderElement_instances, _M3eSliderElement_thumbs, _M3eSliderElement_act
390
922
  * @cssprop --m3e-slider-disabled-tick-inactive-color - Color of inactive ticks when disabled.
391
923
  */
392
924
  let M3eSliderElement = class M3eSliderElement extends LitElement {
393
- constructor() {
394
- super();
395
- _M3eSliderElement_instances.add(this);
396
- /** @private */
397
- this._ticks = new Array();
398
- /** @private */ _M3eSliderElement_thumbs.set(this, new Array());
399
- /** @private */ _M3eSliderElement_activeThumb.set(this, void 0);
400
- /** @private */ _M3eSliderElement_cachedWidth.set(this, 0);
401
- /** @private */ _M3eSliderElement_cachedThumbWidth.set(this, 0);
402
- /** @private */ _M3eSliderElement_cachedLeft.set(this, 0);
403
- /**
404
- * The size of the slider.
405
- * @default "extra-small"
406
- */
407
- this.size = "extra-small";
408
- /**
409
- * Whether the element is disabled.
410
- * @default false
411
- */
412
- this.disabled = false;
413
- /**
414
- * Whether to show tick marks.
415
- * @default false
416
- */
417
- this.discrete = false;
418
- /**
419
- * The minimum allowable value.
420
- * @default 0
421
- */
422
- this.min = 0;
423
- /**
424
- * The maximum allowable value.
425
- * @default 100
426
- */
427
- this.max = 100;
428
- /**
429
- * The value at which the thumb will snap.
430
- * @default 1
431
- */
432
- this.step = 1;
433
- /**
434
- * Whether to show value labels when activated.
435
- * @default false
436
- */
437
- this.labelled = false;
438
- /** The function used to format display values. */
439
- this.displayWith = null;
440
- new ResizeController(this, { callback: () => __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateDimensions).call(this, true) });
441
- }
442
- /** The thumbs used to select values. */
443
- get thumbs() {
444
- return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f");
445
- }
446
- /** Whether the slider is a range slider. */
447
- get isRange() {
448
- return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").length > 1;
449
- }
450
- /** The thumb used to select a value. */
451
- get thumb() {
452
- return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[0] ?? null;
453
- }
454
- /** The thumb used to select the lower value of a range slider. */
455
- get lowerThumb() {
456
- return this.thumb;
457
- }
458
- /** The thumb used to select the upper value of a range slider. */
459
- get upperThumb() {
460
- return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[1] ?? null;
461
- }
462
- /** @inheritdoc */
463
- updated(_changedProperties) {
464
- super.updated(_changedProperties);
465
- if (_changedProperties.has("disabled")) {
466
- __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").forEach((x) => (x.disabled = this.disabled));
467
- }
468
- }
469
- /** @inheritdoc */
470
- render() {
471
- return html `<div
472
- class="base"
473
- tabindex="${o(!this.disabled ? "-1" : undefined)}"
474
- @pointerdown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerDown)}"
475
- @pointermove="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerMove)}"
476
- @pointerup="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerUp)}"
477
- @keydown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleKeyDown)}"
478
- @value-change="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleThumbChange)}"
479
- >
480
- <div class="track" aria-hidden="true">
481
- <div class="track-inactive start"></div>
482
- <div class="track-active"></div>
483
- <div class="track-inactive end"></div>
484
- </div>
485
- <div class="ticks" aria-hidden="true">${this._ticks.map((x) => __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_renderTick).call(this, x))}</div>
486
- <slot @slotchange="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleSlotChange)}"></slot>
487
- </div>`;
925
+ constructor() {
926
+ super();
927
+ _M3eSliderElement_instances.add(this);
928
+ /** @private */
929
+ _M3eSliderElement_directionalitySubscription.set(this, void 0);
930
+ /** @private */
931
+ this._ticks = new Array();
932
+ /** @private */
933
+ _M3eSliderElement_thumbs.set(this, new Array());
934
+ /** @private */
935
+ _M3eSliderElement_activeThumb.set(this, void 0);
936
+ /** @private */
937
+ _M3eSliderElement_cachedWidth.set(this, 0);
938
+ /** @private */
939
+ _M3eSliderElement_cachedThumbWidth.set(this, 0);
940
+ /** @private */
941
+ _M3eSliderElement_cachedLeft.set(this, 0);
942
+ /**
943
+ * The size of the slider.
944
+ * @default "extra-small"
945
+ */
946
+ this.size = "extra-small";
947
+ /**
948
+ * Whether the element is disabled.
949
+ * @default false
950
+ */
951
+ this.disabled = false;
952
+ /**
953
+ * Whether to show tick marks.
954
+ * @default false
955
+ */
956
+ this.discrete = false;
957
+ /**
958
+ * The minimum allowable value.
959
+ * @default 0
960
+ */
961
+ this.min = 0;
962
+ /**
963
+ * The maximum allowable value.
964
+ * @default 100
965
+ */
966
+ this.max = 100;
967
+ /**
968
+ * The value at which the thumb will snap.
969
+ * @default 1
970
+ */
971
+ this.step = 1;
972
+ /**
973
+ * Whether to show value labels when activated.
974
+ * @default false
975
+ */
976
+ this.labelled = false;
977
+ /** The function used to format display values. */
978
+ this.displayWith = null;
979
+ new ResizeController(this, {
980
+ callback: () => __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateDimensions).call(this, true)
981
+ });
982
+ }
983
+ /** The thumbs used to select values. */
984
+ get thumbs() {
985
+ return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f");
986
+ }
987
+ /** Whether the slider is a range slider. */
988
+ get isRange() {
989
+ return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").length > 1;
990
+ }
991
+ /** The thumb used to select a value. */
992
+ get thumb() {
993
+ return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[0] ?? null;
994
+ }
995
+ /** The thumb used to select the lower value of a range slider. */
996
+ get lowerThumb() {
997
+ return this.thumb;
998
+ }
999
+ /** The thumb used to select the upper value of a range slider. */
1000
+ get upperThumb() {
1001
+ return __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[1] ?? null;
1002
+ }
1003
+ /** @inheritdoc */
1004
+ connectedCallback() {
1005
+ super.connectedCallback();
1006
+ __classPrivateFieldSet(this, _M3eSliderElement_directionalitySubscription, M3eDirectionality.observe(() => {
1007
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateDimensions).call(this, true);
1008
+ this.requestUpdate();
1009
+ }), "f");
1010
+ }
1011
+ /** @inheritdoc */
1012
+ disconnectedCallback() {
1013
+ super.disconnectedCallback();
1014
+ __classPrivateFieldGet(this, _M3eSliderElement_directionalitySubscription, "f")?.call(this);
1015
+ }
1016
+ /** @inheritdoc */
1017
+ updated(_changedProperties) {
1018
+ super.updated(_changedProperties);
1019
+ if (_changedProperties.has("disabled")) {
1020
+ __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").forEach(x => x.disabled = this.disabled);
488
1021
  }
1022
+ }
1023
+ /** @inheritdoc */
1024
+ render() {
1025
+ return html`<div class="base" tabindex="${o(!this.disabled ? "-1" : undefined)}" @pointerdown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerDown)}" @pointermove="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerMove)}" @pointerup="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerUp)}" @keydown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleKeyDown)}" @value-change="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleThumbChange)}"><div class="track" aria-hidden="true"><div class="track-inactive start"></div><div class="track-active"></div><div class="track-inactive end"></div></div><div class="ticks" aria-hidden="true">${this._ticks.map(x => __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_renderTick).call(this, x))}</div><slot @slotchange="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleSlotChange)}"></slot></div>`;
1026
+ }
489
1027
  };
1028
+ _M3eSliderElement_directionalitySubscription = new WeakMap();
490
1029
  _M3eSliderElement_thumbs = new WeakMap();
491
1030
  _M3eSliderElement_activeThumb = new WeakMap();
492
1031
  _M3eSliderElement_cachedWidth = new WeakMap();
@@ -494,510 +1033,299 @@ _M3eSliderElement_cachedThumbWidth = new WeakMap();
494
1033
  _M3eSliderElement_cachedLeft = new WeakMap();
495
1034
  _M3eSliderElement_instances = new WeakSet();
496
1035
  _M3eSliderElement_renderTick = function _M3eSliderElement_renderTick(tick) {
497
- return html `<div
498
- class="tick ${tick.active ? "active" : "inactive"}"
499
- style="${safeStyleMap({
500
- transform: `translate(${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, tick.value)}px, 0)`,
501
- })}"
502
- ></div>`;
1036
+ return html`<div class="tick ${tick.active ? "active" : "inactive"}" style="${safeStyleMap({
1037
+ transform: `translate(${M3eDirectionality.current === "rtl" ? -__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, tick.value) : __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, tick.value)}px, 0)`
1038
+ })}"></div>`;
503
1039
  };
504
1040
  _M3eSliderElement_handleSlotChange = function _M3eSliderElement_handleSlotChange(e) {
505
- __classPrivateFieldSet(this, _M3eSliderElement_thumbs, e.target
506
- .assignedElements({ flatten: true })
507
- .filter((x) => x instanceof M3eSliderThumbElement), "f");
508
- if (__classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").length > 2) {
509
- __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").length = 2;
510
- }
511
- if (this.isRange) {
512
- this._base?.style.setProperty("--_slider-active-track-middle-shape", `0`);
513
- }
514
- else {
515
- this._base?.style.removeProperty("--_slider-active-track-middle-shape");
516
- }
517
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateThumbs).call(this);
1041
+ __classPrivateFieldSet(this, _M3eSliderElement_thumbs, e.target.assignedElements({
1042
+ flatten: true
1043
+ }).filter(x => x instanceof M3eSliderThumbElement), "f");
1044
+ if (__classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").length > 2) {
1045
+ __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").length = 2;
1046
+ }
1047
+ if (this.isRange) {
1048
+ this._base?.style.setProperty("--_slider-active-track-middle-shape", `0`);
1049
+ } else {
1050
+ this._base?.style.removeProperty("--_slider-active-track-middle-shape");
1051
+ }
1052
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateThumbs).call(this);
518
1053
  };
519
1054
  _M3eSliderElement_updateThumbs = function _M3eSliderElement_updateThumbs() {
520
- __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").forEach((thumb, i) => {
521
- if (this.disabled) {
522
- thumb.disabled = true;
523
- }
524
- thumb.ariaValueMin = `${__classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[i - 1]?.value ?? this.min}`;
525
- thumb.ariaValueMax = `${__classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[i + 1]?.value ?? this.max}`;
526
- thumb.ariaValueNow = `${thumb.value ?? __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[i - 1]?.value ?? this.min}`;
527
- });
1055
+ __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f").forEach((thumb, i) => {
1056
+ if (this.disabled) {
1057
+ thumb.disabled = true;
1058
+ }
1059
+ thumb.ariaValueMin = `${__classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[i - 1]?.value ?? this.min}`;
1060
+ thumb.ariaValueMax = `${__classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[i + 1]?.value ?? this.max}`;
1061
+ thumb.ariaValueNow = `${thumb.value ?? __classPrivateFieldGet(this, _M3eSliderElement_thumbs, "f")[i - 1]?.value ?? this.min}`;
1062
+ });
528
1063
  };
529
1064
  _M3eSliderElement_pointFromValue = function _M3eSliderElement_pointFromValue(value) {
530
- return (__classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")) * ((value - this.min) / (this.max - this.min));
1065
+ return (__classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")) * ((value - this.min) / (this.max - this.min));
531
1066
  };
532
1067
  _M3eSliderElement_valueFromPoint = function _M3eSliderElement_valueFromPoint(e) {
533
- const pos = e.clientX - __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f");
534
- const step = this.step === 0 ? 1 : this.step;
535
- const numSteps = Math.floor((this.max - this.min) / step);
536
- const percentage = pos / __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f");
537
- const fixedPercentage = Math.round(percentage * numSteps) / numSteps;
538
- const impreciseValue = fixedPercentage * (this.max - this.min) + this.min;
539
- return Math.round(impreciseValue / step) * step;
1068
+ const pos = M3eDirectionality.current === "rtl" ? __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f") + __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - e.clientX : e.clientX - __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f");
1069
+ const step = this.step === 0 ? 1 : this.step;
1070
+ const numSteps = Math.floor((this.max - this.min) / step);
1071
+ const percentage = pos / __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f");
1072
+ const fixedPercentage = Math.round(percentage * numSteps) / numSteps;
1073
+ const impreciseValue = fixedPercentage * (this.max - this.min) + this.min;
1074
+ return Math.round(impreciseValue / step) * step;
540
1075
  };
541
1076
  _M3eSliderElement_updateCachedDimensions = function _M3eSliderElement_updateCachedDimensions(force = false) {
542
- if (!this.lowerThumb)
543
- return;
544
- __classPrivateFieldSet(this, _M3eSliderElement_cachedWidth, !force && __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") > 0 ? __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") : this.clientWidth, "f");
545
- __classPrivateFieldSet(this, _M3eSliderElement_cachedThumbWidth, !force && __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f") > 0 ? __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f") : this.lowerThumb.clientWidth, "f");
546
- __classPrivateFieldSet(this, _M3eSliderElement_cachedLeft, !force && __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f") > 0 ? __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f") : this.getBoundingClientRect().left, "f");
1077
+ if (!this.lowerThumb) return;
1078
+ __classPrivateFieldSet(this, _M3eSliderElement_cachedWidth, !force && __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") > 0 ? __classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") : this.clientWidth, "f");
1079
+ __classPrivateFieldSet(this, _M3eSliderElement_cachedThumbWidth, !force && __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f") > 0 ? __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f") : this.lowerThumb.clientWidth, "f");
1080
+ __classPrivateFieldSet(this, _M3eSliderElement_cachedLeft, !force && __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f") > 0 ? __classPrivateFieldGet(this, _M3eSliderElement_cachedLeft, "f") : this.getBoundingClientRect().left, "f");
547
1081
  };
548
1082
  _M3eSliderElement_updateDimensions = function _M3eSliderElement_updateDimensions(force = false) {
549
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateCachedDimensions).call(this, force);
550
- if (!this.lowerThumb)
551
- return;
552
- const lowerValue = this.lowerThumb.value ?? this.min;
553
- const lowerPos = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, lowerValue);
554
- this.lowerThumb.style.transform = `translate(${lowerPos}px, 0)`;
555
- if (!this.upperThumb) {
556
- this._base?.classList.toggle("range", false);
557
- this._base?.style.setProperty("--_slider-active-track-size", `${lowerPos}px`);
558
- this._base?.style.setProperty("--_slider-inactive-track-after-offset", `${lowerPos + __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
559
- this._base?.style.setProperty("--_slider-inactive-track-after-size", `${__classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - lowerPos - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
560
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateTicks).call(this, (i) => i < lowerValue);
561
- }
562
- else {
563
- const upperValue = this.upperThumb.value ?? lowerValue;
564
- const upperPos = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, upperValue);
565
- this.upperThumb.style.transform = `translate(${upperPos}px, 0)`;
566
- this._base?.classList.toggle("range", true);
567
- this._base?.style.setProperty("--_slider-inactive-track-before-size", `${lowerPos}px`);
568
- this._base?.style.setProperty("--_slider-active-track-offset", `${lowerPos + __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
569
- this._base?.style.setProperty("--_slider-active-track-size", `${upperPos - lowerPos - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
570
- this._base?.style.setProperty("--_slider-inactive-track-after-offset", `${upperPos + __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
571
- this._base?.style.setProperty("--_slider-inactive-track-after-size", `${__classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f") - upperPos}px`);
572
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateTicks).call(this, (i) => i > lowerValue && i < upperValue);
573
- }
1083
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateCachedDimensions).call(this, force);
1084
+ if (!this.lowerThumb) return;
1085
+ const lowerValue = this.lowerThumb.value ?? this.min;
1086
+ const lowerPos = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, lowerValue);
1087
+ this.lowerThumb.style.transform = `translate(${M3eDirectionality.current === "rtl" ? -lowerPos : lowerPos}px, 0)`;
1088
+ if (!this.upperThumb) {
1089
+ this._base?.classList.toggle("range", false);
1090
+ this._base?.style.setProperty("--_slider-active-track-size", `${lowerPos}px`);
1091
+ this._base?.style.setProperty("--_slider-inactive-track-after-offset", `${lowerPos + __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
1092
+ this._base?.style.setProperty("--_slider-inactive-track-after-size", `${__classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - lowerPos - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
1093
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateTicks).call(this, i => i < lowerValue);
1094
+ } else {
1095
+ const upperValue = this.upperThumb.value ?? lowerValue;
1096
+ const upperPos = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_pointFromValue).call(this, upperValue);
1097
+ this.upperThumb.style.transform = `translate(${M3eDirectionality.current === "rtl" ? -upperPos : upperPos}px, 0)`;
1098
+ this._base?.classList.toggle("range", true);
1099
+ this._base?.style.setProperty("--_slider-inactive-track-before-size", `${lowerPos}px`);
1100
+ this._base?.style.setProperty("--_slider-active-track-offset", `${lowerPos + __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
1101
+ this._base?.style.setProperty("--_slider-active-track-size", `${upperPos - lowerPos - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
1102
+ this._base?.style.setProperty("--_slider-inactive-track-after-offset", `${upperPos + __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f")}px`);
1103
+ this._base?.style.setProperty("--_slider-inactive-track-after-size", `${__classPrivateFieldGet(this, _M3eSliderElement_cachedWidth, "f") - __classPrivateFieldGet(this, _M3eSliderElement_cachedThumbWidth, "f") - upperPos}px`);
1104
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateTicks).call(this, i => i > lowerValue && i < upperValue);
1105
+ }
574
1106
  };
575
1107
  _M3eSliderElement_updateTicks = function _M3eSliderElement_updateTicks(active) {
576
- this._ticks = [];
577
- if (this.discrete && this.step > 1) {
578
- for (let i = this.min; i <= this.max; i += this.step) {
579
- this._ticks.push({ value: i, active: active(i) });
580
- }
1108
+ this._ticks = [];
1109
+ if (this.discrete && this.step > 1) {
1110
+ for (let i = this.min; i <= this.max; i += this.step) {
1111
+ this._ticks.push({
1112
+ value: i,
1113
+ active: active(i)
1114
+ });
581
1115
  }
582
- else {
583
- this._ticks.push({ value: this.min, active: active(this.min) });
584
- if (this.min < 0 && this.max > 0) {
585
- this._ticks.push({ value: 0, active: active(0) });
586
- }
587
- this._ticks.push({ value: this.max, active: active(this.max) });
1116
+ } else {
1117
+ this._ticks.push({
1118
+ value: this.min,
1119
+ active: active(this.min)
1120
+ });
1121
+ if (this.min < 0 && this.max > 0) {
1122
+ this._ticks.push({
1123
+ value: 0,
1124
+ active: active(0)
1125
+ });
588
1126
  }
1127
+ this._ticks.push({
1128
+ value: this.max,
1129
+ active: active(this.max)
1130
+ });
1131
+ }
589
1132
  };
590
1133
  _M3eSliderElement_handlePointerDown = function _M3eSliderElement_handlePointerDown(e) {
591
- if (e.pointerType === "mouse" && e.button > 1)
592
- return;
593
- if (!this.lowerThumb || this.disabled)
594
- return;
595
- if (e.target instanceof HTMLElement) {
596
- e.target.setPointerCapture(e.pointerId);
597
- }
598
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, e.composedPath().find((x) => x instanceof M3eSliderThumbElement), "f");
599
- if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) {
600
- return;
1134
+ if (e.pointerType === "mouse" && e.button > 1) return;
1135
+ if (!this.lowerThumb || this.disabled) return;
1136
+ if (e.target instanceof HTMLElement) {
1137
+ e.target.setPointerCapture(e.pointerId);
1138
+ }
1139
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, e.composedPath().find(x => x instanceof M3eSliderThumbElement), "f");
1140
+ if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) {
1141
+ return;
1142
+ }
1143
+ const value = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_valueFromPoint).call(this, e);
1144
+ if (!this.upperThumb) {
1145
+ if (!this.lowerThumb.disabled) {
1146
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.lowerThumb, value, true);
1147
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.lowerThumb, "f");
601
1148
  }
602
- const value = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_valueFromPoint).call(this, e);
603
- if (!this.upperThumb) {
604
- if (!this.lowerThumb.disabled) {
605
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.lowerThumb, value, true);
606
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.lowerThumb, "f");
607
- }
608
- }
609
- else {
610
- const lowerValue = this.lowerThumb.value ?? this.min;
611
- const upperValue = this.upperThumb.value ?? lowerValue;
612
- if (value < lowerValue) {
613
- if (!this.lowerThumb.disabled) {
614
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.lowerThumb, value, true);
615
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.lowerThumb, "f");
616
- }
617
- }
618
- else if (value > upperValue) {
619
- if (!this.upperThumb.disabled) {
620
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.upperThumb, value, true);
621
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.upperThumb, "f");
622
- }
623
- }
624
- else {
625
- const mid = (lowerValue + upperValue) / 2;
626
- if (value < mid && !this.lowerThumb.disabled) {
627
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.lowerThumb, value, true);
628
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.lowerThumb, "f");
629
- }
630
- else if (!this.upperThumb.disabled) {
631
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.upperThumb, value, true);
632
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.upperThumb, "f");
633
- }
634
- }
1149
+ } else {
1150
+ const lowerValue = this.lowerThumb.value ?? this.min;
1151
+ const upperValue = this.upperThumb.value ?? lowerValue;
1152
+ if (value < lowerValue) {
1153
+ if (!this.lowerThumb.disabled) {
1154
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.lowerThumb, value, true);
1155
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.lowerThumb, "f");
1156
+ }
1157
+ } else if (value > upperValue) {
1158
+ if (!this.upperThumb.disabled) {
1159
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.upperThumb, value, true);
1160
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.upperThumb, "f");
1161
+ }
1162
+ } else {
1163
+ const mid = (lowerValue + upperValue) / 2;
1164
+ if (value < mid && !this.lowerThumb.disabled) {
1165
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.lowerThumb, value, true);
1166
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.lowerThumb, "f");
1167
+ } else if (!this.upperThumb.disabled) {
1168
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, this.upperThumb, value, true);
1169
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, this.upperThumb, "f");
1170
+ }
635
1171
  }
1172
+ }
636
1173
  };
637
1174
  _M3eSliderElement_handlePointerMove = function _M3eSliderElement_handlePointerMove(e) {
638
- if (!(e.target instanceof HTMLElement) || !e.target.hasPointerCapture(e.pointerId) || !__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"))
639
- return;
640
- const value = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_valueFromPoint).call(this, e);
641
- let min = this.min;
642
- let max = this.max;
643
- if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f") === this.upperThumb) {
644
- min = Math.max(min, this.lowerThumb?.value ?? 0);
645
- }
646
- else if (this.upperThumb) {
647
- max = Math.min(max, this.upperThumb.value ?? this.max);
648
- }
649
- if (this.classList.contains("-animating")) {
650
- this.classList.toggle("-animating", false);
651
- __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").style.transition = "";
652
- }
653
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, Math.max(min, value)));
1175
+ if (!(e.target instanceof HTMLElement) || !e.target.hasPointerCapture(e.pointerId) || !__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) return;
1176
+ const value = __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_valueFromPoint).call(this, e);
1177
+ let min = this.min;
1178
+ let max = this.max;
1179
+ if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f") === this.upperThumb) {
1180
+ min = Math.max(min, this.lowerThumb?.value ?? 0);
1181
+ } else if (this.upperThumb) {
1182
+ max = Math.min(max, this.upperThumb.value ?? this.max);
1183
+ }
1184
+ if (this.classList.contains("-animating")) {
1185
+ this.classList.toggle("-animating", false);
1186
+ __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").style.transition = "";
1187
+ }
1188
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, Math.max(min, value)));
654
1189
  };
655
1190
  _M3eSliderElement_handlePointerUp = function _M3eSliderElement_handlePointerUp(e) {
656
- if (e.pointerType === "mouse" && e.button > 1)
657
- return;
658
- if (!this.lowerThumb || this.disabled)
659
- return;
660
- if (e.target instanceof HTMLElement) {
661
- e.target.releasePointerCapture(e.pointerId);
662
- }
663
- if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) {
664
- __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").focus();
665
- }
1191
+ if (e.pointerType === "mouse" && e.button > 1) return;
1192
+ if (!this.lowerThumb || this.disabled) return;
1193
+ if (e.target instanceof HTMLElement) {
1194
+ e.target.releasePointerCapture(e.pointerId);
1195
+ }
1196
+ if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) {
1197
+ __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").focus();
1198
+ }
666
1199
  };
667
1200
  _M3eSliderElement_handleKeyDown = function _M3eSliderElement_handleKeyDown(e) {
668
- __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, e.composedPath().find((x) => x instanceof M3eSliderThumbElement), "f");
669
- if (!__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"))
670
- return;
671
- const value = __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").value ?? 0;
672
- let min = this.min;
673
- let max = this.max;
674
- if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f") === this.upperThumb) {
675
- min = Math.max(min, this.lowerThumb?.value ?? 0);
676
- }
677
- else if (this.upperThumb) {
678
- max = Math.max(max, this.upperThumb.value ?? this.max);
679
- }
680
- switch (e.key) {
681
- case "Home":
682
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), min);
683
- e.preventDefault();
684
- break;
685
- case "End":
686
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), max);
687
- e.preventDefault();
688
- break;
689
- case "PageUp":
690
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, value + (this.step > 1 ? this.step : 10)));
691
- e.preventDefault();
692
- break;
693
- case "PageDown":
694
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.max(min, value - (this.step > 1 ? this.step : 10)));
695
- e.preventDefault();
696
- break;
697
- case "Down":
698
- case "ArrowDown":
699
- case "Left":
700
- case "ArrowLeft":
701
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.max(min, value - this.step));
702
- e.preventDefault();
703
- break;
704
- case "Up":
705
- case "ArrowUp":
706
- case "Right":
707
- case "ArrowRight":
708
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, value + this.step));
709
- e.preventDefault();
710
- break;
711
- case " ":
712
- e.preventDefault();
713
- break;
714
- }
1201
+ __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, e.composedPath().find(x => x instanceof M3eSliderThumbElement), "f");
1202
+ if (!__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) return;
1203
+ const value = __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").value ?? 0;
1204
+ let min = this.min;
1205
+ let max = this.max;
1206
+ if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f") === this.upperThumb) {
1207
+ min = Math.max(min, this.lowerThumb?.value ?? 0);
1208
+ } else if (this.upperThumb) {
1209
+ max = Math.max(max, this.upperThumb.value ?? this.max);
1210
+ }
1211
+ switch (e.key) {
1212
+ case "Home":
1213
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), min);
1214
+ e.preventDefault();
1215
+ break;
1216
+ case "End":
1217
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), max);
1218
+ e.preventDefault();
1219
+ break;
1220
+ case "PageUp":
1221
+ if (M3eDirectionality.current === "ltr") {
1222
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, value + (this.step > 1 ? this.step : 10)));
1223
+ } else {
1224
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.max(min, value - (this.step > 1 ? this.step : 10)));
1225
+ }
1226
+ e.preventDefault();
1227
+ break;
1228
+ case "PageDown":
1229
+ if (M3eDirectionality.current === "ltr") {
1230
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.max(min, value - (this.step > 1 ? this.step : 10)));
1231
+ } else {
1232
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, value + (this.step > 1 ? this.step : 10)));
1233
+ }
1234
+ e.preventDefault();
1235
+ break;
1236
+ case "Down":
1237
+ case "ArrowDown":
1238
+ case "Left":
1239
+ case "ArrowLeft":
1240
+ if (M3eDirectionality.current === "ltr") {
1241
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.max(min, value - this.step));
1242
+ } else {
1243
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, value + this.step));
1244
+ }
1245
+ e.preventDefault();
1246
+ break;
1247
+ case "Up":
1248
+ case "ArrowUp":
1249
+ case "Right":
1250
+ case "ArrowRight":
1251
+ if (M3eDirectionality.current === "ltr") {
1252
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.min(max, value + this.step));
1253
+ } else {
1254
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_changeThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"), Math.max(min, value - this.step));
1255
+ }
1256
+ e.preventDefault();
1257
+ break;
1258
+ case " ":
1259
+ e.preventDefault();
1260
+ break;
1261
+ }
715
1262
  };
716
1263
  _M3eSliderElement_handleThumbChange = function _M3eSliderElement_handleThumbChange(e) {
717
- e.stopPropagation();
718
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateThumbs).call(this);
719
- __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateDimensions).call(this);
1264
+ e.stopPropagation();
1265
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateThumbs).call(this);
1266
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateDimensions).call(this);
720
1267
  };
721
1268
  _M3eSliderElement_changeThumb = function _M3eSliderElement_changeThumb(thumb, value, animate = false) {
722
- if (thumb.value === value)
723
- return;
724
- const prev = thumb.value;
725
- if (animate && !prefersReducedMotion()) {
726
- this.classList.toggle("-animating", true);
727
- thumb.addEventListener("transitionend", () => {
728
- thumb.style.transition = "";
729
- this.classList.toggle("-animating", false);
730
- }, { once: true });
731
- thumb.style.transition = `transform ${DesignToken.motion.spring.fastEffects}`;
732
- }
733
- thumb.value = value;
734
- thumb.markAsDirty();
735
- thumb.markAsTouched();
736
- if (thumb.dispatchEvent(new Event("input", { bubbles: true, composed: true, cancelable: true }))) {
737
- thumb.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
738
- }
739
- else {
740
- thumb.value = prev;
741
- }
1269
+ if (thumb.value === value) return;
1270
+ const prev = thumb.value;
1271
+ if (animate && !prefersReducedMotion()) {
1272
+ this.classList.toggle("-animating", true);
1273
+ thumb.addEventListener("transitionend", () => {
1274
+ thumb.style.transition = "";
1275
+ this.classList.toggle("-animating", false);
1276
+ }, {
1277
+ once: true
1278
+ });
1279
+ thumb.style.transition = `transform ${DesignToken.motion.spring.fastEffects}`;
1280
+ }
1281
+ thumb.value = value;
1282
+ thumb.markAsDirty();
1283
+ thumb.markAsTouched();
1284
+ if (thumb.dispatchEvent(new Event("input", {
1285
+ bubbles: true,
1286
+ composed: true,
1287
+ cancelable: true
1288
+ }))) {
1289
+ thumb.dispatchEvent(new Event("change", {
1290
+ bubbles: true,
1291
+ composed: true
1292
+ }));
1293
+ } else {
1294
+ thumb.value = prev;
1295
+ }
742
1296
  };
743
1297
  /** The styles of the element. */
744
- M3eSliderElement.styles = css `
745
- :host {
746
- display: inline-block;
747
- vertical-align: middle;
748
- min-inline-size: var(--m3e-slider-min-width, 12.5rem);
749
- user-select: none;
750
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
751
- }
752
- :host(:not([disabled])) {
753
- cursor: pointer;
754
- }
755
- :host([size="extra-small"]),
756
- :host([size="small"]) {
757
- height: var(--m3e-slider-small-height, 2.75rem);
758
- }
759
- :host([size="extra-small"]) .base,
760
- :host([size="small"]) .base {
761
- --_slider-active-track-shape: var(--m3e-slider-small-active-track-shape, ${DesignToken.shape.corner.smallStart});
762
- --_slider-inactive-track-start-shape: var(
763
- --m3e-slider-small-inactive-active-track-start-shape,
764
- ${DesignToken.shape.corner.smallStart}
765
- );
766
- --_slider-inactive-track-end-shape: var(
767
- --m3e-slider-small-inactive-track-end-shape,
768
- ${DesignToken.shape.corner.smallEnd}
769
- );
770
- }
771
- :host([size="extra-small"]) .track {
772
- height: calc(var(--m3e-slider-extra-small-track-height, 1rem));
773
- }
774
- :host([size="small"]) .track {
775
- height: calc(var(--m3e-slider-small-track-height, 1.5rem));
776
- }
777
- :host([size="medium"]) {
778
- height: var(--m3e-slider-medium-height, 3.25rem);
779
- }
780
- :host([size="medium"]) .base {
781
- --_slider-active-track-shape: var(
782
- --m3e-slider-medium-active-track-shape,
783
- ${DesignToken.shape.corner.mediumStart}
784
- );
785
- --_slider-inactive-track-start-shape: var(
786
- --m3e-slider-medium-inactive-active-track-start-shape,
787
- ${DesignToken.shape.corner.mediumStart}
788
- );
789
- --_slider-inactive-track-end-shape: var(
790
- --m3e-slider-medium-inactive-track-end-shape,
791
- ${DesignToken.shape.corner.mediumEnd}
792
- );
793
- }
794
- :host([size="medium"]) .track {
795
- height: var(--m3e-slider-medium-track-height, 2.5rem);
796
- }
797
- :host([size="large"]) {
798
- height: var(--m3e-slider-large-height, 4.25rem);
799
- }
800
- :host([size="large"]) .base {
801
- --_slider-active-track-shape: var(--m3e-slider-large-active-track-shape, ${DesignToken.shape.corner.largeStart});
802
- --_slider-inactive-track-start-shape: var(
803
- --m3e-slider-large-inactive-active-track-start-shape,
804
- ${DesignToken.shape.corner.largeStart}
805
- );
806
- --_slider-inactive-track-end-shape: var(
807
- --m3e-slider-large-inactive-track-end-shape,
808
- ${DesignToken.shape.corner.largeEnd}
809
- );
810
- }
811
- :host([size="large"]) .track {
812
- height: var(--m3e-slider-large-track-height, 3.5rem);
813
- }
814
- :host([size="extra-large"]) {
815
- height: var(--m3e-slider-extra-large-height, 6.75rem);
816
- }
817
- :host([size="extra-large"]) .base {
818
- --_slider-active-track-shape: var(
819
- --m3e-slider-extra-large-active-track-shape,
820
- ${DesignToken.shape.corner.extraLargeStart}
821
- );
822
- --_slider-inactive-track-start-shape: var(
823
- --m3e-slider-extra-large-inactive-active-track-start-shape,
824
- ${DesignToken.shape.corner.extraLargeStart}
825
- );
826
- --_slider-inactive-track-end-shape: var(
827
- --m3e-slider-extra-large-inactive-track-end-shape,
828
- ${DesignToken.shape.corner.extraLargeEnd}
829
- );
830
- }
831
- :host([size="extra-large"]) .track {
832
- height: var(--m3e-slider-extra-large-track-height, 6rem);
833
- }
834
- :host(.-animating) .track-active,
835
- :host(.-animating) .track-inactive.start,
836
- :host(.-animating) .track-inactive.end {
837
- transition: ${unsafeCSS(`margin-left ${DesignToken.motion.spring.fastEffects},
838
- width ${DesignToken.motion.spring.fastEffects}`)};
839
- }
840
- .base {
841
- display: inline-flex;
842
- align-items: center;
843
- position: relative;
844
- width: 100%;
845
- height: 100%;
846
- border-radius: inherit;
847
- outline: none;
848
- touch-action: none;
849
- }
850
- .track {
851
- position: relative;
852
- flex: 1 1 auto;
853
- touch-action: none;
854
- }
855
- .track-inactive,
856
- .track-active {
857
- position: absolute;
858
- height: 100%;
859
- touch-action: none;
860
- }
861
- .track-active {
862
- margin-left: var(--_slider-active-track-offset, 0px);
863
- width: var(--_slider-active-track-size, 0px);
864
- border-radius: var(--_slider-active-track-middle-shape, var(--_slider-active-track-shape));
865
- }
866
- .track-inactive.start {
867
- width: var(--_slider-inactive-track-before-size, 0px);
868
- border-radius: var(--_slider-inactive-track-start-shape);
869
- }
870
- .track-inactive.end {
871
- margin-left: var(--_slider-inactive-track-after-offset, 0px);
872
- width: var(--_slider-inactive-track-after-size, 0px);
873
- border-radius: var(--_slider-inactive-track-end-shape);
874
- }
875
- .ticks {
876
- position: absolute;
877
- width: 100%;
878
- height: var(--m3e-slider-tick-size, 0.25rem);
879
- overflow: visible;
880
- touch-action: none;
881
- }
882
- .tick {
883
- position: absolute;
884
- top: 0;
885
- touch-action: none;
886
- left: calc(var(--m3e-slider-tick-size, 0.25rem) + calc(var(--m3e-slider-tick-size, 0.25rem) / 2));
887
- width: var(--m3e-slider-tick-size, 0.25rem);
888
- height: var(--m3e-slider-tick-size, 0.25rem);
889
- border-radius: var(--m3e-slider-tick-shape, ${DesignToken.shape.corner.full});
890
- }
891
- :host(:not([disabled])) .track-inactive {
892
- background-color: var(--m3e-slider-inactive-track-color, ${DesignToken.color.secondaryContainer});
893
- }
894
- :host([disabled]) .track-inactive {
895
- background-color: color-mix(
896
- in srgb,
897
- var(--m3e-slider-disabled-inactive-track-color, ${DesignToken.color.onSurface})
898
- var(--m3e-slider-disabled-inactive-track-opacity, 12%),
899
- transparent
900
- );
901
- }
902
- :host(:not([disabled])) .track-active {
903
- background-color: var(--m3e-slider-active-track-color, ${DesignToken.color.primary});
904
- }
905
- :host([disabled]) .track-active {
906
- background-color: color-mix(
907
- in srgb,
908
- var(--m3e-slider-disabled-active-track-color, ${DesignToken.color.onSurface})
909
- var(--m3e-slider-disabled-active-track-opacity, 38%),
910
- transparent
911
- );
912
- }
913
- :host(:not([disabled])) .tick.active {
914
- background-color: var(--m3e-slider-tick-active-color, ${DesignToken.color.onPrimary});
915
- }
916
- :host([disabled]) .tick.active {
917
- background-color: var(--m3e-slider-disabled-tick-active-color, ${DesignToken.color.inverseOnSurface});
918
- }
919
- :host(:not([disabled])) .tick.inactive {
920
- background-color: var(--m3e-slider-tick-inactive-color, ${DesignToken.color.onSecondaryContainer});
921
- }
922
- :host([disabled]) .tick.inactive {
923
- background-color: var(--m3e-slider-disabled-tick-inactive-color, ${DesignToken.color.onSurface});
924
- }
925
- :host(:not([discrete])) .tick.active {
926
- display: none;
927
- }
928
- :host(:hover[labelled]) .base,
929
- :host(:focus-within[labelled]) .base {
930
- --_slider-label-visibility: visible;
931
- --_slider-label-opacity: 1;
932
- --_slider-label-transform: scale(1);
933
- }
934
- @media (forced-colors: active) {
935
- :host(:not([disabled])) .track-inactive {
936
- background-color: unset;
937
- }
938
- :host(:not([disabled])) .base.range .track-inactive.start,
939
- :host(:not([disabled])) .track-inactive.end {
940
- border: 1px solid CanvasText;
941
- box-sizing: border-box;
942
- }
943
- :host(:not([disabled])) .tick.inactive {
944
- background-color: CanvasText;
945
- }
946
- :host(:not([disabled])) .tick.active {
947
- background-color: Canvas;
948
- }
949
- :host(:not([disabled])) .track-active {
950
- background-color: CanvasText;
951
- }
952
- :host([disabled]) .base.range .track-inactive.start,
953
- :host([disabled]) .track-inactive.end {
954
- border: 1px solid GrayText;
955
- box-sizing: border-box;
956
- }
957
- :host([disabled]) .track-active {
958
- background-color: GrayText;
959
- }
960
- :host([disabled]) .tick.inactive {
961
- background-color: GrayText;
962
- }
963
- :host([disabled]) .tick.active {
964
- background-color: Canvas;
965
- }
966
- }
967
- `;
968
- __decorate([
969
- e$1(".base")
970
- ], M3eSliderElement.prototype, "_base", void 0);
971
- __decorate([
972
- r$1()
973
- ], M3eSliderElement.prototype, "_ticks", void 0);
974
- __decorate([
975
- n$1({ reflect: true })
976
- ], M3eSliderElement.prototype, "size", void 0);
977
- __decorate([
978
- n$1({ type: Boolean, reflect: true })
979
- ], M3eSliderElement.prototype, "disabled", void 0);
980
- __decorate([
981
- n$1({ type: Boolean, reflect: true })
982
- ], M3eSliderElement.prototype, "discrete", void 0);
983
- __decorate([
984
- n$1({ type: Number })
985
- ], M3eSliderElement.prototype, "min", void 0);
986
- __decorate([
987
- n$1({ type: Number })
988
- ], M3eSliderElement.prototype, "max", void 0);
989
- __decorate([
990
- n$1({ type: Number })
991
- ], M3eSliderElement.prototype, "step", void 0);
992
- __decorate([
993
- n$1({ type: Boolean })
994
- ], M3eSliderElement.prototype, "labelled", void 0);
995
- __decorate([
996
- n$1({ attribute: false })
997
- ], M3eSliderElement.prototype, "displayWith", void 0);
998
- M3eSliderElement = __decorate([
999
- t$2("m3e-slider")
1000
- ], M3eSliderElement);
1298
+ M3eSliderElement.styles = css`:host { display: inline-block; vertical-align: middle; min-inline-size: var(--m3e-slider-min-width, 12.5rem); user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } :host(:not([disabled])) { cursor: pointer; } :host([size="extra-small"]), :host([size="small"]) { height: var(--m3e-slider-small-height, 2.75rem); } :host(:not(:dir(rtl))[size="extra-small"]) .base, :host(:not(:dir(rtl))[size="small"]) .base { --_slider-active-track-shape: var(--m3e-slider-small-active-track-shape, ${DesignToken.shape.corner.smallStart}); --_slider-inactive-track-start-shape: var( --m3e-slider-small-inactive-active-track-start-shape, ${DesignToken.shape.corner.smallStart} ); --_slider-inactive-track-end-shape: var( --m3e-slider-small-inactive-track-end-shape, ${DesignToken.shape.corner.smallEnd} ); } :host(:dir(rtl)[size="extra-small"]) .base, :host(:dir(rtl)[size="small"]) .base { --_slider-active-track-shape: var(--m3e-slider-small-active-track-shape, ${DesignToken.shape.corner.smallEnd}); --_slider-inactive-track-start-shape: var( --m3e-slider-small-inactive-active-track-start-shape, ${DesignToken.shape.corner.smallEnd} ); --_slider-inactive-track-end-shape: var( --m3e-slider-small-inactive-track-end-shape, ${DesignToken.shape.corner.smallStart} ); } :host([size="extra-small"]) .track { height: calc(var(--m3e-slider-extra-small-track-height, 1rem)); } :host([size="small"]) .track { height: calc(var(--m3e-slider-small-track-height, 1.5rem)); } :host([size="medium"]) { height: var(--m3e-slider-medium-height, 3.25rem); } :host(:not(:dir(rtl))[size="medium"]) .base { --_slider-active-track-shape: var( --m3e-slider-medium-active-track-shape, ${DesignToken.shape.corner.mediumStart} ); --_slider-inactive-track-start-shape: var( --m3e-slider-medium-inactive-active-track-start-shape, ${DesignToken.shape.corner.mediumStart} ); --_slider-inactive-track-end-shape: var( --m3e-slider-medium-inactive-track-end-shape, ${DesignToken.shape.corner.mediumEnd} ); } :host(:dir(rtl)[size="medium"]) .base { --_slider-active-track-shape: var(--m3e-slider-medium-active-track-shape, ${DesignToken.shape.corner.mediumEnd}); --_slider-inactive-track-start-shape: var( --m3e-slider-medium-inactive-active-track-start-shape, ${DesignToken.shape.corner.mediumEnd} ); --_slider-inactive-track-end-shape: var( --m3e-slider-medium-inactive-track-end-shape, ${DesignToken.shape.corner.mediumStart} ); } :host([size="medium"]) .track { height: var(--m3e-slider-medium-track-height, 2.5rem); } :host([size="large"]) { height: var(--m3e-slider-large-height, 4.25rem); } :host(:not(:dir(rtl))[size="large"]) .base { --_slider-active-track-shape: var(--m3e-slider-large-active-track-shape, ${DesignToken.shape.corner.largeStart}); --_slider-inactive-track-start-shape: var( --m3e-slider-large-inactive-active-track-start-shape, ${DesignToken.shape.corner.largeStart} ); --_slider-inactive-track-end-shape: var( --m3e-slider-large-inactive-track-end-shape, ${DesignToken.shape.corner.largeEnd} ); } :host(:dir(rtl)[size="large"]) .base { --_slider-active-track-shape: var(--m3e-slider-large-active-track-shape, ${DesignToken.shape.corner.largeEnd}); --_slider-inactive-track-start-shape: var( --m3e-slider-large-inactive-active-track-start-shape, ${DesignToken.shape.corner.largeEnd} ); --_slider-inactive-track-end-shape: var( --m3e-slider-large-inactive-track-end-shape, ${DesignToken.shape.corner.largeStart} ); } :host([size="large"]) .track { height: var(--m3e-slider-large-track-height, 3.5rem); } :host([size="extra-large"]) { height: var(--m3e-slider-extra-large-height, 6.75rem); } :host(:not(:dir(rtl))[size="extra-large"]) .base { --_slider-active-track-shape: var( --m3e-slider-extra-large-active-track-shape, ${DesignToken.shape.corner.extraLargeStart} ); --_slider-inactive-track-start-shape: var( --m3e-slider-extra-large-inactive-active-track-start-shape, ${DesignToken.shape.corner.extraLargeStart} ); --_slider-inactive-track-end-shape: var( --m3e-slider-extra-large-inactive-track-end-shape, ${DesignToken.shape.corner.extraLargeEnd} ); } :host(:dir(rtl)[size="extra-large"]) .base { --_slider-active-track-shape: var( --m3e-slider-extra-large-active-track-shape, ${DesignToken.shape.corner.extraLargeEnd} ); --_slider-inactive-track-start-shape: var( --m3e-slider-extra-large-inactive-active-track-start-shape, ${DesignToken.shape.corner.extraLargeEnd} ); --_slider-inactive-track-end-shape: var( --m3e-slider-extra-large-inactive-track-end-shape, ${DesignToken.shape.corner.extraLargeStart} ); } :host([size="extra-large"]) .track { height: var(--m3e-slider-extra-large-track-height, 6rem); } :host(.-animating) .track-active, :host(.-animating) .track-inactive.start, :host(.-animating) .track-inactive.end { transition: ${unsafeCSS(`margin-inline-start ${DesignToken.motion.spring.fastEffects},
1299
+ width ${DesignToken.motion.spring.fastEffects}`)}; } .base { display: inline-flex; align-items: center; position: relative; width: 100%; height: 100%; border-radius: inherit; outline: none; touch-action: none; } .track { position: relative; flex: 1 1 auto; touch-action: none; } .track-inactive, .track-active { position: absolute; height: 100%; touch-action: none; } .track-active { margin-inline-start: var(--_slider-active-track-offset, 0px); width: var(--_slider-active-track-size, 0px); border-radius: var(--_slider-active-track-middle-shape, var(--_slider-active-track-shape)); } .track-inactive.start { width: var(--_slider-inactive-track-before-size, 0px); border-radius: var(--_slider-inactive-track-start-shape); } .track-inactive.end { margin-inline-start: var(--_slider-inactive-track-after-offset, 0px); width: var(--_slider-inactive-track-after-size, 0px); border-radius: var(--_slider-inactive-track-end-shape); } .ticks { position: absolute; width: 100%; height: var(--m3e-slider-tick-size, 0.25rem); overflow: visible; touch-action: none; } .tick { position: absolute; top: 0; touch-action: none; inset-inline-start: calc(var(--m3e-slider-tick-size, 0.25rem) + calc(var(--m3e-slider-tick-size, 0.25rem) / 2)); width: var(--m3e-slider-tick-size, 0.25rem); height: var(--m3e-slider-tick-size, 0.25rem); border-radius: var(--m3e-slider-tick-shape, ${DesignToken.shape.corner.full}); } :host(:not([disabled])) .track-inactive { background-color: var(--m3e-slider-inactive-track-color, ${DesignToken.color.secondaryContainer}); } :host([disabled]) .track-inactive { background-color: color-mix( in srgb, var(--m3e-slider-disabled-inactive-track-color, ${DesignToken.color.onSurface}) var(--m3e-slider-disabled-inactive-track-opacity, 12%), transparent ); } :host(:not([disabled])) .track-active { background-color: var(--m3e-slider-active-track-color, ${DesignToken.color.primary}); } :host([disabled]) .track-active { background-color: color-mix( in srgb, var(--m3e-slider-disabled-active-track-color, ${DesignToken.color.onSurface}) var(--m3e-slider-disabled-active-track-opacity, 38%), transparent ); } :host(:not([disabled])) .tick.active { background-color: var(--m3e-slider-tick-active-color, ${DesignToken.color.onPrimary}); } :host([disabled]) .tick.active { background-color: var(--m3e-slider-disabled-tick-active-color, ${DesignToken.color.inverseOnSurface}); } :host(:not([disabled])) .tick.inactive { background-color: var(--m3e-slider-tick-inactive-color, ${DesignToken.color.onSecondaryContainer}); } :host([disabled]) .tick.inactive { background-color: var(--m3e-slider-disabled-tick-inactive-color, ${DesignToken.color.onSurface}); } :host(:not([discrete])) .tick.active { display: none; } :host(:hover[labelled]) .base, :host(:focus-within[labelled]) .base { --_slider-label-visibility: visible; --_slider-label-opacity: 1; --_slider-label-transform: scale(1); } @media (forced-colors: active) { :host(:not([disabled])) .track-inactive { background-color: unset; } :host(:not([disabled])) .base.range .track-inactive.start, :host(:not([disabled])) .track-inactive.end { border: 1px solid CanvasText; box-sizing: border-box; } :host(:not([disabled])) .tick.inactive { background-color: CanvasText; } :host(:not([disabled])) .tick.active { background-color: Canvas; } :host(:not([disabled])) .track-active { background-color: CanvasText; } :host([disabled]) .base.range .track-inactive.start, :host([disabled]) .track-inactive.end { border: 1px solid GrayText; box-sizing: border-box; } :host([disabled]) .track-active { background-color: GrayText; } :host([disabled]) .tick.inactive { background-color: GrayText; } :host([disabled]) .tick.active { background-color: Canvas; } }`;
1300
+ __decorate([e$1(".base")], M3eSliderElement.prototype, "_base", void 0);
1301
+ __decorate([r$1()], M3eSliderElement.prototype, "_ticks", void 0);
1302
+ __decorate([n$1({
1303
+ reflect: true
1304
+ })], M3eSliderElement.prototype, "size", void 0);
1305
+ __decorate([n$1({
1306
+ type: Boolean,
1307
+ reflect: true
1308
+ })], M3eSliderElement.prototype, "disabled", void 0);
1309
+ __decorate([n$1({
1310
+ type: Boolean,
1311
+ reflect: true
1312
+ })], M3eSliderElement.prototype, "discrete", void 0);
1313
+ __decorate([n$1({
1314
+ type: Number
1315
+ })], M3eSliderElement.prototype, "min", void 0);
1316
+ __decorate([n$1({
1317
+ type: Number
1318
+ })], M3eSliderElement.prototype, "max", void 0);
1319
+ __decorate([n$1({
1320
+ type: Number
1321
+ })], M3eSliderElement.prototype, "step", void 0);
1322
+ __decorate([n$1({
1323
+ type: Boolean
1324
+ })], M3eSliderElement.prototype, "labelled", void 0);
1325
+ __decorate([n$1({
1326
+ attribute: false
1327
+ })], M3eSliderElement.prototype, "displayWith", void 0);
1328
+ M3eSliderElement = __decorate([t$2("m3e-slider")], M3eSliderElement);
1001
1329
 
1002
1330
  export { M3eSliderElement, M3eSliderThumbElement };
1003
1331
  //# sourceMappingURL=index.js.map