@lwrjs/client-modules 0.12.0-alpha.13 → 0.12.0-alpha.15

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.
@@ -1,5 +1,4 @@
1
- const environment = globalThis?.LWR?.env || {};
2
- export const isServer = environment && (environment.SSR === 'true' || environment.SSR === true);
1
+ const environment = globalThis?.LWR?.env;
3
2
  // The baseBath from the config or set from the request (e.g. /shop)
4
3
  export const basePath = environment && environment.basePath;
5
4
  // The locale set from the request or the defaultLocale from the config (e.g. en-US)
@@ -7,4 +6,9 @@ export const locale = environment && environment.locale;
7
6
  // Root base path for static assets (e.g. /shop/mobify/bundle/1234/site)
8
7
  export const assetBasePath = environment && environment.assetBasePath;
9
8
  // Base path for UI routing (e.g. /shop/en-US)
10
- export const uiBasePath = environment && environment.uiBasePath;
9
+ export const uiBasePath = environment && environment.uiBasePath;
10
+ // Determines if current environment is executing in SSR or CSR context.
11
+ // This value is dynamic and must be re-evaluated on each request
12
+ export const isServer = () => {
13
+ return globalThis?.LWR?.env && (globalThis?.LWR?.env.SSR === 'true' || globalThis?.LWR?.env.SSR === true);
14
+ };
@@ -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.21.1 */
1456
+ /*! version: 0.21.2 */
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.21.1 */
2115
+ /*! version: 0.21.2 */
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.21.1 */
2174
+ /*! version: 0.21.2 */
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.21.1 */
3860
+ /*! version: 0.21.2 */
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.21.1 */
4109
+ /*! version: 0.21.2 */
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.21.1 */
4307
+ /*! version: 0.21.2 */
4308
4308
 
4309
4309
  /*!
4310
4310
  * Copyright (C) 2019 salesforce.com, inc.
@@ -9880,7 +9880,7 @@ initDistortionElementAfter$LWS, initDistortionElementAppend$LWS, initDistortionE
9880
9880
  // initDistortionNodeAppendChild,
9881
9881
  initDistortionNodeInsertBefore$LWS]);
9882
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'], [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'], [initDistortionLocalStorage$LWS, 'storage'], [initDistortionMessagePortPostMessage$LWS, 'postMessage'], [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']]));
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']]));
9884
9884
  const DocumentBlockedProperties$LWS = ['createProcessingInstruction', 'exitFullscreen', 'fullscreen', 'fullscreenElement', 'fullscreenEnabled', 'mozCancelFullScreen', 'mozFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'onfullscreenchange', 'onfullscreenerror', 'onmozfullscreenchange', 'onmozfullscreenerror', 'onrejectionhandled', 'onunhandledrejection', 'releaseCapture', 'releaseEvents', 'webkitFullScreenKeyboardInputAllowed', 'write', 'writeln'];
9885
9885
  const ElementBlockedProperties$LWS = ['mozRequestFullScreen', 'onfullscreenchange', 'onfullscreenerror', 'requestFullscreen', 'webkitRequestFullScreen', 'webkitRequestFullscreen'];
9886
9886
  const EventBlockedProperties$LWS = ['originalTarget', 'explicitOriginalTarget'];
@@ -9894,63 +9894,60 @@ const HTMLIFrameElementBlockedProperties$LWS = ['getSVGDocument', 'srcdoc'];
9894
9894
  const HTMLObjectElementBlockedProperties$LWS = ['getSVGDocument'];
9895
9895
  const HTMLScriptElementBlockedAttributes$LWS = ['nonce'];
9896
9896
  const HTMLScriptElementBlockedProperties$LWS = ['nonce'];
9897
- const LightningWebSecurity$LWS = {
9898
- __proto__: null
9899
- };
9900
- const distortions$LWS = {
9901
- __proto__: null,
9902
- attributes: true,
9903
- caches: true,
9904
- cookieStore: true,
9905
- documentCookie: true,
9906
- documentDomain: true,
9907
- documentExecCommand: true,
9908
- element: true,
9909
- innerHTML: true,
9910
- navigatorSendBeacon: true,
9911
- node: true,
9912
- performance: true,
9913
- postMessage: true,
9914
- range: true,
9915
- selection: true,
9916
- setInterval: true,
9917
- setTimeout: true,
9918
- storage: true,
9919
- style: true
9920
- };
9921
- ReflectDefineProperty$LWS$1(LightningWebSecurity$LWS, 'distortions', {
9922
- __proto__: null,
9923
- enumerable: false,
9924
- configurable: false,
9925
- writable: false,
9926
- value: distortions$LWS
9927
- });
9928
- ReflectDefineProperty$LWS$1(window, '$LWS', {
9929
- __proto__: null,
9930
- enumerable: false,
9931
- configurable: false,
9932
- writable: false,
9933
- value: LightningWebSecurity$LWS
9934
- });
9935
- ObjectFreeze$LWS$1(LightningWebSecurity$LWS);
9936
- ObjectPreventExtensions$LWS(distortions$LWS);
9937
9897
  const SVGElementBlockedAttributes$LWS = ['nonce'];
9938
9898
  const SVGElementBlockedProperties$LWS = ['nonce'];
9939
9899
  const UIEventBlockedProperties$LWS = ['rangeParent'];
9940
9900
  const WindowBlockedProperties$LWS = ['find'];
9941
9901
  const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
9942
- /*! version: 0.21.1 */
9902
+ /*! version: 0.21.2 */
9943
9903
 
