@ni/spright-components 6.22.1 → 6.22.3

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.
@@ -108,12 +108,10 @@
108
108
  try {
109
109
  // Hopefully we never get here...
110
110
  // Not all environments allow eval and Function. Use only as a last resort:
111
- // eslint-disable-next-line no-new-func
112
111
  return new Function("return this")();
113
112
  }
114
113
  catch {
115
114
  // If all fails, give up and create an object.
116
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
117
115
  return {};
118
116
  }
119
117
  })();
@@ -194,6 +192,17 @@
194
192
  ...propConfig,
195
193
  });
196
194
  }
195
+ /**
196
+ * Core services shared across FAST instances.
197
+ * @internal
198
+ */
199
+ var KernelServiceId;
200
+ (function (KernelServiceId) {
201
+ KernelServiceId[KernelServiceId["updateQueue"] = 1] = "updateQueue";
202
+ KernelServiceId[KernelServiceId["observable"] = 2] = "observable";
203
+ KernelServiceId[KernelServiceId["contextEvent"] = 3] = "contextEvent";
204
+ KernelServiceId[KernelServiceId["elementRegistry"] = 4] = "elementRegistry";
205
+ })(KernelServiceId || (KernelServiceId = {}));
197
206
  /**
198
207
  * A readonly, empty array.
199
208
  * @remarks
@@ -224,7 +233,7 @@
224
233
  };
225
234
  }
226
235
 
227
- const updateQueue = $global.FAST.getById(1 /* KernelServiceId.updateQueue */, () => {
236
+ const updateQueue = $global.FAST.getById(KernelServiceId.updateQueue, () => {
228
237
  const tasks = [];
229
238
  const pendingErrors = [];
230
239
  function throwFirstError() {
@@ -275,11 +284,9 @@
275
284
  process,
276
285
  });
277
286
  });
278
- /* eslint-disable */
279
287
  const fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", {
280
288
  createHTML: html => html,
281
289
  });
282
- /* eslint-enable */
283
290
  let htmlPolicy = fastHTMLPolicy;
284
291
  const marker = `fast-${Math.random().toString(36).substring(2, 8)}`;
285
292
  /** @internal */
@@ -610,7 +617,7 @@
610
617
  * Common Observable APIs.
611
618
  * @public
612
619
  */
613
- const Observable = FAST.getById(2 /* KernelServiceId.observable */, () => {
620
+ const Observable = FAST.getById(KernelServiceId.observable, () => {
614
621
  const volatileRegex = /(\?\?|:|&&|\|\||if)/;
615
622
  const notifierLookup = new WeakMap();
616
623
  const queueUpdate = DOM.queueUpdate;
@@ -864,7 +871,7 @@
864
871
  },
865
872
  });
866
873
  }
