@m3e/textarea-autosize 1.0.6 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -19,33 +19,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
19
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
20
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
21
  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;
22
+ ***************************************************************************** */
23
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
24
+
25
+ function __decorate(decorators, target, key, desc) {
26
+ var c = arguments.length,
27
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
28
+ d;
29
+ 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;
30
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31
+ }
32
+ function __classPrivateFieldGet(receiver, state, kind, f) {
33
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
34
+ 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");
35
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
36
+ }
37
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
38
+ if (kind === "m") throw new TypeError("Private method is not writable");
39
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
40
+ 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");
41
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
42
+ }
43
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
44
+ var e = new Error(message);
45
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
46
  };
50
47
 
51
48
  /**
@@ -53,26 +50,372 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
53
50
  * Copyright 2017 Google LLC
54
51
  * SPDX-License-Identifier: BSD-3-Clause
55
52
  */
56
- const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
53
+ const t$1 = t => (e, o) => {
54
+ void 0 !== o ? o.addInitializer(() => {
55
+ customElements.define(t, e);
56
+ }) : customElements.define(t, e);
57
+ };
57
58
 
58
59
  /**
59
60
  * @license
60
61
  * Copyright 2019 Google LLC
61
62
  * SPDX-License-Identifier: BSD-3-Clause
62
63
  */
63
- const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s)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$1&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s),S=(s,o)=>{if(e$1)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$1=e$1?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
64
+ const t = globalThis,
65
+ e$1 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
66
+ s = Symbol(),
67
+ o$2 = new WeakMap();
68
+ let n$2 = class n {
69
+ constructor(t, e, o) {
70
+ if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
71
+ this.cssText = t, this.t = e;
72
+ }
73
+ get styleSheet() {
74
+ let t = this.o;
75
+ const s = this.t;
76
+ if (e$1 && void 0 === t) {
77
+ const e = void 0 !== s && 1 === s.length;
78
+ e && (t = o$2.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$2.set(s, t));
79
+ }
80
+ return t;
81
+ }
82
+ toString() {
83
+ return this.cssText;
84
+ }
85
+ };
86
+ const r$2 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
87
+ S = (s, o) => {
88
+ if (e$1) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
89
+ const o = document.createElement("style"),
90
+ n = t.litNonce;
91
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
92
+ }
93
+ },
94
+ c$1 = e$1 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
95
+ let e = "";
96
+ for (const s of t.cssRules) e += s.cssText;
97
+ return r$2(e);
98
+ })(t) : t;
64
99
 