9944
9904
  /*!
9945
9905
  * Copyright (C) 2019 salesforce.com, inc.
9946
9906
  */
9947
- const distortionFactoryToggleSwitchesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
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);
9948
9944
  const distortionFactoriesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9949
9945
  const opaqueWindowPostMessageDistortionFactoryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9950
9946
  // WebKit based browsers have a bug that prematurely removes distortion entries
9951
9947
  // from the distortions weak map.
9952
9948
  const SUPPORTS_DISTORTIONS_WEAK_MAP$LWS = !IS_WEBKIT_BROWSER$LWS;
9953
9949
  function createDistortionEntries$LWS(record$LWS, factories$LWS) {
9950
+ toSafeMap$LWS$1(new MapCtor$LWS$1());
9954
9951
  const entries$LWS = [];
9955
9952
  for (let i$LWS = 0, {
9956
9953
  length: length$LWS
@@ -9964,11 +9961,12 @@ function createDistortionEntries$LWS(record$LWS, factories$LWS) {
9964
9961
  } = entry$LWS;
9965
9962
  if (typeof originalValue$LWS === 'function') {
9966
9963
  const proxyMaskedFunctionDistortion$LWS = proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS);
9967
- distortionFactoryToggleSwitchesCache$LWS.get(factory$LWS);
9968
9964
  entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskedFunctionDistortion$LWS];
9969
9965
  } else {
9970
9966
  // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
9971
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.
9972
9970
  entries$LWS[entries$LWS.length] = entry$LWS;
9973
9971
  }
9974
9972
  }
@@ -10052,18 +10050,13 @@ function getOpaqueWindowPostMessageDistortionFactory$LWS(record$LWS) {
10052
10050
  return opaqueWindowPostMessageDistortionFactory$LWS;
10053
10051
  }
10054
10052
  function proxyMaskFunctionDistortion$LWS({
10055
- BASIC_INSTRUMENTATION_DATA: BASIC_INSTRUMENTATION_DATA$LWS,
10056
10053
  LOCKER_VERBOSE_INSTRUMENTATION_FLAG: LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS,
10057
10054
  instrumentation: instrumentation$LWS,
10058
10055
  key: sandboxKey$LWS
10059
10056
  }, distortionFactory$LWS, distortionFunc$LWS, maskFunc$LWS) {
10060
10057
  let activityName$LWS;
10061
- let startActivity$LWS;
10062
10058
  // istanbul ignore if: this is a safety precaution that is unreachable via tests
10063
10059
  if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10064
- ({
10065
- startActivity: startActivity$LWS
10066
- } = instrumentation$LWS);
10067
10060
  const {
10068
10061
  name: factoryName$LWS
10069
10062
  } = distortionFactory$LWS;
@@ -10071,51 +10064,33 @@ function proxyMaskFunctionDistortion$LWS({
10071
10064
  }
10072
10065
  return maskFunction$LWS(distortionFunc$LWS, maskFunc$LWS, {
10073
10066
  apply: function (target$LWS, thisArg$LWS, args$LWS) {
10074
- let activity$LWS;
10075
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10076
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10077
- activity$LWS = startActivity$LWS(activityName$LWS, BASIC_INSTRUMENTATION_DATA$LWS);
10078
- }
10067
+ const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
10079
10068
  try {
10080
10069
  return ReflectApply$LWS$1(target$LWS, thisArg$LWS, args$LWS);
10081
10070
  } catch (error) {
10082
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10083
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10084
- activity$LWS.error({
10085
- sandboxKey: sandboxKey$LWS,
10086
- error
10087
- });
10088
- }
10071
+ activity$LWS == null || activity$LWS.error({
10072
+ sandboxKey: sandboxKey$LWS,
10073
+ error
10074
+ });
10075
+ activity$LWS == null || activity$LWS.stop();
10089
10076
  throw error;
10090
10077
  } finally {
10091
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10092
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10093
- activity$LWS.stop();
10094
- }
10078
+ activity$LWS == null || activity$LWS.stop();
10095
10079
  }
10096
10080
  },
10097
10081
  construct: function (target$LWS, args$LWS, newTarget$LWS) {
10098
- let activity$LWS;
10099
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10100
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10101
- activity$LWS = startActivity$LWS(activityName$LWS, BASIC_INSTRUMENTATION_DATA$LWS);
10102
- }
10082
+ const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
10103
10083
  try {
10104
10084
  return ReflectConstruct$LWS(target$LWS, args$LWS, newTarget$LWS);
10105
10085
  } catch (error) {
10106
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10107
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10108
- activity$LWS.error({
10109
- sandboxKey: sandboxKey$LWS,
10110
- error
10111
- });
10112
- }
10086
+ activity$LWS == null || activity$LWS.error({
10087
+ sandboxKey: sandboxKey$LWS,
10088
+ error
10089
+ });
10090
+ activity$LWS == null || activity$LWS.stop();
10113
10091
  throw error;
10114
10092
  } finally {
10115
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10116
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10117
- activity$LWS.stop();
10118
- }
10093
+ activity$LWS == null || activity$LWS.stop();
10119
10094
  }