867
- const contextEvent = FAST.getById(3 /* KernelServiceId.contextEvent */, () => {
874
+ const contextEvent = FAST.getById(KernelServiceId.contextEvent, () => {
868
875
  let current = null;
869
876
  return {
870
877
  get() {
@@ -1821,7 +1828,9 @@
1821
1828
  function separateSheetsToPrepend(sheets) {
1822
1829
  const prepend = [];
1823
1830
  const append = [];
1824
- sheets.forEach(x => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x));
1831
+ sheets.forEach(x =>
1832
+ // @ts-expect-error
1833
+ (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x));
1825
1834
  return { prepend, append };
1826
1835
  }
1827
1836
  let addAdoptedStyleSheets = (target, sheets) => {
@@ -2035,15 +2044,18 @@
2035
2044
  * @param value - The value to set the attribute/property to.
2036
2045
  */
2037
2046
  setValue(source, newValue) {
2047
+ // @ts-expect-error
2038
2048
  const oldValue = source[this.fieldName];
2039
2049
  const converter = this.converter;
2040
2050
  if (converter !== void 0) {
2041
2051
  newValue = converter.fromView(newValue);
2042
2052
  }
2043
2053
  if (oldValue !== newValue) {
2054
+ // @ts-expect-error
2044
2055
  source[this.fieldName] = newValue;
2045
2056
  this.tryReflectToAttribute(source);
2046
2057
  if (this.hasCallback) {
2058
+ // @ts-expect-error
2047
2059
  source[this.callbackName](oldValue, newValue);
2048
2060
  }
2049
2061
  source.$fastController.notify(this.name);
@@ -2055,6 +2067,7 @@
2055
2067
  */
2056
2068
  getValue(source) {
2057
2069
  Observable.track(source, this.name);
2070
+ // @ts-expect-error
2058
2071
  return source[this.fieldName];
2059
2072
  }
2060
2073
  /** @internal */
@@ -2074,6 +2087,7 @@
2074
2087
  }
2075
2088
  DOM.queueUpdate(() => {
2076
2089
  guards.add(element);
2090
+ // @ts-expect-error
2077
2091
  const latestValue = element[this.fieldName];
2078
2092
  switch (mode) {
2079
2093
  case "reflect":
@@ -2143,7 +2157,7 @@
2143
2157
 
2144
2158
  const defaultShadowOptions = { mode: "open" };
2145
2159
  const defaultElementOptions = {};
2146
- const fastRegistry = FAST.getById(4 /* KernelServiceId.elementRegistry */, () => {
2160
+ const fastRegistry = FAST.getById(KernelServiceId.elementRegistry, () => {
2147
2161
  const typeToDefinition = new Map();
2148
2162
  return Object.freeze({
2149
2163
  register(definition) {
@@ -2613,11 +2627,9 @@
2613
2627
  }
2614
2628
  }
2615
2629
 
2616
- /* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */
2617
2630
  function createFASTElement(BaseType) {
2618
2631
  return class extends BaseType {
2619
2632
  constructor() {
2620
- /* eslint-disable-next-line */
2621
2633
  super();
2622
2634
  Controller.forCustomElement(this);
2623
2635
  }
@@ -3178,7 +3190,6 @@
3178
3190
  }
3179
3191
  }
3180
3192
  /* eslint-disable prefer-rest-params */
3181
- /* eslint-disable @typescript-eslint/explicit-function-return-type */
3182
3193
  /**
3183
3194
  * Enables the array observation mechanism.
3184
3195
  * @remarks
@@ -3282,7 +3293,6 @@
3282
3293
  };
3283
3294
  }
3284
3295
  /* eslint-enable prefer-rest-params */
3285
- /* eslint-enable @typescript-eslint/explicit-function-return-type */
3286
3296
 
3287
3297
  /**
3288
3298
  * The runtime behavior for template references.
@@ -3310,7 +3320,6 @@
3310
3320
  * Unbinds this behavior from the source.
3311
3321
  * @param source - The source to unbind from.
3312
3322
  */
3313
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
3314
3323
  unbind() { }
3315
3324
  }
3316
3325
  /**
@@ -3917,7 +3926,7 @@
3917
3926
  * @returns The resolver.
3918
3927
  */
3919
3928
  instance(value) {
3920
- return this.registerResolver(0 /* ResolverStrategy.instance */, value);
3929
+ return this.registerResolver(ResolverStrategy.instance, value);
3921
3930
  }
3922
3931
  /**
3923
3932
  * Creates a resolver that enforces a singleton lifetime.
@@ -3925,7 +3934,7 @@
3925
3934
  * @returns The resolver.
3926
3935
  */
3927
3936
  singleton(value) {
3928
- return this.registerResolver(1 /* ResolverStrategy.singleton */, value);
3937
+ return this.registerResolver(ResolverStrategy.singleton, value);
3929
3938
  }
3930
3939
  /**
3931
3940
  * Creates a resolver that creates a new instance for every dependency request.
@@ -3933,7 +3942,7 @@
3933
3942
  * @returns - The resolver.
3934
3943
  */
3935
3944
  transient(value) {
3936
- return this.registerResolver(2 /* ResolverStrategy.transient */, value);
3945
+ return this.registerResolver(ResolverStrategy.transient, value);
3937
3946
  }
3938
3947
  /**
3939
3948
  * Creates a resolver that invokes a callback function for every dependency resolution
@@ -3942,7 +3951,7 @@
3942
3951
  * @returns The resolver.
3943
3952
  */
3944
3953
  callback(value) {
3945
- return this.registerResolver(3 /* ResolverStrategy.callback */, value);
3954
+ return this.registerResolver(ResolverStrategy.callback, value);
3946
3955
  }
3947
3956
  /**
3948
3957
  * Creates a resolver that invokes a callback function the first time that a dependency
@@ -3952,7 +3961,7 @@
3952
3961
  * @returns The resolver.
3953
3962
  */
3954
3963
  cachedCallback(value) {
3955
- return this.registerResolver(3 /* ResolverStrategy.callback */, cacheCallbackResult(value));
3964
+ return this.registerResolver(ResolverStrategy.callback, cacheCallbackResult(value));
3956
3965
  }
3957
3966
  /**
3958
3967
  * Aliases the current key to a different key.
@@ -3960,11 +3969,10 @@
3960
3969
  * @returns The resolver.
3961
3970
  */
3962
3971
  aliasTo(destinationKey) {
3963
- return this.registerResolver(5 /* ResolverStrategy.alias */, destinationKey);
3972
+ return this.registerResolver(ResolverStrategy.alias, destinationKey);
3964
3973
  }
3965
3974
  registerResolver(strategy, state) {
3966
3975
  const { container, key } = this;
3967
- /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
3968
3976
  this.container = this.key = (void 0);
3969
3977
  return container.registerResolver(key, new ResolverImpl(key, strategy, state));
3970
3978
  }
@@ -4000,7 +4008,7 @@
4000
4008
  * @returns The resolver.
4001
4009
  */
4002
4010
  singleton(key) {
4003
- return new ResolverImpl(key, 1 /* ResolverStrategy.singleton */, key);
4011
+ return new ResolverImpl(key, ResolverStrategy.singleton, key);
4004
4012
  },
4005
4013
  /**
4006
4014
  * Provides default transient resolution behavior during auto-registration.
@@ -4008,7 +4016,7 @@
4008
4016
  * @returns The resolver.
4009
4017
  */
4010
4018
  transient(key) {
4011
- return new ResolverImpl(key, 2 /* ResolverStrategy.transient */, key);
4019
+ return new ResolverImpl(key, ResolverStrategy.transient, key);
4012
4020
  },
4013
4021
  });
4014
4022
  /**
@@ -4230,8 +4238,10 @@
4230
4238
  const handleChange = () => {
4231
4239
  const newContainer = DI.findResponsibleContainer(this);
4232
4240
  const newValue = newContainer.get(key);
4241
+ // @ts-expect-error
4233
4242
  const oldValue = this[diPropertyKey];
4234
4243
  if (newValue !== oldValue) {
4244
+ // @ts-expect-error
4235
4245
  this[diPropertyKey] = value;
4236
4246
  notifier.notify(propertyName);
4237
4247
  }
@@ -4414,6 +4424,16 @@
4414
4424
  DI.inject;
4415
4425
  const defaultSingletonOptions = { scoped: false };
4416
4426
  /** @internal */
4427
+ var ResolverStrategy;
4428
+ (function (ResolverStrategy) {
4429
+ ResolverStrategy[ResolverStrategy["instance"] = 0] = "instance";
4430
+ ResolverStrategy[ResolverStrategy["singleton"] = 1] = "singleton";
4431
+ ResolverStrategy[ResolverStrategy["transient"] = 2] = "transient";
4432
+ ResolverStrategy[ResolverStrategy["callback"] = 3] = "callback";
4433
+ ResolverStrategy[ResolverStrategy["array"] = 4] = "array";
4434
+ ResolverStrategy[ResolverStrategy["alias"] = 5] = "alias";
4435
+ })(ResolverStrategy || (ResolverStrategy = {}));
4436
+ /** @internal */
4417
4437
  class ResolverImpl {
4418
4438
  constructor(key, strategy, state) {
4419
4439
  this.key = key;
@@ -4429,9 +4449,9 @@
4429
4449
  }
4430
4450
  resolve(handler, requestor) {
4431
4451
  switch (this.strategy) {
4432
- case 0 /* ResolverStrategy.instance */:
4452
+ case ResolverStrategy.instance:
4433
4453
  return this.state;
4434
- case 1 /* ResolverStrategy.singleton */: {
4454
+ case ResolverStrategy.singleton: {
4435
4455
  if (this.resolving) {
4436
4456
  throw new Error(`Cyclic dependency found: ${this.state.name}`);
4437
4457
  }
@@ -4439,11 +4459,11 @@
4439
4459
  this.state = handler
4440
4460
  .getFactory(this.state)
4441
4461
  .construct(requestor);
4442
- this.strategy = 0 /* ResolverStrategy.instance */;
4462
+ this.strategy = ResolverStrategy.instance;
4443
4463
  this.resolving = false;
4444
4464
  return this.state;
4445
4465
  }
4446
- case 2 /* ResolverStrategy.transient */: {
4466
+ case ResolverStrategy.transient: {
4447
4467
  // Always create transients from the requesting container
4448
4468
  const factory = handler.getFactory(this.state);
4449
4469
  if (factory === null) {
@@ -4451,11 +4471,11 @@
4451
4471
  }
4452
4472
  return factory.construct(requestor);
4453
4473
  }
4454
- case 3 /* ResolverStrategy.callback */:
4474
+ case ResolverStrategy.callback:
4455
4475
  return this.state(handler, requestor, this);
4456
- case 4 /* ResolverStrategy.array */:
4476
+ case ResolverStrategy.array:
4457
4477
  return this.state[0].resolve(handler, requestor);
4458
- case 5 /* ResolverStrategy.alias */:
4478
+ case ResolverStrategy.alias:
4459
4479
  return requestor.get(this.state);
4460
4480
  default:
4461
4481
  throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`);
@@ -4463,10 +4483,10 @@
4463
4483
  }
4464
4484
  getFactory(container) {
4465
4485
  switch (this.strategy) {
4466
- case 1 /* ResolverStrategy.singleton */:
4467
- case 2 /* ResolverStrategy.transient */:
4486
+ case ResolverStrategy.singleton:
4487
+ case ResolverStrategy.transient:
4468
4488
  return container.getFactory(this.state);
4469
- case 5 /* ResolverStrategy.alias */:
4489
+ case ResolverStrategy.alias:
4470
4490
  return container.getResolver(this.state)?.getFactory?.(container) ?? null;
4471
4491
  default:
4472
4492
  return null;
@@ -4653,11 +4673,11 @@
4653
4673
  resolvers.set(key, resolver);
4654
4674
  }
4655
4675
  else if (result instanceof ResolverImpl &&
4656
- result.strategy === 4 /* ResolverStrategy.array */) {
4676
+ result.strategy === ResolverStrategy.array) {
4657
4677
  result.state.push(resolver);
4658
4678
  }
4659
4679
  else {
4660
- resolvers.set(key, new ResolverImpl(key, 4 /* ResolverStrategy.array */, [result, resolver]));
4680
+ resolvers.set(key, new ResolverImpl(key, ResolverStrategy.array, [result, resolver]));
4661
4681
  }
4662
4682
  return resolver;
4663
4683
  }
@@ -4749,9 +4769,7 @@
4749
4769
  while (current != null) {
4750
4770
  resolver = current.resolvers.get(key);
4751
4771
  if (resolver != null) {
4752
- resolutions = resolutions.concat(
4753
- /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
4754
- buildAllResponse(resolver, current, requestor));
4772
+ resolutions = resolutions.concat(buildAllResponse(resolver, current, requestor));
4755
4773
  }
4756
4774
  current = current.parent;
4757
4775
  }
@@ -4857,7 +4875,7 @@
4857
4875
  * @param value - The instance to return when the key is requested.
4858
4876
  */
4859
4877
  instance(key, value) {
4860
- return new ResolverImpl(key, 0 /* ResolverStrategy.instance */, value);
4878
+ return new ResolverImpl(key, ResolverStrategy.instance, value);
4861
4879
  },
4862
4880
  /**
4863
4881
  * Creates an instance from the class.
@@ -4872,7 +4890,7 @@
4872
4890
  * @param value - The class to instantiate as a singleton when first requested.
4873
4891
  */
4874
4892
  singleton(key, value) {
4875
- return new ResolverImpl(key, 1 /* ResolverStrategy.singleton */, value);
4893
+ return new ResolverImpl(key, ResolverStrategy.singleton, value);
4876
4894
  },
4877
4895
  /**
4878
4896
  * Creates an instance from a class.
@@ -4887,7 +4905,7 @@
4887
4905
  * @param value - The class to instantiate each time the key is requested.
4888
4906
  */
4889
4907
  transient(key, value) {
4890
- return new ResolverImpl(key, 2 /* ResolverStrategy.transient */, value);
4908
+ return new ResolverImpl(key, ResolverStrategy.transient, value);
4891
4909
  },
4892
4910
  /**
4893
4911
  * Delegates to a callback function to provide the dependency.
@@ -4904,7 +4922,7 @@
4904
4922
  * @param callback - The function that is expected to return the dependency.
4905
4923
  */
4906
4924
  callback(key, callback) {
4907
- return new ResolverImpl(key, 3 /* ResolverStrategy.callback */, callback);
4925
+ return new ResolverImpl(key, ResolverStrategy.callback, callback);
4908
4926
  },
4909
4927
  /**
4910
4928
  * Delegates to a callback function to provide the dependency and then caches the
@@ -4923,7 +4941,7 @@
4923
4941
  * Should all references to the resolver returned be removed, the cache will expire.
4924
4942
  */
4925
4943
  cachedCallback(key, callback) {
4926
- return new ResolverImpl(key, 3 /* ResolverStrategy.callback */, cacheCallbackResult(callback));
4944
+ return new ResolverImpl(key, ResolverStrategy.callback, cacheCallbackResult(callback));
4927
4945
  },
4928
4946
  /**
4929
4947
  * Creates an alternate {@link Key} to retrieve an instance by.
@@ -4940,7 +4958,7 @@
4940
4958
  * @param aliasKey - The alias to the original key.
4941
4959
  */
4942
4960
  aliasTo(originalKey, aliasKey) {
4943
- return new ResolverImpl(aliasKey, 5 /* ResolverStrategy.alias */, originalKey);
4961
+ return new ResolverImpl(aliasKey, ResolverStrategy.alias, originalKey);
4944
4962
  },
4945
4963
  });
4946
4964
  /** @internal */
@@ -4951,7 +4969,7 @@
4951
4969
  }
4952
4970
  function buildAllResponse(resolver, handler, requestor) {
4953
4971
  if (resolver instanceof ResolverImpl &&
4954
- resolver.strategy === 4 /* ResolverStrategy.array */) {
4972
+ resolver.strategy === ResolverStrategy.array) {
4955
4973
  const state = resolver.state;
4956
4974
  let i = state.length;
4957
4975
  const results = new Array(i);
@@ -5268,9 +5286,7 @@
5268
5286
  baseCtors.forEach(baseCtor => {
5269
5287
  Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
5270
5288
  if (name !== "constructor") {
5271
- Object.defineProperty(derivedCtor.prototype, name,
5272
- /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
5273
- Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
5289
+ Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
5274
5290
  }
5275
5291
  });
5276
5292
  const baseAttributes = AttributeConfiguration.locate(baseCtor);
@@ -5366,7 +5382,7 @@
5366
5382
  styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0);
5367
5383
  _canUseFocusVisible = true;
5368
5384
  }
5369
- catch (_a) {
5385
+ catch {
5370
5386
  _canUseFocusVisible = false;
5371
5387
  }
5372
5388
  finally {
@@ -9087,6 +9103,7 @@
9087
9103
  constructor(source) {
9088
9104
  super();
9089
9105
  const sheet = new CSSStyleSheet();
9106
+ // @ts-expect-error
9090
9107
  sheet[prependToAdoptedStyleSheetsSymbol] = true;
9091
9108
  this.target = sheet.cssRules[sheet.insertRule(":host{}")].style;
9092
9109
  source.$fastController.addStyles(ElementStyles.create([sheet]));
@@ -9266,7 +9283,6 @@
9266
9283
  };
9267
9284
  }
9268
9285
  if (propertyTargetCache.has(source)) {
9269
- /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
9270
9286
  return propertyTargetCache.get(source);
9271
9287
  }
9272
9288
  let target;
@@ -9938,9 +9954,7 @@
9938
9954
  RootStyleSheetTarget.unregisterRoot(target);
9939
9955
  },
9940
9956
  });
9941
- /* eslint-enable @typescript-eslint/no-non-null-assertion */
9942
9957
 
9943
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
9944
9958
  /**
9945
9959
  * Indicates what to do with an ambiguous (duplicate) element.
9946
9960
  * @public
@@ -10144,7 +10158,6 @@
10144
10158
  return DesignSystem.tagFor(type);
10145
10159
  }
10146
10160
  }
10147
- /* eslint-enable @typescript-eslint/no-non-null-assertion */
10148
10161
 
10149
10162
  /*!
10150
10163
  * tabbable 6.5.0
@@ -11994,6 +12007,7 @@
11994
12007
  return (this.parentToolbar ?? false);
11995
12008
  }
11996
12009
  get isInsideFoundationToolbar() {
12010
+ // @ts-expect-error
11997
12011
  return !!this.parentToolbar?.["$fastController"];
11998
12012
  }
11999
12013
  /**
@@ -12964,8 +12978,11 @@
12964
12978
  }
12965
12979
  // If the original property isn't emptied out,
12966
12980
  // the next set will morph into a grid-area style setting that is not what we want
12981
+ // @ts-expect-error
12967
12982
  tab.style[gridHorizontalProperty] = "";
12983
+ // @ts-expect-error
12968
12984
  tab.style[gridVerticalProperty] = "";
12985
+ // @ts-expect-error
12969
12986
  tab.style[gridProperty] = `${index + 1}`;
12970
12987
  if (!this.isHorizontal()) {
12971
12988
  tab.classList.add("vertical");
@@ -13183,15 +13200,20 @@
13183
13200
  ? "translateX"
13184
13201
  : "translateY";
13185
13202
  const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop";
13203
+ // @ts-expect-error
13186
13204
  const prev = this.activeIndicatorRef[offsetProperty];
13205
+ // @ts-expect-error
13187
13206
  this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`;
13207
+ // @ts-expect-error
13188
13208
  const next = this.activeIndicatorRef[offsetProperty];
13209
+ // @ts-expect-error
13189
13210
  this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`;
13190
13211
  const dif = next - prev;
13191
13212
  this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`;
13192
13213
  this.activeIndicatorRef.classList.add("activeIndicatorTransition");
13193
13214
  this.activeIndicatorRef.addEventListener("transitionend", () => {
13194
13215
  this.ticking = false;
13216
+ // @ts-expect-error
13195
13217
  this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`;
13196
13218
  this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`;
13197
13219
  this.activeIndicatorRef.classList.remove("activeIndicatorTransition");
@@ -13590,7 +13612,10 @@
13590
13612
  * @internal
13591
13613
  */
13592
13614
  getDirectionalIncrementer(key) {
13593
- return (ToolbarArrowKeyMap[key]?.[this.orientation]?.[this.direction] ??
13615
+ return (
13616
+ // @ts-expect-error
13617
+ ToolbarArrowKeyMap[key]?.[this.orientation]?.[this.direction] ??
13618
+ // @ts-expect-error
13594
13619
  ToolbarArrowKeyMap[key]?.[this.orientation] ??
13595
13620
  0);
13596
13621
  }
@@ -15197,6 +15222,30 @@
15197
15222
  this.b = blue;
15198
15223
  this.a = typeof alpha === "number" && !isNaN(alpha) ? alpha : 1;
15199
15224
  }
15225
+ /**
15226
+ * The red value
15227
+ * @remarks
15228
+ * Scaled to the range [0.0 , 1.0]. Values outside this range are allowed but any methods that convert or tostring the values will also be clamped
15229
+ */
15230
+ r;
15231
+ /**
15232
+ * The green value
15233
+ * @remarks
15234
+ * Scaled to the range [0.0 , 1.0]. Values outside this range are allowed but any methods that convert or tostring the values will also be clamped
15235
+ */
15236
+ g;
15237
+ /**
15238
+ * The blue value
15239
+ * @remarks
15240
+ * Scaled to the range [0.0 , 1.0]. Values outside this range are allowed but any methods that convert or tostring the values will also be clamped
15241
+ */
15242
+ b;
15243
+ /**
15244
+ * The alpha value
15245
+ * @remarks
15246
+ * Scaled to the range [0.0 , 1.0]. Values outside this range are allowed but any methods that convert or tostring the values will also be clamped
15247
+ */
15248
+ a;
15200
15249
  /**
15201
15250
  * Determines if one color is equal to another.
15202
15251
  * @param rhs - the color to compare
@@ -52298,6 +52347,19 @@ img.ProseMirror-separator {
52298
52347
  const QUOTE_TEST_RE = /['"]/;
52299
52348
  const QUOTE_RE = /['"]/g;
52300
52349
  const APOSTROPHE$1 = '\u2019'; /* ’ */
52350
+ // Caps memory on malicious input
52351
+ const MAX_OPENERS = 1000;
52352
+
52353
+ function truncateStack (stack, heads, length) {
52354
+ while (stack.length > length) {
52355
+ const item = stack.pop();
52356
+ if (item.isSingleQuote) {
52357
+ heads.single = item.prevSameQuoteIdx;
52358
+ } else {
52359
+ heads.double = item.prevSameQuoteIdx;
52360
+ }
52361
+ }
52362
+ }
52301
52363
 
52302
52364
  function addReplacement (replacements, tokenIdx, pos, ch) {
52303
52365
  if (!replacements[tokenIdx]) {
@@ -52327,6 +52389,8 @@ img.ProseMirror-separator {
52327
52389
  let j;
52328
52390
 
52329
52391
  const stack = [];
52392
+ // stack indexes of topmost openers of each type (-1 if none)
52393
+ const heads = { single: -1, double: -1 };
52330
52394
  // token index -> list of replacements in the original token content
52331
52395
  const replacements = {};
52332
52396
 
@@ -52338,7 +52402,7 @@ img.ProseMirror-separator {
52338
52402
  for (j = stack.length - 1; j >= 0; j--) {
52339
52403
  if (stack[j].level <= thisLevel) { break }
52340
52404
  }
52341
- stack.length = j + 1;
52405
+ truncateStack(stack, heads, j + 1);
52342
52406
 
52343
52407
  if (token.type !== 'text') { continue }
52344
52408
 
@@ -52442,39 +52506,45 @@ img.ProseMirror-separator {
52442
52506
  }
52443
52507
 
52444
52508
  if (canClose) {
52445
- // this could be a closing quote, rewind the stack to get a match
52446
- for (j = stack.length - 1; j >= 0; j--) {
52447
- let item = stack[j];
52448
- if (stack[j].level < thisLevel) { break }
52449
- if (item.single === isSingle && stack[j].level === thisLevel) {
52450
- item = stack[j];
52451
-
52452
- let openQuote;
52453
- let closeQuote;
52454
- if (isSingle) {
52455
- openQuote = state.md.options.quotes[2];
52456
- closeQuote = state.md.options.quotes[3];
52457
- } else {
52458
- openQuote = state.md.options.quotes[0];
52459
- closeQuote = state.md.options.quotes[1];
52460
- }
52509
+ // Stack levels never decrease, so an opener of this type below
52510
+ // the current level means there is no match
52511
+ j = isSingle ? heads.single : heads.double;
52512
+ if (j >= 0 && stack[j].level === thisLevel) {
52513
+ const item = stack[j];
52514
+
52515
+ let openQuote;
52516
+ let closeQuote;
52517
+ if (isSingle) {
52518
+ openQuote = state.md.options.quotes[2];
52519
+ closeQuote = state.md.options.quotes[3];
52520
+ } else {
52521
+ openQuote = state.md.options.quotes[0];
52522
+ closeQuote = state.md.options.quotes[1];
52523
+ }
52461
52524
 
52462
- addReplacement(replacements, i, t.index, closeQuote);
52463
- addReplacement(replacements, item.token, item.pos, openQuote);
52525
+ addReplacement(replacements, i, t.index, closeQuote);
52526
+ addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote);
52464
52527
 
52465
- stack.length = j;
52466
- continue OUTER
52467
- }
52528
+ truncateStack(stack, heads, j);
52529
+ continue OUTER
52468
52530
  }
52469
52531
  }
52470
52532
 
52471
52533
  if (canOpen) {
52534
+ if (stack.length >= MAX_OPENERS) { return }
52472
52535
  stack.push({
52473
- token: i,
52474
- pos: t.index,
52475
- single: isSingle,
52476
- level: thisLevel
52536
+ tokenIdx: i,
52537
+ contentPos: t.index,
52538
+ isSingleQuote: isSingle,
52539
+ level: thisLevel,
52540
+ // stack index of the previous opener of the same quote type, -1 if none
52541
+ prevSameQuoteIdx: isSingle ? heads.single : heads.double
52477
52542
  });
52543
+ if (isSingle) {
52544
+ heads.single = stack.length - 1;
52545
+ } else {
52546
+ heads.double = stack.length - 1;
52547
+ }
52478
52548
  } else if (canClose && isSingle) {
52479
52549
  addReplacement(replacements, i, t.index, APOSTROPHE$1);
52480
52550
  }
@@ -76441,8 +76511,11 @@ focus outline in that case.
76441
76511
  </template>
76442
76512
  `;
76443
76513
 
76444
- function createLazyMeasurementsView(count, flat, getItemKey) {
76445
- const cache = new Array(count);
76514
+ function getMeasurementKey(item) {
76515
+ return typeof item === "object" ? item.key : item;
76516
+ }
76517
+ function createLazyMeasurementsView(cache, flat) {
76518
+ const count = cache.length;
76446
76519
  return new Proxy(cache, {
76447
76520
  get(target, prop, receiver) {
76448
76521
  if (typeof prop === "string") {
@@ -76451,11 +76524,11 @@ focus outline in that case.
76451
76524
  const i = +prop;
76452
76525
  if (Number.isInteger(i) && i >= 0 && i < count) {
76453
76526
  let v = target[i];
76454
- if (!v) {
76527
+ if (typeof v !== "object") {
76455
76528
  const s = flat[i * 2];
76456
76529
  v = target[i] = {
76457
76530
  index: i,
76458
- key: getItemKey(i),
76531
+ key: v,
76459
76532
  start: s,
76460
76533
  size: flat[i * 2 + 1],
76461
76534
  end: s + flat[i * 2 + 1],
@@ -76627,7 +76700,7 @@ focus outline in that case.
76627
76700
  let offset = 0;
76628
76701
  const fallback = registerScrollendEvent ? null : debounce(
76629
76702
  targetWindow,
76630
- () => cb(offset, false),
76703
+ () => cb(readOffset(element), false),
76631
76704
  instance.options.isScrollingResetDelay
76632
76705
  );
76633
76706
  const createHandler = (isScrolling) => () => {
@@ -76689,6 +76762,27 @@ focus outline in that case.
76689
76762
  });
76690
76763
  };
76691
76764
  const elementScroll = scrollWithAdjustments;
76765
+ function isAppendWithTrim(prevCount, nextCount, getPreviousKey, getNextKey) {
76766
+ if (nextCount === 0) return false;
76767
+ const firstKey = getNextKey(0);
76768
+ const removedKeys = /* @__PURE__ */ new Set();
76769
+ let removedCount = 0;
76770
+ while (removedCount < prevCount) {
76771
+ const key = getPreviousKey(removedCount);
76772
+ if (key === firstKey) break;
76773
+ removedKeys.add(key);
76774
+ removedCount++;
76775
+ }
76776
+ const retainedCount = prevCount - removedCount;
76777
+ if (retainedCount === 0 || retainedCount >= nextCount) return false;
76778
+ for (let i = 0; i < retainedCount; i++) {
76779
+ if (getNextKey(i) !== getPreviousKey(removedCount + i)) return false;
76780
+ }
76781
+ for (let i = retainedCount; i < nextCount; i++) {
76782
+ if (removedKeys.has(getNextKey(i))) return false;
76783
+ }
76784
+ return true;
76785
+ }
76692
76786
  let Virtualizer$1 = class Virtualizer {
76693
76787
  constructor(opts) {
76694
76788
  this.unsubs = [];
@@ -76697,7 +76791,7 @@ focus outline in that case.
76697
76791
  this.isScrolling = false;
76698
76792
  this.scrollState = null;
76699
76793
  this.measurementsCache = [];
76700
- this._flatMeasurements = null;
76794
+ this._singleLaneMeasurements = null;
76701
76795
  this.itemSizeCache = /* @__PURE__ */ new Map();
76702
76796
  this.itemSizeCacheVersion = 0;
76703
76797
  this.laneAssignments = /* @__PURE__ */ new Map();
@@ -76715,6 +76809,7 @@ focus outline in that case.
76715
76809
  this._iosJustTouchEnded = false;
76716
76810
  this._iosTouchEndTimerId = null;
76717
76811
  this._intendedScrollOffset = null;
76812
+ this._clampedAdjustment = null;
76718
76813
  this.elementsCache = /* @__PURE__ */ new Map();
76719
76814
  this.now = () => {
76720
76815
  var _a, _b, _c;
@@ -76774,7 +76869,7 @@ focus outline in that case.
76774
76869
  })();
76775
76870
  this.range = null;
76776
76871
  this.setOptions = (opts2) => {
76777
- var _a, _b;
76872
+ var _a;
76778
76873
  const merged = {
76779
76874
  debug: false,
76780
76875
  initialOffset: 0,
@@ -76818,8 +76913,10 @@ focus outline in that case.
76818
76913
  const prevCount = prevOptions.count;
76819
76914
  const nextCount = merged.count;
76820
76915
  const measurements = this.getMeasurements();
76821
- const prevFirstKey = prevCount > 0 ? ((_a = measurements[0]) == null ? void 0 : _a.key) ?? prevOptions.getItemKey(0) : null;
76822
- const prevLastKey = prevCount > 0 ? ((_b = measurements[prevCount - 1]) == null ? void 0 : _b.key) ?? prevOptions.getItemKey(prevCount - 1) : null;
76916
+ const previousItems = ((_a = this._singleLaneMeasurements) == null ? void 0 : _a.items) ?? measurements;
76917
+ const getPreviousKey = (index) => getMeasurementKey(previousItems[index]);
76918
+ const prevFirstKey = prevCount > 0 ? getPreviousKey(0) : null;
76919
+ const prevLastKey = prevCount > 0 ? getPreviousKey(prevCount - 1) : null;
76823
76920
  const didCountChange = nextCount !== prevCount;
76824
76921
  const didEdgeKeysChange = didCountChange || prevCount > 0 && nextCount > 0 && (merged.getItemKey(0) !== prevFirstKey || merged.getItemKey(nextCount - 1) !== prevLastKey);
76825
76922
  if (didEdgeKeysChange) {
@@ -76829,8 +76926,15 @@ focus outline in that case.
76829
76926
  anchor = [item.key, this.getScrollOffset() - item.start];
76830
76927
  }
76831
76928
  const behavior = merged.followOnAppend === true ? "auto" : merged.followOnAppend || null;
76832
- if (behavior && nextCount > prevCount && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
76833
- followOnAppend = behavior;
76929
+ if (behavior && nextCount > 0 && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
76930
+ if (nextCount > prevCount || isAppendWithTrim(
76931
+ prevCount,
76932
+ nextCount,
76933
+ getPreviousKey,
76934
+ merged.getItemKey
76935
+ )) {
76936
+ followOnAppend = behavior;
76937
+ }
76834
76938
  }
76835
76939
  }
76836
76940
  }
@@ -76853,7 +76957,7 @@ focus outline in that case.
76853
76957
  const anchorItem = newMeasurements[idx];
76854
76958
  if (anchorItem) {
76855
76959
  const newOffset = Math.max(0, anchorItem.start + anchorOffset);
76856
- if (newOffset !== this.scrollOffset) {
76960
+ if (!followOnAppend && newOffset !== this.scrollOffset) {
76857
76961
  anchorDelta = newOffset - this.scrollOffset;
76858
76962
  this.scrollOffset = newOffset;
76859
76963
  anchorResolved = true;
@@ -76910,6 +77014,7 @@ focus outline in that case.
76910
77014
  this._iosDeferredAdjustment = 0;
76911
77015
  this._iosTouching = false;
76912
77016
  this._iosJustTouchEnded = false;
77017
+ this._clampedAdjustment = null;
76913
77018
  this.scrollElement = null;
76914
77019
  this.targetWindow = null;
76915
77020
  };
@@ -76919,7 +77024,7 @@ focus outline in that case.
76919
77024
  };
76920
77025
  };
76921
77026
  this._willUpdate = () => {
76922
- var _a;
77027
+ var _a, _b;
76923
77028
  const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
76924
77029
  if (this.scrollElement !== scrollElement) {
76925
77030
  this.cleanup();
@@ -76951,6 +77056,9 @@ focus outline in that case.
76951
77056
  offset = this._intendedScrollOffset;
76952
77057
  }
76953
77058
  this._intendedScrollOffset = null;
77059
+ if (this._clampedAdjustment !== null && Math.abs(offset - this._clampedAdjustment.maxAtWrite) >= 1.5) {
77060
+ this._clampedAdjustment = null;
77061
+ }
76954
77062
  this.scrollAdjustments = 0;
76955
77063
  const prevOffset = this.getScrollOffset();
76956
77064
  this.scrollDirection = isScrolling ? prevOffset === offset ? this.scrollDirection : prevOffset < offset ? "forward" : "backward" : null;
@@ -77018,7 +77126,11 @@ focus outline in that case.
77018
77126
  if (anchorDelta !== 0) {
77019
77127
  this._iosDeferredAdjustment += anchorDelta;
77020
77128
  }
77021
- } else {
77129
+ } else if (((_b = this.scrollState) == null ? void 0 : _b.behavior) === "smooth" && !approxEqual(
77130
+ this.getScrollOffset() - anchorDelta,
77131
+ this.scrollState.lastTargetOffset
77132
+ )) ;
77133
+ else {
77022
77134
  this._scrollToOffset(this.getScrollOffset(), {
77023
77135
  adjustments: void 0,
77024
77136
  behavior: void 0
@@ -77029,6 +77141,21 @@ focus outline in that case.
77029
77141
  this.scrollToEnd({ behavior: followOnAppend });
77030
77142
  }
77031
77143
  }
77144
+ this._retryClampedAdjustment();
77145
+ };
77146
+ this._retryClampedAdjustment = () => {
77147
+ if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled) {
77148
+ return;
77149
+ }
77150
+ const { target, maxAtWrite } = this._clampedAdjustment;
77151
+ const max = this.getMaxScrollOffset();
77152
+ if (max > maxAtWrite + 0.5) {
77153
+ this._clampedAdjustment = target > max + 0.5 ? { target, maxAtWrite: max } : null;
77154
+ this._scrollToOffset(target, {
77155
+ adjustments: void 0,
77156
+ behavior: void 0
77157
+ });
77158
+ }
77032
77159
  };
77033
77160
  this._flushIosDeferredIfReady = () => {
77034
77161
  if (this._iosDeferredAdjustment === 0) return;
@@ -77112,9 +77239,11 @@ focus outline in that case.
77112
77239
  laneAssignmentMode,
77113
77240
  gap
77114
77241
  }, _itemSizeCacheVersion) => {
77242
+ var _a;
77115
77243
  const itemSizeCache = this.itemSizeCache;
77116
77244
  if (!enabled) {
77117
77245
  this.measurementsCache = [];
77246
+ this._singleLaneMeasurements = null;
77118
77247
  this.itemSizeCache.clear();
77119
77248
  this.laneAssignments.clear();
77120
77249
  return [];
@@ -77130,6 +77259,7 @@ focus outline in that case.
77130
77259
  this.lanesChangedFlag = false;
77131
77260
  this.lanesSettling = true;
77132
77261
  this.measurementsCache = [];
77262
+ this._singleLaneMeasurements = null;
77133
77263
  this.itemSizeCache.clear();
77134
77264
  this.laneAssignments.clear();
77135
77265
  this.pendingMin = null;
@@ -77147,13 +77277,13 @@ focus outline in that case.
77147
77277
  }
77148
77278
  if (lanes === 1) {
77149
77279
  const need = count * 2;
77150
- let flat = this._flatMeasurements;
77280
+ let flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77151
77281
  if (!flat || flat.length < need) {
77152
77282
  const next = new Float64Array(need);
77153
77283
  if (flat && min > 0) next.set(flat.subarray(0, min * 2));
77154
77284
  flat = next;
77155
- this._flatMeasurements = flat;
77156
77285
  }
77286
+ const items = min === 0 ? new Array(count) : this._singleLaneMeasurements.items.slice();
77157
77287
  let runningStart;
77158
77288
  if (min === 0) {
77159
77289
  runningStart = paddingStart + scrollMargin;
@@ -77163,13 +77293,15 @@ focus outline in that case.
77163
77293
  }
77164
77294
  for (let i = min; i < count; i++) {
77165
77295
  const key = getItemKey(i);
77296
+ items[i] = key;
77166
77297
  const measuredSize = itemSizeCache.get(key);
77167
77298
  const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
77168
77299
  flat[i * 2] = runningStart;
77169
77300
  flat[i * 2 + 1] = size;
77170
77301
  runningStart += size + gap;
77171
77302
  }
77172
- const view = createLazyMeasurementsView(count, flat, getItemKey);
77303
+ this._singleLaneMeasurements = { flat, items };
77304
+ const view = createLazyMeasurementsView(items, flat);
77173
77305
  this.measurementsCache = view;
77174
77306
  return view;
77175
77307
  }
@@ -77264,7 +77396,7 @@ focus outline in that case.
77264
77396
  lanes,
77265
77397
  // Pass the typed array so binary search + forward-walk can read
77266
77398
  // start/end directly from Float64Array, skipping the Proxy traps.
77267
- lanes === 1 && this._flatMeasurements != null ? this._flatMeasurements : null
77399
+ lanes === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null
77268
77400
  );
77269
77401
  return this.range;
77270
77402
  },
@@ -77361,13 +77493,13 @@ focus outline in that case.
77361
77493
  }
77362
77494
  };
77363
77495
  this.resizeItem = (index, size) => {
77364
- var _a, _b;
77496
+ var _a, _b, _c;
77365
77497
  if (!this.isIndexInRange(index)) return;
77366
77498
  let cachedSize;
77367
77499
  let itemStart;
77368
77500
  let key;
77369
- const flat = this._flatMeasurements;
77370
- if (this.options.lanes === 1 && flat !== null) {
77501
+ const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77502
+ if (this.options.lanes === 1 && flat != null) {
77371
77503
  key = this.options.getItemKey(index);
77372
77504
  itemStart = flat[index * 2];
77373
77505
  cachedSize = flat[index * 2 + 1];
@@ -77381,7 +77513,7 @@ focus outline in that case.
77381
77513
  const itemSize = this.itemSizeCache.get(key) ?? cachedSize;
77382
77514
  const delta = size - itemSize;
77383
77515
  if (delta !== 0) {
77384
- const wasAtEnd = this.options.anchorTo === "end" && ((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
77516
+ const wasAtEnd = this.options.anchorTo === "end" && ((_b = this.scrollState) == null ? void 0 : _b.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
77385
77517
  const prevTotalSize = wasAtEnd ? this.getTotalSize() : 0;
77386
77518
  const scrollOffsetWithAdj = this.getScrollOffset() + this.scrollAdjustments;
77387
77519
  const isFirstMeasure = !this.itemSizeCache.has(key);
@@ -77400,7 +77532,7 @@ focus outline in that case.
77400
77532
  // scrolling up" cascade.
77401
77533
  itemStart + itemSize <= scrollOffsetWithAdj && this.scrollDirection !== "backward"
77402
77534
  );
77403
- const shouldAdjustScroll = ((_b = this.scrollState) == null ? void 0 : _b.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
77535
+ const shouldAdjustScroll = ((_c = this.scrollState) == null ? void 0 : _c.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
77404
77536
  // The callback expects a VirtualItem; build one lazily only
77405
77537
  // when the consumer actually supplied a custom predicate.
77406
77538
  this.measurementsCache[index] ?? {
@@ -77428,6 +77560,7 @@ focus outline in that case.
77428
77560
  adjustedSync = this.applyScrollAdjustment(delta);
77429
77561
  }
77430
77562
  this.notify(adjustedSync);
77563
+ this._retryClampedAdjustment();
77431
77564
  }
77432
77565
  };
77433
77566
  this.getVirtualItems = memo(
@@ -77447,11 +77580,12 @@ focus outline in that case.
77447
77580
  }
77448
77581
  );
77449
77582
  this.getVirtualItemForOffset = (offset) => {
77583
+ var _a;
77450
77584
  const measurements = this.getMeasurements();
77451
77585
  if (measurements.length === 0) {
77452
77586
  return void 0;
77453
77587
  }
77454
- const flat = this._flatMeasurements;
77588
+ const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77455
77589
  const useFlat = this.options.lanes === 1 && flat != null;
77456
77590
  const idx = findNearestBinarySearch(
77457
77591
  0,
@@ -77586,18 +77720,18 @@ focus outline in that case.
77586
77720
  });
77587
77721
  };
77588
77722
  this.getTotalSize = () => {
77589
- var _a;
77723
+ var _a, _b;
77590
77724
  const measurements = this.getMeasurements();
77591
77725
  let end;
77592
77726
  if (measurements.length === 0) {
77593
77727
  end = this.options.paddingStart;
77594
77728
  } else if (this.options.lanes === 1) {
77595
77729
  const lastIdx = measurements.length - 1;
77596
- const flat = this._flatMeasurements;
77730
+ const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77597
77731
  if (flat != null) {
77598
77732
  end = flat[lastIdx * 2] + flat[lastIdx * 2 + 1];
77599
77733
  } else {
77600
- end = ((_a = measurements[lastIdx]) == null ? void 0 : _a.end) ?? 0;
77734
+ end = ((_b = measurements[lastIdx]) == null ? void 0 : _b.end) ?? 0;
77601
77735
  }
77602
77736
  } else {
77603
77737
  const endByLane = Array(this.options.lanes).fill(null);
@@ -77663,6 +77797,10 @@ focus outline in that case.
77663
77797
  this._iosDeferredAdjustment += delta;
77664
77798
  return false;
77665
77799
  } else {
77800
+ const target = this.getScrollOffset() + this.scrollAdjustments + delta;
77801
+ const el = this.scrollElement;
77802
+ const maxAtWrite = el !== null && ("scrollHeight" in el || "document" in el) ? this.getMaxScrollOffset() : null;
77803
+ this._clampedAdjustment = maxAtWrite !== null && target > maxAtWrite + 0.5 ? { target, maxAtWrite } : null;
77666
77804
  this._scrollToOffset(this.getScrollOffset(), {
77667
77805
  adjustments: this.scrollAdjustments += delta,
77668
77806
  behavior
@@ -104504,9 +104642,12 @@ focus outline in that case.
104504
104642
  :host {
104505
104643
  min-width: ${standardPadding};
104506
104644
  min-height: ${standardPadding};
104645
+ width: fit-content;
104646
+ max-width: 100%;
104507
104647
 
104508
104648
  flex-direction: row;
104509
104649
  justify-content: flex-start;
104650
+ align-self: flex-start;
104510
104651
  flex-shrink: 0;
104511
104652
  font: ${bodyFont};
104512
104653
  color: ${bodyFontColor};
@@ -104515,7 +104656,7 @@ focus outline in that case.
104515
104656
  .container {
104516
104657
  display: flex;
104517
104658
  flex-direction: column;
104518
- max-width: calc(90%);
104659
+ width: 100%;
104519
104660
  }
104520
104661
 
104521
104662
  [part='start'] {
@@ -104525,6 +104666,7 @@ focus outline in that case.
104525
104666
  .message-content {
104526
104667
  width: fit-content;
104527
104668
  height: fit-content;
104669
+ max-width: 100%;
104528
104670
  overflow-x: auto;
104529
104671
  }
104530
104672
 
@@ -104607,9 +104749,12 @@ focus outline in that case.
104607
104749
  :host {
104608
104750
  min-width: ${standardPadding};
104609
104751
  min-height: ${standardPadding};
104752
+ width: fit-content;
104753
+ max-width: 90%;
104610
104754
 
104611
104755
  flex-direction: row;
104612
104756
  justify-content: flex-end;
104757
+ align-self: flex-end;
104613
104758
  flex-shrink: 0;
104614
104759
  font: ${bodyFont};
104615
104760
  color: ${bodyFontColor};
@@ -104618,21 +104763,19 @@ focus outline in that case.
104618
104763
  .container {
104619
104764
  display: flex;
104620
104765
  flex-direction: column;
104621
- max-width: calc(90%);
104766
+ width: 100%;
104767
+ background: ${fillSelectedColor};
104768
+ border: ${borderWidth} solid ${borderHoverColor};
104769
+ border-radius: ${mediumPadding} ${mediumPadding} 0px ${mediumPadding};
104770
+ padding: ${mediumPadding};
104622
104771
  }
104623
104772
 
104624
104773
  .message-content {
104625
104774
  width: fit-content;
104626
104775
  height: fit-content;
104776
+ max-width: 100%;
104627
104777
  overflow-x: auto;
104628
104778
  }
104629
-
104630
- :host .message-content {
104631
- background: ${fillSelectedColor};
104632
- border: ${borderWidth} solid ${borderHoverColor};
104633
- border-radius: ${mediumPadding} ${mediumPadding} 0px ${mediumPadding};
104634
- padding: ${mediumPadding};
104635
- }
104636
104779
  `;
104637
104780
 
104638
104781
  const template$b = () => html `
@@ -104668,9 +104811,12 @@ focus outline in that case.
104668
104811
  :host {
104669
104812
  min-width: ${standardPadding};
104670
104813
  min-height: ${standardPadding};
104814
+ width: fit-content;
104815
+ max-width: 90%;
104671
104816
 
104672
104817
  flex-direction: row;
104673
104818
  justify-content: center;
104819
+ align-self: center;
104674
104820
  flex-shrink: 0;
104675
104821
  font: ${bodyFont};
104676
104822
  color: ${bodyFontColor};
@@ -104679,12 +104825,13 @@ focus outline in that case.
104679
104825
  .container {
104680
104826
  display: flex;
104681
104827
  flex-direction: column;
104682
- max-width: calc(90%);
104828
+ width: 100%;
104683
104829
  }
104684
104830
 
104685
104831
  .message-content {
104686
104832
  width: fit-content;
104687
104833
  height: fit-content;
104834
+ max-width: 100%;
104688
104835
  overflow-x: auto;
104689
104836
  }
104690
104837
  `;
@@ -104720,10 +104867,12 @@ focus outline in that case.
104720
104867
  :host {
104721
104868
  min-width: ${standardPadding};
104722
104869
  min-height: ${standardPadding};
104870
+ max-width: 90%;
104723
104871
 
104724
104872
  flex: 1;
104725
104873
  flex-direction: row;
104726
104874
  justify-content: center;
104875
+ align-self: center;
104727
104876
  align-items: center;
104728
104877
  font: ${bodyFont};
104729
104878
  color: ${bodyFontColor};
@@ -104733,7 +104882,6 @@ focus outline in that case.
104733
104882
  display: flex;
104734
104883
  flex-direction: column;
104735
104884
  align-items: center;
104736
- max-width: calc(90%);
104737
104885
  gap: ${mediumPadding};
104738
104886
  }
104739
104887
 
@@ -104767,6 +104915,7 @@ focus outline in that case.
104767
104915
  align-items: center;
104768
104916
  width: fit-content;
104769
104917
  height: fit-content;
104918
+ max-width: 100%;
104770
104919
  overflow-x: auto;
104771
104920
  gap: ${mediumPadding};
104772
104921
  }