65
100
  /**
66
101
  * @license
67
102
  * Copyright 2017 Google LLC
68
103
  * SPDX-License-Identifier: BSD-3-Clause
69
- */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l: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=(t,s)=>!i(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.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(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(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("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$1(t),...o$1(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$1(s));}else void 0!==s&&i.push(c$1(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(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).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;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)(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("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
104
+ */
105
+ const {
106
+ is: i,
107
+ defineProperty: e,
108
+ getOwnPropertyDescriptor: h,
109
+ getOwnPropertyNames: r$1,
110
+ getOwnPropertySymbols: o$1,
111
+ getPrototypeOf: n$1
112
+ } = Object,
113
+ a = globalThis,
114
+ c = a.trustedTypes,
115
+ l = c ? c.emptyScript : "",
116
+ p = a.reactiveElementPolyfillSupport,
117
+ d = (t, s) => t,
118
+ u = {
119
+ toAttribute(t, s) {
120
+ switch (s) {
121
+ case Boolean:
122
+ t = t ? l : null;
123
+ break;
124
+ case Object:
125
+ case Array:
126
+ t = null == t ? t : JSON.stringify(t);
127
+ }
128
+ return t;
129
+ },
130
+ fromAttribute(t, s) {
131
+ let i = t;
132
+ switch (s) {
133
+ case Boolean:
134
+ i = null !== t;
135
+ break;
136
+ case Number:
137
+ i = null === t ? null : Number(t);
138
+ break;
139
+ case Object:
140
+ case Array:
141
+ try {
142
+ i = JSON.parse(t);
143
+ } catch (t) {
144
+ i = null;
145
+ }
146
+ }
147
+ return i;
148
+ }
149
+ },
150
+ f = (t, s) => !i(t, s),
151
+ b = {
152
+ attribute: true,
153
+ type: String,
154
+ converter: u,
155
+ reflect: false,
156
+ useDefault: false,
157
+ hasChanged: f
158
+ };
159
+ Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
160
+ class y extends HTMLElement {
161
+ static addInitializer(t) {
162
+ this._$Ei(), (this.l ??= []).push(t);
163
+ }
164
+ static get observedAttributes() {
165
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
166
+ }
167
+ static createProperty(t, s = b) {
168
+ 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) {
169
+ const i = Symbol(),
170
+ h = this.getPropertyDescriptor(t, i, s);
171
+ void 0 !== h && e(this.prototype, t, h);
172
+ }
173
+ }
174
+ static getPropertyDescriptor(t, s, i) {
175
+ const {
176
+ get: e,
177
+ set: r
178
+ } = h(this.prototype, t) ?? {
179
+ get() {
180
+ return this[s];
181
+ },
182
+ set(t) {
183
+ this[s] = t;
184
+ }
185
+ };
186
+ return {
187
+ get: e,
188
+ set(s) {
189
+ const h = e?.call(this);
190
+ r?.call(this, s), this.requestUpdate(t, h, i);
191
+ },
192
+ configurable: true,
193
+ enumerable: true
194
+ };
195
+ }
196
+ static getPropertyOptions(t) {
197
+ return this.elementProperties.get(t) ?? b;
198
+ }
199
+ static _$Ei() {
200
+ if (this.hasOwnProperty(d("elementProperties"))) return;
201
+ const t = n$1(this);
202
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
203
+ }
204
+ static finalize() {
205
+ if (this.hasOwnProperty(d("finalized"))) return;
206
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
207
+ const t = this.properties,
208
+ s = [...r$1(t), ...o$1(t)];
209
+ for (const i of s) this.createProperty(i, t[i]);
210
+ }
211
+ const t = this[Symbol.metadata];
212
+ if (null !== t) {
213
+ const s = litPropertyMetadata.get(t);
214
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
215
+ }
216
+ this._$Eh = new Map();
217
+ for (const [t, s] of this.elementProperties) {
218
+ const i = this._$Eu(t, s);
219
+ void 0 !== i && this._$Eh.set(i, t);
220
+ }
221
+ this.elementStyles = this.finalizeStyles(this.styles);
222
+ }
223
+ static finalizeStyles(s) {
224
+ const i = [];
225
+ if (Array.isArray(s)) {
226
+ const e = new Set(s.flat(1 / 0).reverse());
227
+ for (const s of e) i.unshift(c$1(s));
228
+ } else void 0 !== s && i.push(c$1(s));
229
+ return i;
230
+ }
231
+ static _$Eu(t, s) {
232
+ const i = s.attribute;
233
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
234
+ }
235
+ constructor() {
236
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
237
+ }
238
+ _$Ev() {
239
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
240
+ }
241
+ addController(t) {
242
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
243
+ }
244
+ removeController(t) {
245
+ this._$EO?.delete(t);
246
+ }
247
+ _$E_() {
248
+ const t = new Map(),
249
+ s = this.constructor.elementProperties;
250
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
251
+ t.size > 0 && (this._$Ep = t);
252
+ }
253
+ createRenderRoot() {
254
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
255
+ return S(t, this.constructor.elementStyles), t;
256
+ }
257
+ connectedCallback() {
258
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
259
+ }
260
+ enableUpdating(t) {}
261
+ disconnectedCallback() {
262
+ this._$EO?.forEach(t => t.hostDisconnected?.());
263
+ }
264
+ attributeChangedCallback(t, s, i) {
265
+ this._$AK(t, i);
266
+ }
267
+ _$ET(t, s) {
268
+ const i = this.constructor.elementProperties.get(t),
269
+ e = this.constructor._$Eu(t, i);
270
+ if (void 0 !== e && true === i.reflect) {
271
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
272
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
273
+ }
274
+ }
275
+ _$AK(t, s) {
276
+ const i = this.constructor,
277
+ e = i._$Eh.get(t);
278
+ if (void 0 !== e && this._$Em !== e) {
279
+ const t = i.getPropertyOptions(e),
280
+ h = "function" == typeof t.converter ? {
281
+ fromAttribute: t.converter
282
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u;
283
+ this._$Em = e;
284
+ const r = h.fromAttribute(s, t.type);
285
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
286
+ }
287
+ }
288
+ requestUpdate(t, s, i) {
289
+ if (void 0 !== t) {
290
+ const e = this.constructor,
291
+ h = this[t];
292
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
293
+ this.C(t, s, i);
294
+ }
295
+ false === this.isUpdatePending && (this._$ES = this._$EP());
296
+ }
297
+ C(t, s, {
298
+ useDefault: i,
299
+ reflect: e,
300
+ wrapped: h
301
+ }, r) {
302
+ 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));
303
+ }
304
+ async _$EP() {
305
+ this.isUpdatePending = true;
306
+ try {
307
+ await this._$ES;
308
+ } catch (t) {
309
+ Promise.reject(t);
310
+ }
311
+ const t = this.scheduleUpdate();
312
+ return null != t && (await t), !this.isUpdatePending;
313
+ }
314
+ scheduleUpdate() {
315
+ return this.performUpdate();
316
+ }
317
+ performUpdate() {
318
+ if (!this.isUpdatePending) return;
319
+ if (!this.hasUpdated) {
320
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
321
+ for (const [t, s] of this._$Ep) this[t] = s;
322
+ this._$Ep = void 0;
323
+ }
324
+ const t = this.constructor.elementProperties;
325
+ if (t.size > 0) for (const [s, i] of t) {
326
+ const {
327
+ wrapped: t
328
+ } = i,
329
+ e = this[s];
330
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
331
+ }
332
+ }
333
+ let t = false;
334
+ const s = this._$AL;
335
+ try {
336
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
337
+ } catch (s) {
338
+ throw t = false, this._$EM(), s;
339
+ }
340
+ t && this._$AE(s);
341
+ }
342
+ willUpdate(t) {}
343
+ _$AE(t) {
344
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
345
+ }
346
+ _$EM() {
347
+ this._$AL = new Map(), this.isUpdatePending = false;
348
+ }
349
+ get updateComplete() {
350
+ return this.getUpdateComplete();
351
+ }
352
+ getUpdateComplete() {
353
+ return this._$ES;
354
+ }
355
+ shouldUpdate(t) {
356
+ return true;
357
+ }
358
+ update(t) {
359
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
360
+ }
361
+ updated(t) {}
362
+ firstUpdated(t) {}
363
+ }
364
+ y.elementStyles = [], y.shadowRootOptions = {
365
+ mode: "open"
366
+ }, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
367
+ ReactiveElement: y
368
+ }), (a.reactiveElementVersions ??= []).push("2.1.1");
70
369
 
