@wix/bex-utils 2.131.0 → 2.133.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 (34) hide show
  1. package/@wix/bex-bundled-mini-essentials/dist/cjs/bex-bundled-mini-essentials.js +1305 -276
  2. package/@wix/bex-bundled-mini-essentials/dist/cjs/bex-bundled-mini-essentials.js.map +1 -1
  3. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/http-client/testkit/client.js +218 -116
  4. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/http-client/testkit/client.js.map +1 -1
  5. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/testkit/index.d.ts +7 -8
  6. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/testkit/index.js +1255 -263
  7. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/testkit/index.js.map +1 -1
  8. package/@wix/bex-bundled-mini-essentials/dist/esm/bex-bundled-mini-essentials.mjs +1298 -325
  9. package/@wix/bex-bundled-mini-essentials/dist/esm/bex-bundled-mini-essentials.mjs.map +1 -1
  10. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-P2YUYYLM.mjs +34 -0
  11. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-P2YUYYLM.mjs.map +1 -0
  12. package/@wix/bex-bundled-mini-essentials/dist/esm/{exports/testkit/common-errors_ja-73RRUZ7T.mjs → common-errors_ja-MS5PSRSC.mjs} +2 -2
  13. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_ja-OOUHZN3G.mjs.map → common-errors_ja-MS5PSRSC.mjs.map} +1 -1
  14. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_uk-TGSY773Q.mjs → common-errors_uk-G7XUMV2H.mjs} +2 -2
  15. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_uk-TGSY773Q.mjs.map → common-errors_uk-G7XUMV2H.mjs.map} +1 -1
  16. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/http-client/testkit/client.mjs +37 -8
  17. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/http-client/testkit/client.mjs.map +1 -1
  18. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-EY6JYIPV.mjs +34 -0
  19. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-EY6JYIPV.mjs.map +1 -0
  20. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_ja-OOUHZN3G.mjs → exports/testkit/common-errors_ja-J6VU7MQY.mjs} +2 -2
  21. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/{common-errors_ja-73RRUZ7T.mjs.map → common-errors_ja-J6VU7MQY.mjs.map} +1 -1
  22. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/{common-errors_uk-5VEGIENP.mjs → common-errors_uk-T2LUNSSB.mjs} +2 -2
  23. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/{common-errors_uk-5VEGIENP.mjs.map → common-errors_uk-T2LUNSSB.mjs.map} +1 -1
  24. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/index.d.mts +7 -8
  25. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/index.mjs +1161 -230
  26. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/index.mjs.map +1 -1
  27. package/@wix/bex-bundled-mini-essentials/dist/tsconfig.tsbuildinfo +1 -1
  28. package/@wix/bex-bundled-mini-essentials/package.json +12 -3
  29. package/package.json +3 -3
  30. package/@wix/bex-bundled-mini-essentials/CHANGELOG.md +0 -359
  31. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-UKK4LODD.mjs +0 -34
  32. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-UKK4LODD.mjs.map +0 -1
  33. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-X2D2EJ6Z.mjs +0 -34
  34. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-X2D2EJ6Z.mjs.map +0 -1