10120
10095
  }
10121
10096
  });
@@ -15138,44 +15113,12 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
15138
15113
  // tools from mistaking the regexp or the replacement string for an
15139
15114
  // actual source mapping URL.
15140
15115
  /\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
15141
- sourceText$LWS = `\n//# LWS Version = "0.21.1"\n${sourceText$LWS}`;
15116
+ sourceText$LWS = `\n//# LWS Version = "0.21.2"\n${sourceText$LWS}`;
15142
15117
  return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
15143
15118
  // Append "'use strict'" to the extracted function body so it is
15144
15119
  // evaluated in strict mode.
15145
15120
  `'use strict';${sourceText$LWS}` : sourceText$LWS;
15146
15121
  }
15147
- const rootSandboxRegistry$LWS = {
15148
- __proto__: null
15149
- };
15150
- const documentSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1([[rootDocument$LWS, rootSandboxRegistry$LWS]]));
15151
- const opaqueWindowSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
15152
- function getOpaqueSandboxRegistry$LWS(globalObject$LWS) {
15153
- // Use the `document` as the key because a window object maintains its
15154
- // identity continuity when its location changes and while the
15155
- // non-configurable document property does not.
15156
- let sandboxRegistry$LWS = opaqueWindowSandboxRegistryCache$LWS.get(globalObject$LWS);
15157
- // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
15158
- if (sandboxRegistry$LWS === undefined) {
15159
- sandboxRegistry$LWS = {
15160
- __proto__: null
15161
- };
15162
- opaqueWindowSandboxRegistryCache$LWS.set(globalObject$LWS, sandboxRegistry$LWS);
15163
- }
15164
- return sandboxRegistry$LWS;
15165
- }
15166
- function getSandboxRegistry$LWS(document$LWS) {
15167
- // Use the `document` as the key because a window object maintains its
15168
- // identity continuity when its location changes and while the
15169
- // non-configurable document property does not.
15170
- let sandboxRegistry$LWS = documentSandboxRegistryCache$LWS.get(document$LWS);
15171
- if (sandboxRegistry$LWS === undefined) {
15172
- sandboxRegistry$LWS = {
15173
- __proto__: null
15174
- };
15175
- documentSandboxRegistryCache$LWS.set(document$LWS, sandboxRegistry$LWS);
15176
- }
15177
- return sandboxRegistry$LWS;
15178
- }
15179
15122
 
15180
15123
  // Flag whether the iframe should remain connected to the DOM.
15181
15124
  const IFRAME_KEEP_ALIVE_FLAG$LWS = LOCKER_UNMINIFIED_FLAG$LWS$1 && !false;