71
370
  /**
72
371
  * @license
73
372
  * Copyright 2017 Google LLC
74
373
  * SPDX-License-Identifier: BSD-3-Clause
75
- */const o={attribute:true,type:String,converter:u,reflect:false,hasChanged:f},r=(t=o,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(t){return (e,o)=>"object"==typeof o?r(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)}
374
+ */
375
+ const o = {
376
+ attribute: true,
377
+ type: String,
378
+ converter: u,
379
+ reflect: false,
380
+ hasChanged: f
381
+ },
382
+ r = (t = o, e, r) => {
383
+ const {
384
+ kind: n,
385
+ metadata: i
386
+ } = r;
387
+ let s = globalThis.litPropertyMetadata.get(i);
388
+ 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) {
389
+ const {
390
+ name: o
391
+ } = r;
392
+ return {
393
+ set(r) {
394
+ const n = e.get.call(this);
395
+ e.set.call(this, r), this.requestUpdate(o, n, t);
396
+ },
397
+ init(e) {
398
+ return void 0 !== e && this.C(o, void 0, t, e), e;
399
+ }
400
+ };
401
+ }
402
+ if ("setter" === n) {
403
+ const {
404
+ name: o
405
+ } = r;
406
+ return function (r) {
407
+ const n = this[o];
408
+ e.call(this, r), this.requestUpdate(o, n, t);
409
+ };
410
+ }
411
+ throw Error("Unsupported decorator location: " + n);
412
+ };
413
+ function n(t) {
414
+ return (e, o) => "object" == typeof o ? r(t, e, o) : ((t, e, o) => {
415
+ const r = e.hasOwnProperty(o);
416
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
417
+ })(t, e, o);
418
+ }
76
419
 
