@adobe/alloy 2.21.1 → 2.22.0-alpha.0

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.
Files changed (436) hide show
  1. package/babel.config.cjs +0 -1
  2. package/libEs5/baseCode/index.js +3 -2
  3. package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +23 -20
  4. package/libEs5/components/ActivityCollector/configValidators.js +2 -2
  5. package/libEs5/components/ActivityCollector/createClickActivityStorage.js +11 -9
  6. package/libEs5/components/ActivityCollector/createClickedElementProperties.js +39 -32
  7. package/libEs5/components/ActivityCollector/createGetClickedElementProperties.js +28 -20
  8. package/libEs5/components/ActivityCollector/createInjectClickedElementProperties.js +24 -21
  9. package/libEs5/components/ActivityCollector/createRecallAndInjectClickedElementProperties.js +10 -8
  10. package/libEs5/components/ActivityCollector/createStorePageViewProperties.js +6 -4
  11. package/libEs5/components/ActivityCollector/getLinkName.js +19 -18
  12. package/libEs5/components/ActivityCollector/getLinkRegion.js +10 -9
  13. package/libEs5/components/ActivityCollector/index.js +61 -45
  14. package/libEs5/components/ActivityCollector/utils/activityMapExtensionEnabled.js +3 -5
  15. package/libEs5/components/ActivityCollector/utils/createTransientStorage.js +7 -6
  16. package/libEs5/components/ActivityCollector/utils/determineLinkType.js +4 -3
  17. package/libEs5/components/ActivityCollector/utils/dom/elementHasClickHandler.js +3 -2
  18. package/libEs5/components/ActivityCollector/utils/dom/extractDomain.js +5 -4
  19. package/libEs5/components/ActivityCollector/utils/dom/findClickableElement.js +4 -3
  20. package/libEs5/components/ActivityCollector/utils/dom/getAbsoluteUrlFromAnchorElement.js +11 -8
  21. package/libEs5/components/ActivityCollector/utils/dom/isButtonSubmitElement.js +3 -2
  22. package/libEs5/components/ActivityCollector/utils/dom/isDownloadLink.js +6 -5
  23. package/libEs5/components/ActivityCollector/utils/dom/isExitLink.js +6 -5
  24. package/libEs5/components/ActivityCollector/utils/dom/isInputSubmitElement.js +4 -3
  25. package/libEs5/components/ActivityCollector/utils/dom/isSupportedAnchorElement.js +3 -2
  26. package/libEs5/components/ActivityCollector/utils/dom/isSupportedTextNode.js +4 -3
  27. package/libEs5/components/ActivityCollector/utils/hasPageName.js +4 -3
  28. package/libEs5/components/ActivityCollector/utils/isDifferentDomains.js +5 -4
  29. package/libEs5/components/ActivityCollector/utils/trimQueryFromUrl.js +5 -4
  30. package/libEs5/components/ActivityCollector/utils/truncateWhiteSpace.js +3 -2
  31. package/libEs5/components/ActivityCollector/utils/urlStartsWithScheme.js +3 -2
  32. package/libEs5/components/Audiences/index.js +13 -12
  33. package/libEs5/components/Audiences/injectProcessDestinations.js +32 -35
  34. package/libEs5/components/Audiences/injectProcessResponse.js +19 -16
  35. package/libEs5/components/Context/createComponent.js +10 -13
  36. package/libEs5/components/Context/implementationDetails.js +5 -4
  37. package/libEs5/components/Context/index.js +24 -28
  38. package/libEs5/components/Context/injectDevice.js +23 -15
  39. package/libEs5/components/Context/injectEnvironment.js +17 -12
  40. package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +12 -21
  41. package/libEs5/components/Context/injectPlaceContext.js +8 -7
  42. package/libEs5/components/Context/injectTimestamp.js +6 -5
  43. package/libEs5/components/Context/injectWeb.js +6 -5
  44. package/libEs5/components/DataCollector/index.js +37 -38
  45. package/libEs5/components/DataCollector/validateApplyResponse.js +6 -4
  46. package/libEs5/components/DataCollector/validateUserEventOptions.js +6 -4
  47. package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +11 -8
  48. package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +10 -7
  49. package/libEs5/components/DecisioningEngine/constants.js +3 -3
  50. package/libEs5/components/DecisioningEngine/createApplyResponse.js +15 -15
  51. package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -13
  52. package/libEs5/components/DecisioningEngine/createContextProvider.js +48 -44
  53. package/libEs5/components/DecisioningEngine/createDecisionHistory.js +7 -5
  54. package/libEs5/components/DecisioningEngine/createDecisionProvider.js +16 -21
  55. package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +39 -37
  56. package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +21 -19
  57. package/libEs5/components/DecisioningEngine/createEventRegistry.js +63 -67
  58. package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +23 -22
  59. package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +100 -55
  60. package/libEs5/components/DecisioningEngine/index.js +83 -54
  61. package/libEs5/components/DecisioningEngine/utils.js +43 -38
  62. package/libEs5/components/EventMerge/createComponent.js +5 -3
  63. package/libEs5/components/EventMerge/createEventMergeId.js +3 -2
  64. package/libEs5/components/EventMerge/index.js +1 -1
  65. package/libEs5/components/Identity/addEcidQueryToPayload.js +3 -2
  66. package/libEs5/components/Identity/addEcidToPayload.js +3 -2
  67. package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +13 -23
  68. package/libEs5/components/Identity/configValidators.js +1 -1
  69. package/libEs5/components/Identity/constants/authState.js +3 -3
  70. package/libEs5/components/Identity/createComponent.js +39 -33
  71. package/libEs5/components/Identity/createLegacyIdentity.js +29 -29
  72. package/libEs5/components/Identity/getEcidFromResponse.js +5 -7
  73. package/libEs5/components/Identity/getIdentity/createGetIdentity.js +17 -15
  74. package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +10 -8
  75. package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +5 -4
  76. package/libEs5/components/Identity/index.js +61 -62
  77. package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +8 -6
  78. package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +46 -52
  79. package/libEs5/components/Identity/injectAwaitIdentityCookie.js +14 -11
  80. package/libEs5/components/Identity/injectEnsureSingleIdentity.js +25 -24
  81. package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +6 -4
  82. package/libEs5/components/Identity/injectProcessIdSyncs.js +20 -22
  83. package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +7 -5
  84. package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +8 -6
  85. package/libEs5/components/Identity/visitorService/getVisitor.js +4 -3
  86. package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +15 -13
  87. package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +9 -9
  88. package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +2 -2
  89. package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +61 -63
  90. package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +38 -37
  91. package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +54 -52
  92. package/libEs5/components/LegacyMediaAnalytics/index.js +32 -33
  93. package/libEs5/components/LibraryInfo/index.js +23 -30
  94. package/libEs5/components/MachineLearning/index.js +1 -1
  95. package/libEs5/components/MachineLearning/processResponse.js +5 -3
  96. package/libEs5/components/Personalization/constants/loggerMessage.js +2 -2
  97. package/libEs5/components/Personalization/constants/scopeType.js +3 -3
  98. package/libEs5/components/Personalization/constants/surface.js +4 -4
  99. package/libEs5/components/Personalization/createActionsProvider.js +37 -32
  100. package/libEs5/components/Personalization/createApplyPropositions.js +71 -81
  101. package/libEs5/components/Personalization/createClickStorage.js +30 -32
  102. package/libEs5/components/Personalization/createComponent.js +65 -74
  103. package/libEs5/components/Personalization/createFetchDataHandler.js +49 -52
  104. package/libEs5/components/Personalization/createGetPageLocation.js +6 -6
  105. package/libEs5/components/Personalization/createHandleConsentFlicker.js +15 -14
  106. package/libEs5/components/Personalization/createInteractionStorage.js +25 -39
  107. package/libEs5/components/Personalization/createNotificationHandler.js +9 -10
  108. package/libEs5/components/Personalization/createOnClickHandler.js +29 -25
  109. package/libEs5/components/Personalization/createOnDecisionHandler.js +23 -21
  110. package/libEs5/components/Personalization/createPersonalizationDetails.js +39 -45
  111. package/libEs5/components/Personalization/createPreprocessors.js +7 -7
  112. package/libEs5/components/Personalization/createSetTargetMigration.js +6 -4
  113. package/libEs5/components/Personalization/createViewCacheManager.js +29 -32
  114. package/libEs5/components/Personalization/createViewChangeHandler.js +25 -20
  115. package/libEs5/components/Personalization/dom-actions/action.js +24 -25
  116. package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +12 -13
  117. package/libEs5/components/Personalization/dom-actions/appendHtml.js +8 -7
  118. package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +28 -33
  119. package/libEs5/components/Personalization/dom-actions/clicks/collectInteractions.js +37 -40
  120. package/libEs5/components/Personalization/dom-actions/collectInteractions.js +3 -2
  121. package/libEs5/components/Personalization/dom-actions/createPreprocess.js +10 -11
  122. package/libEs5/components/Personalization/dom-actions/createRedirect.js +11 -13
  123. package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +3 -2
  124. package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +3 -2
  125. package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +6 -3
  126. package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +6 -3
  127. package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +3 -3
  128. package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +3 -2
  129. package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +3 -2
  130. package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +7 -6
  131. package/libEs5/components/Personalization/dom-actions/dom/getParent.js +3 -2
  132. package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +7 -7
  133. package/libEs5/components/Personalization/dom-actions/dom/index.js +14 -14
  134. package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +4 -3
  135. package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +4 -3
  136. package/libEs5/components/Personalization/dom-actions/dom/isDomElement.js +2 -3
  137. package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +6 -5
  138. package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +3 -2
  139. package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +39 -38
  140. package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +3 -2
  141. package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +4 -3
  142. package/libEs5/components/Personalization/dom-actions/images.js +10 -9
  143. package/libEs5/components/Personalization/dom-actions/index.js +1 -1
  144. package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +40 -25
  145. package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +9 -8
  146. package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +8 -7
  147. package/libEs5/components/Personalization/dom-actions/prependHtml.js +13 -10
  148. package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +9 -7
  149. package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +14 -9
  150. package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +16 -14
  151. package/libEs5/components/Personalization/dom-actions/replaceHtml.js +4 -3
  152. package/libEs5/components/Personalization/dom-actions/scripts.js +58 -38
  153. package/libEs5/components/Personalization/dom-actions/setAttributes.js +4 -3
  154. package/libEs5/components/Personalization/dom-actions/setHtml.js +5 -4
  155. package/libEs5/components/Personalization/dom-actions/setStyles.js +8 -8
  156. package/libEs5/components/Personalization/dom-actions/setText.js +3 -2
  157. package/libEs5/components/Personalization/dom-actions/swapImage.js +3 -2
  158. package/libEs5/components/Personalization/flicker/index.js +34 -31
  159. package/libEs5/components/Personalization/handlers/createDecorateProposition.js +16 -13
  160. package/libEs5/components/Personalization/handlers/createProcessDomAction.js +45 -50
  161. package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +30 -29
  162. package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +35 -31
  163. package/libEs5/components/Personalization/handlers/createProcessPropositions.js +91 -107
  164. package/libEs5/components/Personalization/handlers/createProcessRedirect.js +30 -29
  165. package/libEs5/components/Personalization/handlers/injectCreateProposition.js +59 -64
  166. package/libEs5/components/Personalization/handlers/processDefaultContent.js +3 -2
  167. package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +140 -121
  168. package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +4 -5
  169. package/libEs5/components/Personalization/in-app-message-actions/utils.js +23 -19
  170. package/libEs5/components/Personalization/index.js +112 -99
  171. package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +10 -10
  172. package/libEs5/components/Personalization/utils/createAsyncArray.js +10 -9
  173. package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +3 -3
  174. package/libEs5/components/Personalization/utils/metaUtils.js +14 -19
  175. package/libEs5/components/Personalization/utils/surfaceUtils.js +27 -46
  176. package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +8 -6
  177. package/libEs5/components/Privacy/computeConsentHash.js +9 -9
  178. package/libEs5/components/Privacy/createComponent.js +32 -32
  179. package/libEs5/components/Privacy/createConsentHashStore.js +27 -24
  180. package/libEs5/components/Privacy/createConsentRequest.js +10 -8
  181. package/libEs5/components/Privacy/createConsentRequestPayload.js +9 -8
  182. package/libEs5/components/Privacy/createStoredConsent.js +11 -9
  183. package/libEs5/components/Privacy/index.js +26 -23
  184. package/libEs5/components/Privacy/injectSendSetConsentRequest.js +30 -29
  185. package/libEs5/components/Privacy/parseConsentCookie.js +6 -14
  186. package/libEs5/components/StreamingMedia/createMediaEventManager.js +59 -45
  187. package/libEs5/components/StreamingMedia/createMediaRequest.js +8 -6
  188. package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +22 -17
  189. package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +22 -18
  190. package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +30 -29
  191. package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +41 -36
  192. package/libEs5/components/StreamingMedia/createTrackMediaSession.js +25 -22
  193. package/libEs5/components/StreamingMedia/index.js +33 -34
  194. package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +9 -12
  195. package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +6 -4
  196. package/libEs5/constants/browser.js +7 -7
  197. package/libEs5/constants/consentPurpose.js +1 -1
  198. package/libEs5/constants/consentStatus.js +3 -3
  199. package/libEs5/constants/contentType.js +2 -2
  200. package/libEs5/constants/cookieNameKey.js +3 -3
  201. package/libEs5/constants/coreCommands.js +2 -2
  202. package/libEs5/constants/decisionProvider.js +4 -3
  203. package/libEs5/constants/domain.js +2 -2
  204. package/libEs5/constants/elementAttribute.js +1 -1
  205. package/libEs5/constants/eventType.js +5 -5
  206. package/libEs5/constants/handle.js +1 -1
  207. package/libEs5/constants/httpHeaderNames.js +2 -2
  208. package/libEs5/constants/httpStatusCode.js +5 -5
  209. package/libEs5/constants/identityMapAuthenticatedState.js +3 -3
  210. package/libEs5/constants/legacyCookies.js +3 -3
  211. package/libEs5/constants/libraryVersion.js +1 -1
  212. package/libEs5/constants/propositionEventType.js +18 -12
  213. package/libEs5/constants/propositionInteractionType.js +4 -4
  214. package/libEs5/constants/schema.js +11 -11
  215. package/libEs5/constants/sessionDataKeys.js +1 -1
  216. package/libEs5/constants/tagName.js +7 -7
  217. package/libEs5/core/buildAndValidateConfig.js +55 -69
  218. package/libEs5/core/componentCreators.js +70 -41
  219. package/libEs5/core/config/createConfig.js +4 -3
  220. package/libEs5/core/config/createCoreConfigs.js +11 -12
  221. package/libEs5/core/consent/createConsent.js +16 -14
  222. package/libEs5/core/consent/createConsentStateMachine.js +27 -35
  223. package/libEs5/core/createComponentRegistry.js +28 -27
  224. package/libEs5/core/createCookieTransfer.js +18 -18
  225. package/libEs5/core/createEvent.js +39 -44
  226. package/libEs5/core/createEventManager.js +64 -69
  227. package/libEs5/core/createInstanceFunction.js +4 -11
  228. package/libEs5/core/createLifecycle.js +14 -19
  229. package/libEs5/core/createLogController.js +30 -29
  230. package/libEs5/core/createLogger.js +28 -27
  231. package/libEs5/core/edgeNetwork/handleRequestFailure.js +6 -5
  232. package/libEs5/core/edgeNetwork/injectApplyResponse.js +29 -32
  233. package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +19 -25
  234. package/libEs5/core/edgeNetwork/injectGetLocationHint.js +11 -11
  235. package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +20 -16
  236. package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +42 -38
  237. package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +8 -12
  238. package/libEs5/core/index.js +137 -133
  239. package/libEs5/core/initializeComponents.js +17 -15
  240. package/libEs5/core/injectCreateResponse.js +47 -53
  241. package/libEs5/core/injectExecuteCommand.js +39 -40
  242. package/libEs5/core/injectHandleError.js +19 -19
  243. package/libEs5/core/injectShouldTransferCookie.js +12 -12
  244. package/libEs5/core/network/getRequestRetryDelay.js +20 -18
  245. package/libEs5/core/network/injectSendNetworkRequest.js +46 -49
  246. package/libEs5/core/network/isRequestRetryable.js +9 -8
  247. package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +10 -8
  248. package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +18 -19
  249. package/libEs5/core/requiredComponentCreators.js +23 -0
  250. package/libEs5/core/validateCommandOptions.js +14 -11
  251. package/libEs5/index.js +43 -22
  252. package/libEs5/standalone.js +6 -1
  253. package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +3 -5
  254. package/libEs5/utils/assignConcatArrayValues.js +9 -18
  255. package/libEs5/utils/clone.js +2 -3
  256. package/libEs5/utils/cookieJar.js +4 -4
  257. package/libEs5/utils/crc32.js +8 -8
  258. package/libEs5/utils/createCallbackAggregator.js +7 -11
  259. package/libEs5/utils/createCollect.js +52 -0
  260. package/libEs5/utils/createLoggingCookieJar.js +14 -16
  261. package/libEs5/utils/createMerger.js +9 -10
  262. package/libEs5/utils/createSubscription.js +48 -48
  263. package/libEs5/utils/createTaskQueue.js +8 -7
  264. package/libEs5/utils/deduplicateArray.js +7 -11
  265. package/libEs5/utils/deepAssign.js +7 -11
  266. package/libEs5/utils/defer.js +5 -4
  267. package/libEs5/utils/dom/appendNode.js +3 -2
  268. package/libEs5/utils/dom/awaitSelector.js +36 -34
  269. package/libEs5/utils/dom/createNode.js +10 -15
  270. package/libEs5/utils/dom/index.js +8 -8
  271. package/libEs5/utils/dom/isShadowSelector.js +2 -3
  272. package/libEs5/utils/dom/matchesSelector.js +3 -2
  273. package/libEs5/utils/dom/querySelectorAll.js +5 -13
  274. package/libEs5/utils/dom/removeNode.js +4 -3
  275. package/libEs5/utils/dom/selectNodes.js +3 -3
  276. package/libEs5/utils/dom/selectNodesWithShadow.js +14 -23
  277. package/libEs5/utils/event.js +49 -0
  278. package/libEs5/utils/filterObject.js +14 -12
  279. package/libEs5/utils/fireImage.js +10 -9
  280. package/libEs5/utils/flattenArray.js +4 -11
  281. package/libEs5/utils/flattenObject.js +8 -18
  282. package/libEs5/utils/getApexDomain.js +7 -6
  283. package/libEs5/utils/getBrowser.js +45 -12
  284. package/libEs5/utils/getLastArrayItems.js +2 -3
  285. package/libEs5/utils/getNamespacedCookieName.js +2 -3
  286. package/libEs5/utils/groupBy.js +6 -5
  287. package/libEs5/utils/index.js +50 -113
  288. package/libEs5/utils/injectDoesIdentityCookieExist.js +7 -7
  289. package/libEs5/utils/injectFireReferrerHideableImage.js +28 -34
  290. package/libEs5/utils/injectStorage.js +13 -15
  291. package/libEs5/utils/intersection.js +2 -6
  292. package/libEs5/utils/isBlankString.js +2 -3
  293. package/libEs5/utils/isBoolean.js +2 -3
  294. package/libEs5/utils/isEmptyObject.js +2 -3
  295. package/libEs5/utils/isFunction.js +2 -3
  296. package/libEs5/utils/isInteger.js +4 -3
  297. package/libEs5/utils/isNamespacedCookieName.js +2 -3
  298. package/libEs5/utils/isNil.js +2 -3
  299. package/libEs5/utils/isNonEmptyArray.js +2 -3
  300. package/libEs5/utils/isNonEmptyString.js +2 -3
  301. package/libEs5/utils/isNumber.js +2 -4
  302. package/libEs5/utils/isObject.js +3 -4
  303. package/libEs5/utils/isString.js +2 -3
  304. package/libEs5/utils/isUnique.js +6 -5
  305. package/libEs5/utils/isValidRegExp.js +3 -2
  306. package/libEs5/utils/memoize.js +7 -6
  307. package/libEs5/utils/noop.js +2 -1
  308. package/libEs5/utils/parseUrl.js +19 -25
  309. package/libEs5/utils/prepareConfigOverridesForEdge.js +6 -5
  310. package/libEs5/utils/request/createAddIdentity.js +4 -3
  311. package/libEs5/utils/request/createDataCollectionRequest.js +15 -11
  312. package/libEs5/utils/request/createDataCollectionRequestPayload.js +9 -10
  313. package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +17 -15
  314. package/libEs5/utils/request/createHasIdentity.js +4 -5
  315. package/libEs5/utils/request/createRequest.js +26 -23
  316. package/libEs5/utils/request/createRequestParams.js +13 -13
  317. package/libEs5/utils/request/createRequestPayload.js +13 -12
  318. package/libEs5/utils/request/index.js +8 -8
  319. package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
  320. package/libEs5/utils/stackError.js +8 -6
  321. package/libEs5/utils/stringToBoolean.js +3 -2
  322. package/libEs5/utils/toArray.js +3 -2
  323. package/libEs5/utils/toError.js +3 -2
  324. package/libEs5/utils/toISOStringLocal.js +29 -14
  325. package/libEs5/utils/toInteger.js +5 -5
  326. package/libEs5/utils/updateErrorMessage.js +6 -4
  327. package/libEs5/utils/validation/booleanValidator.js +3 -2
  328. package/libEs5/utils/validation/callbackValidator.js +3 -2
  329. package/libEs5/utils/validation/createAnyOfValidator.js +14 -17
  330. package/libEs5/utils/validation/createArrayOfValidator.js +16 -18
  331. package/libEs5/utils/validation/createDefaultValidator.js +7 -8
  332. package/libEs5/utils/validation/createDeprecatedValidator.js +12 -14
  333. package/libEs5/utils/validation/createLiteralValidator.js +5 -6
  334. package/libEs5/utils/validation/createMapOfValuesValidator.js +20 -22
  335. package/libEs5/utils/validation/createMaximumValidator.js +5 -6
  336. package/libEs5/utils/validation/createMinimumValidator.js +5 -6
  337. package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +13 -14
  338. package/libEs5/utils/validation/createNonEmptyValidator.js +9 -10
  339. package/libEs5/utils/validation/createObjectOfValidator.js +27 -29
  340. package/libEs5/utils/validation/createRenamedValidator.js +24 -27
  341. package/libEs5/utils/validation/createUniqueItemsValidator.js +4 -3
  342. package/libEs5/utils/validation/createUniqueValidator.js +5 -4
  343. package/libEs5/utils/validation/domainValidator.js +4 -3
  344. package/libEs5/utils/validation/index.js +66 -72
  345. package/libEs5/utils/validation/integerValidator.js +3 -2
  346. package/libEs5/utils/validation/matchesRegexpValidator.js +5 -6
  347. package/libEs5/utils/validation/numberValidator.js +3 -2
  348. package/libEs5/utils/validation/regexpValidator.js +3 -2
  349. package/libEs5/utils/validation/requiredValidator.js +3 -2
  350. package/libEs5/utils/validation/stringValidator.js +3 -2
  351. package/libEs5/utils/validation/utils.js +29 -35
  352. package/libEs6/components/ActivityCollector/index.js +18 -8
  353. package/libEs6/components/Context/createComponent.js +1 -3
  354. package/libEs6/components/DecisioningEngine/createApplyResponse.js +1 -1
  355. package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +78 -28
  356. package/libEs6/components/DecisioningEngine/index.js +22 -2
  357. package/libEs6/components/DecisioningEngine/utils.js +2 -9
  358. package/libEs6/components/Identity/createComponent.js +4 -2
  359. package/libEs6/components/Identity/getEcidFromResponse.js +1 -3
  360. package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +2 -2
  361. package/libEs6/components/LibraryInfo/index.js +4 -5
  362. package/libEs6/components/Personalization/createActionsProvider.js +4 -2
  363. package/libEs6/components/Personalization/createComponent.js +2 -2
  364. package/libEs6/components/Personalization/createPersonalizationDetails.js +6 -6
  365. package/libEs6/components/Personalization/createViewCacheManager.js +5 -2
  366. package/libEs6/components/Personalization/dom-actions/createPreprocess.js +5 -2
  367. package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +1 -3
  368. package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +6 -4
  369. package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +3 -2
  370. package/libEs6/components/Personalization/dom-actions/scripts.js +18 -2
  371. package/libEs6/components/Personalization/handlers/createDecorateProposition.js +2 -2
  372. package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +8 -5
  373. package/libEs6/components/Personalization/in-app-message-actions/utils.js +2 -2
  374. package/libEs6/components/Personalization/index.js +2 -2
  375. package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +4 -4
  376. package/libEs6/components/Personalization/utils/surfaceUtils.js +3 -3
  377. package/libEs6/constants/decisionProvider.js +1 -0
  378. package/libEs6/constants/libraryVersion.js +1 -1
  379. package/libEs6/constants/schema.js +1 -1
  380. package/libEs6/core/buildAndValidateConfig.js +8 -5
  381. package/libEs6/core/componentCreators.js +14 -43
  382. package/libEs6/core/config/createConfig.js +3 -2
  383. package/libEs6/core/createCookieTransfer.js +1 -3
  384. package/libEs6/core/createInstanceFunction.js +1 -9
  385. package/libEs6/core/createLogger.js +4 -2
  386. package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +1 -7
  387. package/libEs6/core/index.js +11 -10
  388. package/libEs6/core/injectCreateResponse.js +1 -3
  389. package/libEs6/core/network/isRequestRetryable.js +1 -2
  390. package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +1 -2
  391. package/libEs6/{utils/assignIf.js → core/requiredComponentCreators.js} +4 -8
  392. package/libEs6/index.js +26 -6
  393. package/libEs6/standalone.js +7 -1
  394. package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +1 -2
  395. package/libEs6/utils/assignConcatArrayValues.js +1 -2
  396. package/libEs6/utils/cookieJar.js +4 -4
  397. package/libEs6/{components/Personalization → utils}/createCollect.js +3 -3
  398. package/libEs6/utils/createSubscription.js +20 -3
  399. package/libEs6/utils/dom/querySelectorAll.js +1 -10
  400. package/libEs6/utils/dom/selectNodesWithShadow.js +2 -12
  401. package/libEs6/{components/Personalization → utils}/event.js +1 -1
  402. package/libEs6/utils/index.js +1 -10
  403. package/libEs6/utils/injectStorage.js +1 -2
  404. package/libEs6/utils/intersection.js +1 -4
  405. package/libEs6/utils/isNumber.js +1 -2
  406. package/libEs6/utils/toISOStringLocal.js +14 -1
  407. package/libEs6/utils/toInteger.js +1 -2
  408. package/libEs6/utils/validation/createAnyOfValidator.js +1 -2
  409. package/libEs6/utils/validation/utils.js +3 -6
  410. package/package.json +35 -37
  411. package/rollup.config.js +115 -7
  412. package/scripts/alloyBuilder.js +89 -55
  413. package/scripts/helpers/entryPointGeneratorBabelPlugin.js +39 -0
  414. package/libEs5/components/Personalization/createCollect.js +0 -53
  415. package/libEs5/components/Personalization/event.js +0 -49
  416. package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +0 -50
  417. package/libEs5/utils/assign.js +0 -16
  418. package/libEs5/utils/assignIf.js +0 -21
  419. package/libEs5/utils/endsWith.js +0 -23
  420. package/libEs5/utils/find.js +0 -30
  421. package/libEs5/utils/flatMap.js +0 -17
  422. package/libEs5/utils/includes.js +0 -23
  423. package/libEs5/utils/padStart.js +0 -27
  424. package/libEs5/utils/startsWith.js +0 -23
  425. package/libEs5/utils/values.js +0 -25
  426. package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +0 -49
  427. package/libEs6/utils/assign.js +0 -14
  428. package/libEs6/utils/endsWith.js +0 -19
  429. package/libEs6/utils/find.js +0 -28
  430. package/libEs6/utils/flatMap.js +0 -14
  431. package/libEs6/utils/includes.js +0 -21
  432. package/libEs6/utils/padStart.js +0 -25
  433. package/libEs6/utils/startsWith.js +0 -19
  434. package/libEs6/utils/values.js +0 -21
  435. package/scripts/helpers/alloyComponents.js +0 -63
  436. package/scripts/helpers/conditionalBuildBabelPlugin.js +0 -57
