@lwrjs/client-modules 0.12.0-alpha.2 → 0.12.0-alpha.21

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.
@@ -699,24 +699,24 @@ const {
699
699
  delete: SetProtoDelete$LWS,
700
700
  entries: SetProtoEntries$LWS,
701
701
  forEach: SetProtoForEach$LWS,
702
- has: SetProtoHas$LWS,
702
+ has: SetProtoHas$LWS$1,
703
703
  keys: SetProtoKeys$LWS,
704
704
  [SymbolIterator$LWS$1]: SetProtoSymbolIterator$LWS,
705
705
  [SymbolToStringTag$LWS$1]: SetProtoSymbolToStringTag$LWS
706
706
  } = SetProto$LWS$1;
707
707
  const {
708
- add: SetProtoAdd$LWS,
709
- values: SetProtoValues$LWS
708
+ add: SetProtoAdd$LWS$1,
709
+ values: SetProtoValues$LWS$1
710
710
  } = SetProto$LWS$1;
711
711
  const SetProtoSizeGetter$LWS = ObjectLookupOwnGetter$LWS$1(SetProto$LWS$1, 'size');
712
712
  function toSafeSet$LWS(set$LWS) {
713
713
  ReflectSetPrototypeOf$LWS$1(set$LWS, null);
714
- set$LWS.add = SetProtoAdd$LWS;
714
+ set$LWS.add = SetProtoAdd$LWS$1;
715
715
  set$LWS.clear = SetProtoClear$LWS;
716
716
  set$LWS.delete = SetProtoDelete$LWS;
717
717
  set$LWS.entries = SetProtoEntries$LWS;
718
718
  set$LWS.forEach = SetProtoForEach$LWS;
719
- set$LWS.has = SetProtoHas$LWS;
719
+ set$LWS.has = SetProtoHas$LWS$1;
720
720
  set$LWS.keys = SetProtoKeys$LWS;
721
721
  ReflectDefineProperty$LWS$1(set$LWS, 'size', {
722
722
  __proto__: null,
@@ -725,7 +725,7 @@ function toSafeSet$LWS(set$LWS) {
725
725
  get: SetProtoSizeGetter$LWS,
726
726
  set: undefined
727
727
  });
728
- set$LWS.values = SetProtoValues$LWS;
728
+ set$LWS.values = SetProtoValues$LWS$1;
729
729
  set$LWS[SymbolIterator$LWS$1] = SetProtoSymbolIterator$LWS;
730
730
  set$LWS[SymbolToStringTag$LWS$1] = SetProtoSymbolToStringTag$LWS;
731
731
  ReflectSetPrototypeOf$LWS$1(set$LWS, SetProto$LWS$1);
@@ -1073,7 +1073,7 @@ function cloneSet$LWS(set$LWS, queue$LWS) {
1073
1073
  // Step 26.2.1: Let copiedList be a new empty List.
1074
1074
  const clone$LWS = new SetCtor$LWS$1();
1075
1075
  // Step 26.2.2: For each entry of value.[[SetData]]...
1076
- const valuesIterable$LWS = ReflectApply$LWS$1(SetProtoValues$LWS, set$LWS, []);
1076
+ const valuesIterable$LWS = ReflectApply$LWS$1(SetProtoValues$LWS$1, set$LWS, []);
1077
1077
  // Step 26.2.3: For each entry of copiedList:
1078
1078
  let {
1079
1079
  length: queueOffset$LWS
@@ -1089,7 +1089,7 @@ function cloneSet$LWS(set$LWS, queue$LWS) {
1089
1089
  }
1090
1090
  // Step 26.2.3.1: Let serializedEntry be ? StructuredSerializeInternal(entry, forStorage, memory).
1091
1091
  queue$LWS[queueOffset$LWS++] = [subCloneValue$LWS => {
1092
- ReflectApply$LWS$1(SetProtoAdd$LWS, clone$LWS, [subCloneValue$LWS]);
1092
+ ReflectApply$LWS$1(SetProtoAdd$LWS$1, clone$LWS, [subCloneValue$LWS]);
1093
1093
  }, subValue$LWS];
1094
1094
  }
1095
1095
  return clone$LWS;
@@ -1453,7 +1453,7 @@ const {
1453
1453
  } = PromiseCtor$LWS.prototype;
1454
1454
  const PromiseResolve$LWS = PromiseCtor$LWS.resolve.bind(PromiseCtor$LWS);
1455
1455
  const PromiseReject$LWS = PromiseCtor$LWS.reject.bind(PromiseCtor$LWS);
1456
- /*! version: 0.20.8 */
1456
+ /*! version: 0.21.3 */
1457
1457
 
1458
1458
  /*!
1459
1459
  * Copyright (C) 2019 salesforce.com, inc.
@@ -2112,7 +2112,7 @@ const {
2112
2112
  const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'responseText');
2113
2113
  const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'status');
2114
2114
  ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
2115
- /*! version: 0.20.8 */
2115
+ /*! version: 0.21.3 */
2116
2116
 
2117
2117
  /*!
2118
2118
  * Copyright (C) 2019 salesforce.com, inc.
@@ -2171,7 +2171,7 @@ function sanitizeURLForElement$LWS(url$LWS) {
2171
2171
  function sanitizeURLString$LWS(urlString$LWS) {
2172
2172
  return urlString$LWS === '' ? urlString$LWS : ReflectApply$LWS$1(StringProtoReplace$LWS, urlString$LWS, [newlinesAndTabsRegExp$LWS, '']);
2173
2173
  }
2174
- /*! version: 0.20.8 */
2174
+ /*! version: 0.21.3 */
2175
2175
 
2176
2176
  /*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */
2177
2177
 
@@ -3857,7 +3857,7 @@ try {
3857
3857
  // swallow
3858
3858
  }
3859
3859
  const trusted = createPolicy('trusted', policyOptions);
3860
- /*! version: 0.20.8 */
3860
+ /*! version: 0.21.3 */
3861
3861
 
3862
3862
  /*!
3863
3863
  * Copyright (C) 2019 salesforce.com, inc.
@@ -4106,7 +4106,7 @@ function blobSanitizer$LWS(sandboxKey$LWS) {
4106
4106
  }
4107
4107
  return getSanitizerForConfig$LWS(sandboxKey$LWS, 'STRING_BLOB_HTML');
4108
4108
  }
4109
- /*! version: 0.20.8 */
4109
+ /*! version: 0.21.3 */
4110
4110
 
4111
4111
  /*!
4112
4112
  * Copyright (C) 2023 salesforce.com, inc.
@@ -4304,7 +4304,7 @@ function encloseSrcSetter$LWS(targetElement$LWS) {
4304
4304
  ReflectApply$LWS$1(ElementProtoSetAttributeNS$LWS, targetElement$LWS, [attributeNamespaceURI$LWS, attributeName$LWS, src$LWS]);
4305
4305
  };
4306
4306
  }
4307
- /*! version: 0.20.8 */
4307
+ /*! version: 0.21.3 */
4308
4308
 
4309
4309
  /*!
4310
4310
  * Copyright (C) 2019 salesforce.com, inc.
@@ -5887,7 +5887,7 @@ function initDistortionDocumentExecCommand$LWS({
5887
5887
  if (length$LWS >= 1) {
5888
5888
  const command$LWS = toString$LWS(args$LWS[0]);
5889
5889
  const loweredCommand$LWS = ReflectApply$LWS$1(StringProtoToLowerCase$LWS, command$LWS, []);
5890
- if (length$LWS === 1 && loweredCommand$LWS === 'selectall' && this === rootDocument$LWS) {
5890
+ if (loweredCommand$LWS === 'selectall' && this === rootDocument$LWS) {
5891
5891
  throwLockerSecurityError$LWS(command$LWS, this);
5892
5892
  }
5893
5893
  if (length$LWS > 2) {
@@ -6106,6 +6106,7 @@ function initDistortionElementAppend$LWS({
6106
6106
  return distortionEntry$LWS;
6107
6107
  };
6108
6108
  }
6109
+ const FORCED_MODE$LWS = 'closed';
6109
6110
  function initDistortionElementAttachShadow$LWS({
6110
6111
  globalObject: {
6111
6112
  Element: {
@@ -6125,8 +6126,14 @@ function initDistortionElementAttachShadow$LWS({
6125
6126
  if (originalShadowRootInit$LWS !== null && originalShadowRootInit$LWS !== undefined) {
6126
6127
  // Snapshot shadowRootInit to avoid getter poisoning.
6127
6128
  const clonedShadowRootInit$LWS = shallowCloneOptions$LWS(originalShadowRootInit$LWS);
6129
+ if (clonedShadowRootInit$LWS.mode !== FORCED_MODE$LWS) {
6130
+ const {
6131
+ mode: mode$LWS
6132
+ } = clonedShadowRootInit$LWS;
6133
+ consoleWarn$LWS(`Lightning Web Security: changing shadow root's mode from '${mode$LWS}' to '${FORCED_MODE$LWS}'`);
6134
+ }
6128
6135
  // Override the user defined shadowRoot mode to ensure that it is always closed
6129
- clonedShadowRootInit$LWS.mode = 'closed';
6136
+ clonedShadowRootInit$LWS.mode = FORCED_MODE$LWS;
6130
6137
  // Set the prototype of shadowRootInit after assignment
6131
6138
  // of mode to avoid complications with inherited
6132
6139
  // non-configurable/non-writable mode properties.
@@ -6234,6 +6241,13 @@ function initDistortionElementGetInnerHTML$LWS({
6234
6241
  const clonedOptions$LWS = shallowCloneOptions$LWS(options$LWS);
6235
6242
  clonedOptions$LWS.includeShadowRoots = false;
6236
6243
  args$LWS[0] = clonedOptions$LWS;
6244
+ } else {
6245
+ // If there was an argument, but it wasn't "object like",
6246
+ // it is considered invalid, so override it.
6247
+ args$LWS[0] = {
6248
+ __proto__: null,
6249
+ includeShadowRoots: false
6250
+ };
6237
6251
  }
6238
6252
  } else {
6239
6253
  args$LWS[0] = {
@@ -6741,6 +6755,7 @@ function initDistortionElementSetHTML$LWS({
6741
6755
  // istanbul ignore next: only runs in browsers without property
6742
6756
  return noop$LWS$1;
6743
6757
  }
6758
+ // istanbul ignore next: Element.prototype.setHTML is not supported in any browser yet
6744
6759
  return function distortionElementSetHTML$LWS({
6745
6760
  key: key$LWS
6746
6761
  }) {
@@ -7211,7 +7226,7 @@ function initDistortionHTMLIFrameElementSrcSetter$LWS({
7211
7226
  };
7212
7227
  }
7213
7228
  const importRegExp$LWS = /import/i;
7214
- const WARN_MESSAGE$LWS = 'HTMLLinkElement does not allow setting "rel" property to "import" value.';
7229
+ const WARN_MESSAGE$LWS = 'Lightning Web Security: HTMLLinkElement does not allow setting "rel" property to "import" value.';
7215
7230
  function isValidRelValue$LWS(value$LWS) {
7216
7231
  return typeof value$LWS !== 'string' || !ReflectApply$LWS$1(RegExpProtoTest$LWS$1, importRegExp$LWS, [value$LWS]);
7217
7232
  }
@@ -7997,7 +8012,7 @@ function initDistortionPerformanceMeasure$LWS({
7997
8012
  throw error;
7998
8013
  }
7999
8014
  }];
8000
- return function distortionPerformanceMark$LWS() {
8015
+ return function distortionPerformanceMeasure$LWS() {
8001
8016
  return distortionEntry$LWS;
8002
8017
  };
8003
8018
  }
@@ -9865,6 +9880,7 @@ initDistortionElementAfter$LWS, initDistortionElementAppend$LWS, initDistortionE
9865
9880
  // initDistortionNodeAppendChild,
9866
9881
  initDistortionNodeInsertBefore$LWS]);
9867
9882
  const externalKeyedDistortionFactoryInitializers$LWS = internalKeyedDistortionFactoryInitializers$LWS;
9883
+ toSafeMap$LWS$1(new MapCtor$LWS$1([[initDistortionCacheStorageDelete$LWS, 'caches'], [initDistortionCacheStorageHas$LWS, 'caches'], [initDistortionCacheStorageKeys$LWS, 'caches'], [initDistortionCacheStorageMatch$LWS, 'caches'], [initDistortionCacheStorageOpen$LWS, 'caches'], [initDistortionCookieStoreDelete$LWS, 'cookieStore'], [initDistortionCookieStoreGet$LWS, 'cookieStore'], [initDistortionCookieStoreGetAll$LWS, 'cookieStore'], [initDistortionCookieStoreOnChange$LWS, 'cookieStore'], [initDistortionCookieStoreSet$LWS, 'cookieStore'], [initDistortionCSSStyleRuleStyleGetter$LWS, 'style'], [initDistortionCustomElementRegistryDefine$LWS, 'customElements'], [initDistortionCustomElementRegistryGet$LWS, 'customElements'], [initDistortionCustomElementRegistryUpgrade$LWS, 'customElements'], [initDistortionCustomElementRegistryWhenDefined$LWS, 'customElements'], [initDistortionDocumentCookieGetter$LWS, 'documentCookie'], [initDistortionDocumentCookieSetter$LWS, 'documentCookie'], [initDistortionDocumentDomainSetter$LWS, 'documentDomain'], [initDistortionDocumentExecCommand$LWS, 'documentExecCommand'], [initDistortionElementAfter$LWS, 'element'], [initDistortionElementAppend$LWS, 'element'], [initDistortionElementAttributesGetter$LWS, 'attributes'], [initDistortionElementBefore$LWS, 'element'], [initDistortionElementGetInnerHTML$LWS, 'innerHTML'], [initDistortionElementInnerHTMLSetter$LWS, 'innerHTML'], [initDistortionElementInsertAdjacentElement$LWS, 'element'], [initDistortionElementInsertAdjacentHTML$LWS, 'element'], [initDistortionElementOuterHTMLSetter$LWS, 'element'], [initDistortionElementPrepend$LWS, 'element'], [initDistortionElementRemove$LWS, 'element'], [initDistortionElementReplaceChildren$LWS, 'element'], [initDistortionElementReplaceWith$LWS, 'element'], [initDistortionElementSetAttribute$LWS, 'attributes'], [initDistortionElementSetAttributeNode$LWS, 'attributes'], [initDistortionElementSetAttributeNodeNS$LWS, 'attributes'], [initDistortionElementSetAttributeNS$LWS, 'attributes'], [initDistortionElementSetHTML$LWS, 'element'], [initDistortionElementToggleAttribute$LWS, 'attributes'], [initDistortionIDBObjectStoreAdd$LWS, 'indexedDB'], [initDistortionIDBObjectStorePut$LWS, 'indexedDB'], [initDistortionLocalStorage$LWS, 'storage'], [initDistortionMessagePortPostMessage$LWS, 'postMessage'], [initDistortionNamedNodeMapSetNamedItem$LWS, 'attributes'], [initDistortionNamedNodeMapSetNamedItemNS$LWS, 'attributes'], [initDistortionNavigatorSendBeacon$LWS, 'navigatorSendBeacon'], [initDistortionNodeInsertBefore$LWS, 'node'], [initDistortionNodeRemoveChild$LWS, 'node'], [initDistortionNodeReplaceChild$LWS, 'node'], [initDistortionNodeTextContentGetter$LWS, 'node'], [initDistortionNodeTextContentSetter$LWS, 'node'], [initDistortionNodeValueSetter$LWS, 'node'], [initDistortionPerformanceMark$LWS, 'performance'], [initDistortionPerformanceMarkCtor$LWS, 'performance'], [initDistortionPerformanceMeasure$LWS, 'performance'], [initDistortionRangeCreateContextualFragment$LWS, 'range'], [initDistortionRangeDeleteContents$LWS, 'range'], [initDistortionRangeExtractContents$LWS, 'range'], [initDistortionRangeInsertNode$LWS, 'range'], [initDistortionRangeSelectNode$LWS, 'range'], [initDistortionRangeSelectNodeContents$LWS, 'range'], [initDistortionRangeSetEnd$LWS, 'range'], [initDistortionRangeSetEndAfter$LWS, 'range'], [initDistortionRangeSetEndBefore$LWS, 'range'], [initDistortionRangeSetStart$LWS, 'range'], [initDistortionRangeSetStartAfter$LWS, 'range'], [initDistortionRangeSetStartBefore$LWS, 'range'], [initDistortionRangeSurroundContents$LWS, 'range'], [initDistortionSelectionCollapse$LWS, 'selection'], [initDistortionSelectionExtend$LWS, 'selection'], [initDistortionSelectionSelectAllChildren$LWS, 'selection'], [initDistortionSelectionSetBaseAndExtent$LWS, 'selection'], [initDistortionSelectionSetPosition$LWS, 'selection'], [initDistortionSessionStorage$LWS, 'storage'], [initDistortionShadowRootInnerHTMLSetter$LWS, 'innerHTML'], [initDistortionStorage$LWS, 'storage'], [initDistortionStorageClear$LWS, 'storage'], [initDistortionStorageGetItem$LWS, 'storage'], [initDistortionStorageKey$LWS, 'storage'], [initDistortionStorageLength$LWS, 'storage'], [initDistortionStorageRemoveItem$LWS, 'storage'], [initDistortionStorageSetItem$LWS, 'storage'], [initDistortionWindowPostMessage$LWS, 'postMessage'], [initDistortionWindowSetInterval$LWS, 'setInterval'], [initDistortionWindowSetTimeout$LWS, 'setTimeout']]));
9868
9884
  const DocumentBlockedProperties$LWS = ['createProcessingInstruction', 'exitFullscreen', 'fullscreen', 'fullscreenElement', 'fullscreenEnabled', 'mozCancelFullScreen', 'mozFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'onfullscreenchange', 'onfullscreenerror', 'onmozfullscreenchange', 'onmozfullscreenerror', 'onrejectionhandled', 'onunhandledrejection', 'releaseCapture', 'releaseEvents', 'webkitFullScreenKeyboardInputAllowed', 'write', 'writeln'];
9869
9885
  const ElementBlockedProperties$LWS = ['mozRequestFullScreen', 'onfullscreenchange', 'onfullscreenerror', 'requestFullscreen', 'webkitRequestFullScreen', 'webkitRequestFullscreen'];
9870
9886
  const EventBlockedProperties$LWS = ['originalTarget', 'explicitOriginalTarget'];
@@ -9883,17 +9899,55 @@ const SVGElementBlockedProperties$LWS = ['nonce'];
9883
9899
  const UIEventBlockedProperties$LWS = ['rangeParent'];
9884
9900
  const WindowBlockedProperties$LWS = ['find'];
9885
9901
  const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
9886
- /*! version: 0.20.8 */
9902
+ /*! version: 0.21.3 */
9887
9903
 
9888
9904
  /*!
9889
9905
  * Copyright (C) 2019 salesforce.com, inc.
9890
9906
  */
9907
+ const rootSandboxRegistry$LWS = {
9908
+ __proto__: null
9909
+ };
9910
+ const documentSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1([[rootDocument$LWS, rootSandboxRegistry$LWS]]));
9911
+ const opaqueWindowSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9912
+ function getOpaqueSandboxRegistry$LWS(globalObject$LWS) {
9913
+ // Use the `document` as the key because a window object maintains its
9914
+ // identity continuity when its location changes and while the
9915
+ // non-configurable document property does not.
9916
+ let sandboxRegistry$LWS = opaqueWindowSandboxRegistryCache$LWS.get(globalObject$LWS);
9917
+ // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
9918
+ if (sandboxRegistry$LWS === undefined) {
9919
+ sandboxRegistry$LWS = {
9920
+ __proto__: null
9921
+ };
9922
+ opaqueWindowSandboxRegistryCache$LWS.set(globalObject$LWS, sandboxRegistry$LWS);
9923
+ }
9924
+ return sandboxRegistry$LWS;
9925
+ }
9926
+ function getSandboxRegistry$LWS(document$LWS) {
9927
+ // Use the `document` as the key because a window object maintains its
9928
+ // identity continuity when its location changes and while the
9929
+ // non-configurable document property does not.
9930
+ let sandboxRegistry$LWS = documentSandboxRegistryCache$LWS.get(document$LWS);
9931
+ if (sandboxRegistry$LWS === undefined) {
9932
+ sandboxRegistry$LWS = {
9933
+ __proto__: null
9934
+ };
9935
+ documentSandboxRegistryCache$LWS.set(document$LWS, sandboxRegistry$LWS);
9936
+ }
9937
+ return sandboxRegistry$LWS;
9938
+ }
9939
+ const LightningWebSecurity$LWS = {
9940
+ __proto__: null
9941
+ };
9942
+ toSafeMap$LWS$1(new MapCtor$LWS$1());
9943
+ ObjectFreeze$LWS$1(LightningWebSecurity$LWS);
9891
9944
  const distortionFactoriesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9892
9945
  const opaqueWindowPostMessageDistortionFactoryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9893
9946
  // WebKit based browsers have a bug that prematurely removes distortion entries
9894
9947
  // from the distortions weak map.
9895
9948
  const SUPPORTS_DISTORTIONS_WEAK_MAP$LWS = !IS_WEBKIT_BROWSER$LWS;
9896
9949
  function createDistortionEntries$LWS(record$LWS, factories$LWS) {
9950
+ toSafeMap$LWS$1(new MapCtor$LWS$1());
9897
9951
  const entries$LWS = [];
9898
9952
  for (let i$LWS = 0, {
9899
9953
  length: length$LWS
@@ -9906,10 +9960,13 @@ function createDistortionEntries$LWS(record$LWS, factories$LWS) {
9906
9960
  1: distortedValue$LWS
9907
9961
  } = entry$LWS;
9908
9962
  if (typeof originalValue$LWS === 'function') {
9909
- entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS)];
9963
+ const proxyMaskedFunctionDistortion$LWS = proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS);
9964
+ entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskedFunctionDistortion$LWS];
9910
9965
  } else {
9911
9966
  // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
9912
9967
  if (typeof originalValue$LWS === 'object' && originalValue$LWS !== null) {
9968
+ // TODO: we may need to make this assigned value a proxy when ENABLE_DISTORTION_TOGGLE_SWITCHES is true,
9969
+ // allowing us to change which value is provided for the distortion.
9913
9970
  entries$LWS[entries$LWS.length] = entry$LWS;
9914
9971
  }
9915
9972
  }
@@ -9993,18 +10050,13 @@ function getOpaqueWindowPostMessageDistortionFactory$LWS(record$LWS) {
9993
10050
  return opaqueWindowPostMessageDistortionFactory$LWS;
9994
10051
  }
9995
10052
  function proxyMaskFunctionDistortion$LWS({
9996
- BASIC_INSTRUMENTATION_DATA: BASIC_INSTRUMENTATION_DATA$LWS,
9997
10053
  LOCKER_VERBOSE_INSTRUMENTATION_FLAG: LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS,
9998
10054
  instrumentation: instrumentation$LWS,
9999
10055
  key: sandboxKey$LWS
10000
10056
  }, distortionFactory$LWS, distortionFunc$LWS, maskFunc$LWS) {
10001
10057
  let activityName$LWS;
10002
- let startActivity$LWS;
10003
10058
  // istanbul ignore if: this is a safety precaution that is unreachable via tests
10004
10059
  if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10005
- ({
10006
- startActivity: startActivity$LWS
10007
- } = instrumentation$LWS);
10008
10060
  const {
10009
10061
  name: factoryName$LWS
10010
10062
  } = distortionFactory$LWS;
@@ -10012,51 +10064,33 @@ function proxyMaskFunctionDistortion$LWS({
10012
10064
  }
10013
10065
  return maskFunction$LWS(distortionFunc$LWS, maskFunc$LWS, {
10014
10066
  apply: function (target$LWS, thisArg$LWS, args$LWS) {
10015
- let activity$LWS;
10016
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10017
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10018
- activity$LWS = startActivity$LWS(activityName$LWS, BASIC_INSTRUMENTATION_DATA$LWS);
10019
- }
10067
+ const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
10020
10068
  try {
10021
10069
  return ReflectApply$LWS$1(target$LWS, thisArg$LWS, args$LWS);
10022
10070
  } catch (error) {
10023
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10024
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10025
- activity$LWS.error({
10026
- sandboxKey: sandboxKey$LWS,
10027
- error
10028
- });
10029
- }
10071
+ activity$LWS == null || activity$LWS.error({
10072
+ sandboxKey: sandboxKey$LWS,
10073
+ error
10074
+ });
10075
+ activity$LWS == null || activity$LWS.stop();
10030
10076
  throw error;
10031
10077
  } finally {
10032
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10033
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10034
- activity$LWS.stop();
10035
- }
10078
+ activity$LWS == null || activity$LWS.stop();
10036
10079
  }
10037
10080
  },
10038
10081
  construct: function (target$LWS, args$LWS, newTarget$LWS) {
10039
- let activity$LWS;
10040
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10041
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10042
- activity$LWS = startActivity$LWS(activityName$LWS, BASIC_INSTRUMENTATION_DATA$LWS);
10043
- }
10082
+ const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
10044
10083
  try {
10045
10084
  return ReflectConstruct$LWS(target$LWS, args$LWS, newTarget$LWS);
10046
10085
  } catch (error) {
10047
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10048
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10049
- activity$LWS.error({
10050
- sandboxKey: sandboxKey$LWS,
10051
- error
10052
- });
10053
- }
10086
+ activity$LWS == null || activity$LWS.error({
10087
+ sandboxKey: sandboxKey$LWS,
10088
+ error
10089
+ });
10090
+ activity$LWS == null || activity$LWS.stop();
10054
10091
  throw error;
10055
10092
  } finally {
10056
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10057
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10058
- activity$LWS.stop();
10059
- }
10093
+ activity$LWS == null || activity$LWS.stop();
10060
10094
  }