77
420
  /**
78
421
  * Adapted from Angular Material CDK Text Field
@@ -111,108 +454,116 @@ var _M3eTextareaAutosizeElement_instances, _M3eTextareaAutosizeElement_initialHe
111
454
  * @attr min-rows - The minimum amount of rows in the `textarea`.
112
455
  */
113
456
  let M3eTextareaAutosizeElement = class M3eTextareaAutosizeElement extends HtmlFor(Role(LitElement, "none")) {
114
- constructor() {
115
- super(...arguments);
116
- _M3eTextareaAutosizeElement_instances.add(this);
117
- /** @private */ _M3eTextareaAutosizeElement_initialHeight.set(this, void 0);
118
- /** @private */ _M3eTextareaAutosizeElement_cachedLineHeight.set(this, void 0);
119
- /** @private */ _M3eTextareaAutosizeElement_cachedPlaceholderHeight.set(this, void 0);
120
- /** @private */ _M3eTextareaAutosizeElement_previousMinRows.set(this, void 0);
121
- /** @private */ _M3eTextareaAutosizeElement_previousValue.set(this, void 0);
122
- /** @private */ _M3eTextareaAutosizeElement_hasFocus.set(this, false);
123
- /** @private */ _M3eTextareaAutosizeElement_windowResizeHandler.set(this, () => this._handleWindowResize());
124
- /** @private */ _M3eTextareaAutosizeElement_focusHandler.set(this, (e) => (__classPrivateFieldSet(this, _M3eTextareaAutosizeElement_hasFocus, e.type === "focus", "f")));
125
- /** @private */ _M3eTextareaAutosizeElement_inputHandler.set(this, () => this.resizeToFitContent());
126
- /**
127
- * The maximum amount of rows in the `textarea`.
128
- * @default 0
129
- */
130
- this.maxRows = 0;
131
- /**
132
- * The minimum amount of rows in the `textarea`.
133
- * @default 0
134
- */
135
- this.minRows = 0;
136
- /**
137
- * Whether auto-sizing is disabled.
138
- * @default false
139
- */
140
- this.disabled = false;
141
- }
142
- /** @inheritdoc */
143
- attach(control) {
144
- super.attach(control);
145
- if (control instanceof HTMLTextAreaElement) {
146
- control.style.resize = "none";
147
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_initialHeight, control.style.height, "f");
148
- control.addEventListener("focus", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
149
- control.addEventListener("blur", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
150
- control.addEventListener("input", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_inputHandler, "f"));
151
- window.addEventListener("resize", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_windowResizeHandler, "f"));
152
- }
457
+ constructor() {
458
+ super(...arguments);
459
+ _M3eTextareaAutosizeElement_instances.add(this);
460
+ /** @private */
461
+ _M3eTextareaAutosizeElement_initialHeight.set(this, void 0);
462
+ /** @private */
463
+ _M3eTextareaAutosizeElement_cachedLineHeight.set(this, void 0);
464
+ /** @private */
465
+ _M3eTextareaAutosizeElement_cachedPlaceholderHeight.set(this, void 0);
466
+ /** @private */
467
+ _M3eTextareaAutosizeElement_previousMinRows.set(this, void 0);
468
+ /** @private */
469
+ _M3eTextareaAutosizeElement_previousValue.set(this, void 0);
470
+ /** @private */
471
+ _M3eTextareaAutosizeElement_hasFocus.set(this, false);
472
+ /** @private */
473
+ _M3eTextareaAutosizeElement_windowResizeHandler.set(this, () => this._handleWindowResize());
474
+ /** @private */
475
+ _M3eTextareaAutosizeElement_focusHandler.set(this, e => __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_hasFocus, e.type === "focus", "f"));
476
+ /** @private */
477
+ _M3eTextareaAutosizeElement_inputHandler.set(this, () => this.resizeToFitContent());
478
+ /**
479
+ * The maximum amount of rows in the `textarea`.
480
+ * @default 0
481
+ */
482
+ this.maxRows = 0;
483
+ /**
484
+ * The minimum amount of rows in the `textarea`.
485
+ * @default 0
486
+ */
487
+ this.minRows = 0;
488
+ /**
489
+ * Whether auto-sizing is disabled.
490
+ * @default false
491
+ */
492
+ this.disabled = false;
493
+ }
494
+ /** @inheritdoc */
495
+ attach(control) {
496
+ super.attach(control);
497
+ if (control instanceof HTMLTextAreaElement) {
498
+ control.style.resize = "none";
499
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_initialHeight, control.style.height, "f");
500
+ control.addEventListener("focus", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
501
+ control.addEventListener("blur", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
502
+ control.addEventListener("input", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_inputHandler, "f"));
503
+ window.addEventListener("resize", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_windowResizeHandler, "f"));
153
504
  }