@@ -5,18 +5,7 @@ var _index = require("../../utils/index.js");
5
5
  var _schema = require("../../constants/schema.js");
6
6
  var _pageWideScope = require("../../constants/pageWideScope.js");
7
7
  var _initDomActionsModules = require("./dom-actions/initDomActionsModules.js");
8
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
10
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
13
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
14
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
8
+ /*
20
9
  Copyright 2022 Adobe. All rights reserved.
21
10
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
22
11
  you may not use this file except in compliance with the License. You may obtain a copy
@@ -27,66 +16,70 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
27
16
  OF ANY KIND, either express or implied. See the License for the specific language
28
17
  governing permissions and limitations under the License.
29
18
  */
30
- var isInteractionTrackingItem = function isInteractionTrackingItem(schema, actionType) {
31
- return schema === _schema.JSON_CONTENT_ITEM && actionType === _initDomActionsModules.DOM_ACTION_COLLECT_INTERACTIONS;
32
- };
33
- var SUPPORTED_SCHEMAS = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, _schema.DOM_ACTION, function () {
34
- return true;
35
- }), _schema.HTML_CONTENT_ITEM, function () {
36
- return true;
37
- }), _schema.JSON_CONTENT_ITEM, isInteractionTrackingItem), _schema.MESSAGE_IN_APP, function () {
38
- return true;
39
- });
40
- var filterItemsPredicate = function filterItemsPredicate(schema, actionType) {
41
- return typeof SUPPORTED_SCHEMAS[schema] === "function" && SUPPORTED_SCHEMAS[schema](schema, actionType);
19
+
20
+ const isInteractionTrackingItem = (schema, actionType) => schema === _schema.JSON_CONTENT_ITEM && actionType === _initDomActionsModules.DOM_ACTION_COLLECT_INTERACTIONS;
21
+ const SUPPORTED_SCHEMAS = {
22
+ [_schema.DOM_ACTION]: () => true,
23
+ [_schema.HTML_CONTENT_ITEM]: () => true,
24
+ [_schema.JSON_CONTENT_ITEM]: isInteractionTrackingItem,
25
+ [_schema.MESSAGE_IN_APP]: () => true
42
26
  };
43
- var _default = exports.default = function _default(_ref) {
44
- var processPropositions = _ref.processPropositions,
45
- createProposition = _ref.createProposition,
46
- renderedPropositions = _ref.renderedPropositions,
47
- viewCache = _ref.viewCache;
48
- var updatePropositionItems = function updatePropositionItems(_ref2) {
49
- var items = _ref2.items,
50
- _ref2$metadataForScop = _ref2.metadataForScope,
51
- metadataForScope = _ref2$metadataForScop === void 0 ? {} : _ref2$metadataForScop;
52
- var actionType = metadataForScope.actionType,
53
- selector = metadataForScope.selector;
54
- return items.filter(function (item) {
55
- return filterItemsPredicate(item.schema, actionType);
56
- }).map(function (item) {
57
- var schema = item.schema;
27
+ const filterItemsPredicate = (schema, actionType) => typeof SUPPORTED_SCHEMAS[schema] === "function" && SUPPORTED_SCHEMAS[schema](schema, actionType);
28
+ var _default = ({
29
+ processPropositions,
30
+ createProposition,
31
+ renderedPropositions,
32
+ viewCache
33
+ }) => {
34
+ const updatePropositionItems = ({
35
+ items,
36
+ metadataForScope = {}
37
+ }) => {
38
+ const {
39
+ actionType,
40
+ selector
41
+ } = metadataForScope;
42
+ return items.filter(item => filterItemsPredicate(item.schema, actionType)).map(item => {
43
+ const {
44
+ schema
45
+ } = item;
58
46
  if (schema !== _schema.HTML_CONTENT_ITEM && !isInteractionTrackingItem(schema, actionType)) {
59
- return _objectSpread({}, item);
47
+ return {
48
+ ...item
49
+ };
60
50
  }
61
51
  if (!(0, _index.isEmptyObject)(metadataForScope)) {
62
- return _objectSpread(_objectSpread({}, item), {}, {
52
+ return {
53
+ ...item,
63
54
  schema: isInteractionTrackingItem(schema, actionType) ? _schema.DOM_ACTION : schema,
64
- data: _objectSpread(_objectSpread({}, item.data), {}, {
65
- selector: selector,
55
+ data: {
56
+ ...item.data,
57
+ selector,
66
58
  type: actionType
67
- })
68
- });
59
+ }
60
+ };
69
61
  }
70
62
  return undefined;
71
- }).filter(function (item) {
72
- return item;
73
- });
63
+ }).filter(item => item);
74
64
  };
75
- var filterPropositionsPredicate = function filterPropositionsPredicate(proposition) {
65
+ const filterPropositionsPredicate = proposition => {
76
66
  return !(proposition.scope === _pageWideScope.default && proposition.renderAttempted);
77
67
  };
78
- var preparePropositions = function preparePropositions(_ref3) {
79
- var propositions = _ref3.propositions,
80
- metadata = _ref3.metadata;
81
- return propositions.filter(filterPropositionsPredicate).map(function (proposition) {
68
+ const preparePropositions = ({
69
+ propositions,
70
+ metadata
71
+ }) => {
72
+ return propositions.filter(filterPropositionsPredicate).map(proposition => {
82
73
  if ((0, _index.isNonEmptyArray)(proposition.items)) {
83
- var id = proposition.id,
84
- scope = proposition.scope,
85
- scopeDetails = proposition.scopeDetails;
74
+ const {
75
+ id,
76
+ scope,
77
+ scopeDetails
78
+ } = proposition;
86
79
  return {
87
- id: id,
88
- scope: scope,
89
- scopeDetails: scopeDetails,
80
+ id,
81
+ scope,
82
+ scopeDetails,
90
83
  items: updatePropositionItems({
91
84
  items: proposition.items,
92
85
  metadataForScope: metadata[proposition.scope]
@@ -94,39 +87,36 @@ var _default = exports.default = function _default(_ref) {
94
87
  };
95
88
  }
96
89
  return proposition;
97
- }).filter(function (proposition) {
98
- return (0, _index.isNonEmptyArray)(proposition.items);
99
- });
90
+ }).filter(proposition => (0, _index.isNonEmptyArray)(proposition.items));
100
91
  };
101
- return function (_ref4) {
102
- var _ref4$propositions = _ref4.propositions,
103
- propositions = _ref4$propositions === void 0 ? [] : _ref4$propositions,
104
- _ref4$metadata = _ref4.metadata,
105
- metadata = _ref4$metadata === void 0 ? {} : _ref4$metadata,
106
- viewName = _ref4.viewName;
92
+ return ({
93
+ propositions = [],
94
+ metadata = {},
95
+ viewName
96
+ }) => {
107
97
  // We need to immediately call concat so that subsequent sendEvent
108
98
  // calls will wait for applyPropositions to complete before executing.
109
- var renderedPropositionsDeferred = (0, _index.defer)();
99
+ const renderedPropositionsDeferred = (0, _index.defer)();
110
100
  renderedPropositions.concat(renderedPropositionsDeferred.promise);
111
- var propositionsToExecute = preparePropositions({
112
- propositions: propositions,
113
- metadata: metadata
114
- }).map(function (proposition) {
115
- return createProposition(proposition);
116
- });
117
- return Promise.resolve().then(function () {
101
+ const propositionsToExecute = preparePropositions({
102
+ propositions,
103
+ metadata
104
+ }).map(proposition => createProposition(proposition));
105
+ return Promise.resolve().then(() => {
118
106
  if (viewName) {
119
107
  return viewCache.getView(viewName);
120
108
  }
121
109
  return [];
122
- }).then(function (additionalPropositions) {
123
- var _processPropositions = processPropositions([].concat(_toConsumableArray(propositionsToExecute), _toConsumableArray(additionalPropositions))),
124
- render = _processPropositions.render,
125
- returnedPropositions = _processPropositions.returnedPropositions;
110
+ }).then(additionalPropositions => {
111
+ const {
112
+ render,
113
+ returnedPropositions
114
+ } = processPropositions([...propositionsToExecute, ...additionalPropositions]);
126
115
  render().then(renderedPropositionsDeferred.resolve);
127
116
  return {
128
117
  propositions: returnedPropositions
129
118
  };
130
119
  });
131
120
  };
132
- };
121
+ };
122
+ exports.default = _default;
@@ -1,12 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  exports.default = void 0;
4
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
4
  /*
11
5
  Copyright 2020 Adobe. All rights reserved.
12
6
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -19,46 +13,50 @@ OF ANY KIND, either express or implied. See the License for the specific languag
19
13
  governing permissions and limitations under the License.
20
14
  */
21
15
 
22
- var metasToArray = function metasToArray(metas) {
23
- return Object.keys(metas).map(function (key) {
24
- return _objectSpread({
25
- id: key
26
- }, metas[key]);
16
+ const metasToArray = metas => {
17
+ return Object.keys(metas).map(key => {
18
+ return {
19
+ id: key,
20
+ ...metas[key]
21
+ };
27
22
  });
28
23
  };
29
- var _default = exports.default = function _default() {
30
- var clickStorage = {};
31
- var storeClickMeta = function storeClickMeta(_ref) {
32
- var selector = _ref.selector,
33
- _ref$meta = _ref.meta,
34
- id = _ref$meta.id,
35
- scope = _ref$meta.scope,
36
- scopeDetails = _ref$meta.scopeDetails,
37
- trackingLabel = _ref$meta.trackingLabel,
38
- scopeType = _ref$meta.scopeType;
24
+ var _default = () => {
25
+ const clickStorage = {};
26
+ const storeClickMeta = ({
27
+ selector,
28
+ meta: {
29
+ id,
30
+ scope,
31
+ scopeDetails,
32
+ trackingLabel,
33
+ scopeType
34
+ }
35
+ }) => {
39
36
  if (!clickStorage[selector]) {
40
37
  clickStorage[selector] = {};
41
38
  }
42
39
  clickStorage[selector][id] = {
43
- scope: scope,
44
- scopeDetails: scopeDetails,
45
- trackingLabel: trackingLabel,
46
- scopeType: scopeType
40
+ scope,
41
+ scopeDetails,
42
+ trackingLabel,
43
+ scopeType
47
44
  };
48
45
  };
49
- var getClickSelectors = function getClickSelectors() {
46
+ const getClickSelectors = () => {
50
47
  return Object.keys(clickStorage);
51
48
  };
52
- var getClickMetas = function getClickMetas(selector) {
53
- var metas = clickStorage[selector];
49
+ const getClickMetas = selector => {
50
+ const metas = clickStorage[selector];
54
51
  if (!metas) {
55
52
  return {};
56
53
  }
57
54
  return metasToArray(clickStorage[selector]);
58
55
  };
59
56
  return {
60
- storeClickMeta: storeClickMeta,
61
- getClickSelectors: getClickSelectors,
62
- getClickMetas: getClickMetas
57
+ storeClickMeta,
58
+ getClickSelectors,
59
+ getClickMetas
63
60
  };
64
- };
61
+ };
62
+ exports.default = _default;
@@ -17,53 +17,48 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
17
17
  OF ANY KIND, either express or implied. See the License for the specific language
18
18
  governing permissions and limitations under the License.
19
19
  */
20
- var _default = exports.default = function _default(_ref) {
21
- var getPageLocation = _ref.getPageLocation,
22
- logger = _ref.logger,
23
- fetchDataHandler = _ref.fetchDataHandler,
24
- viewChangeHandler = _ref.viewChangeHandler,
25
- onClickHandler = _ref.onClickHandler,
26
- isAuthoringModeEnabled = _ref.isAuthoringModeEnabled,
27
- mergeQuery = _ref.mergeQuery,
28
- viewCache = _ref.viewCache,
29
- showContainers = _ref.showContainers,
30
- applyPropositions = _ref.applyPropositions,
31
- setTargetMigration = _ref.setTargetMigration,
32
- mergeDecisionsMeta = _ref.mergeDecisionsMeta,
33
- renderedPropositions = _ref.renderedPropositions,
34
- onDecisionHandler = _ref.onDecisionHandler,
35
- handleConsentFlicker = _ref.handleConsentFlicker;
20
+ var _default = ({
21
+ getPageLocation,
22
+ logger,
23
+ fetchDataHandler,
24
+ viewChangeHandler,
25
+ onClickHandler,
26
+ isAuthoringModeEnabled,
27
+ mergeQuery,
28
+ viewCache,
29
+ showContainers,
30
+ applyPropositions,
31
+ setTargetMigration,
32
+ mergeDecisionsMeta,
33
+ renderedPropositions,
34
+ onDecisionHandler,
35
+ handleConsentFlicker
36
+ }) => {
36
37
  return {
37
38
  lifecycle: {
38
- onComponentsRegistered: function onComponentsRegistered() {
39
+ onComponentsRegistered() {
39
40
  handleConsentFlicker();
40
41
  },
41
42
  onDecision: onDecisionHandler,
42
- onBeforeRequest: function onBeforeRequest(_ref2) {
43
- var request = _ref2.request;
43
+ onBeforeRequest({
44
+ request
45
+ }) {
44
46
  setTargetMigration(request);
45
47
  return Promise.resolve();
46
48
  },
47
- onBeforeEvent: function onBeforeEvent(_ref3) {
48
- var event = _ref3.event,
49
- renderDecisions = _ref3.renderDecisions,
50
- _ref3$decisionScopes = _ref3.decisionScopes,
51
- decisionScopes = _ref3$decisionScopes === void 0 ? [] : _ref3$decisionScopes,
52
- _ref3$personalization = _ref3.personalization,
53
- personalization = _ref3$personalization === void 0 ? {} : _ref3$personalization,
54
- _ref3$onResponse = _ref3.onResponse,
55
- onResponse = _ref3$onResponse === void 0 ? _index.noop : _ref3$onResponse,
56
- _ref3$onRequestFailur = _ref3.onRequestFailure,
57
- onRequestFailure = _ref3$onRequestFailur === void 0 ? _index.noop : _ref3$onRequestFailur;
49
+ onBeforeEvent({
50
+ event,
51
+ renderDecisions,
52
+ decisionScopes = [],
53
+ personalization = {},
54
+ onResponse = _index.noop,
55
+ onRequestFailure = _index.noop
56
+ }) {
58
57
  // Include propositions on all responses, overridden with data as needed
59
- onResponse(function () {
60
- return {
61
- propositions: []
62
- };
63
- });
64
- onRequestFailure(function () {
65
- return showContainers();
66
- });
58
+ onResponse(() => ({
59
+ propositions: []
60
+ }));
61
+ onRequestFailure(() => showContainers());
67
62
  if (isAuthoringModeEnabled()) {
68
63
  logger.warn(_loggerMessage.AUTHORING_ENABLED);
69
64
 
@@ -73,73 +68,69 @@ var _default = exports.default = function _default(_ref) {
73
68
  });
74
69
  return Promise.resolve();
75
70
  }
76
- var personalizationDetails = (0, _createPersonalizationDetails.default)({
77
- getPageLocation: getPageLocation,
78
- renderDecisions: renderDecisions,
79
- decisionScopes: decisionScopes,
80
- personalization: personalization,
81
- event: event,
71
+ const personalizationDetails = (0, _createPersonalizationDetails.default)({
72
+ getPageLocation,
73
+ renderDecisions,
74
+ decisionScopes,
75
+ personalization,
76
+ event,
82
77
  isCacheInitialized: viewCache.isInitialized(),
83
- logger: logger
78
+ logger
84
79
  });
85
- var decisionsMetaPromises = [];
80
+ const decisionsMetaPromises = [];
86
81
  if (personalizationDetails.shouldIncludeRenderedPropositions()) {
87
82
  decisionsMetaPromises.push(renderedPropositions.clear());
88
83
  }
89
84
  if (personalizationDetails.shouldFetchData()) {
90
- var cacheUpdate = viewCache.createCacheUpdate(personalizationDetails.getViewName());
91
- onRequestFailure(function () {
92
- return cacheUpdate.cancel();
93
- });
85
+ const cacheUpdate = viewCache.createCacheUpdate(personalizationDetails.getViewName());
86
+ onRequestFailure(() => cacheUpdate.cancel());
94
87
  fetchDataHandler({
95
- cacheUpdate: cacheUpdate,
96
- personalizationDetails: personalizationDetails,
97
- event: event,
98
- onResponse: onResponse
88
+ cacheUpdate,
89
+ personalizationDetails,
90
+ event,
91
+ onResponse
99
92
  });
100
93
  } else if (personalizationDetails.shouldUseCachedData()) {
101
94
  // eslint-disable-next-line consistent-return
102
95
  decisionsMetaPromises.push(viewChangeHandler({
103
- personalizationDetails: personalizationDetails,
104
- event: event,
105
- onResponse: onResponse,
106
- onRequestFailure: onRequestFailure
96
+ personalizationDetails,
97
+ event,
98
+ onResponse,
99
+ onRequestFailure
107
100
  }));
108
101
  }
109
102
 
110
103
  // This promise.all waits for both the pending display notifications to be resolved
111
104
  // (i.e. the top of page call to finish rendering) and the view change handler to
112
105
  // finish rendering anything for this view.
113
- return Promise.all(decisionsMetaPromises).then(function (decisionsMetas) {
106
+ return Promise.all(decisionsMetaPromises).then(decisionsMetas => {
114
107
  // We only want to call mergeDecisionsMeta once, but we can get the propositions
115
108
  // from two places: the pending display notifications and the view change handler.
116
- var decisionsMeta = (0, _index.flatMap)(decisionsMetas, function (dms) {
117
- return dms;
118
- });
109
+ const decisionsMeta = decisionsMetas.flatMap(dms => dms);
119
110
  if ((0, _index.isNonEmptyArray)(decisionsMeta)) {
120
111
  mergeDecisionsMeta(event, decisionsMeta, [_propositionEventType.PropositionEventType.DISPLAY]);
121
112
  }
122
113
  });
123
114
  },
124
- onClick: function onClick(_ref4) {
125
- var event = _ref4.event,
126
- clickedElement = _ref4.clickedElement;
115
+ onClick({
116
+ event,
117
+ clickedElement
118
+ }) {
127
119
  onClickHandler({
128
- event: event,
129
- clickedElement: clickedElement
120
+ event,
121
+ clickedElement
130
122
  });
131
123
  }
132
124
  },
133
125
  commands: {
134
126
  applyPropositions: {
135
- optionsValidator: function optionsValidator(options) {
136
- return (0, _validateApplyPropositionsOptions.default)({
137
- logger: logger,
138
- options: options
139
- });
140
- },
127
+ optionsValidator: options => (0, _validateApplyPropositionsOptions.default)({
128
+ logger,
129
+ options
130
+ }),
141
131
  run: applyPropositions
142
132
  }
143
133
  }
144
134
  };
145
- };
135
+ };
136
+ exports.default = _default;
@@ -2,12 +2,7 @@
2
2
 
3
3
  exports.default = void 0;
4
4
  var _index = require("../../utils/index.js");
5
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
6
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
8
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
9
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
10
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /*
5
+ /*
11
6
  Copyright 2023 Adobe. All rights reserved.
12
7
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
8
  you may not use this file except in compliance with the License. You may obtain a copy
@@ -18,24 +13,28 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
18
13
  OF ANY KIND, either express or implied. See the License for the specific language
19
14
  governing permissions and limitations under the License.
20
15
  */
21
- var DECISIONS_HANDLE = "personalization:decisions";
22
- var _default = exports.default = function _default(_ref) {
23
- var prehidingStyle = _ref.prehidingStyle,
24
- showContainers = _ref.showContainers,
25
- hideContainers = _ref.hideContainers,
26
- mergeQuery = _ref.mergeQuery,
27
- processPropositions = _ref.processPropositions,
28
- createProposition = _ref.createProposition,
29
- notificationHandler = _ref.notificationHandler,
30
- consent = _ref.consent;
31
- return function (_ref2) {
32
- var cacheUpdate = _ref2.cacheUpdate,
33
- personalizationDetails = _ref2.personalizationDetails,
34
- event = _ref2.event,
35
- onResponse = _ref2.onResponse;
36
- var _consent$current = consent.current(),
37
- state = _consent$current.state,
38
- wasSet = _consent$current.wasSet;
16
+
17
+ const DECISIONS_HANDLE = "personalization:decisions";
18
+ var _default = ({
19
+ prehidingStyle,
20
+ showContainers,
21
+ hideContainers,
22
+ mergeQuery,
23
+ processPropositions,
24
+ createProposition,
25
+ notificationHandler,
26
+ consent
27
+ }) => {
28
+ return ({
29
+ cacheUpdate,
30
+ personalizationDetails,
31
+ event,
32
+ onResponse
33
+ }) => {
34
+ const {
35
+ state,
36
+ wasSet
37
+ } = consent.current();
39
38
  if (!(state === "out" && wasSet)) {
40
39
  if (personalizationDetails.isRenderDecisions()) {
41
40
  hideContainers(prehidingStyle);
@@ -47,31 +46,27 @@ var _default = exports.default = function _default(_ref) {
47
46
 
48
47
  // This needs to be called before the response so that future sendEvent calls
49
48
  // can know to wait until this request is complete for pending display notifications.
50
- var handleNotifications = notificationHandler(personalizationDetails.isRenderDecisions(), personalizationDetails.isSendDisplayEvent(), personalizationDetails.getViewName());
51
- onResponse(function (_ref3) {
52
- var response = _ref3.response;
53
- var handles = response.getPayloadsByType(DECISIONS_HANDLE);
54
- var propositions = handles.map(function (handle) {
55
- return createProposition(handle);
56
- });
57
- var _groupBy = (0, _index.groupBy)(propositions, function (p) {
58
- return p.getScopeType();
59
- }),
60
- _groupBy$page = _groupBy.page,
61
- pagePropositions = _groupBy$page === void 0 ? [] : _groupBy$page,
62
- _groupBy$view = _groupBy.view,
63
- viewPropositions = _groupBy$view === void 0 ? [] : _groupBy$view,
64
- _groupBy$proposition = _groupBy.proposition,
65
- nonRenderedPropositions = _groupBy$proposition === void 0 ? [] : _groupBy$proposition;
66
- var currentViewPropositions = cacheUpdate.update(viewPropositions);
67
- var render;
68
- var returnedPropositions;
69
- var returnedDecisions;
49
+ const handleNotifications = notificationHandler(personalizationDetails.isRenderDecisions(), personalizationDetails.isSendDisplayEvent(), personalizationDetails.getViewName());
50
+ onResponse(({
51
+ response
52
+ }) => {
53
+ const handles = response.getPayloadsByType(DECISIONS_HANDLE);
54
+ const propositions = handles.map(handle => createProposition(handle));
55
+ const {
56
+ page: pagePropositions = [],
57
+ view: viewPropositions = [],
58
+ proposition: nonRenderedPropositions = []
59
+ } = (0, _index.groupBy)(propositions, p => p.getScopeType());
60
+ const currentViewPropositions = cacheUpdate.update(viewPropositions);
61
+ let render;
62
+ let returnedPropositions;
63
+ let returnedDecisions;
70
64
  if (personalizationDetails.isRenderDecisions()) {
71
- var _processPropositions = processPropositions([].concat(_toConsumableArray(pagePropositions), _toConsumableArray(currentViewPropositions)), nonRenderedPropositions);
72
- render = _processPropositions.render;
73
- returnedPropositions = _processPropositions.returnedPropositions;
74
- returnedDecisions = _processPropositions.returnedDecisions;
65
+ ({
66
+ render,
67
+ returnedPropositions,
68
+ returnedDecisions
69
+ } = processPropositions([...pagePropositions, ...currentViewPropositions], nonRenderedPropositions));
75
70
  render().then(handleNotifications);
76
71
 
77
72
  // Render could take a long time especially if one of the renders
@@ -79,9 +74,10 @@ var _default = exports.default = function _default(_ref) {
79
74
  // immediately, and whatever renders quickly will not have flicker.
80
75
  showContainers();
81
76
  } else {
82
- var _processPropositions2 = processPropositions([], [].concat(_toConsumableArray(pagePropositions), _toConsumableArray(currentViewPropositions), _toConsumableArray(nonRenderedPropositions)));
83
- returnedPropositions = _processPropositions2.returnedPropositions;
84
- returnedDecisions = _processPropositions2.returnedDecisions;
77
+ ({
78
+ returnedPropositions,
79
+ returnedDecisions
80
+ } = processPropositions([], [...pagePropositions, ...currentViewPropositions, ...nonRenderedPropositions]));
85
81
  }
86
82
  return {
87
83
  propositions: returnedPropositions,
@@ -89,4 +85,5 @@ var _default = exports.default = function _default(_ref) {
89
85
  };
90
86
  });
91
87
  };
92
- };
88
+ };
89
+ exports.default = _default;
@@ -12,9 +12,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
12
12
  OF ANY KIND, either express or implied. See the License for the specific language
13
13
  governing permissions and limitations under the License.
14
14
  */
15
- var _default = exports.default = function _default(_ref) {
16
- var window = _ref.window;
17
- return function () {
18
- return window.location;
19
- };
20
- };
15
+ var _default = ({
16
+ window
17
+ }) => () => {
18
+ return window.location;
19
+ };
20
+ exports.default = _default;