@@ -6941,6 +6941,7 @@ var require_browser = __commonJS({
6941
6941
  init_define_process_env();
6942
6942
  Object.defineProperty(exports, "__esModule", { value: true });
6943
6943
  exports.readCookie = exports.sendBeacon = exports.getWindowSize = exports.getDesktopSize = exports.now = void 0;
6944
+ var utils_1 = require_utils();
6944
6945
  function now2() {
6945
6946
  return typeof performance !== "undefined" && performance && performance.now ? performance.now() : -1;
6946
6947
  }
@@ -6977,7 +6978,7 @@ var require_browser = __commonJS({
6977
6978
  }
6978
6979
  exports.sendBeacon = sendBeacon2;
6979
6980
  function readCookie2(cookieName) {
6980
- if (typeof document === "undefined") {
6981
+ if ((0, utils_1.isDataProtocol)() || typeof document === "undefined") {
6981
6982
  return null;
6982
6983
  }
6983
6984
  if (window.__ENABLE_COOKIE_READ_OPTIMIZATION__ && window.__BI_cookie_cache && window.__BI_cookie_cache[cookieName] !== void 0) {
@@ -7014,8 +7015,8 @@ var require_constants = __commonJS({
7014
7015
  "use strict";
7015
7016
  init_define_process_env();
7016
7017
  Object.defineProperty(exports, "__esModule", { value: true });
7017
- exports.DefaultCommonConfig = exports.BrandToHostMap = exports.HeadlessHost = exports.DefaultBrand = exports.EventContextMap = exports.BackofficeDomains = exports.LoggerVersion = void 0;
7018
- exports.LoggerVersion = "2.0.985|C";
7018
+ exports.DefaultCommonConfig = exports.BrandToDomainMap = exports.BrandToHostMap = exports.HeadlessHost = exports.DefaultScreenResolution = exports.DefaultBrand = exports.EventContextMap = exports.BackofficeDomains = exports.LoggerVersion = void 0;
7019
+ exports.LoggerVersion = "2.0.987|C";
7019
7020
  exports.BackofficeDomains = [".wix.com", ".editorx.com"];
7020
7021
  var EventContextMap;
7021
7022
  (function(EventContextMap2) {
@@ -7026,16 +7027,22 @@ var require_constants = __commonJS({
7026
7027
  EventContextMap2["siteMemberId"] = "_siteMemberId";
7027
7028
  EventContextMap2["brandId"] = "_brandId";
7028
7029
  EventContextMap2["siteBranchId"] = "_siteBranchId";
7030
+ EventContextMap2["screenResolution"] = "_sr";
7029
7031
  EventContextMap2["ms"] = "_ms";
7030
7032
  EventContextMap2["lv"] = "_lv";
7031
7033
  EventContextMap2["isHeadless"] = "_isHeadless";
7032
7034
  EventContextMap2["hostingPlatform"] = "_hostingPlatform";
7033
7035
  })(EventContextMap = exports.EventContextMap || (exports.EventContextMap = {}));
7034
7036
  exports.DefaultBrand = "wix";
7037
+ exports.DefaultScreenResolution = "0x0";
7035
7038
  exports.HeadlessHost = "VIEWER_HEADLESS";
7036
7039
  exports.BrandToHostMap = {
7037
7040
  wix: "wix",
7038
- editorx: "editorx"
7041
+ editorx: "editorx",
7042
+ base44: "base44"
7043
+ };
7044
+ exports.BrandToDomainMap = {
7045
+ base44: /\.base44\.com$/
7039
7046
  };
7040
7047
  exports.DefaultCommonConfig = {
7041
7048
  brand: exports.DefaultBrand
@@ -7049,7 +7056,7 @@ var require_env = __commonJS({
7049
7056
  "use strict";
7050
7057
  init_define_process_env();
7051
7058
  Object.defineProperty(exports, "__esModule", { value: true });
7052
- exports.getGlobal = exports.getWindowIfTop = exports.isBackoffice = exports.isWebWorker = exports.getHost = exports.setHost = void 0;
7059
+ exports.getGlobal = exports.getWindowIfTop = exports.isBackoffice = exports.isWebWorker = exports.getBrandByDomain = exports.getHost = exports.setHost = void 0;
7053
7060
  var constants_1 = require_constants();
7054
7061
  var host;
7055
7062
  var hostByDomain;
@@ -7070,7 +7077,7 @@ var require_env = __commonJS({
7070
7077
  if (!window2.location || !window2.location.hostname) {
7071
7078
  return null;
7072
7079
  }
7073
- var _a = window2.location.hostname.match(/\.(wix|editorx)\.com$/) || [], domain = _a[1];
7080
+ var _a = window2.location.hostname.match(/\.(wix|editorx|base44)\.com$/) || [], domain = _a[1];
7074
7081
  return domain || null;
7075
7082
  }, null);
7076
7083
  }
@@ -7078,6 +7085,17 @@ var require_env = __commonJS({
7078
7085
  return "frog.".concat(hostByDomainOrBrand, ".com");
7079
7086
  }
7080
7087
  exports.getHost = getHost;
7088
+ function getBrandByDomain() {
7089
+ return getGlobal2(function(global2) {
7090
+ if (!global2.location || !global2.location.hostname) {
7091
+ return null;
7092
+ }
7093
+ return Object.keys(constants_1.BrandToDomainMap).find(function(brand) {
7094
+ return constants_1.BrandToDomainMap[brand].test(global2.location.hostname);
7095
+ }) || null;
7096
+ }, null);
7097
+ }
7098
+ exports.getBrandByDomain = getBrandByDomain;
7081
7099
  function isWebWorker() {
7082
7100
  return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
7083
7101
  }
@@ -7098,77 +7116,1094 @@ var require_env = __commonJS({
7098
7116
  } catch (e) {
7099
7117
  return null;
7100
7118
  }
7101
- }
7102
- return null;
7103
- }
7104
- exports.getWindowIfTop = getWindowIfTop;
7105
- function getGlobal2(cb, defaultValue) {
7106
- if (defaultValue === void 0) {
7107
- defaultValue = null;
7108
- }
7109
- if (typeof self !== "undefined" && self) {
7110
- return cb(self) || defaultValue;
7111
- }
7112
- return defaultValue;
7113
- }
7114
- exports.getGlobal = getGlobal2;
7119
+ }
7120
+ return null;
7121
+ }
7122
+ exports.getWindowIfTop = getWindowIfTop;
7123
+ function getGlobal2(cb, defaultValue) {
7124
+ if (defaultValue === void 0) {
7125
+ defaultValue = null;
7126
+ }
7127
+ if (typeof self !== "undefined" && self) {
7128
+ return cb(self) || defaultValue;
7129
+ }
7130
+ return defaultValue;
7131
+ }
7132
+ exports.getGlobal = getGlobal2;
7133
+ }
7134
+ });
7135
+
7136
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js
7137
+ var require_utils = __commonJS({
7138
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js"(exports) {
7139
+ "use strict";
7140
+ init_define_process_env();
7141
+ Object.defineProperty(exports, "__esModule", { value: true });
7142
+ exports.guid = exports.isDataProtocol = exports.buildBiUrl = exports.getCookies = void 0;
7143
+ var browser_1 = require_browser();
7144
+ var env_1 = require_env();
7145
+ var cacheKillerCounter = 0;
7146
+ function getCookies(params) {
7147
+ return Object.keys(params).reduce(function(res, param) {
7148
+ var _a = typeof params[param] === "string" ? { name: params[param] } : params[param], name = _a.name, _b = _a.transform, transform = _b === void 0 ? function(x) {
7149
+ return x;
7150
+ } : _b;
7151
+ var value = transform((0, browser_1.readCookie)(name));
7152
+ if (value) {
7153
+ res[param] = value;
7154
+ }
7155
+ return res;
7156
+ }, {});
7157
+ }
7158
+ exports.getCookies = getCookies;
7159
+ function buildBiUrl(_a, params, context) {
7160
+ var _b = _a.host, host = _b === void 0 ? "" : _b, _c = _a.endpoint, endpoint = _c === void 0 ? "" : _c;
7161
+ if (context === void 0) {
7162
+ context = {};
7163
+ }
7164
+ host = typeof host === "function" ? host() : host;
7165
+ host = host || (0, env_1.getHost)();
7166
+ endpoint = context.endpoint || endpoint;
7167
+ if (!context.useBatch) {
7168
+ params._ = "" + (/* @__PURE__ */ new Date()).getTime() + cacheKillerCounter++;
7169
+ }
7170
+ var pairs = context.useBatch ? [] : Object.keys(params).map(function(key) {
7171
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
7172
+ }, []);
7173
+ var url = ["//".concat(host, "/").concat(endpoint)].concat(pairs.length ? pairs.join("&") : []).join("?");
7174
+ if (url.startsWith("//") && isDataProtocol()) {
7175
+ url = "https:" + url;
7176
+ }
7177
+ return url;
7178
+ }
7179
+ exports.buildBiUrl = buildBiUrl;
7180
+ function isDataProtocol() {
7181
+ return typeof window !== "undefined" && (window === null || window === void 0 ? void 0 : window.location.protocol) === "data:";
7182
+ }
7183
+ exports.isDataProtocol = isDataProtocol;
7184
+ function guid() {
7185
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
7186
+ var r = Math.random() * 16 | 0;
7187
+ var v = c === "x" ? r : r & 3 | 8;
7188
+ return v.toString(16);
7189
+ });
7190
+ }
7191
+ exports.guid = guid;
7192
+ }
7193
+ });
7194
+
7195
+ // ../../node_modules/@wix/web-bi-logger/dist/src/types.js
7196
+ var require_types = __commonJS({
7197
+ "../../node_modules/@wix/web-bi-logger/dist/src/types.js"(exports) {
7198
+ "use strict";
7199
+ init_define_process_env();
7200
+ Object.defineProperty(exports, "__esModule", { value: true });
7201
+ exports.Errors = exports.EventCategories = exports.PublishMethods = void 0;
7202
+ var PublishMethods;
7203
+ (function(PublishMethods2) {
7204
+ PublishMethods2["Auto"] = "auto";
7205
+ PublishMethods2["PostMessage"] = "postMessage";
7206
+ PublishMethods2["Fetch"] = "fetch";
7207
+ })(PublishMethods = exports.PublishMethods || (exports.PublishMethods = {}));
7208
+ var EventCategories;
7209
+ (function(EventCategories2) {
7210
+ EventCategories2["Essential"] = "essential";
7211
+ EventCategories2["Functional"] = "functional";
7212
+ EventCategories2["Analytics"] = "analytics";
7213
+ })(EventCategories = exports.EventCategories || (exports.EventCategories = {}));
7214
+ var Errors;
7215
+ (function(Errors2) {
7216
+ Errors2[Errors2["Unsupported"] = 0] = "Unsupported";
7217
+ })(Errors = exports.Errors || (exports.Errors = {}));
7218
+ }
7219
+ });
7220
+
7221
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js
7222
+ var require_transport = __commonJS({
7223
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js"(exports) {
7224
+ "use strict";
7225
+ init_define_process_env();
7226
+ Object.defineProperty(exports, "__esModule", { value: true });
7227
+ exports.postMessageTransport = exports.xhrTransport = exports.fetchTransport = exports.pixelTransport = exports.beaconTransport = void 0;
7228
+ var browser_1 = require_browser();
7229
+ var errors_1 = require_errors();
7230
+ function beaconTransport(url, params, sendInBody) {
7231
+ if (sendInBody === void 0) {
7232
+ sendInBody = false;
7233
+ }
7234
+ return new Promise(function(resolve, reject) {
7235
+ return (0, browser_1.sendBeacon)(url, sendInBody ? JSON.stringify(params) : void 0) ? resolve() : reject(new Error("Transport Error: Cannot send bi using beacon"));
7236
+ });
7237
+ }
7238
+ exports.beaconTransport = beaconTransport;
7239
+ function pixelTransport(url, image) {
7240
+ return new Promise(function(resolve, reject) {
7241
+ var biImage = image || new window.Image(0, 0);
7242
+ biImage.onload = function() {
7243
+ return resolve();
7244
+ };
7245
+ biImage.onerror = function() {
7246
+ return reject(new Error("Transport Error: Cannot send bi using pixel"));
7247
+ };
7248
+ biImage.src = url;
7249
+ });
7250
+ }
7251
+ exports.pixelTransport = pixelTransport;
7252
+ function fetchTransport(url, params, method, fetchFunction) {
7253
+ if (method === void 0) {
7254
+ method = "GET";
7255
+ }
7256
+ if (typeof fetchFunction === "undefined") {
7257
+ if (typeof fetch === "undefined") {
7258
+ return Promise.reject(new errors_1.APINotSupportedError("fetch"));
7259
+ }
7260
+ fetchFunction = fetch;
7261
+ }
7262
+ var options = {
7263
+ method,
7264
+ credentials: "include"
7265
+ };
7266
+ if (method === "POST") {
7267
+ options.body = JSON.stringify(params);
7268
+ } else {
7269
+ options.keepalive = true;
7270
+ }
7271
+ return fetchFunction(url, options).then(function(response) {
7272
+ if (!response.ok) {
7273
+ throw Error("Transport Error: Cannot send bi using fetch. Status: ".concat(response.status));
7274
+ }
7275
+ });
7276
+ }
7277
+ exports.fetchTransport = fetchTransport;
7278
+ function xhrTransport(url, params, method) {
7279
+ if (method === void 0) {
7280
+ method = "GET";
7281
+ }
7282
+ return new Promise(function(resolve, reject) {
7283
+ var xhr = new XMLHttpRequest();
7284
+ xhr.open(method, "".concat(location.protocol).concat(url));
7285
+ xhr.onload = resolve;
7286
+ xhr.onerror = function() {
7287
+ reject(new Error("Transport Error: Cannot send bi using xhr."));
7288
+ };
7289
+ xhr.withCredentials = true;
7290
+ if (method === "POST") {
7291
+ xhr.send(JSON.stringify(params));
7292
+ } else {
7293
+ xhr.send();
7294
+ }
7295
+ });
7296
+ }
7297
+ exports.xhrTransport = xhrTransport;
7298
+ function postMessageTransport(message, postMessage) {
7299
+ if (postMessage === void 0) {
7300
+ postMessage = self.postMessage;
7301
+ }
7302
+ var messageArgs = [message];
7303
+ if (typeof WorkerGlobalScope === "undefined") {
7304
+ messageArgs.push("*");
7305
+ }
7306
+ return postMessage.apply(self, messageArgs);
7307
+ }
7308
+ exports.postMessageTransport = postMessageTransport;
7309
+ }
7310
+ });
7311
+
7312
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js
7313
+ var require_publishers = __commonJS({
7314
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js"(exports) {
7315
+ "use strict";
7316
+ init_define_process_env();
7317
+ var __assign = exports && exports.__assign || function() {
7318
+ __assign = Object.assign || function(t) {
7319
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
7320
+ s = arguments[i];
7321
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7322
+ t[p] = s[p];
7323
+ }
7324
+ return t;
7325
+ };
7326
+ return __assign.apply(this, arguments);
7327
+ };
7328
+ var __rest = exports && exports.__rest || function(s, e) {
7329
+ var t = {};
7330
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7331
+ t[p] = s[p];
7332
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7333
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7334
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7335
+ t[p[i]] = s[p[i]];
7336
+ }
7337
+ return t;
7338
+ };
7339
+ Object.defineProperty(exports, "__esModule", { value: true });
7340
+ exports.getTransformers = exports.getPublisher = exports.postMessagePublisher = exports.xhrPublisher = exports.fetchPublisher = exports.beaconPublisher = exports.imagePublisher = exports.resolvePublisher = void 0;
7341
+ var utils_1 = require_utils();
7342
+ var env_1 = require_env();
7343
+ var errors_1 = require_errors();
7344
+ var types_1 = require_types();
7345
+ var transport_1 = require_transport();
7346
+ var getHttpMethod = function(context) {
7347
+ return context.useBatch ? "POST" : "GET";
7348
+ };
7349
+ var resolvePublisher = function(options, publishFunctions) {
7350
+ var publisherFactory;
7351
+ var publishFunction;
7352
+ if (options.publishMethod === types_1.PublishMethods.PostMessage) {
7353
+ publisherFactory = postMessagePublisher;
7354
+ publishFunction = publishFunctions && publishFunctions[types_1.PublishMethods.PostMessage];
7355
+ } else if (options.publishMethod === types_1.PublishMethods.Fetch) {
7356
+ publisherFactory = fetchPublisher;
7357
+ publishFunction = publishFunctions && publishFunctions[types_1.PublishMethods.Fetch];
7358
+ } else if ((0, env_1.isWebWorker)()) {
7359
+ publisherFactory = fetchPublisher;
7360
+ } else {
7361
+ publisherFactory = beaconPublisher;
7362
+ }
7363
+ return publisherFactory(options, publishFunction);
7364
+ };
7365
+ exports.resolvePublisher = resolvePublisher;
7366
+ function imagePublisher(options) {
7367
+ if (options === void 0) {
7368
+ options = {};
7369
+ }
7370
+ return function image(params, context) {
7371
+ if (context === void 0) {
7372
+ context = {};
7373
+ }
7374
+ if (context.useBatch) {
7375
+ throw new errors_1.APINotSupportedError("Can't use image publisher to send batched events.");
7376
+ }
7377
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
7378
+ return (0, transport_1.pixelTransport)(url, context.image);
7379
+ };
7380
+ }
7381
+ exports.imagePublisher = imagePublisher;
7382
+ function beaconPublisher(options) {
7383
+ if (options === void 0) {
7384
+ options = {};
7385
+ }
7386
+ return function beacon(params, context) {
7387
+ if (context === void 0) {
7388
+ context = {};
7389
+ }
7390
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
7391
+ return (0, transport_1.beaconTransport)(url, params, !!context.useBatch).catch(function() {
7392
+ var method = getHttpMethod(context);
7393
+ return context.useBatch ? (0, transport_1.fetchTransport)(url, params, method).catch(function(error) {
7394
+ return error instanceof errors_1.APINotSupportedError ? (0, transport_1.xhrTransport)(url, params, method) : Promise.reject(error);
7395
+ }) : (0, transport_1.pixelTransport)(url, context.image);
7396
+ });
7397
+ };
7398
+ }
7399
+ exports.beaconPublisher = beaconPublisher;
7400
+ function fetchPublisher(options, fetchFunction) {
7401
+ if (options === void 0) {
7402
+ options = {};
7403
+ }
7404
+ return function fetch2(params, context) {
7405
+ if (context === void 0) {
7406
+ context = {};
7407
+ }
7408
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
7409
+ var method = getHttpMethod(context);
7410
+ return (0, transport_1.fetchTransport)(url, params, method, fetchFunction).catch(function(error) {
7411
+ return error instanceof errors_1.APINotSupportedError ? (0, transport_1.xhrTransport)(url, params, method) : Promise.reject(error);
7412
+ });
7413
+ };
7414
+ }
7415
+ exports.fetchPublisher = fetchPublisher;
7416
+ function xhrPublisher(options) {
7417
+ if (options === void 0) {
7418
+ options = {};
7419
+ }
7420
+ return function xhr(params, context) {
7421
+ if (context === void 0) {
7422
+ context = {};
7423
+ }
7424
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
7425
+ var method = getHttpMethod(context);
7426
+ return (0, transport_1.xhrTransport)(url, params, method);
7427
+ };
7428
+ }
7429
+ exports.xhrPublisher = xhrPublisher;
7430
+ function postMessagePublisher(options, publishFunction) {
7431
+ if (options === void 0) {
7432
+ options = {};
7433
+ }
7434
+ return function postMessage(params) {
7435
+ return (0, transport_1.postMessageTransport)(params, publishFunction);
7436
+ };
7437
+ }
7438
+ exports.postMessagePublisher = postMessagePublisher;
7439
+ function getPublisher(options, publishFunctions) {
7440
+ return (0, exports.resolvePublisher)(options, publishFunctions);
7441
+ }
7442
+ exports.getPublisher = getPublisher;
7443
+ var getTransformers = function(factoryOptions, transformer) {
7444
+ var _eventTransformer, _payloadTransformer;
7445
+ if (transformer) {
7446
+ if (typeof transformer !== "function" && transformer.postMessage && factoryOptions.publishMethod === types_1.PublishMethods.PostMessage) {
7447
+ _payloadTransformer = transformer.postMessage;
7448
+ } else if (typeof transformer === "function") {
7449
+ _eventTransformer = transformer;
7450
+ }
7451
+ }
7452
+ var eventTransformer = _eventTransformer;
7453
+ var payloadTransformer = function(params, publisherContext) {
7454
+ if (publisherContext.useBatch) {
7455
+ var getEndpoint_1 = function(context) {
7456
+ return (context === null || context === void 0 ? void 0 : context.endpoint) || publisherContext.endpoint || factoryOptions.endpoint;
7457
+ };
7458
+ params.e = params.e.map(function(e) {
7459
+ var context = e.context, event = __rest(e, ["context"]);
7460
+ var res = __assign(__assign({}, event), { f: __assign(__assign({}, event.f), { _rp: getEndpoint_1(context) }) });
7461
+ return res;
7462
+ });
7463
+ }
7464
+ return _payloadTransformer ? _payloadTransformer(params) : params;
7465
+ };
7466
+ return { eventTransformer, payloadTransformer };
7467
+ };
7468
+ exports.getTransformers = getTransformers;
7469
+ }
7470
+ });
7471
+
7472
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js
7473
+ var require_common_config = __commonJS({
7474
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js"(exports) {
7475
+ "use strict";
7476
+ init_define_process_env();
7477
+ Object.defineProperty(exports, "__esModule", { value: true });
7478
+ exports.getWixHost = exports.getBranchId = exports.getBrand = exports.getCommonConfigValue = void 0;
7479
+ var env_1 = require_env();
7480
+ var constants_1 = require_constants();
7481
+ var resolveCommonConfig = function() {
7482
+ return (0, env_1.getGlobal)(function(g) {
7483
+ return g.Wix && g.Wix.Utils && g.Wix.Utils.commonConfig || g.commonConfig;
7484
+ });
7485
+ };
7486
+ var getCommonConfigValue = function(key, commonConfig2, defaultValue) {
7487
+ if (commonConfig2 === void 0) {
7488
+ commonConfig2 = resolveCommonConfig();
7489
+ }
7490
+ if (defaultValue === void 0) {
7491
+ defaultValue = constants_1.DefaultCommonConfig[key];
7492
+ }
7493
+ commonConfig2 = commonConfig2 && typeof commonConfig2.getAll === "function" ? commonConfig2.getAll() : commonConfig2;
7494
+ if (!commonConfig2 || typeof commonConfig2[key] === "undefined") {
7495
+ return defaultValue;
7496
+ }
7497
+ return commonConfig2[key];
7498
+ };
7499
+ exports.getCommonConfigValue = getCommonConfigValue;
7500
+ var getBrand = function(commonConfigGetter) {
7501
+ return (0, exports.getCommonConfigValue)("brand", commonConfigGetter(), (0, env_1.getBrandByDomain)() || constants_1.DefaultBrand);
7502
+ };
7503
+ exports.getBrand = getBrand;
7504
+ var getBranchId = function(commonConfigGetter) {
7505
+ return (0, exports.getCommonConfigValue)("branchId", commonConfigGetter());
7506
+ };
7507
+ exports.getBranchId = getBranchId;
7508
+ var getWixHost = function(commonConfigGetter) {
7509
+ return (0, exports.getCommonConfigValue)("host", commonConfigGetter());
7510
+ };
7511
+ exports.getWixHost = getWixHost;
7512
+ }
7513
+ });
7514
+
7515
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js
7516
+ var require_event_defaults = __commonJS({
7517
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js"(exports) {
7518
+ "use strict";
7519
+ init_define_process_env();
7520
+ Object.defineProperty(exports, "__esModule", { value: true });
7521
+ exports.getCommonDefaults = exports.getUserDefaults = exports.transformDefaults = void 0;
7522
+ var constants_1 = require_constants();
7523
+ var browser_1 = require_browser();
7524
+ var common_config_1 = require_common_config();
7525
+ var env_1 = require_env();
7526
+ var utils_1 = require_utils();
7527
+ var transformDefaults = function(context) {
7528
+ return Object.keys(context).reduce(function(res, key) {
7529
+ var mappedKey = constants_1.EventContextMap[key] || key;
7530
+ res[mappedKey] = context[key];
7531
+ return res;
7532
+ }, {});
7533
+ };
7534
+ exports.transformDefaults = transformDefaults;
7535
+ var getUserDefaults = function() {
7536
+ return (0, utils_1.getCookies)({
7537
+ clientId: "_wixCIDX",
7538
+ uuid: {
7539
+ name: "_wixUIDX",
7540
+ transform: function(value) {
7541
+ return typeof value === "string" && value.split("|")[1];
7542
+ }
7543
+ }
7544
+ });
7545
+ };
7546
+ exports.getUserDefaults = getUserDefaults;
7547
+ var getCommonDefaults = function(commonConfigGetter, consentPolicyGetter) {
7548
+ return (0, exports.transformDefaults)({
7549
+ brandId: function() {
7550
+ return (0, common_config_1.getBrand)(commonConfigGetter);
7551
+ },
7552
+ siteBranchId: function() {
7553
+ return (0, common_config_1.getBranchId)(commonConfigGetter);
7554
+ },
7555
+ screenResolution: function() {
7556
+ return resolveScreenResolution();
7557
+ },
7558
+ ms: function() {
7559
+ return Math.round((0, browser_1.now)());
7560
+ },
7561
+ isHeadless: function() {
7562
+ return resolveIsHeadless(commonConfigGetter);
7563
+ },
7564
+ hostingPlatform: function() {
7565
+ return (0, common_config_1.getWixHost)(commonConfigGetter);
7566
+ },
7567
+ lv: constants_1.LoggerVersion
7568
+ });
7569
+ };
7570
+ exports.getCommonDefaults = getCommonDefaults;
7571
+ var resolveIsHeadless = function(commonConfigGetter) {
7572
+ return (0, common_config_1.getWixHost)(commonConfigGetter) === constants_1.HeadlessHost || void 0;
7573
+ };
7574
+ var resolveScreenResolution = function() {
7575
+ return (0, env_1.getWindowIfTop)(function(window2) {
7576
+ return (0, browser_1.getDesktopSize)(window2);
7577
+ }) || constants_1.DefaultScreenResolution;
7578
+ };
7579
+ }
7580
+ });
7581
+
7582
+ // ../../node_modules/@wix/web-bi-logger/dist/src/logger.js
7583
+ var require_logger = __commonJS({
7584
+ "../../node_modules/@wix/web-bi-logger/dist/src/logger.js"(exports) {
7585
+ "use strict";
7586
+ init_define_process_env();
7587
+ var __assign = exports && exports.__assign || function() {
7588
+ __assign = Object.assign || function(t) {
7589
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
7590
+ s = arguments[i];
7591
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7592
+ t[p] = s[p];
7593
+ }
7594
+ return t;
7595
+ };
7596
+ return __assign.apply(this, arguments);
7597
+ };
7598
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7599
+ if (k2 === void 0) k2 = k;
7600
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7601
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7602
+ desc = { enumerable: true, get: function() {
7603
+ return m[k];
7604
+ } };
7605
+ }
7606
+ Object.defineProperty(o, k2, desc);
7607
+ } : function(o, m, k, k2) {
7608
+ if (k2 === void 0) k2 = k;
7609
+ o[k2] = m[k];
7610
+ });
7611
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
7612
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7613
+ } : function(o, v) {
7614
+ o["default"] = v;
7615
+ });
7616
+ var __importStar = exports && exports.__importStar || function(mod) {
7617
+ if (mod && mod.__esModule) return mod;
7618
+ var result = {};
7619
+ if (mod != null) {
7620
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7621
+ }
7622
+ __setModuleDefault(result, mod);
7623
+ return result;
7624
+ };
7625
+ Object.defineProperty(exports, "__esModule", { value: true });
7626
+ exports.BiLoggerClientFactory = exports.createBatchQueue = exports.manager = exports.factory = exports.Factory = exports.setHost = exports.EventCategories = exports.PublishMethods = void 0;
7627
+ var wix_bi_logger_client_1 = require_dist();
7628
+ var consent_policy_client_accessor_1 = (init_src(), __toCommonJS(src_exports));
7629
+ var assert2 = __importStar(require_assert2());
7630
+ var publishers_1 = require_publishers();
7631
+ var common_config_1 = require_common_config();
7632
+ var env_1 = require_env();
7633
+ var types_1 = require_types();
7634
+ var event_defaults_1 = require_event_defaults();
7635
+ var types_2 = require_types();
7636
+ Object.defineProperty(exports, "PublishMethods", { enumerable: true, get: function() {
7637
+ return types_2.PublishMethods;
7638
+ } });
7639
+ Object.defineProperty(exports, "EventCategories", { enumerable: true, get: function() {
7640
+ return types_2.EventCategories;
7641
+ } });
7642
+ var env_2 = require_env();
7643
+ Object.defineProperty(exports, "setHost", { enumerable: true, get: function() {
7644
+ return env_2.setHost;
7645
+ } });
7646
+ var Factory = (
7647
+ /** @class */
7648
+ function() {
7649
+ function Factory2(options) {
7650
+ if (options === void 0) {
7651
+ options = {};
7652
+ }
7653
+ this.options = options;
7654
+ this.commonConfigGetter = function() {
7655
+ return void 0;
7656
+ };
7657
+ this.initialized = false;
7658
+ assert2.ok(!options.publishMethod || Object.keys(types_1.PublishMethods).map(function(key) {
7659
+ return types_1.PublishMethods[key];
7660
+ }).indexOf(options.publishMethod) !== -1, 'Unsupported publish method "'.concat(options.publishMethod, '"'));
7661
+ Factory2.consentPolicyAccessor = Factory2.consentPolicyAccessor || new consent_policy_client_accessor_1.ConsentPolicyAccessor();
7662
+ this.loggerClientFactory = (0, wix_bi_logger_client_1.factory)();
7663
+ }
7664
+ Factory2.prototype.initFactory = function() {
7665
+ var _this = this;
7666
+ if (this.initialized) {
7667
+ return this.loggerClientFactory;
7668
+ }
7669
+ this.initialized = true;
7670
+ this.updateDefaults((0, event_defaults_1.getCommonDefaults)(this.commonConfigGetter, Factory2.consentPolicyAccessor));
7671
+ this.withUserContext((0, event_defaults_1.getUserDefaults)());
7672
+ var options = __assign(__assign({}, this.options), { host: this.options.host || function() {
7673
+ return (0, env_1.getHost)((0, common_config_1.getBrand)(_this.commonConfigGetter));
7674
+ } });
7675
+ var publisher = (0, publishers_1.getPublisher)(options, this.publishFunctions);
7676
+ var _a = (0, publishers_1.getTransformers)(options, this.transformer), eventTransformer = _a.eventTransformer, payloadTransformer = _a.payloadTransformer;
7677
+ var baseFactory = this.loggerClientFactory.addPublisher(publisher).withConsentPolicyGetter(function() {
7678
+ return Factory2.consentPolicyAccessor.getCurrentConsentPolicy();
7679
+ });
7680
+ if (eventTransformer) {
7681
+ baseFactory.withEventTransformer(eventTransformer);
7682
+ }
7683
+ if (payloadTransformer) {
7684
+ baseFactory.withPayloadTransformer(payloadTransformer);
7685
+ }
7686
+ return baseFactory;
7687
+ };
7688
+ Factory2.prototype.withTransformer = function(transformer) {
7689
+ assert2.defined(transformer, "Transformer must be provided");
7690
+ assert2.ok(typeof transformer === "function" || transformer && typeof transformer[types_1.PublishMethods.PostMessage] === "function", "Valid transformer must be provided");
7691
+ this.transformer = transformer;
7692
+ return this;
7693
+ };
7694
+ Factory2.prototype.withPublishFunction = function(publishFunctions) {
7695
+ assert2.defined(publishFunctions, "Publish functions object must be provided");
7696
+ assert2.ok(this.options.publishMethod && this.options.publishMethod !== types_1.PublishMethods.Auto, "Publish function can be used only when using a custom publish method");
7697
+ assert2.ok(publishFunctions && typeof publishFunctions[this.options.publishMethod] === "function", "Valid publish function must be provided");
7698
+ this.publishFunctions = publishFunctions;
7699
+ return this;
7700
+ };
7701
+ Factory2.prototype.withUserContext = function(context) {
7702
+ assert2.defined(context, "User context object must be provided");
7703
+ this.updateDefaults((0, event_defaults_1.transformDefaults)(context));
7704
+ return this;
7705
+ };
7706
+ Factory2.prototype.withUoUContext = function(context) {
7707
+ assert2.defined(context, "UoU context object must be provided");
7708
+ this.updateDefaults((0, event_defaults_1.transformDefaults)(context));
7709
+ return this;
7710
+ };
7711
+ Factory2.prototype.withNonEssentialContext = function(context) {
7712
+ assert2.defined(context, "Non-essential context object must be provided");
7713
+ this.loggerClientFactory.updateNonEssentialDefaults((0, event_defaults_1.transformDefaults)(context));
7714
+ return this;
7715
+ };
7716
+ Factory2.prototype.withCommonConfigGetter = function(commonConfigGetter) {
7717
+ assert2.defined(commonConfigGetter, "Common config getter must be provided");
7718
+ assert2.ok(typeof commonConfigGetter === "function", "Common config getter must be a function");
7719
+ this.commonConfigGetter = commonConfigGetter;
7720
+ return this;
7721
+ };
7722
+ Factory2.prototype.updateDefaults = function(params) {
7723
+ this.loggerClientFactory.updateDefaults(params);
7724
+ return this;
7725
+ };
7726
+ Factory2.prototype.setMuted = function(isMuted) {
7727
+ this.loggerClientFactory.setMuted(isMuted);
7728
+ return this;
7729
+ };
7730
+ Factory2.prototype.setEvents = function(events) {
7731
+ this.loggerClientFactory.setEvents(events);
7732
+ return this;
7733
+ };
7734
+ Factory2.prototype.setGlobalBatchQueue = function(batchQueue) {
7735
+ this.loggerClientFactory.setGlobalBatchQueue(batchQueue);
7736
+ return this;
7737
+ };
7738
+ Factory2.prototype.onError = function(handler) {
7739
+ this.loggerClientFactory.setPublisherFailHandler(handler);
7740
+ return this;
7741
+ };
7742
+ Factory2.prototype.logger = function(options) {
7743
+ if (options === void 0) {
7744
+ options = {};
7745
+ }
7746
+ var _a = this.options, endpoint = _a.endpoint, useBatch = _a.useBatch;
7747
+ var logger = this.initFactory().logger(__assign({ endpoint, useBatch }, options));
7748
+ return logger;
7749
+ };
7750
+ return Factory2;
7751
+ }()
7752
+ );
7753
+ exports.Factory = Factory;
7754
+ var factory2 = function(options) {
7755
+ if (options === void 0) {
7756
+ options = {};
7757
+ }
7758
+ return new Factory(options);
7759
+ };
7760
+ exports.factory = factory2;
7761
+ exports.manager = wix_bi_logger_client_1.manager;
7762
+ exports.createBatchQueue = wix_bi_logger_client_1.createBatchQueue;
7763
+ exports.BiLoggerClientFactory = wix_bi_logger_client_1.BiLoggerFactory;
7764
+ }
7765
+ });
7766
+
7767
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/browser.js
7768
+ var require_browser2 = __commonJS({
7769
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/browser.js"(exports) {
7770
+ "use strict";
7771
+ init_define_process_env();
7772
+ Object.defineProperty(exports, "__esModule", { value: true });
7773
+ exports.readCookie = exports.sendBeacon = exports.getWindowSize = exports.getDesktopSize = exports.now = void 0;
7774
+ var utils_1 = require_utils2();
7775
+ function now2() {
7776
+ return typeof performance !== "undefined" && performance && performance.now ? performance.now() : -1;
7777
+ }
7778
+ exports.now = now2;
7779
+ function getDesktopSize(window2) {
7780
+ var width = window2.screen && window2.screen.width || 0;
7781
+ var height = window2.screen && window2.screen.height || 0;
7782
+ return "".concat(width, "x").concat(height);
7783
+ }
7784
+ exports.getDesktopSize = getDesktopSize;
7785
+ function getWindowSize(window2) {
7786
+ var width = 0;
7787
+ var height = 0;
7788
+ if (window2.innerWidth) {
7789
+ width = window2.innerWidth;
7790
+ height = window2.innerHeight;
7791
+ } else if (window2.document) {
7792
+ if (window2.document.documentElement && window2.document.documentElement.clientWidth) {
7793
+ width = window2.document.documentElement.clientWidth;
7794
+ height = window2.document.documentElement.clientHeight;
7795
+ } else if (window2.document.body && window2.document.body.clientWidth) {
7796
+ width = window2.document.body.clientWidth;
7797
+ height = window2.document.body.clientHeight;
7798
+ }
7799
+ }
7800
+ return "".concat(width, "x").concat(height);
7801
+ }
7802
+ exports.getWindowSize = getWindowSize;
7803
+ function sendBeacon2(url, data) {
7804
+ if (typeof navigator === "undefined" || !navigator || !navigator.sendBeacon) {
7805
+ return false;
7806
+ }
7807
+ return navigator.sendBeacon(url, data);
7808
+ }
7809
+ exports.sendBeacon = sendBeacon2;
7810
+ function readCookie2(cookieName) {
7811
+ if ((0, utils_1.isDataProtocol)() || typeof document === "undefined") {
7812
+ return null;
7813
+ }
7814
+ if (window.__ENABLE_COOKIE_READ_OPTIMIZATION__ && window.__BI_cookie_cache && window.__BI_cookie_cache[cookieName] !== void 0) {
7815
+ return window.__BI_cookie_cache[cookieName];
7816
+ }
7817
+ var cookies = document.cookie.split(";");
7818
+ for (var _i = 0, cookies_1 = cookies; _i < cookies_1.length; _i++) {
7819
+ var cookie = cookies_1[_i];
7820
+ var pair = cookie.split("=");
7821
+ var name_1 = pair[0];
7822
+ var value = pair[1];
7823
+ while (name_1[0] === " ") {
7824
+ name_1 = name_1.substr(1);
7825
+ }
7826
+ if (name_1 === cookieName) {
7827
+ if (window.__ENABLE_COOKIE_READ_OPTIMIZATION__) {
7828
+ if (!window.__BI_cookie_cache) {
7829
+ window.__BI_cookie_cache = {};
7830
+ }
7831
+ window.__BI_cookie_cache[cookieName] = value;
7832
+ }
7833
+ return value;
7834
+ }
7835
+ }
7836
+ return "";
7837
+ }
7838
+ exports.readCookie = readCookie2;
7839
+ }
7840
+ });
7841
+
7842
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/constants.js
7843
+ var require_constants2 = __commonJS({
7844
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/constants.js"(exports) {
7845
+ "use strict";
7846
+ init_define_process_env();
7847
+ Object.defineProperty(exports, "__esModule", { value: true });
7848
+ exports.DefaultCommonConfig = exports.BrandToHostMap = exports.HeadlessHost = exports.DefaultBrand = exports.EventContextMap = exports.BackofficeDomains = exports.LoggerVersion = void 0;
7849
+ exports.LoggerVersion = "2.0.985|C";
7850
+ exports.BackofficeDomains = [".wix.com", ".editorx.com"];
7851
+ var EventContextMap;
7852
+ (function(EventContextMap2) {
7853
+ EventContextMap2["msid"] = "_msid";
7854
+ EventContextMap2["clientId"] = "_client_id";
7855
+ EventContextMap2["uuid"] = "_uuid";
7856
+ EventContextMap2["visitorId"] = "_visitorId";
7857
+ EventContextMap2["siteMemberId"] = "_siteMemberId";
7858
+ EventContextMap2["brandId"] = "_brandId";
7859
+ EventContextMap2["siteBranchId"] = "_siteBranchId";
7860
+ EventContextMap2["ms"] = "_ms";
7861
+ EventContextMap2["lv"] = "_lv";
7862
+ EventContextMap2["isHeadless"] = "_isHeadless";
7863
+ EventContextMap2["hostingPlatform"] = "_hostingPlatform";
7864
+ })(EventContextMap = exports.EventContextMap || (exports.EventContextMap = {}));
7865
+ exports.DefaultBrand = "wix";
7866
+ exports.HeadlessHost = "VIEWER_HEADLESS";
7867
+ exports.BrandToHostMap = {
7868
+ wix: "wix",
7869
+ editorx: "editorx"
7870
+ };
7871
+ exports.DefaultCommonConfig = {
7872
+ brand: exports.DefaultBrand
7873
+ };
7874
+ }
7875
+ });
7876
+
7877
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/env.js
7878
+ var require_env2 = __commonJS({
7879
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/env.js"(exports) {
7880
+ "use strict";
7881
+ init_define_process_env();
7882
+ Object.defineProperty(exports, "__esModule", { value: true });
7883
+ exports.getGlobal = exports.getWindowIfTop = exports.isBackoffice = exports.isWebWorker = exports.getHost = exports.setHost = void 0;
7884
+ var constants_1 = require_constants2();
7885
+ var host;
7886
+ var hostByDomain;
7887
+ function setHost(_host) {
7888
+ host = _host;
7889
+ }
7890
+ exports.setHost = setHost;
7891
+ function getHost(brand) {
7892
+ if (brand === void 0) {
7893
+ brand = constants_1.DefaultBrand;
7894
+ }
7895
+ if (host) {
7896
+ return host;
7897
+ }
7898
+ var hostByDomainOrBrand = "";
7899
+ if (typeof hostByDomain === "undefined") {
7900
+ hostByDomain = getGlobal2(function(window2) {
7901
+ if (!window2.location || !window2.location.hostname) {
7902
+ return null;
7903
+ }
7904
+ var _a = window2.location.hostname.match(/\.(wix|editorx)\.com$/) || [], domain = _a[1];
7905
+ return domain || null;
7906
+ }, null);
7907
+ }
7908
+ hostByDomainOrBrand = hostByDomain || constants_1.BrandToHostMap[brand] || constants_1.BrandToHostMap[constants_1.DefaultBrand];
7909
+ return "frog.".concat(hostByDomainOrBrand, ".com");
7910
+ }
7911
+ exports.getHost = getHost;
7912
+ function isWebWorker() {
7913
+ return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
7914
+ }
7915
+ exports.isWebWorker = isWebWorker;
7916
+ function isBackoffice() {
7917
+ return getWindowIfTop(function(_a) {
7918
+ var document2 = _a.document;
7919
+ return constants_1.BackofficeDomains.some(function(domain) {
7920
+ return document2.location.host.indexOf(domain) !== -1;
7921
+ });
7922
+ });
7923
+ }
7924
+ exports.isBackoffice = isBackoffice;
7925
+ function getWindowIfTop(cb) {
7926
+ if (typeof window !== "undefined" && window) {
7927
+ try {
7928
+ return window.top === window.self ? cb ? cb(window) : window : null;
7929
+ } catch (e) {
7930
+ return null;
7931
+ }
7932
+ }
7933
+ return null;
7934
+ }
7935
+ exports.getWindowIfTop = getWindowIfTop;
7936
+ function getGlobal2(cb, defaultValue) {
7937
+ if (defaultValue === void 0) {
7938
+ defaultValue = null;
7939
+ }
7940
+ if (typeof self !== "undefined" && self) {
7941
+ return cb(self) || defaultValue;
7942
+ }
7943
+ return defaultValue;
7944
+ }
7945
+ exports.getGlobal = getGlobal2;
7946
+ }
7947
+ });
7948
+
7949
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/utils.js
7950
+ var require_utils2 = __commonJS({
7951
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/utils.js"(exports) {
7952
+ "use strict";
7953
+ init_define_process_env();
7954
+ Object.defineProperty(exports, "__esModule", { value: true });
7955
+ exports.guid = exports.isDataProtocol = exports.buildBiUrl = exports.getCookies = void 0;
7956
+ var browser_1 = require_browser2();
7957
+ var env_1 = require_env2();
7958
+ var cacheKillerCounter = 0;
7959
+ function getCookies(params) {
7960
+ return Object.keys(params).reduce(function(res, param) {
7961
+ var _a = typeof params[param] === "string" ? { name: params[param] } : params[param], name = _a.name, _b = _a.transform, transform = _b === void 0 ? function(x) {
7962
+ return x;
7963
+ } : _b;
7964
+ var value = transform((0, browser_1.readCookie)(name));
7965
+ if (value) {
7966
+ res[param] = value;
7967
+ }
7968
+ return res;
7969
+ }, {});
7970
+ }
7971
+ exports.getCookies = getCookies;
7972
+ function buildBiUrl(_a, params, context) {
7973
+ var _b = _a.host, host = _b === void 0 ? "" : _b, _c = _a.endpoint, endpoint = _c === void 0 ? "" : _c;
7974
+ if (context === void 0) {
7975
+ context = {};
7976
+ }
7977
+ host = typeof host === "function" ? host() : host;
7978
+ host = host || (0, env_1.getHost)();
7979
+ endpoint = context.endpoint || endpoint;
7980
+ if (!context.useBatch) {
7981
+ params._ = "" + (/* @__PURE__ */ new Date()).getTime() + cacheKillerCounter++;
7982
+ }
7983
+ var pairs = context.useBatch ? [] : Object.keys(params).map(function(key) {
7984
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
7985
+ }, []);
7986
+ var url = ["//".concat(host, "/").concat(endpoint)].concat(pairs.length ? pairs.join("&") : []).join("?");
7987
+ if (url.startsWith("//") && isDataProtocol()) {
7988
+ url = "https:" + url;
7989
+ }
7990
+ return url;
7991
+ }
7992
+ exports.buildBiUrl = buildBiUrl;
7993
+ function isDataProtocol() {
7994
+ return typeof window !== "undefined" && (window === null || window === void 0 ? void 0 : window.location.protocol) === "data:";
7995
+ }
7996
+ exports.isDataProtocol = isDataProtocol;
7997
+ function guid() {
7998
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
7999
+ var r = Math.random() * 16 | 0;
8000
+ var v = c === "x" ? r : r & 3 | 8;
8001
+ return v.toString(16);
8002
+ });
8003
+ }
8004
+ exports.guid = guid;
8005
+ }
8006
+ });
8007
+
8008
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js
8009
+ var require_navigator = __commonJS({
8010
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js"(exports) {
8011
+ "use strict";
8012
+ init_define_process_env();
8013
+ Object.defineProperty(exports, "__esModule", { value: true });
8014
+ exports.listen = void 0;
8015
+ var env_1 = require_env2();
8016
+ function hook(obj, fnName, cbHook) {
8017
+ if (!obj || !obj[fnName]) {
8018
+ return;
8019
+ }
8020
+ var original = obj[fnName];
8021
+ obj[fnName] = function() {
8022
+ cbHook.apply(null, arguments);
8023
+ return original.apply(obj, arguments);
8024
+ };
8025
+ }
8026
+ function onLoad(cb) {
8027
+ setTimeout(function() {
8028
+ return (0, env_1.getWindowIfTop)(function(window2) {
8029
+ return cb(window2.location.href);
8030
+ });
8031
+ });
8032
+ }
8033
+ function onPushState(cb) {
8034
+ (0, env_1.getWindowIfTop)(function(_a) {
8035
+ var history = _a.history;
8036
+ return ["pushState", "replaceState"].forEach(function(fnName) {
8037
+ hook(history, fnName, function(_, __, url) {
8038
+ return cb(url);
8039
+ });
8040
+ });
8041
+ });
8042
+ }
8043
+ function onPopState(cb) {
8044
+ (0, env_1.getWindowIfTop)(function(window2) {
8045
+ return window2.addEventListener("popstate", function() {
8046
+ return cb(window2.location.href);
8047
+ });
8048
+ });
8049
+ }
8050
+ function listen(cb) {
8051
+ (0, env_1.getWindowIfTop)(function(window2) {
8052
+ var fromUrl = window2.document.referrer;
8053
+ [onLoad, onPushState, onPopState].forEach(function(event) {
8054
+ return event(function(toUrl) {
8055
+ cb(fromUrl, toUrl);
8056
+ fromUrl = toUrl;
8057
+ });
8058
+ });
8059
+ });
8060
+ }
8061
+ exports.listen = listen;
8062
+ }
8063
+ });
8064
+
8065
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js
8066
+ var require_tracker = __commonJS({
8067
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js"(exports) {
8068
+ "use strict";
8069
+ init_define_process_env();
8070
+ Object.defineProperty(exports, "__esModule", { value: true });
8071
+ exports.track = void 0;
8072
+ var utils_1 = require_utils2();
8073
+ var navigator_1 = require_navigator();
8074
+ var env_1 = require_env2();
8075
+ var browser_1 = require_browser2();
8076
+ var IS_TRACKING = "__isTrackingPageViews__";
8077
+ var ENDPOINT = "p";
8078
+ var SOURCE = 19;
8079
+ var EVID = 3;
8080
+ function shouldTrack(force) {
8081
+ return force || !(0, env_1.isWebWorker)() && (0, env_1.isBackoffice)() && (0, env_1.getWindowIfTop)(function(window2) {
8082
+ return !window2[IS_TRACKING];
8083
+ });
8084
+ }
8085
+ function setIsTracking() {
8086
+ return (0, env_1.getWindowIfTop)(function(window2) {
8087
+ return window2[IS_TRACKING] = true;
8088
+ });
8089
+ }
8090
+ function getLogger(loggerFactory) {
8091
+ return loggerFactory({ endpoint: ENDPOINT }).updateDefaults({ src: SOURCE, evid: EVID, vsi: (0, utils_1.guid)() }).logger();
8092
+ }
8093
+ function trackBrowsingSession(loggerFactory) {
8094
+ var logger = getLogger(loggerFactory);
8095
+ var firstInSession = 1;
8096
+ (0, navigator_1.listen)(function(fromUrl, toUrl) {
8097
+ var _a = (0, env_1.getWindowIfTop)(function(window2) {
8098
+ return {
8099
+ sr: (0, browser_1.getDesktopSize)(window2),
8100
+ wr: (0, browser_1.getWindowSize)(window2)
8101
+ };
8102
+ }), sr = _a.sr, wr = _a.wr;
8103
+ logger.log({ from: fromUrl, to: toUrl, fis: firstInSession, sr, wr });
8104
+ firstInSession = 0;
8105
+ });
8106
+ }
8107
+ function track(loggerFactory, options) {
8108
+ if (options === void 0) {
8109
+ options = { force: false };
8110
+ }
8111
+ if (shouldTrack(options.force)) {
8112
+ setIsTracking();
8113
+ trackBrowsingSession(loggerFactory);
8114
+ }
8115
+ }
8116
+ exports.track = track;
8117
+ }
8118
+ });
8119
+
8120
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/errors.js
8121
+ var require_errors2 = __commonJS({
8122
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/errors.js"(exports) {
8123
+ "use strict";
8124
+ init_define_process_env();
8125
+ var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
8126
+ var extendStatics = function(d, b) {
8127
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
8128
+ d2.__proto__ = b2;
8129
+ } || function(d2, b2) {
8130
+ for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
8131
+ };
8132
+ return extendStatics(d, b);
8133
+ };
8134
+ return function(d, b) {
8135
+ if (typeof b !== "function" && b !== null)
8136
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
8137
+ extendStatics(d, b);
8138
+ function __() {
8139
+ this.constructor = d;
8140
+ }
8141
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
8142
+ };
8143
+ }();
8144
+ Object.defineProperty(exports, "__esModule", { value: true });
8145
+ exports.APINotSupportedError = exports.AssertionError = void 0;
8146
+ var AssertionError = (
8147
+ /** @class */
8148
+ function(_super) {
8149
+ __extends(AssertionError2, _super);
8150
+ function AssertionError2(message) {
8151
+ var _this = _super.call(this, message) || this;
8152
+ _this.name = _this.constructor.name;
8153
+ return _this;
8154
+ }
8155
+ return AssertionError2;
8156
+ }(Error)
8157
+ );
8158
+ exports.AssertionError = AssertionError;
8159
+ var APINotSupportedError = (
8160
+ /** @class */
8161
+ function(_super) {
8162
+ __extends(APINotSupportedError2, _super);
8163
+ function APINotSupportedError2(message) {
8164
+ var _this = _super.call(this, message) || this;
8165
+ _this.name = _this.constructor.name;
8166
+ return _this;
8167
+ }
8168
+ return APINotSupportedError2;
8169
+ }(Error)
8170
+ );
8171
+ exports.APINotSupportedError = APINotSupportedError;
7115
8172
  }