154
- /** @inheritdoc */
155
- detach() {
156
- if (this.control instanceof HTMLTextAreaElement) {
157
- window.removeEventListener("resize", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_windowResizeHandler, "f"));
158
- this.control.removeEventListener("focus", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
159
- this.control.removeEventListener("blur", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
160
- this.control.removeEventListener("input", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_inputHandler, "f"));
161
- }
162
- super.detach();
505
+ }
506
+ /** @inheritdoc */
507
+ detach() {
508
+ if (this.control instanceof HTMLTextAreaElement) {
509
+ window.removeEventListener("resize", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_windowResizeHandler, "f"));
510
+ this.control.removeEventListener("focus", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
511
+ this.control.removeEventListener("blur", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_focusHandler, "f"));
512
+ this.control.removeEventListener("input", __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_inputHandler, "f"));
163
513
  }
164
- /** @inheritdoc */
165
- connectedCallback() {
166
- this.ariaHidden = "true";
167
- super.connectedCallback();
514
+ super.detach();
515
+ }
516
+ /** @inheritdoc */
517
+ connectedCallback() {
518
+ this.ariaHidden = "true";
519
+ super.connectedCallback();
520
+ }
521
+ /** @inheritdoc */
522
+ updated(_changedProperties) {
523
+ super.updated(_changedProperties);
524
+ if (_changedProperties.has("disabled")) {
525
+ if (this.disabled) {
526
+ this.reset();
527
+ } else {
528
+ this.resizeToFitContent(true);
529
+ }
168
530
  }
169
- /** @inheritdoc */
170
- updated(_changedProperties) {
171
- super.updated(_changedProperties);
172
- if (_changedProperties.has("disabled")) {
173
- if (this.disabled) {
174
- this.reset();
175
- }
176
- else {
177
- this.resizeToFitContent(true);
178
- }
179
- }
531
+ }
532
+ /**
533
+ * Resize the `textarea` to fit its content.
534
+ * @param {boolean} [force=false] - Whether to force a height recalculation.
535
+ */
536
+ resizeToFitContent(force = false) {
537
+ if (this.disabled || !(this.control instanceof HTMLTextAreaElement)) {
538
+ return;
180
539
  }
181
- /**
182
- * Resize the `textarea` to fit its content.
183
- * @param {boolean} [force=false] - Whether to force a height recalculation.
184
- */
185
- resizeToFitContent(force = false) {
186
- if (this.disabled || !(this.control instanceof HTMLTextAreaElement)) {
187
- return;
188
- }
189
- __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_cacheTextareaLineHeight).call(this);
190
- __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_cacheTextareaPlaceholderHeight).call(this);
191
- if (!__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f")) {
192
- return;
193
- }
194
- const value = this.control.value;
195
- if (!force && this.minRows === __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_previousMinRows, "f") && value === __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_previousValue, "f")) {
196
- return;
197
- }
198
- const scrollHeight = __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_measureScrollHeight).call(this);
199
- const height = Math.max(scrollHeight, __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, "f") || 0);
200
- this.control.style.height = `${height}px`;
201
- setTimeout(() => __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_scrollToCaretPosition).call(this));
202
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_previousValue, value, "f");
203
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_previousMinRows, this.minRows, "f");
540
+ __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_cacheTextareaLineHeight).call(this);
541
+ __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_cacheTextareaPlaceholderHeight).call(this);
542
+ if (!__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f")) {
543
+ return;
204
544
  }