@@ -15253,7 +15196,6 @@ function createSandboxEvaluator$LWS({
15253
15196
  }
15254
15197
  function createVirtualEnvironment$LWS(record$LWS) {
15255
15198
  const {
15256
- LOCKER_VERBOSE_INSTRUMENTATION_FLAG: verboseInstrumentation$LWS,
15257
15199
  endowments: endowments$LWS,
15258
15200
  globalObject: globalObject$LWS,
15259
15201
  instrumentation: instrumentation$LWS,
@@ -15352,7 +15294,7 @@ function createVirtualEnvironment$LWS(record$LWS) {
15352
15294
  // and the default endowments descriptors so they can be
15353
15295
  // accessible from inside the sandbox.
15354
15296
  ObjectAssign$LWS$1({}, DEFAULT_ENDOWMENTS_DESCRIPTOR_MAP$LWS, ObjectGetOwnPropertyDescriptors$LWS(endowments$LWS)) : DEFAULT_ENDOWMENTS_DESCRIPTOR_MAP$LWS,
15355
- instrumentation: verboseInstrumentation$LWS ? instrumentation$LWS : undefined,
15297
+ instrumentation: instrumentation$LWS,
15356
15298
  remapTypedArrays: key$LWS !== 'omnistudio',
15357
15299
  keepAlive: IFRAME_KEEP_ALIVE_FLAG$LWS,
15358
15300
  liveTargetCallback: isTargetLive$LWS,
@@ -15660,7 +15602,6 @@ function internalEvaluateInSandbox$LWS(evaluateOptions$LWS) {
15660
15602
  throw new LockerSecurityError$LWS(ERR_INVALID_SANDBOX_KEY$LWS);
15661
15603
  }
15662
15604
  const {
15663
- BASIC_INSTRUMENTATION_DATA: BASIC_INSTRUMENTATION_DATA$LWS,
15664
15605
  LOCKER_INSTRUMENTATION_FLAG: LOCKER_INSTRUMENTATION_FLAG$LWS,
15665
15606
  helpers: helpers$LWS,
15666
15607
  virtualEnvironmentEvaluator: virtualEnvironmentEvaluator$LWS
@@ -15688,33 +15629,25 @@ function internalEvaluateInSandbox$LWS(evaluateOptions$LWS) {
15688
15629
  }
15689
15630
  let result$LWS;
15690
15631
  const sourceText$LWS = toSourceText$LWS(source$LWS, sourceType$LWS);
15691
- const startActivity$LWS = LOCKER_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS.startActivity : undefined;
15692
- let activity$LWS;
15693
- // istanbul ignore else: this is a safety precaution that is unreachable via tests
15694
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15695
- activity$LWS = startActivity$LWS('lws.evaluate', BASIC_INSTRUMENTATION_DATA$LWS);
15696
- }
15632
+ const activity$LWS = LOCKER_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null ? void 0 : instrumentation$LWS.startActivity('lws.evaluate') : undefined;
15697
15633
  try {
15698
15634
  // Protecting against errors during evaluation can guarantee the state
15699
15635
  // of the EvalContext to avoid leaking context values
15700
15636
  result$LWS = virtualEnvironmentEvaluator$LWS(sourceText$LWS);
15637
+ instrumentation$LWS == null || instrumentation$LWS.incrementCounter == null || instrumentation$LWS.incrementCounter('lws.evaluate', 1, false);
15701
15638
  } catch (error) {
15702
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
15703
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15704
- activity$LWS.error({
15705
- sandboxKey: key$LWS,
15706
- error
15707
- });
15708
- }
15639
+ instrumentation$LWS == null || instrumentation$LWS.incrementCounter == null || instrumentation$LWS.incrementCounter('lws.evaluate', 1, true);
15640
+ activity$LWS == null || activity$LWS.error({
15641
+ sandboxKey: key$LWS,
15642
+ error
15643
+ });
15644
+ activity$LWS == null || activity$LWS.stop();
15709
15645
  throw error;
15710
15646
  } finally {
15711
15647
  clearEvalContext$LWS();
15712
15648
  clearEvalHelpers$LWS();
15713
15649
  }
15714
- // istanbul ignore else: this is a safety precaution that is unreachable via tests
15715
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15716
- activity$LWS.stop();
15717
- }
15650
+ activity$LWS == null || activity$LWS.stop();
15718
15651
  return result$LWS;
15719
15652
  }
15720
15653
  // istanbul ignore next: currently unreachable via tests, exclusively used in AMD format mode
@@ -15834,7 +15767,7 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
15834
15767
  depRegistry$LWS.set(dep$LWS, secureDep$LWS);
15835
15768
  return secureDep$LWS;
15836
15769
  }
15837
- /*! version: 0.21.1 */
15770
+ /*! version: 0.21.2 */
15838
15771
 
15839
15772
  const loaderDefine = globalThis.LWR.define;
15840
15773