@ni/ok-components 1.9.0 → 1.9.2

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
@@ -52306,6 +52355,19 @@ img.ProseMirror-separator {
52306
52355
  const QUOTE_TEST_RE = /['"]/;
52307
52356
  const QUOTE_RE = /['"]/g;
52308
52357
  const APOSTROPHE$1 = '\u2019'; /* ’ */
52358
+ // Caps memory on malicious input
52359
+ const MAX_OPENERS = 1000;
52360
+
52361
+ function truncateStack (stack, heads, length) {
52362
+ while (stack.length > length) {
52363
+ const item = stack.pop();
52364
+ if (item.isSingleQuote) {
52365
+ heads.single = item.prevSameQuoteIdx;
52366
+ } else {
52367
+ heads.double = item.prevSameQuoteIdx;
52368
+ }
52369
+ }
52370
+ }
52309
52371
 
52310
52372
  function addReplacement (replacements, tokenIdx, pos, ch) {
52311
52373
  if (!replacements[tokenIdx]) {
@@ -52335,6 +52397,8 @@ img.ProseMirror-separator {
52335
52397
  let j;
52336
52398
 
52337
52399
  const stack = [];
52400
+ // stack indexes of topmost openers of each type (-1 if none)
52401
+ const heads = { single: -1, double: -1 };
52338
52402
  // token index -> list of replacements in the original token content
52339
52403
  const replacements = {};
52340
52404
 
@@ -52346,7 +52410,7 @@ img.ProseMirror-separator {
52346
52410
  for (j = stack.length - 1; j >= 0; j--) {
52347
52411
  if (stack[j].level <= thisLevel) { break }
52348
52412
  }
52349
- stack.length = j + 1;
52413
+ truncateStack(stack, heads, j + 1);
52350
52414
 
52351
52415
  if (token.type !== 'text') { continue }
52352
52416
 
@@ -52450,39 +52514,45 @@ img.ProseMirror-separator {
52450
52514
  }
52451
52515
 
52452
52516
  if (canClose) {
52453
- // this could be a closing quote, rewind the stack to get a match
52454
- for (j = stack.length - 1; j >= 0; j--) {
52455
- let item = stack[j];
52456
- if (stack[j].level < thisLevel) { break }
52457
- if (item.single === isSingle && stack[j].level === thisLevel) {
52458
- item = stack[j];
52459
-
52460
- let openQuote;
52461
- let closeQuote;
52462
- if (isSingle) {
52463
- openQuote = state.md.options.quotes[2];
52464
- closeQuote = state.md.options.quotes[3];
52465
- } else {
52466
- openQuote = state.md.options.quotes[0];
52467
- closeQuote = state.md.options.quotes[1];
52468
- }
52517
+ // Stack levels never decrease, so an opener of this type below
52518
+ // the current level means there is no match
52519
+ j = isSingle ? heads.single : heads.double;
52520
+ if (j >= 0 && stack[j].level === thisLevel) {
52521
+ const item = stack[j];
52522
+
52523
+ let openQuote;
52524
+ let closeQuote;
52525
+ if (isSingle) {
52526
+ openQuote = state.md.options.quotes[2];
52527
+ closeQuote = state.md.options.quotes[3];
52528
+ } else {
52529
+ openQuote = state.md.options.quotes[0];
52530
+ closeQuote = state.md.options.quotes[1];
52531
+ }
52469
52532
 
52470
- addReplacement(replacements, i, t.index, closeQuote);
52471
- addReplacement(replacements, item.token, item.pos, openQuote);
52533
+ addReplacement(replacements, i, t.index, closeQuote);
52534
+ addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote);
52472
52535
 
52473
- stack.length = j;
52474
- continue OUTER
52475
- }
52536
+ truncateStack(stack, heads, j);
52537
+ continue OUTER
52476
52538
  }
52477
52539
  }
52478
52540
 
52479
52541
  if (canOpen) {
52542
+ if (stack.length >= MAX_OPENERS) { return }
52480
52543
  stack.push({
52481
- token: i,
52482
- pos: t.index,
52483
- single: isSingle,
52484
- level: thisLevel
52544
+ tokenIdx: i,
52545
+ contentPos: t.index,
52546
+ isSingleQuote: isSingle,
52547
+ level: thisLevel,
52548
+ // stack index of the previous opener of the same quote type, -1 if none
52549
+ prevSameQuoteIdx: isSingle ? heads.single : heads.double
52485
52550
  });
52551
+ if (isSingle) {
52552
+ heads.single = stack.length - 1;
52553
+ } else {
52554
+ heads.double = stack.length - 1;
52555
+ }
52486
52556
  } else if (canClose && isSingle) {
52487
52557
  addReplacement(replacements, i, t.index, APOSTROPHE$1);
52488
52558
  }
@@ -76449,8 +76519,11 @@ focus outline in that case.
76449
76519
  </template>
76450
76520
  `;
76451
76521
 
76452
- function createLazyMeasurementsView(count, flat, getItemKey) {
76453
- const cache = new Array(count);
76522
+ function getMeasurementKey(item) {
76523
+ return typeof item === "object" ? item.key : item;
76524
+ }
76525
+ function createLazyMeasurementsView(cache, flat) {
76526
+ const count = cache.length;
76454
76527
  return new Proxy(cache, {
76455
76528
  get(target, prop, receiver) {
76456
76529
  if (typeof prop === "string") {
@@ -76459,11 +76532,11 @@ focus outline in that case.
76459
76532
  const i = +prop;
76460
76533
  if (Number.isInteger(i) && i >= 0 && i < count) {
76461
76534
  let v = target[i];
76462
- if (!v) {
76535
+ if (typeof v !== "object") {
76463
76536
  const s = flat[i * 2];
76464
76537
  v = target[i] = {
76465
76538
  index: i,
76466
- key: getItemKey(i),
76539
+ key: v,
76467
76540
  start: s,
76468
76541
  size: flat[i * 2 + 1],
76469
76542
  end: s + flat[i * 2 + 1],
@@ -76635,7 +76708,7 @@ focus outline in that case.
76635
76708
  let offset = 0;
76636
76709
  const fallback = registerScrollendEvent ? null : debounce(
76637
76710
  targetWindow,
76638
- () => cb(offset, false),
76711
+ () => cb(readOffset(element), false),
76639
76712
  instance.options.isScrollingResetDelay
76640
76713
  );
76641
76714
  const createHandler = (isScrolling) => () => {
@@ -76697,6 +76770,27 @@ focus outline in that case.
76697
76770
  });
76698
76771
  };
76699
76772
  const elementScroll = scrollWithAdjustments;
76773
+ function isAppendWithTrim(prevCount, nextCount, getPreviousKey, getNextKey) {
76774
+ if (nextCount === 0) return false;
76775
+ const firstKey = getNextKey(0);
76776
+ const removedKeys = /* @__PURE__ */ new Set();
76777
+ let removedCount = 0;
76778
+ while (removedCount < prevCount) {
76779
+ const key = getPreviousKey(removedCount);
76780
+ if (key === firstKey) break;
76781
+ removedKeys.add(key);
76782
+ removedCount++;
76783
+ }
76784
+ const retainedCount = prevCount - removedCount;
76785
+ if (retainedCount === 0 || retainedCount >= nextCount) return false;
76786
+ for (let i = 0; i < retainedCount; i++) {
76787
+ if (getNextKey(i) !== getPreviousKey(removedCount + i)) return false;
76788
+ }
76789
+ for (let i = retainedCount; i < nextCount; i++) {
76790
+ if (removedKeys.has(getNextKey(i))) return false;
76791
+ }
76792
+ return true;
76793
+ }
76700
76794
  let Virtualizer$1 = class Virtualizer {
76701
76795
  constructor(opts) {
76702
76796
  this.unsubs = [];
@@ -76705,7 +76799,7 @@ focus outline in that case.
76705
76799
  this.isScrolling = false;
76706
76800
  this.scrollState = null;
76707
76801
  this.measurementsCache = [];
76708
- this._flatMeasurements = null;
76802
+ this._singleLaneMeasurements = null;
76709
76803
  this.itemSizeCache = /* @__PURE__ */ new Map();
76710
76804
  this.itemSizeCacheVersion = 0;
76711
76805
  this.laneAssignments = /* @__PURE__ */ new Map();
@@ -76723,6 +76817,7 @@ focus outline in that case.
76723
76817
  this._iosJustTouchEnded = false;
76724
76818
  this._iosTouchEndTimerId = null;
76725
76819
  this._intendedScrollOffset = null;
76820
+ this._clampedAdjustment = null;
76726
76821
  this.elementsCache = /* @__PURE__ */ new Map();
76727
76822
  this.now = () => {
76728
76823
  var _a, _b, _c;
@@ -76782,7 +76877,7 @@ focus outline in that case.
76782
76877
  })();
76783
76878
  this.range = null;
76784
76879
  this.setOptions = (opts2) => {
76785
- var _a, _b;
76880
+ var _a;
76786
76881
  const merged = {
76787
76882
  debug: false,
76788
76883
  initialOffset: 0,
@@ -76826,8 +76921,10 @@ focus outline in that case.
76826
76921
  const prevCount = prevOptions.count;
76827
76922
  const nextCount = merged.count;
76828
76923
  const measurements = this.getMeasurements();
76829
- const prevFirstKey = prevCount > 0 ? ((_a = measurements[0]) == null ? void 0 : _a.key) ?? prevOptions.getItemKey(0) : null;
76830
- const prevLastKey = prevCount > 0 ? ((_b = measurements[prevCount - 1]) == null ? void 0 : _b.key) ?? prevOptions.getItemKey(prevCount - 1) : null;
76924
+ const previousItems = ((_a = this._singleLaneMeasurements) == null ? void 0 : _a.items) ?? measurements;
76925
+ const getPreviousKey = (index) => getMeasurementKey(previousItems[index]);
76926
+ const prevFirstKey = prevCount > 0 ? getPreviousKey(0) : null;
76927
+ const prevLastKey = prevCount > 0 ? getPreviousKey(prevCount - 1) : null;
76831
76928
  const didCountChange = nextCount !== prevCount;
76832
76929
  const didEdgeKeysChange = didCountChange || prevCount > 0 && nextCount > 0 && (merged.getItemKey(0) !== prevFirstKey || merged.getItemKey(nextCount - 1) !== prevLastKey);
76833
76930
  if (didEdgeKeysChange) {
@@ -76837,8 +76934,15 @@ focus outline in that case.
76837
76934
  anchor = [item.key, this.getScrollOffset() - item.start];
76838
76935
  }
76839
76936
  const behavior = merged.followOnAppend === true ? "auto" : merged.followOnAppend || null;
76840
- if (behavior && nextCount > prevCount && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
76841
- followOnAppend = behavior;
76937
+ if (behavior && nextCount > 0 && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
76938
+ if (nextCount > prevCount || isAppendWithTrim(
76939
+ prevCount,
76940
+ nextCount,
76941
+ getPreviousKey,
76942
+ merged.getItemKey
76943
+ )) {
76944
+ followOnAppend = behavior;
76945
+ }
76842
76946
  }
76843
76947
  }
76844
76948
  }
@@ -76861,7 +76965,7 @@ focus outline in that case.
76861
76965
  const anchorItem = newMeasurements[idx];
76862
76966
  if (anchorItem) {
76863
76967
  const newOffset = Math.max(0, anchorItem.start + anchorOffset);
76864
- if (newOffset !== this.scrollOffset) {
76968
+ if (!followOnAppend && newOffset !== this.scrollOffset) {
76865
76969
  anchorDelta = newOffset - this.scrollOffset;
76866
76970
  this.scrollOffset = newOffset;
76867
76971
  anchorResolved = true;
@@ -76918,6 +77022,7 @@ focus outline in that case.
76918
77022
  this._iosDeferredAdjustment = 0;
76919
77023
  this._iosTouching = false;
76920
77024
  this._iosJustTouchEnded = false;
77025
+ this._clampedAdjustment = null;
76921
77026
  this.scrollElement = null;
76922
77027
  this.targetWindow = null;
76923
77028
  };
@@ -76927,7 +77032,7 @@ focus outline in that case.
76927
77032
  };
76928
77033
  };
76929
77034
  this._willUpdate = () => {
76930
- var _a;
77035
+ var _a, _b;
76931
77036
  const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
76932
77037
  if (this.scrollElement !== scrollElement) {
76933
77038
  this.cleanup();
@@ -76959,6 +77064,9 @@ focus outline in that case.
76959
77064
  offset = this._intendedScrollOffset;
76960
77065
  }
76961
77066
  this._intendedScrollOffset = null;
77067
+ if (this._clampedAdjustment !== null && Math.abs(offset - this._clampedAdjustment.maxAtWrite) >= 1.5) {
77068
+ this._clampedAdjustment = null;
77069
+ }
76962
77070
  this.scrollAdjustments = 0;
76963
77071
  const prevOffset = this.getScrollOffset();
76964
77072
  this.scrollDirection = isScrolling ? prevOffset === offset ? this.scrollDirection : prevOffset < offset ? "forward" : "backward" : null;
@@ -77026,7 +77134,11 @@ focus outline in that case.
77026
77134
  if (anchorDelta !== 0) {
77027
77135
  this._iosDeferredAdjustment += anchorDelta;
77028
77136
  }
77029
- } else {
77137
+ } else if (((_b = this.scrollState) == null ? void 0 : _b.behavior) === "smooth" && !approxEqual(
77138
+ this.getScrollOffset() - anchorDelta,
77139
+ this.scrollState.lastTargetOffset
77140
+ )) ;
77141
+ else {
77030
77142
  this._scrollToOffset(this.getScrollOffset(), {
77031
77143
  adjustments: void 0,
77032
77144
  behavior: void 0
@@ -77037,6 +77149,21 @@ focus outline in that case.
77037
77149
  this.scrollToEnd({ behavior: followOnAppend });
77038
77150
  }
77039
77151
  }
77152
+ this._retryClampedAdjustment();
77153
+ };
77154
+ this._retryClampedAdjustment = () => {
77155
+ if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled) {
77156
+ return;
77157
+ }
77158
+ const { target, maxAtWrite } = this._clampedAdjustment;
77159
+ const max = this.getMaxScrollOffset();
77160
+ if (max > maxAtWrite + 0.5) {
77161
+ this._clampedAdjustment = target > max + 0.5 ? { target, maxAtWrite: max } : null;
77162
+ this._scrollToOffset(target, {
77163
+ adjustments: void 0,
77164
+ behavior: void 0
77165
+ });
77166
+ }
77040
77167
  };
77041
77168
  this._flushIosDeferredIfReady = () => {
77042
77169
  if (this._iosDeferredAdjustment === 0) return;
@@ -77120,9 +77247,11 @@ focus outline in that case.
77120
77247
  laneAssignmentMode,
77121
77248
  gap
77122
77249
  }, _itemSizeCacheVersion) => {
77250
+ var _a;
77123
77251
  const itemSizeCache = this.itemSizeCache;
77124
77252
  if (!enabled) {
77125
77253
  this.measurementsCache = [];
77254
+ this._singleLaneMeasurements = null;
77126
77255
  this.itemSizeCache.clear();
77127
77256
  this.laneAssignments.clear();
77128
77257
  return [];
@@ -77138,6 +77267,7 @@ focus outline in that case.
77138
77267
  this.lanesChangedFlag = false;
77139
77268
  this.lanesSettling = true;
77140
77269
  this.measurementsCache = [];
77270
+ this._singleLaneMeasurements = null;
77141
77271
  this.itemSizeCache.clear();
77142
77272
  this.laneAssignments.clear();
77143
77273
  this.pendingMin = null;
@@ -77155,13 +77285,13 @@ focus outline in that case.
77155
77285
  }
77156
77286
  if (lanes === 1) {
77157
77287
  const need = count * 2;
77158
- let flat = this._flatMeasurements;
77288
+ let flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77159
77289
  if (!flat || flat.length < need) {
77160
77290
  const next = new Float64Array(need);
77161
77291
  if (flat && min > 0) next.set(flat.subarray(0, min * 2));
77162
77292
  flat = next;
77163
- this._flatMeasurements = flat;
77164
77293
  }
77294
+ const items = min === 0 ? new Array(count) : this._singleLaneMeasurements.items.slice();
77165
77295
  let runningStart;
77166
77296
  if (min === 0) {
77167
77297
  runningStart = paddingStart + scrollMargin;
@@ -77171,13 +77301,15 @@ focus outline in that case.
77171
77301
  }
77172
77302
  for (let i = min; i < count; i++) {
77173
77303
  const key = getItemKey(i);
77304
+ items[i] = key;
77174
77305
  const measuredSize = itemSizeCache.get(key);
77175
77306
  const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
77176
77307
  flat[i * 2] = runningStart;
77177
77308
  flat[i * 2 + 1] = size;
77178
77309
  runningStart += size + gap;
77179
77310
  }
77180
- const view = createLazyMeasurementsView(count, flat, getItemKey);
77311
+ this._singleLaneMeasurements = { flat, items };
77312
+ const view = createLazyMeasurementsView(items, flat);
77181
77313
  this.measurementsCache = view;
77182
77314
  return view;
77183
77315
  }
@@ -77272,7 +77404,7 @@ focus outline in that case.
77272
77404
  lanes,
77273
77405
  // Pass the typed array so binary search + forward-walk can read
77274
77406
  // start/end directly from Float64Array, skipping the Proxy traps.
77275
- lanes === 1 && this._flatMeasurements != null ? this._flatMeasurements : null
77407
+ lanes === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null
77276
77408
  );
77277
77409
  return this.range;
77278
77410
  },
@@ -77369,13 +77501,13 @@ focus outline in that case.
77369
77501
  }
77370
77502
  };
77371
77503
  this.resizeItem = (index, size) => {
77372
- var _a, _b;
77504
+ var _a, _b, _c;
77373
77505
  if (!this.isIndexInRange(index)) return;
77374
77506
  let cachedSize;
77375
77507
  let itemStart;
77376
77508
  let key;
77377
- const flat = this._flatMeasurements;
77378
- if (this.options.lanes === 1 && flat !== null) {
77509
+ const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77510
+ if (this.options.lanes === 1 && flat != null) {
77379
77511
  key = this.options.getItemKey(index);
77380
77512
  itemStart = flat[index * 2];
77381
77513
  cachedSize = flat[index * 2 + 1];
@@ -77389,7 +77521,7 @@ focus outline in that case.
77389
77521
  const itemSize = this.itemSizeCache.get(key) ?? cachedSize;
77390
77522
  const delta = size - itemSize;
77391
77523
  if (delta !== 0) {
77392
- const wasAtEnd = this.options.anchorTo === "end" && ((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
77524
+ const wasAtEnd = this.options.anchorTo === "end" && ((_b = this.scrollState) == null ? void 0 : _b.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
77393
77525
  const prevTotalSize = wasAtEnd ? this.getTotalSize() : 0;
77394
77526
  const scrollOffsetWithAdj = this.getScrollOffset() + this.scrollAdjustments;
77395
77527
  const isFirstMeasure = !this.itemSizeCache.has(key);
@@ -77408,7 +77540,7 @@ focus outline in that case.
77408
77540
  // scrolling up" cascade.
77409
77541
  itemStart + itemSize <= scrollOffsetWithAdj && this.scrollDirection !== "backward"
77410
77542
  );
77411
- const shouldAdjustScroll = ((_b = this.scrollState) == null ? void 0 : _b.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
77543
+ const shouldAdjustScroll = ((_c = this.scrollState) == null ? void 0 : _c.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
77412
77544
  // The callback expects a VirtualItem; build one lazily only
77413
77545
  // when the consumer actually supplied a custom predicate.
77414
77546
  this.measurementsCache[index] ?? {
@@ -77436,6 +77568,7 @@ focus outline in that case.
77436
77568
  adjustedSync = this.applyScrollAdjustment(delta);
77437
77569
  }
77438
77570
  this.notify(adjustedSync);
77571
+ this._retryClampedAdjustment();
77439
77572
  }
77440
77573
  };
77441
77574
  this.getVirtualItems = memo(
@@ -77455,11 +77588,12 @@ focus outline in that case.
77455
77588
  }
77456
77589
  );
77457
77590
  this.getVirtualItemForOffset = (offset) => {
77591
+ var _a;
77458
77592
  const measurements = this.getMeasurements();
77459
77593
  if (measurements.length === 0) {
77460
77594
  return void 0;
77461
77595
  }
77462
- const flat = this._flatMeasurements;
77596
+ const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77463
77597
  const useFlat = this.options.lanes === 1 && flat != null;
77464
77598
  const idx = findNearestBinarySearch(
77465
77599
  0,
@@ -77594,18 +77728,18 @@ focus outline in that case.
77594
77728
  });
77595
77729
  };
77596
77730
  this.getTotalSize = () => {
77597
- var _a;
77731
+ var _a, _b;
77598
77732
  const measurements = this.getMeasurements();
77599
77733
  let end;
77600
77734
  if (measurements.length === 0) {
77601
77735
  end = this.options.paddingStart;
77602
77736
  } else if (this.options.lanes === 1) {
77603
77737
  const lastIdx = measurements.length - 1;
77604
- const flat = this._flatMeasurements;
77738
+ const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
77605
77739
  if (flat != null) {
77606
77740
  end = flat[lastIdx * 2] + flat[lastIdx * 2 + 1];
77607
77741
  } else {
77608
- end = ((_a = measurements[lastIdx]) == null ? void 0 : _a.end) ?? 0;
77742
+ end = ((_b = measurements[lastIdx]) == null ? void 0 : _b.end) ?? 0;
77609
77743
  }
77610
77744
  } else {
77611
77745
  const endByLane = Array(this.options.lanes).fill(null);
@@ -77671,6 +77805,10 @@ focus outline in that case.
77671
77805
  this._iosDeferredAdjustment += delta;
77672
77806
  return false;
77673
77807
  } else {
77808
+ const target = this.getScrollOffset() + this.scrollAdjustments + delta;
77809
+ const el = this.scrollElement;
77810
+ const maxAtWrite = el !== null && ("scrollHeight" in el || "document" in el) ? this.getMaxScrollOffset() : null;
77811
+ this._clampedAdjustment = maxAtWrite !== null && target > maxAtWrite + 0.5 ? { target, maxAtWrite } : null;
77674
77812
  this._scrollToOffset(this.getScrollOffset(), {
77675
77813
  adjustments: this.scrollAdjustments += delta,
77676
77814
  behavior
@@ -104513,9 +104651,12 @@ focus outline in that case.
104513
104651
  :host {
104514
104652
  min-width: ${standardPadding};
104515
104653
  min-height: ${standardPadding};
104654
+ width: fit-content;
104655
+ max-width: 100%;
104516
104656
 
104517
104657
  flex-direction: row;
104518
104658
  justify-content: flex-start;
104659
+ align-self: flex-start;
104519
104660
  flex-shrink: 0;
104520
104661
  font: ${bodyFont};
104521
104662
  color: ${bodyFontColor};
@@ -104524,7 +104665,7 @@ focus outline in that case.
104524
104665
  .container {
104525
104666
  display: flex;
104526
104667
  flex-direction: column;
104527
- max-width: calc(90%);
104668
+ width: 100%;
104528
104669
  }
104529
104670
 
104530
104671
  [part='start'] {
@@ -104534,6 +104675,7 @@ focus outline in that case.
104534
104675
  .message-content {
104535
104676
  width: fit-content;
104536
104677
  height: fit-content;
104678
+ max-width: 100%;
104537
104679
  overflow-x: auto;
104538
104680
  }
104539
104681
 
@@ -104616,9 +104758,12 @@ focus outline in that case.
104616
104758
  :host {
104617
104759
  min-width: ${standardPadding};
104618
104760
  min-height: ${standardPadding};
104761
+ width: fit-content;
104762
+ max-width: 90%;
104619
104763
 
104620
104764
  flex-direction: row;
104621
104765
  justify-content: flex-end;
104766
+ align-self: flex-end;
104622
104767
  flex-shrink: 0;
104623
104768
  font: ${bodyFont};
104624
104769
  color: ${bodyFontColor};
@@ -104627,21 +104772,19 @@ focus outline in that case.
104627
104772
  .container {
104628
104773
  display: flex;
104629
104774
  flex-direction: column;
104630
- max-width: calc(90%);
104775
+ width: 100%;
104776
+ background: ${fillSelectedColor};
104777
+ border: ${borderWidth} solid ${borderHoverColor};
104778
+ border-radius: ${mediumPadding} ${mediumPadding} 0px ${mediumPadding};
104779
+ padding: ${mediumPadding};
104631
104780
  }
104632
104781
 
104633
104782
  .message-content {
104634
104783
  width: fit-content;
104635
104784
  height: fit-content;
104785
+ max-width: 100%;
104636
104786
  overflow-x: auto;
104637
104787
  }
104638
-
104639
- :host .message-content {
104640
- background: ${fillSelectedColor};
104641
- border: ${borderWidth} solid ${borderHoverColor};
104642
- border-radius: ${mediumPadding} ${mediumPadding} 0px ${mediumPadding};
104643
- padding: ${mediumPadding};
104644
- }
104645
104788
  `;
104646
104789
 
104647
104790
  const template$s = () => html `
@@ -104677,9 +104820,12 @@ focus outline in that case.
104677
104820
  :host {
104678
104821
  min-width: ${standardPadding};
104679
104822
  min-height: ${standardPadding};
104823
+ width: fit-content;
104824
+ max-width: 90%;
104680
104825
 
104681
104826
  flex-direction: row;
104682
104827
  justify-content: center;
104828
+ align-self: center;
104683
104829
  flex-shrink: 0;
104684
104830
  font: ${bodyFont};
104685
104831
  color: ${bodyFontColor};
@@ -104688,12 +104834,13 @@ focus outline in that case.
104688
104834
  .container {
104689
104835
  display: flex;
104690
104836
  flex-direction: column;
104691
- max-width: calc(90%);
104837
+ width: 100%;
104692
104838
  }
104693
104839
 
104694
104840
  .message-content {
104695
104841
  width: fit-content;
104696
104842
  height: fit-content;
104843
+ max-width: 100%;
104697
104844
  overflow-x: auto;
104698
104845
  }
104699
104846
  `;
@@ -104729,10 +104876,12 @@ focus outline in that case.
104729
104876
  :host {
104730
104877
  min-width: ${standardPadding};
104731
104878
  min-height: ${standardPadding};
104879
+ max-width: 90%;
104732
104880
 
104733
104881
  flex: 1;
104734
104882
  flex-direction: row;
104735
104883
  justify-content: center;
104884
+ align-self: center;
104736
104885
  align-items: center;
104737
104886
  font: ${bodyFont};
104738
104887
  color: ${bodyFontColor};
@@ -104742,7 +104891,6 @@ focus outline in that case.
104742
104891
  display: flex;
104743
104892
  flex-direction: column;
104744
104893
  align-items: center;
104745
- max-width: calc(90%);
104746
104894
  gap: ${mediumPadding};
104747
104895
  }
104748
104896
 
@@ -104776,6 +104924,7 @@ focus outline in that case.
104776
104924
  align-items: center;
104777
104925
  width: fit-content;
104778
104926
  height: fit-content;
104927
+ max-width: 100%;
104779
104928
  overflow-x: auto;
104780
104929
  gap: ${mediumPadding};
104781
104930
  }