205
- /** Resets the `textarea` to its original size. */
206
- reset() {
207
- if (__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_initialHeight, "f") !== undefined && this.control instanceof HTMLTextAreaElement) {
208
- this.control.style.height = __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_initialHeight, "f");
209
- }
545
+ const value = this.control.value;
546
+ if (!force && this.minRows === __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_previousMinRows, "f") && value === __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_previousValue, "f")) {
547
+ return;
210
548
  }
211
- /** @private */
212
- _handleWindowResize() {
213
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedLineHeight, __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, undefined, "f"), "f");
214
- this.resizeToFitContent(true);
549
+ const scrollHeight = __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_measureScrollHeight).call(this);
550
+ const height = Math.max(scrollHeight, __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, "f") || 0);
551
+ this.control.style.height = `${height}px`;
552
+ setTimeout(() => __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_scrollToCaretPosition).call(this));
553
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_previousValue, value, "f");
554
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_previousMinRows, this.minRows, "f");
555
+ }
556
+ /** Resets the `textarea` to its original size. */
557
+ reset() {
558
+ if (__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_initialHeight, "f") !== undefined && this.control instanceof HTMLTextAreaElement) {
559
+ this.control.style.height = __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_initialHeight, "f");
215
560
  }
561
+ }
562
+ /** @private */
563
+ _handleWindowResize() {
564
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedLineHeight, __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, undefined, "f"), "f");
565
+ this.resizeToFitContent(true);
566
+ }
216
567
  };
217
568
  _M3eTextareaAutosizeElement_initialHeight = new WeakMap();
218
569
  _M3eTextareaAutosizeElement_cachedLineHeight = new WeakMap();
@@ -225,115 +576,112 @@ _M3eTextareaAutosizeElement_focusHandler = new WeakMap();
225
576
  _M3eTextareaAutosizeElement_inputHandler = new WeakMap();
226
577
  _M3eTextareaAutosizeElement_instances = new WeakSet();
227
578
  _M3eTextareaAutosizeElement_cacheTextareaLineHeight = function _M3eTextareaAutosizeElement_cacheTextareaLineHeight() {
228
- if (__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f") || !(this.control instanceof HTMLTextAreaElement)) {
229
- return;
230
- }
231
- const clone = this.control.cloneNode(false);
232
- clone.rows = 1;
233
- clone.style.position = "absolute";
234
- clone.style.visibility = "hidden";
235
- clone.style.border = "none";
236
- clone.style.padding = "0";
237
- clone.style.height = "";
238
- clone.style.minHeight = "";
239
- clone.style.maxHeight = "";
240
- clone.style.top = clone.style.bottom = clone.style.left = clone.style.right = "auto";
241
- clone.style.overflow = "hidden";
242
- this.control.parentElement?.appendChild(clone);
243
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedLineHeight, clone.clientHeight, "f");
244
- clone.remove();
245
- __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_setMinHeight).call(this);
246
- __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_setMaxHeight).call(this);
579
+ if (__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f") || !(this.control instanceof HTMLTextAreaElement)) {
580
+ return;
581
+ }
582
+ const clone = this.control.cloneNode(false);
583
+ clone.rows = 1;
584
+ clone.style.position = "absolute";
585
+ clone.style.visibility = "hidden";
586
+ clone.style.border = "none";
587
+ clone.style.padding = "0";
588
+ clone.style.height = "";
589
+ clone.style.minHeight = "";
590
+ clone.style.maxHeight = "";
591
+ clone.style.top = clone.style.bottom = clone.style.left = clone.style.right = "auto";
592
+ clone.style.overflow = "hidden";
593
+ this.control.parentElement?.appendChild(clone);
594
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedLineHeight, clone.clientHeight, "f");
595
+ clone.remove();
596
+ __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_setMinHeight).call(this);
597
+ __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_setMaxHeight).call(this);
247
598
  };
