@schibsted/account-sdk-browser 5.2.2 → 5.2.5

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.
@@ -819,6 +819,7 @@ __webpack_require__.r(__webpack_exports__);
819
819
  /* harmony import */ var _spidTalk_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(177);
820
820
  /* harmony import */ var _SDKError_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(140);
821
821
  /* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(178);
822
+ /* harmony import */ var _global_registry_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(179);
822
823
  /* Copyright 2024 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.
823
824
  * See LICENSE.md in the project root.
824
825
  */
@@ -874,6 +875,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
874
875
 
875
876
 
876
877
 
878
+
877
879
  var globalWindow = function globalWindow() {
878
880
  return window;
879
881
  };
@@ -918,6 +920,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
918
920
  Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isUrl"])(sessionDomain), 'sessionDomain parameter is not a valid URL');
919
921
  _this._setSessionServiceUrl(sessionDomain);
920
922
  }
923
+ Object(_global_registry_js__WEBPACK_IMPORTED_MODULE_33__["registerGlobal"])(window, 'Monetization', _assertThisInitialized(_this));
921
924
  return _this;
922
925
  }
923
926
 
@@ -9107,9 +9110,39 @@ __webpack_require__.r(__webpack_exports__);
9107
9110
 
9108
9111
 
9109
9112
 
9110
- var version = '5.2.2';
9113
+ var version = '5.2.5';
9111
9114
  /* harmony default export */ __webpack_exports__["default"] = (version);
9112
9115
 
9116
+ /***/ }),
9117
+ /* 179 */
9118
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
9119
+
9120
+ "use strict";
9121
+ __webpack_require__.r(__webpack_exports__);
9122
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerGlobal", function() { return registerGlobal; });
9123
+ /**
9124
+ * Registers a component as a property on the provided global object, if not already registered, and dispatches an event to notify listeners.
9125
+ * The event is dispatched on `document` and will have the name `$sch${componentClassName}:ready` and a `detail` property with the instance.
9126
+ *
9127
+ * @param {any} global typically `window`
9128
+ * @param {string} componentClassName the name of the component to register, 'identity', 'monetization' or 'payment'
9129
+ * @param {any} instance the instance of the component to register
9130
+ * @returns {void}
9131
+ */
9132
+ var registerGlobal = function registerGlobal(global, componentClassName, instance) {
9133
+ var prefixedName = "sch".concat(componentClassName);
9134
+ if (!global[prefixedName]) {
9135
+ global[prefixedName] = instance;
9136
+ }
9137
+ if (typeof global.dispatchEvent === 'function') {
9138
+ global.dispatchEvent(new CustomEvent("".concat(prefixedName, ":ready"), {
9139
+ detail: {
9140
+ instance: instance
9141
+ }
9142
+ }));
9143
+ }
9144
+ };
9145
+
9113
9146
  /***/ })
9114
9147
  /******/ ]);
9115
9148
  //# sourceMappingURL=monetization.js.map