10061
10095
  }
10062
10096
  });
@@ -10331,6 +10365,11 @@ const SetCtor$LWS = Set;
10331
10365
  const {
10332
10366
  prototype: SetProto$LWS
10333
10367
  } = SetCtor$LWS;
10368
+ const {
10369
+ add: SetProtoAdd$LWS,
10370
+ has: SetProtoHas$LWS,
10371
+ values: SetProtoValues$LWS
10372
+ } = SetProto$LWS;
10334
10373
  ObjectLookupOwnGetter$LWS(SetProto$LWS, 'size');
10335
10374
  const StringCtor$LWS = String;
10336
10375
  const {
@@ -13596,7 +13635,11 @@ function createMembraneMarshall$LWS(globalObject$LWS) {
13596
13635
  selectedTarget$LWS = undefined;
13597
13636
  let proto$LWS;
13598
13637
  if (typeof protoPointerOrNull$LWS === 'function') {
13599
- protoPointerOrNull$LWS();
13638
+ // Instead of calling `protoPointerOrNull()` directly we use
13639
+ // `ReflectApply` to avoid a Maglev (https://v8.dev/blog/maglev)
13640
+ // optimizing JIT bug in Chrome >= 117:
13641
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1494060
13642
+ ReflectApply$LWS(protoPointerOrNull$LWS, undefined, []);
13600
13643
  proto$LWS = selectedTarget$LWS;
13601
13644
  selectedTarget$LWS = undefined;
13602
13645
  } else {
@@ -14378,66 +14421,61 @@ class VirtualEnvironment$LWS {
14378
14421
  * problematic, and requires a lot more work to guarantee that objects from both sides
14379
14422
  * can be considered equivalents (without identity discontinuity).
14380
14423
  */
14381
- const ESGlobalKeys$LWS = [
14382
- // *** 19.1 Value Properties of the Global Object
14383
- 'globalThis', 'Infinity', 'NaN', 'undefined',
14384
- // *** 19.2 Function Properties of the Global Object
14385
- // 'eval', // dangerous & Reflective
14386
- 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
14387
- // *** 19.3 Constructor Properties of the Global Object
14388
- // 'AggregateError', // Reflective
14389
- // 'Array', // Reflective
14390
- // 'ArrayBuffer', // Remapped
14391
- 'BigInt',
14392
- // 'BigInt64Array', // Remapped
14393
- // 'BigUint64Array', // Remapped
14394
- 'Boolean',
14395
- // 'DataView', // Remapped
14396
- // 'Date', // Remapped
14397
- // 'Error', // Reflective
14398
- // 'EvalError', // Reflective
14399
- 'FinalizationRegistry',
14400
- // 'Float32Array', // Remapped
14401
- // 'Float64Array', // Remapped
14402
- // 'Function', // dangerous & Reflective
14403
- // 'Int8Array', // Remapped
14404
- // 'Int16Array', // Remapped
14405
- // 'Int32Array', // Remapped
14406
- // 'Map', // Remapped
14407
- 'Number',
14408
- // 'Object', // Reflective
14409
- // Allow blue `Promise` constructor to overwrite the Red one so that promises
14410
- // created by the `Promise` constructor or APIs like `fetch` will work.
14411
- // 'Promise', // Remapped
14412
- // 'Proxy', // Reflective
14413
- // 'RangeError', // Reflective
14414
- // 'ReferenceError', // Reflective
14415
- 'RegExp',
14416
- // 'Set', // Remapped
14417
- // 'SharedArrayBuffer', // Remapped
14418
- 'String', 'Symbol',
14419
- // 'SyntaxError', // Reflective
14420
- // 'TypeError', // Reflective
14421
- // 'Uint8Array', // Remapped
14422
- // 'Uint8ClampedArray', // Remapped
14423
- // 'Uint16Array', // Remapped
14424
- // 'Uint32Array', // Remapped
14425
- // 'URIError', // Reflective
14426
- // 'WeakMap', // Remapped
14427
- // 'WeakSet', // Remapped
14428
- 'WeakRef',
14429
- // *** 18.4 Other Properties of the Global Object
14430
- // 'Atomics', // Remapped
14431
- 'JSON', 'Math', 'Reflect',
14432
- // *** Annex B
14433
- 'escape', 'unescape'
14434
- // *** ECMA-402
14435
- // 'Intl', // Remapped
14436
- ];
14424
+ function getESGlobalKeys$LWS(remapTypedArrays$LWS = true) {
14425
+ const ESGlobalKeys$LWS = [
14426
+ // *** 19.1 Value Properties of the Global Object
14427
+ 'globalThis', 'Infinity', 'NaN', 'undefined',
14428
+ // *** 19.2 Function Properties of the Global Object
14429
+ // 'eval', // dangerous & Reflective
14430
+ 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
14431
+ // *** 19.3 Constructor Properties of the Global Object
14432
+ // 'AggregateError', // Reflective
14433
+ // 'Array', // Reflective
14434
+ 'BigInt', 'Boolean',
14435
+ // 'Date', // Remapped
14436
+ // 'Error', // Reflective
14437
+ // 'EvalError', // Reflective
14438
+ 'FinalizationRegistry',
14439
+ // 'Function', // dangerous & Reflective
14440
+ // 'Map', // Remapped
14441
+ 'Number',
14442
+ // 'Object', // Reflective
14443
+ // Allow blue `Promise` constructor to overwrite the Red one so that promises
14444
+ // created by the `Promise` constructor or APIs like `fetch` will work.
14445
+ // 'Promise', // Remapped
14446
+ // 'Proxy', // Reflective
14447
+ // 'RangeError', // Reflective
14448
+ // 'ReferenceError', // Reflective
14449
+ 'RegExp',
14450
+ // 'Set', // Remapped
14451
+ 'String', 'Symbol',
14452
+ // 'SyntaxError', // Reflective
14453
+ // 'TypeError', // Reflective
14454
+ // 'URIError', // Reflective
14455
+ // 'WeakMap', // Remapped
14456
+ // 'WeakSet', // Remapped
14457
+ 'WeakRef',
14458
+ // *** 18.4 Other Properties of the Global Object
14459
+ // 'Atomics', // Remapped
14460
+ 'JSON', 'Math', 'Reflect',
14461
+ // *** Annex B
14462
+ 'escape', 'unescape'
14463
+ // *** ECMA-402
14464
+ // 'Intl', // Remapped
14465
+ ];
14466
+
14467
+ if (remapTypedArrays$LWS === false) {
14468
+ ESGlobalKeys$LWS.push('ArrayBuffer', 'BigInt64Array', 'BigUint64Array', 'DataView', 'Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'SharedArrayBuffer', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array');
14469
+ }
14470
+ return ESGlobalKeys$LWS;
14471
+ }
14437
14472
  // These are foundational things that should never be wrapped but are equivalent
14438
14473
  // @TODO: Revisit this list.
14439
14474
  const ReflectiveIntrinsicObjectNames$LWS = ['AggregateError', 'Array', 'Error', 'EvalError', 'Function', 'Object', 'Proxy', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'eval', 'globalThis'];
14440
- const ESGlobalsAndReflectiveIntrinsicObjectNames$LWS = toSafeArray$LWS([...ESGlobalKeys$LWS, ...ReflectiveIntrinsicObjectNames$LWS]);
14475
+ function getESGlobalsAndReflectiveIntrinsicObjectNames$LWS(remapTypedArrays$LWS = true) {
14476
+ const ESGlobalKeys$LWS = getESGlobalKeys$LWS(remapTypedArrays$LWS);
14477
+ return toSafeArray$LWS([...ESGlobalKeys$LWS, ...ReflectiveIntrinsicObjectNames$LWS]);
14478
+ }
14441
14479
  function getGlobalObjectOwnKeys$LWS(source$LWS) {
14442
14480
  const ownKeys$LWS = ReflectOwnKeys$LWS(source$LWS);
14443
14481
  // WKWebView incorrectly excludes the 'webkit' own property of the global
@@ -14448,8 +14486,9 @@ function getGlobalObjectOwnKeys$LWS(source$LWS) {
14448
14486
  }
14449
14487
  return ownKeys$LWS;
14450
14488
  }
14451
- function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(descs$LWS, source$LWS) {
14489
+ function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(descs$LWS, source$LWS, includeTypedArrays$LWS) {
14452
14490
  const ownKeys$LWS = getGlobalObjectOwnKeys$LWS(source$LWS);
14491
+ const ESGlobalsAndReflectiveIntrinsicObjectNames$LWS = getESGlobalsAndReflectiveIntrinsicObjectNames$LWS(includeTypedArrays$LWS);
14453
14492
  for (let i$LWS = 0, {
14454
14493
  length: length$LWS
14455
14494
  } = ownKeys$LWS; i$LWS < length$LWS; i$LWS += 1) {
@@ -14472,10 +14511,11 @@ function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(descs$LWS,
14472
14511
  }
14473
14512
  return descs$LWS;
14474
14513
  }
14475
- function getFilteredGlobalOwnKeys$LWS(source$LWS) {
14514
+ function getFilteredGlobalOwnKeys$LWS(source$LWS, includeTypedArrays$LWS) {
14476
14515
  const result$LWS = [];
14477
14516
  let resultOffset$LWS = 0;
14478
14517
  const ownKeys$LWS = getGlobalObjectOwnKeys$LWS(source$LWS);
14518
+ const ESGlobalsAndReflectiveIntrinsicObjectNames$LWS = getESGlobalsAndReflectiveIntrinsicObjectNames$LWS(includeTypedArrays$LWS);
14479
14519
  for (let i$LWS = 0, {
14480
14520
  length: length$LWS
14481
14521
  } = ownKeys$LWS; i$LWS < length$LWS; i$LWS += 1) {
@@ -14549,20 +14589,24 @@ function getCachedGlobalObjectReferences$LWS(globalObject$LWS) {
14549
14589
  blueDocumentToRecordMap$LWS.set(document$LWS, record$LWS);
14550
14590
  return record$LWS;
14551
14591
  }
14552
- function filterWindowKeys$LWS(keys$LWS) {
14592
+ function filterWindowKeys$LWS(keys$LWS, remapTypedArrays$LWS) {
14593
+ const excludedKeys$LWS = new SetCtor$LWS(['document', 'location', 'top', 'window']);
14594
+ // Crypto and typed arrays must be from the same global object
14595
+ if (remapTypedArrays$LWS === false) {
14596
+ excludedKeys$LWS.add('crypto');
14597
+ excludedKeys$LWS.add('Crypto');
14598
+ excludedKeys$LWS.add('SubtleCrypto');
14599
+ }
14553
14600
  const result$LWS = [];
14554
14601
  let resultOffset$LWS = 0;
14555
14602
  for (let i$LWS = 0, {
14556
14603
  length: length$LWS
14557
14604
  } = keys$LWS; i$LWS < length$LWS; i$LWS += 1) {
14558
14605
  const key$LWS = keys$LWS[i$LWS];
14559
- if (
14560
- // Filter out unforgeable property keys that cannot be installed.
14561
- key$LWS !== 'document' && key$LWS !== 'location ' && key$LWS !== 'top' && key$LWS !== 'window' &&
14562
- // Remove other browser specific unforgeables.
14563
- key$LWS !== 'chrome') {
14564
- result$LWS[resultOffset$LWS++] = key$LWS;
14606
+ if (ReflectApply$LWS(SetProtoHas$LWS, excludedKeys$LWS, [key$LWS])) {
14607
+ continue;
14565
14608
  }
14609
+ result$LWS[resultOffset$LWS++] = key$LWS;
14566
14610
  }
14567
14611
  return result$LWS;
14568
14612
  }
@@ -14593,7 +14637,7 @@ function filterWindowKeys$LWS(keys$LWS) {
14593
14637
  * that will be installed (via the membrane) as global descriptors in
14594
14638
  * the red realm.
14595
14639
  */
14596
- function removeWindowDescriptors$LWS(unsafeDescs$LWS) {
14640
+ function removeWindowDescriptors$LWS(unsafeDescs$LWS, remapTypedArrays$LWS) {
14597
14641
  // Remove unforgeable descriptors that cannot be installed.
14598
14642
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'document');
14599
14643
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'location');
@@ -14601,6 +14645,12 @@ function removeWindowDescriptors$LWS(unsafeDescs$LWS) {
14601
14645
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'window');
14602
14646
  // Remove other browser specific unforgeables.
14603
14647
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'chrome');
14648
+ // Crypto and typed arrays must be from the same global object
14649
+ if (remapTypedArrays$LWS === false) {
14650
+ ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'crypto');
14651
+ ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'Crypto');
14652
+ ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'SubtleCrypto');
14653
+ }
14604
14654
  return unsafeDescs$LWS;
14605
14655
  }
14606
14656
  /**
@@ -14613,7 +14663,6 @@ getCachedGlobalObjectReferences$LWS(rootWindow$LWS);
14613
14663
  const IFRAME_SANDBOX_ATTRIBUTE_VALUE$LWS = 'allow-same-origin allow-scripts';
14614
14664
  const revoked$LWS = toSafeWeakSet$LWS(new WeakSetCtor$LWS());
14615
14665
  const blueCreateHooksCallbackCache$LWS = toSafeWeakMap$LWS(new WeakMapCtor$LWS());
14616
- let defaultGlobalOwnKeys$LWS = null;
14617
14666
  function createDetachableIframe$LWS(doc$LWS) {
14618
14667
  var _ReflectApply$LWS;
14619
14668
  const iframe$LWS = ReflectApply$LWS(DocumentProtoCreateElement$LWS, doc$LWS, ['iframe']);
@@ -14642,6 +14691,7 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14642
14691
  instrumentation: instrumentation$LWS,
14643
14692
  keepAlive: keepAlive$LWS = true,
14644
14693
  liveTargetCallback: liveTargetCallback$LWS,
14694
+ remapTypedArrays: remapTypedArrays$LWS = true,
14645
14695
  signSourceCallback: signSourceCallback$LWS
14646
14696
  // eslint-disable-next-line prefer-object-spread
14647
14697
  } = ObjectAssign$LWS({
@@ -14650,9 +14700,7 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14650
14700
  const iframe$LWS = createDetachableIframe$LWS(blueRefs$LWS.document);
14651
14701
  const redWindow$LWS = ReflectApply$LWS(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, []);
14652
14702
  const shouldUseDefaultGlobalOwnKeys$LWS = typeof globalObjectShape$LWS !== 'object' || globalObjectShape$LWS === null;
14653
- if (shouldUseDefaultGlobalOwnKeys$LWS && defaultGlobalOwnKeys$LWS === null) {
14654
- defaultGlobalOwnKeys$LWS = filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(redWindow$LWS));
14655
- }
14703
+ const defaultGlobalOwnKeys$LWS = filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(redWindow$LWS, remapTypedArrays$LWS), remapTypedArrays$LWS);
14656
14704
  let blueConnector$LWS = blueCreateHooksCallbackCache$LWS.get(blueRefs$LWS.document);
14657
14705
  if (blueConnector$LWS === undefined) {
14658
14706
  blueConnector$LWS = createBlueConnector$LWS(globalObject$LWS);
@@ -14693,7 +14741,7 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14693
14741
  // window.__proto__.__proto__.__proto__ (aka EventTarget.prototype)
14694
14742
  env$LWS.link('__proto__', '__proto__', '__proto__');
14695
14743
  env$LWS.remapProto(blueRefs$LWS.document, blueRefs$LWS.DocumentProto);
14696
- env$LWS.lazyRemapProperties(blueRefs$LWS.window, shouldUseDefaultGlobalOwnKeys$LWS ? defaultGlobalOwnKeys$LWS : filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(globalObjectShape$LWS)),
14744
+ env$LWS.lazyRemapProperties(blueRefs$LWS.window, shouldUseDefaultGlobalOwnKeys$LWS ? defaultGlobalOwnKeys$LWS : filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(globalObjectShape$LWS), remapTypedArrays$LWS),
14697
14745
  // Chromium based browsers have a bug that nulls the result of `window`
14698
14746
  // getters in detached iframes when the property descriptor of `window.window`
14699
14747
  // is retrieved.
@@ -14701,8 +14749,8 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14701
14749
  keepAlive$LWS ? undefined : unforgeablePoisonedWindowKeys$LWS);
14702
14750
  if (endowments$LWS) {
14703
14751
  const filteredEndowments$LWS = {};
14704
- assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(filteredEndowments$LWS, endowments$LWS);
14705
- removeWindowDescriptors$LWS(filteredEndowments$LWS);
14752
+ assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(filteredEndowments$LWS, endowments$LWS, remapTypedArrays$LWS);
14753
+ removeWindowDescriptors$LWS(filteredEndowments$LWS, remapTypedArrays$LWS);
14706
14754
  env$LWS.remapProperties(blueRefs$LWS.window, filteredEndowments$LWS);
14707
14755
  }
14708
14756
  // We intentionally skip remapping Window.prototype because there is nothing
@@ -15062,44 +15110,12 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
15062
15110
  // tools from mistaking the regexp or the replacement string for an
15063
15111
  // actual source mapping URL.
15064
15112
  /\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
15065
- sourceText$LWS = `\n//# LWS Version = "0.20.8"\n${sourceText$LWS}`;
15113
+ sourceText$LWS = `\n//# LWS Version = "0.21.3"\n${sourceText$LWS}`;
15066
15114
  return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
15067
15115
  // Append "'use strict'" to the extracted function body so it is
15068
15116
  // evaluated in strict mode.
15069
15117
  `'use strict';${sourceText$LWS}` : sourceText$LWS;
15070
15118
  }
15071
- const rootSandboxRegistry$LWS = {
15072
- __proto__: null
15073
- };
15074
- const documentSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1([[rootDocument$LWS, rootSandboxRegistry$LWS]]));
15075
- const opaqueWindowSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
15076
- function getOpaqueSandboxRegistry$LWS(globalObject$LWS) {
15077
- // Use the `document` as the key because a window object maintains its
15078
- // identity continuity when its location changes and while the
15079
- // non-configurable document property does not.
15080
- let sandboxRegistry$LWS = opaqueWindowSandboxRegistryCache$LWS.get(globalObject$LWS);
15081
- // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
15082
- if (sandboxRegistry$LWS === undefined) {
15083
- sandboxRegistry$LWS = {
15084
- __proto__: null
15085
- };
15086
- opaqueWindowSandboxRegistryCache$LWS.set(globalObject$LWS, sandboxRegistry$LWS);
15087
- }
15088
- return sandboxRegistry$LWS;
15089
- }
15090
- function getSandboxRegistry$LWS(document$LWS) {
15091
- // Use the `document` as the key because a window object maintains its
15092
- // identity continuity when its location changes and while the
15093
- // non-configurable document property does not.
15094
- let sandboxRegistry$LWS = documentSandboxRegistryCache$LWS.get(document$LWS);
15095
- if (sandboxRegistry$LWS === undefined) {
15096
- sandboxRegistry$LWS = {
15097
- __proto__: null
15098
- };
15099
- documentSandboxRegistryCache$LWS.set(document$LWS, sandboxRegistry$LWS);
15100
- }
15101
- return sandboxRegistry$LWS;
15102
- }
15103
15119
 
15104
15120
  // Flag whether the iframe should remain connected to the DOM.
15105
15121
  const IFRAME_KEEP_ALIVE_FLAG$LWS = LOCKER_UNMINIFIED_FLAG$LWS$1 && !false;
@@ -15177,7 +15193,6 @@ function createSandboxEvaluator$LWS({
15177
15193
  }
15178
15194
  function createVirtualEnvironment$LWS(record$LWS) {
15179
15195
  const {
15180
- LOCKER_VERBOSE_INSTRUMENTATION_FLAG: verboseInstrumentation$LWS,
15181
15196
  endowments: endowments$LWS,
15182
15197
  globalObject: globalObject$LWS,
15183
15198
  instrumentation: instrumentation$LWS,
@@ -15188,6 +15203,13 @@ function createVirtualEnvironment$LWS(record$LWS) {
15188
15203
  },
15189
15204
  type: type$LWS
15190
15205
  } = record$LWS;
15206
+ // only Omnistudio test namespaces 'devopsimpkg*' or exact 'omnistudio' name
15207
+ let remapTypedArrays$LWS = true;
15208
+ if (key$LWS === 'omnistudio') {
15209
+ remapTypedArrays$LWS = false;
15210
+ } else if (ReflectApply$LWS$1(StringProtoStartsWith$LWS, key$LWS, ['devopsimpkg'])) {
15211
+ remapTypedArrays$LWS = false;
15212
+ }
15191
15213
  return createIframeVirtualEnvironment$LWS(globalObject$LWS, {
15192
15214
  defaultPolicy: {
15193
15215
  createScript:
@@ -15276,7 +15298,8 @@ function createVirtualEnvironment$LWS(record$LWS) {
15276
15298
  // and the default endowments descriptors so they can be
15277
15299
  // accessible from inside the sandbox.
15278
15300
  ObjectAssign$LWS$1({}, DEFAULT_ENDOWMENTS_DESCRIPTOR_MAP$LWS, ObjectGetOwnPropertyDescriptors$LWS(endowments$LWS)) : DEFAULT_ENDOWMENTS_DESCRIPTOR_MAP$LWS,
15279
- instrumentation: verboseInstrumentation$LWS ? instrumentation$LWS : undefined,
15301
+ instrumentation: instrumentation$LWS,
15302
+ remapTypedArrays: remapTypedArrays$LWS,
15280
15303
  keepAlive: IFRAME_KEEP_ALIVE_FLAG$LWS,
15281
15304
  liveTargetCallback: isTargetLive$LWS,
15282
15305
  signSourceCallback: sourceText$LWS => trusted.createScript(sourceText$LWS)
@@ -15583,7 +15606,6 @@ function internalEvaluateInSandbox$LWS(evaluateOptions$LWS) {
15583
15606
  throw new LockerSecurityError$LWS(ERR_INVALID_SANDBOX_KEY$LWS);
15584
15607
  }
15585
15608
  const {
15586
- BASIC_INSTRUMENTATION_DATA: BASIC_INSTRUMENTATION_DATA$LWS,
15587
15609
  LOCKER_INSTRUMENTATION_FLAG: LOCKER_INSTRUMENTATION_FLAG$LWS,
15588
15610
  helpers: helpers$LWS,
15589
15611
  virtualEnvironmentEvaluator: virtualEnvironmentEvaluator$LWS
@@ -15611,33 +15633,25 @@ function internalEvaluateInSandbox$LWS(evaluateOptions$LWS) {
15611
15633
  }
15612
15634
  let result$LWS;
15613
15635
  const sourceText$LWS = toSourceText$LWS(source$LWS, sourceType$LWS);
15614
- const startActivity$LWS = LOCKER_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS.startActivity : undefined;
15615
- let activity$LWS;
15616
- // istanbul ignore else: this is a safety precaution that is unreachable via tests
15617
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15618
- activity$LWS = startActivity$LWS('evaluateInSandbox', BASIC_INSTRUMENTATION_DATA$LWS);
15619
- }
15636
+ const activity$LWS = LOCKER_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null ? void 0 : instrumentation$LWS.startActivity('lws.evaluate') : undefined;
15620
15637
  try {
15621
15638
  // Protecting against errors during evaluation can guarantee the state
15622
15639
  // of the EvalContext to avoid leaking context values
15623
15640
  result$LWS = virtualEnvironmentEvaluator$LWS(sourceText$LWS);
15641
+ instrumentation$LWS == null || instrumentation$LWS.incrementCounter == null || instrumentation$LWS.incrementCounter('lws.evaluate', 1, false);
15624
15642
  } catch (error) {
15625
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
15626
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15627
- activity$LWS.error({
15628
- sandboxKey: key$LWS,
15629
- error
15630
- });
15631
- }
15643
+ instrumentation$LWS == null || instrumentation$LWS.incrementCounter == null || instrumentation$LWS.incrementCounter('lws.evaluate', 1, true);
15644
+ activity$LWS == null || activity$LWS.error({
15645
+ sandboxKey: key$LWS,
15646
+ error
15647
+ });
15648
+ activity$LWS == null || activity$LWS.stop();
15632
15649
  throw error;
15633
15650
  } finally {
15634
15651
  clearEvalContext$LWS();
15635
15652
  clearEvalHelpers$LWS();
15636
15653
  }
15637
- // istanbul ignore else: this is a safety precaution that is unreachable via tests
15638
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15639
- activity$LWS.stop();
15640
- }
15654
+ activity$LWS == null || activity$LWS.stop();
15641
15655
  return result$LWS;
15642
15656
  }
15643
15657
  // istanbul ignore next: currently unreachable via tests, exclusively used in AMD format mode
@@ -15757,7 +15771,7 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
15757
15771
  depRegistry$LWS.set(dep$LWS, secureDep$LWS);
15758
15772
  return secureDep$LWS;
15759
15773
  }
15760
- /*! version: 0.20.8 */
15774
+ /*! version: 0.21.3 */
15761
15775
 
15762
15776
  const loaderDefine = globalThis.LWR.define;
15763
15777