248
599
  _M3eTextareaAutosizeElement_cacheTextareaPlaceholderHeight = function _M3eTextareaAutosizeElement_cacheTextareaPlaceholderHeight() {
249
- if (!(this.control instanceof HTMLTextAreaElement) || __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, "f") != undefined) {
250
- return;
251
- }
252
- if (!this.control.placeholder) {
253
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, 0, "f");
254
- return;
255
- }
256
- const value = this.control.value;
257
- this.control.value = this.control.placeholder;
258
- __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_measureScrollHeight).call(this), "f");
259
- this.control.value = value;
600
+ if (!(this.control instanceof HTMLTextAreaElement) || __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, "f") != undefined) {
601
+ return;
602
+ }
603
+ if (!this.control.placeholder) {
604
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, 0, "f");
605
+ return;
606
+ }
607
+ const value = this.control.value;
608
+ this.control.value = this.control.placeholder;
609
+ __classPrivateFieldSet(this, _M3eTextareaAutosizeElement_cachedPlaceholderHeight, __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_instances, "m", _M3eTextareaAutosizeElement_measureScrollHeight).call(this), "f");
610
+ this.control.value = value;
260
611
  };
261
612
  _M3eTextareaAutosizeElement_setMinHeight = function _M3eTextareaAutosizeElement_setMinHeight() {
262
- const minHeight = this.minRows && __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f") ? `${this.minRows * __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f")}px` : null;
263
- if (minHeight && this.control) {
264
- this.control.style.minHeight = minHeight;
265
- }
613
+ const minHeight = this.minRows && __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f") ? `${this.minRows * __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f")}px` : null;
614
+ if (minHeight && this.control) {
615
+ this.control.style.minHeight = minHeight;
616
+ }
266
617
  };