7116
8173
  });
7117
8174
 
7118
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js
7119
- var require_utils = __commonJS({
7120
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js"(exports) {
8175
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/assert.js
8176
+ var require_assert3 = __commonJS({
8177
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/assert.js"(exports) {
7121
8178
  "use strict";
7122
8179
  init_define_process_env();
7123
8180
  Object.defineProperty(exports, "__esModule", { value: true });
7124
- exports.guid = exports.buildBiUrl = exports.getCookies = void 0;
7125
- var browser_1 = require_browser();
7126
- var env_1 = require_env();
7127
- var cacheKillerCounter = 0;
7128
- function getCookies(params) {
7129
- return Object.keys(params).reduce(function(res, param) {
7130
- var _a = typeof params[param] === "string" ? { name: params[param] } : params[param], name = _a.name, _b = _a.transform, transform = _b === void 0 ? function(x) {
7131
- return x;
7132
- } : _b;
7133
- var value = transform((0, browser_1.readCookie)(name));
7134
- if (value) {
7135
- res[param] = value;
7136
- }
7137
- return res;
7138
- }, {});
7139
- }
7140
- exports.getCookies = getCookies;
7141
- function buildBiUrl(_a, params, context) {
7142
- var _b = _a.host, host = _b === void 0 ? "" : _b, _c = _a.endpoint, endpoint = _c === void 0 ? "" : _c;
7143
- if (context === void 0) {
7144
- context = {};
8181
+ exports.ok = exports.object = exports.defined = void 0;
8182
+ var errors_1 = require_errors2();
8183
+ var defined = function(target, message) {
8184
+ if (target === void 0) {
8185
+ throw new errors_1.AssertionError(message);
7145
8186
  }
7146
- host = typeof host === "function" ? host() : host;
7147
- host = host || (0, env_1.getHost)();
7148
- endpoint = context.endpoint || endpoint;
7149
- if (!context.useBatch) {
7150
- params._ = "" + (/* @__PURE__ */ new Date()).getTime() + cacheKillerCounter++;
8187
+ };
8188
+ exports.defined = defined;
8189
+ var object = function(target, message) {
8190
+ if (target !== void 0 && (typeof target !== "object" || Array.isArray(target) || target === null)) {
8191
+ throw new errors_1.AssertionError(message);
7151
8192
  }
7152
- var pairs = context.useBatch ? [] : Object.keys(params).map(function(key) {
7153
- return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
7154
- }, []);
7155
- return ["//".concat(host, "/").concat(endpoint)].concat(pairs.length ? pairs.join("&") : []).join("?");
7156
- }
7157
- exports.buildBiUrl = buildBiUrl;
7158
- function guid() {
7159
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
7160
- var r = Math.random() * 16 | 0;
7161
- var v = c === "x" ? r : r & 3 | 8;
7162
- return v.toString(16);
7163
- });
7164
- }
7165
- exports.guid = guid;
8193
+ };
8194
+ exports.object = object;
8195
+ var ok = function(target, message) {
8196
+ if (!target) {
8197
+ throw new errors_1.AssertionError(message);
8198
+ }
8199
+ };
8200
+ exports.ok = ok;
7166
8201
  }
7167
8202
  });
7168
8203
 
7169
- // ../../node_modules/@wix/web-bi-logger/dist/src/types.js
7170
- var require_types = __commonJS({
7171
- "../../node_modules/@wix/web-bi-logger/dist/src/types.js"(exports) {
8204
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/types.js
8205
+ var require_types2 = __commonJS({
8206
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/types.js"(exports) {
7172
8207
  "use strict";
7173
8208
  init_define_process_env();
7174
8209
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7192,15 +8227,15 @@ var require_types = __commonJS({
7192
8227
  }
7193
8228
  });
7194
8229
 
7195
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js
7196
- var require_transport = __commonJS({
7197
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js"(exports) {
8230
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/transport.js
8231
+ var require_transport2 = __commonJS({
8232
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/transport.js"(exports) {
7198
8233
  "use strict";
7199
8234
  init_define_process_env();
7200
8235
  Object.defineProperty(exports, "__esModule", { value: true });
7201
8236
  exports.postMessageTransport = exports.xhrTransport = exports.fetchTransport = exports.pixelTransport = exports.beaconTransport = void 0;
7202
- var browser_1 = require_browser();
7203
- var errors_1 = require_errors();
8237
+ var browser_1 = require_browser2();
8238
+ var errors_1 = require_errors2();
7204
8239
  function beaconTransport(url, params, sendInBody) {
7205
8240
  if (sendInBody === void 0) {
7206
8241
  sendInBody = false;
@@ -7283,9 +8318,9 @@ var require_transport = __commonJS({
7283
8318
  }
7284
8319
  });
7285
8320
 
7286
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js
7287
- var require_publishers = __commonJS({
7288
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js"(exports) {
8321
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js
8322
+ var require_publishers2 = __commonJS({
8323
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js"(exports) {
7289
8324
  "use strict";
7290
8325
  init_define_process_env();
7291
8326
  var __assign = exports && exports.__assign || function() {
@@ -7312,11 +8347,11 @@ var require_publishers = __commonJS({
7312
8347
  };
7313
8348
  Object.defineProperty(exports, "__esModule", { value: true });
7314
8349
  exports.getTransformers = exports.getPublisher = exports.postMessagePublisher = exports.xhrPublisher = exports.fetchPublisher = exports.beaconPublisher = exports.imagePublisher = exports.resolvePublisher = void 0;
7315
- var utils_1 = require_utils();
7316
- var env_1 = require_env();
7317
- var errors_1 = require_errors();
7318
- var types_1 = require_types();
7319
- var transport_1 = require_transport();
8350
+ var utils_1 = require_utils2();
8351
+ var env_1 = require_env2();
8352
+ var errors_1 = require_errors2();
8353
+ var types_1 = require_types2();
8354
+ var transport_1 = require_transport2();
7320
8355
  var getHttpMethod = function(context) {
7321
8356
  return context.useBatch ? "POST" : "GET";
7322
8357
  };
@@ -7443,15 +8478,15 @@ var require_publishers = __commonJS({
7443
8478
  }
7444
8479
  });
7445
8480
 
7446
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js
7447
- var require_common_config = __commonJS({
7448
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js"(exports) {
8481
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js
8482
+ var require_common_config2 = __commonJS({
8483
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js"(exports) {
7449
8484
  "use strict";
7450
8485
  init_define_process_env();
7451
8486
  Object.defineProperty(exports, "__esModule", { value: true });
7452
8487
  exports.getWixHost = exports.getBranchId = exports.getBrand = exports.getCommonConfigValue = void 0;
7453
- var env_1 = require_env();
7454
- var constants_1 = require_constants();
8488
+ var env_1 = require_env2();
8489
+ var constants_1 = require_constants2();
7455
8490
  var resolveCommonConfig = function() {
7456
8491
  return (0, env_1.getGlobal)(function(g) {
7457
8492
  return g.Wix && g.Wix.Utils && g.Wix.Utils.commonConfig || g.commonConfig;
@@ -7483,17 +8518,17 @@ var require_common_config = __commonJS({
7483
8518
  }
7484
8519
  });
7485
8520
 
7486
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js
7487
- var require_event_defaults = __commonJS({
7488
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js"(exports) {
8521
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js
8522
+ var require_event_defaults2 = __commonJS({
8523
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js"(exports) {
7489
8524
  "use strict";
7490
8525
  init_define_process_env();
7491
8526
  Object.defineProperty(exports, "__esModule", { value: true });
7492
8527
  exports.getCommonDefaults = exports.getUserDefaults = exports.transformDefaults = void 0;
7493
- var constants_1 = require_constants();
7494
- var browser_1 = require_browser();
7495
- var common_config_1 = require_common_config();
7496
- var utils_1 = require_utils();
8528
+ var constants_1 = require_constants2();
8529
+ var browser_1 = require_browser2();
8530
+ var common_config_1 = require_common_config2();
8531
+ var utils_1 = require_utils2();
7497
8532
  var transformDefaults = function(context) {
7498
8533
  return Object.keys(context).reduce(function(res, key) {
7499
8534
  var mappedKey = constants_1.EventContextMap[key] || key;
@@ -7541,9 +8576,9 @@ var require_event_defaults = __commonJS({
7541
8576
  }
7542
8577
  });
7543
8578
 
7544
- // ../../node_modules/@wix/web-bi-logger/dist/src/logger.js
7545
- var require_logger = __commonJS({
7546
- "../../node_modules/@wix/web-bi-logger/dist/src/logger.js"(exports) {
8579
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/logger.js
8580
+ var require_logger2 = __commonJS({
8581
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/logger.js"(exports) {
7547
8582
  "use strict";
7548
8583
  init_define_process_env();
7549
8584
  var __assign = exports && exports.__assign || function() {
@@ -7588,20 +8623,20 @@ var require_logger = __commonJS({
7588
8623
  exports.BiLoggerClientFactory = exports.createBatchQueue = exports.manager = exports.factory = exports.Factory = exports.setHost = exports.EventCategories = exports.PublishMethods = void 0;
7589
8624
  var wix_bi_logger_client_1 = require_dist();
7590
8625
  var consent_policy_client_accessor_1 = (init_src(), __toCommonJS(src_exports));
7591
- var assert2 = __importStar(require_assert2());
7592
- var publishers_1 = require_publishers();
7593
- var common_config_1 = require_common_config();
7594
- var env_1 = require_env();
7595
- var types_1 = require_types();
7596
- var event_defaults_1 = require_event_defaults();
7597
- var types_2 = require_types();
8626
+ var assert2 = __importStar(require_assert3());
8627
+ var publishers_1 = require_publishers2();
8628
+ var common_config_1 = require_common_config2();
8629
+ var env_1 = require_env2();
8630
+ var types_1 = require_types2();
8631
+ var event_defaults_1 = require_event_defaults2();
8632
+ var types_2 = require_types2();
7598
8633
  Object.defineProperty(exports, "PublishMethods", { enumerable: true, get: function() {
7599
8634
  return types_2.PublishMethods;
7600
8635
  } });
7601
8636
  Object.defineProperty(exports, "EventCategories", { enumerable: true, get: function() {
7602
8637
  return types_2.EventCategories;
7603
8638
  } });
7604
- var env_2 = require_env();
8639
+ var env_2 = require_env2();
7605
8640
  Object.defineProperty(exports, "setHost", { enumerable: true, get: function() {
7606
8641
  return env_2.setHost;
7607
8642
  } });
@@ -7726,121 +8761,9 @@ var require_logger = __commonJS({
7726
8761
  }
7727
8762
  });
7728
8763
 
7729
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js
7730
- var require_navigator = __commonJS({
7731
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js"(exports) {
7732
- "use strict";
7733
- init_define_process_env();
7734
- Object.defineProperty(exports, "__esModule", { value: true });
7735
- exports.listen = void 0;
7736
- var env_1 = require_env();
7737
- function hook(obj, fnName, cbHook) {
7738
- if (!obj || !obj[fnName]) {
7739
- return;
7740
- }
7741
- var original = obj[fnName];
7742
- obj[fnName] = function() {
7743
- cbHook.apply(null, arguments);
7744
- return original.apply(obj, arguments);
7745
- };
7746
- }
7747
- function onLoad(cb) {
7748
- setTimeout(function() {
7749
- return (0, env_1.getWindowIfTop)(function(window2) {
7750
- return cb(window2.location.href);
7751
- });
7752
- });
7753
- }
7754
- function onPushState(cb) {
7755
- (0, env_1.getWindowIfTop)(function(_a) {
7756
- var history = _a.history;
7757
- return ["pushState", "replaceState"].forEach(function(fnName) {
7758
- hook(history, fnName, function(_, __, url) {
7759
- return cb(url);
7760
- });
7761
- });
7762
- });
7763
- }
7764
- function onPopState(cb) {
7765
- (0, env_1.getWindowIfTop)(function(window2) {
7766
- return window2.addEventListener("popstate", function() {
7767
- return cb(window2.location.href);
7768
- });
7769
- });
7770
- }
7771
- function listen(cb) {
7772
- (0, env_1.getWindowIfTop)(function(window2) {
7773
- var fromUrl = window2.document.referrer;
7774
- [onLoad, onPushState, onPopState].forEach(function(event) {
7775
- return event(function(toUrl) {
7776
- cb(fromUrl, toUrl);
7777
- fromUrl = toUrl;
7778
- });
7779
- });
7780
- });
7781
- }
7782
- exports.listen = listen;
7783
- }
7784
- });
7785
-
7786
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js
7787
- var require_tracker = __commonJS({
7788
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js"(exports) {
7789
- "use strict";
7790
- init_define_process_env();
7791
- Object.defineProperty(exports, "__esModule", { value: true });
7792
- exports.track = void 0;
7793
- var utils_1 = require_utils();
7794
- var navigator_1 = require_navigator();
7795
- var env_1 = require_env();
7796
- var browser_1 = require_browser();
7797
- var IS_TRACKING = "__isTrackingPageViews__";
7798
- var ENDPOINT = "p";
7799
- var SOURCE = 19;
7800
- var EVID = 3;
7801
- function shouldTrack(force) {
7802
- return force || !(0, env_1.isWebWorker)() && (0, env_1.isBackoffice)() && (0, env_1.getWindowIfTop)(function(window2) {
7803
- return !window2[IS_TRACKING];
7804
- });
7805
- }
7806
- function setIsTracking() {
7807
- return (0, env_1.getWindowIfTop)(function(window2) {
7808
- return window2[IS_TRACKING] = true;
7809
- });
7810
- }
7811
- function getLogger(loggerFactory) {
7812
- return loggerFactory({ endpoint: ENDPOINT }).updateDefaults({ src: SOURCE, evid: EVID, vsi: (0, utils_1.guid)() }).logger();
7813
- }
7814
- function trackBrowsingSession(loggerFactory) {
7815
- var logger = getLogger(loggerFactory);
7816
- var firstInSession = 1;
7817
- (0, navigator_1.listen)(function(fromUrl, toUrl) {
7818
- var _a = (0, env_1.getWindowIfTop)(function(window2) {
7819
- return {
7820
- sr: (0, browser_1.getDesktopSize)(window2),
7821
- wr: (0, browser_1.getWindowSize)(window2)
7822
- };
7823
- }), sr = _a.sr, wr = _a.wr;
7824
- logger.log({ from: fromUrl, to: toUrl, fis: firstInSession, sr, wr });
7825
- firstInSession = 0;
7826
- });
7827
- }
7828
- function track(loggerFactory, options) {
7829
- if (options === void 0) {
7830
- options = { force: false };
7831
- }
7832
- if (shouldTrack(options.force)) {
7833
- setIsTracking();
7834
- trackBrowsingSession(loggerFactory);
7835
- }
7836
- }
7837
- exports.track = track;
7838
- }
7839
- });
7840
-
7841
- // ../../node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js
8764
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js
7842
8765
  var require_tracking_logger = __commonJS({
7843
- "../../node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js"(exports) {
8766
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js"(exports) {
7844
8767
  "use strict";
7845
8768
  init_define_process_env();
7846
8769
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
@@ -7874,7 +8797,7 @@ var require_tracking_logger = __commonJS({
7874
8797
  exports.BiLoggerClientFactory = exports.EventCategories = exports.createBatchQueue = exports.manager = exports.setHost = exports.factory = void 0;
7875
8798
  var wix_bi_logger_client_1 = require_dist();
7876
8799
  var tracker = __importStar(require_tracker());
7877
- var logger = __importStar(require_logger());
8800
+ var logger = __importStar(require_logger2());
7878
8801
  var factory2 = function(options) {
7879
8802
  if (options === void 0) {
7880
8803
  options = {};
@@ -8181,6 +9104,9 @@ init_define_process_env();
8181
9104
  init_define_process_env();
8182
9105
  var import_base_64 = __toESM(require_base64());
8183
9106
 
9107
+ // ../../node_modules/@wix/headers/dist/esm/headers/currency.js
9108
+ init_define_process_env();
9109
+
8184
9110
  // ../../node_modules/@wix/headers/dist/esm/assert.js
8185
9111
  init_define_process_env();
8186
9112
 
@@ -8934,7 +9860,8 @@ var ReadOnlyExperiments = (
8934
9860
  return this.experiments[key];
8935
9861
  };
8936
9862
  ReadOnlyExperiments2.prototype.enabled = function(key) {
8937
- return this.get(key) === "true";
9863
+ var value = this.experiments[key];
9864
+ return value === "true" || value === true || value === "B";
8938
9865
  };
8939
9866
  ReadOnlyExperiments2.prototype.pending = function() {
8940
9867
  return false;
@@ -11582,7 +12509,7 @@ var translationsImportsMap = {
11582
12509
  ))),
11583
12510
  hi: () => Promise.resolve().then(() => __toESM(__require(
11584
12511
  /* webpackChunkName: "common-errors_hi-json" */
11585
- "./common-errors_hi-X2D2EJ6Z.mjs"
12512
+ "./common-errors_hi-EY6JYIPV.mjs"
11586
12513
  ))),
11587
12514
  hr: () => Promise.resolve().then(() => __toESM(__require(
11588
12515
  /* webpackChunkName: "common-errors_hr-json" */
@@ -11602,7 +12529,7 @@ var translationsImportsMap = {
11602
12529
  ))),
11603
12530
  ja: () => Promise.resolve().then(() => __toESM(__require(
11604
12531
  /* webpackChunkName: "common-errors_ja-json" */
11605
- "./common-errors_ja-73RRUZ7T.mjs"
12532
+ "./common-errors_ja-J6VU7MQY.mjs"
11606
12533
  ))),
11607
12534
  ko: () => Promise.resolve().then(() => __toESM(__require(
11608
12535
  /* webpackChunkName: "common-errors_ko-json" */
@@ -11670,7 +12597,7 @@ var translationsImportsMap = {
11670
12597
  ))),
11671
12598
  uk: () => Promise.resolve().then(() => __toESM(__require(
11672
12599
  /* webpackChunkName: "common-errors_uk-json" */
11673
- "./common-errors_uk-5VEGIENP.mjs"
12600
+ "./common-errors_uk-T2LUNSSB.mjs"
11674
12601
  ))),
11675
12602
  vi: () => Promise.resolve().then(() => __toESM(__require(
11676
12603
  /* webpackChunkName: "common-errors_vi-json" */
@@ -11770,10 +12697,9 @@ init_define_process_env();
11770
12697
  // ../../node_modules/@wix/error-handler/node_modules/uuid/dist/esm-browser/stringify.js
11771
12698
  init_define_process_env();
11772
12699
  var byteToHex = [];
11773
- for (i = 0; i < 256; ++i) {
12700
+ for (let i = 0; i < 256; ++i) {
11774
12701
  byteToHex.push((i + 256).toString(16).slice(1));
11775
12702
  }
11776
- var i;
11777
12703
  function unsafeStringify(arr2, offset = 0) {
11778
12704
  return (byteToHex[arr2[offset + 0]] + byteToHex[arr2[offset + 1]] + byteToHex[arr2[offset + 2]] + byteToHex[arr2[offset + 3]] + "-" + byteToHex[arr2[offset + 4]] + byteToHex[arr2[offset + 5]] + "-" + byteToHex[arr2[offset + 6]] + byteToHex[arr2[offset + 7]] + "-" + byteToHex[arr2[offset + 8]] + byteToHex[arr2[offset + 9]] + "-" + byteToHex[arr2[offset + 10]] + byteToHex[arr2[offset + 11]] + byteToHex[arr2[offset + 12]] + byteToHex[arr2[offset + 13]] + byteToHex[arr2[offset + 14]] + byteToHex[arr2[offset + 15]]).toLowerCase();
11779
12705
  }
@@ -11784,10 +12710,10 @@ var getRandomValues;
11784
12710
  var rnds8 = new Uint8Array(16);
11785
12711
  function rng() {
11786
12712
  if (!getRandomValues) {
11787
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
11788
- if (!getRandomValues) {
12713
+ if (typeof crypto === "undefined" || !crypto.getRandomValues) {
11789
12714
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
11790
12715
  }
12716
+ getRandomValues = crypto.getRandomValues.bind(crypto);
11791
12717
  }
11792
12718
  return getRandomValues(rnds8);
11793
12719
  }
@@ -11798,22 +12724,27 @@ init_define_process_env();
11798
12724
  // ../../node_modules/@wix/error-handler/node_modules/uuid/dist/esm-browser/native.js
11799
12725
  init_define_process_env();
11800
12726
  var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
11801
- var native_default = {
11802
- randomUUID
11803
- };
12727
+ var native_default = { randomUUID };
11804
12728
 
11805
12729
  // ../../node_modules/@wix/error-handler/node_modules/uuid/dist/esm-browser/v4.js
11806
12730
  function v4(options, buf, offset) {
12731
+ var _a, _b, _c;
11807
12732
  if (native_default.randomUUID && !buf && !options) {
11808
12733
  return native_default.randomUUID();
11809
12734
  }
11810
12735
  options = options || {};
11811
- var rnds = options.random || (options.rng || rng)();
12736
+ const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
12737
+ if (rnds.length < 16) {
12738
+ throw new Error("Random bytes length must be >= 16");
12739
+ }
11812
12740
  rnds[6] = rnds[6] & 15 | 64;
11813
12741
  rnds[8] = rnds[8] & 63 | 128;
11814
12742
  if (buf) {
11815
12743
  offset = offset || 0;
11816
- for (var i = 0; i < 16; ++i) {
12744
+ if (offset < 0 || offset + 16 > buf.length) {
12745
+ throw new RangeError("UUID byte range ".concat(offset, ":").concat(offset + 15, " is out of buffer bounds"));
12746
+ }
12747
+ for (let i = 0; i < 16; ++i) {
11817
12748
  buf[offset + i] = rnds[i];
11818
12749
  }
11819
12750
  return buf;