267
618
  _M3eTextareaAutosizeElement_setMaxHeight = function _M3eTextareaAutosizeElement_setMaxHeight() {
268
- const maxHeight = this.maxRows && __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f") ? `${this.maxRows * __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f")}px` : null;
269
- if (maxHeight && this.control) {
270
- this.control.style.maxHeight = maxHeight;
271
- }
619
+ const maxHeight = this.maxRows && __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f") ? `${this.maxRows * __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_cachedLineHeight, "f")}px` : null;
620
+ if (maxHeight && this.control) {
621
+ this.control.style.maxHeight = maxHeight;
622
+ }
272
623
  };
273
624
  _M3eTextareaAutosizeElement_measureScrollHeight = function _M3eTextareaAutosizeElement_measureScrollHeight() {
274
- if (!this.control) {
275
- return 0;
276
- }
277
- const element = this.control;
278
- const previousMargin = element.style.marginBottom || "";
279
- const isFirefox = navigator.userAgent.includes("Firefox");
280
- const needsMarginFiller = isFirefox && __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_hasFocus, "f");
281
- if (needsMarginFiller) {
282
- element.style.marginBottom = `${element.clientHeight}px`;
283
- }
284
- const initialStyle = {
285
- padding: element.style.padding,
286
- boxSizing: element.style.boxSizing,
287
- height: element.style.height,
288
- overflow: element.style.overflow,
289
- };
290
- element.style.padding = "2px 0";
291
- element.style.boxSizing = "content-box";
292
- if (!isFirefox) {
293
- element.style.height = "auto";
294
- element.style.overflow = "hidden";
295
- }
296
- else {
297
- element.style.height = "0";
298
- }
299
- const scrollHeight = element.scrollHeight - 4;
300
- element.style.padding = initialStyle.padding;
301
- element.style.boxSizing = initialStyle.boxSizing;
302
- element.style.height = initialStyle.height;
303
- element.style.overflow = initialStyle.overflow;
304
- if (needsMarginFiller) {
305
- element.style.marginBottom = previousMargin;
306
- }
307
- return scrollHeight;
625
+ if (!this.control) {
626
+ return 0;
627
+ }
628
+ const element = this.control;
629
+ const previousMargin = element.style.marginBottom || "";
630
+ const isFirefox = navigator.userAgent.includes("Firefox");
631
+ const needsMarginFiller = isFirefox && __classPrivateFieldGet(this, _M3eTextareaAutosizeElement_hasFocus, "f");
632
+ if (needsMarginFiller) {
633
+ element.style.marginBottom = `${element.clientHeight}px`;
634
+ }
635
+ const initialStyle = {
636
+ padding: element.style.padding,
637
+ boxSizing: element.style.boxSizing,
638
+ height: element.style.height,
639
+ overflow: element.style.overflow
640
+ };
641
+ element.style.padding = "2px 0";
642
+ element.style.boxSizing = "content-box";
643
+ if (!isFirefox) {
644
+ element.style.height = "auto";
645
+ element.style.overflow = "hidden";
646
+ } else {
647
+ element.style.height = "0";
648
+ }
649
+ const scrollHeight = element.scrollHeight - 4;
650
+ element.style.padding = initialStyle.padding;
651
+ element.style.boxSizing = initialStyle.boxSizing;
652
+ element.style.height = initialStyle.height;
653
+ element.style.overflow = initialStyle.overflow;
654
+ if (needsMarginFiller) {
655
+ element.style.marginBottom = previousMargin;
656
+ }
657
+ return scrollHeight;
308
658
  };
309
659
  _M3eTextareaAutosizeElement_scrollToCaretPosition = function _M3eTextareaAutosizeElement_scrollToCaretPosition() {
310
- if (!(this.control instanceof HTMLTextAreaElement) || !__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_hasFocus, "f")) {
311
- return;
312
- }
313
- const { selectionStart, selectionEnd } = this.control;
314
- this.control.setSelectionRange(selectionStart, selectionEnd);
660
+ if (!(this.control instanceof HTMLTextAreaElement) || !__classPrivateFieldGet(this, _M3eTextareaAutosizeElement_hasFocus, "f")) {
661
+ return;
662
+ }
663
+ const {
664
+ selectionStart,
665
+ selectionEnd
666
+ } = this.control;
667
+ this.control.setSelectionRange(selectionStart, selectionEnd);
315
668
  };
316
669
  /** The styles of the element. */
317
- M3eTextareaAutosizeElement.styles = css `
318
- :host {
319
- display: none;
320
- }
321
- `;
322
- __decorate([
323
- n({ attribute: "max-rows", type: Number })
324
- ], M3eTextareaAutosizeElement.prototype, "maxRows", void 0);
325
- __decorate([
326
- n({ attribute: "min-rows", type: Number })
327
- ], M3eTextareaAutosizeElement.prototype, "minRows", void 0);
328
- __decorate([
329
- n({ type: Boolean, reflect: true })
330
- ], M3eTextareaAutosizeElement.prototype, "disabled", void 0);
331
- __decorate([
332
- debounce(16)
333
- ], M3eTextareaAutosizeElement.prototype, "_handleWindowResize", null);
334
- M3eTextareaAutosizeElement = __decorate([
335
- t$1("m3e-textarea-autosize")
336
- ], M3eTextareaAutosizeElement);
670
+ M3eTextareaAutosizeElement.styles = css`:host { display: none; }`;
671
+ __decorate([n({
672
+ attribute: "max-rows",
673
+ type: Number
674
+ })], M3eTextareaAutosizeElement.prototype, "maxRows", void 0);
675
+ __decorate([n({
676
+ attribute: "min-rows",
677
+ type: Number
678
+ })], M3eTextareaAutosizeElement.prototype, "minRows", void 0);
679
+ __decorate([n({
680
+ type: Boolean,
681
+ reflect: true
682
+ })], M3eTextareaAutosizeElement.prototype, "disabled", void 0);
683
+ __decorate([debounce(16)], M3eTextareaAutosizeElement.prototype, "_handleWindowResize", null);
684
+ M3eTextareaAutosizeElement = __decorate([t$1("m3e-textarea-autosize")], M3eTextareaAutosizeElement);
337
685
 
338
686
  export { M3eTextareaAutosizeElement };
339
687
  //# sourceMappingURL=index.js.map