@pendo/agent 2.323.1 → 2.324.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.
@@ -3967,8 +3967,8 @@ let SERVER = '';
3967
3967
  let ASSET_HOST = '';
3968
3968
  let ASSET_PATH = '';
3969
3969
  let DESIGNER_SERVER = '';
3970
- let VERSION = '2.323.1_';
3971
- let PACKAGE_VERSION = '2.323.1';
3970
+ let VERSION = '2.324.0_';
3971
+ let PACKAGE_VERSION = '2.324.0';
3972
3972
  let LOADER = 'xhr';
3973
3973
  /* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
3974
3974
  /**
@@ -12939,6 +12939,13 @@ function filterAnalyticsDisabled(silo, next) {
12939
12939
  return;
12940
12940
  next(silo);
12941
12941
  }
12942
+ function filterBrokenTimestamps(silo, next) {
12943
+ if (!_.isNumber(silo.browser_time) || isNaN(silo.browser_time)) {
12944
+ log.critical(new Error('Event missing browser_time'));
12945
+ return;
12946
+ }
12947
+ next(silo);
12948
+ }
12942
12949
  function fireEventCaptured(silo, next) {
12943
12950
  var captureEvent = Events.eventCaptured.trigger(silo);
12944
12951
  if (captureEvent.cancel) {
@@ -13287,7 +13294,7 @@ class EventQueue {
13287
13294
  }
13288
13295
  function createEventQueue(options) {
13289
13296
  const processSilos = createSiloQueue(options);
13290
- const packageSilos = pipeline(filterNonGuideAnalytics(options.beacon), filterAnalyticsByType, eventSequence, siloReducer(options.cache), filterSiloCapacity({
13297
+ const packageSilos = pipeline(filterBrokenTimestamps, filterNonGuideAnalytics(options.beacon), filterAnalyticsByType, eventSequence, siloReducer(options.cache), filterSiloCapacity({
13291
13298
  overhead: jwtSizeOverhead,
13292
13299
  lower: ConfigReader.get('sendEventsWithPostOnly') ? ENCODED_EVENT_MAX_POST_LENGTH : ENCODED_EVENT_MAX_LENGTH,
13293
13300
  upper: ENCODED_EVENT_MAX_POST_LENGTH,
@@ -18905,7 +18912,7 @@ var BuildingBlockResourceCenter = (function () {
18905
18912
  integrationIframe.css({ display: 'none' });
18906
18913
  }
18907
18914
  function getSupportedNativeIntegrations() {
18908
- return ['drift-native-chat', 'intercom-chat', 'zendesk-chat', 'zendesk-native-kb', 'zendesk-messaging'];
18915
+ return ['drift-native-chat', 'intercom-chat', 'zendesk-chat', 'zendesk-native-kb', 'zendesk-messaging', 'visitorAssist'];
18909
18916
  }
18910
18917
  function isSupportedNativeIntegration(provider) {
18911
18918
  if (!provider)
@@ -18932,6 +18939,8 @@ var BuildingBlockResourceCenter = (function () {
18932
18939
  return 'Intercom';
18933
18940
  case 'drift-native-chat':
18934
18941
  return 'drift';
18942
+ case 'visitorAssist':
18943
+ return 'visitorAssist';
18935
18944
  default:
18936
18945
  return null;
18937
18946
  }
@@ -19029,6 +19038,9 @@ var BuildingBlockResourceCenter = (function () {
19029
19038
  break;
19030
19039
  case 'drift-native-chat':
19031
19040
  configureDriftChatSettings();
19041
+ break;
19042
+ case 'visitorAssist':
19043
+ configureVisitorAssistChatSettings();
19032
19044
  }
19033
19045
  }
19034
19046
  function webWidgetWrapper(provider, ...webWidgetArgs) {
@@ -19134,6 +19146,11 @@ var BuildingBlockResourceCenter = (function () {
19134
19146
  endNativeChatExperience();
19135
19147
  });
19136
19148
  }
19149
+ function configureVisitorAssistChatSettings() {
19150
+ window.visitorAssist.onClose(function () {
19151
+ endNativeChatExperience();
19152
+ });
19153
+ }
19137
19154
  function flattenMetadata(metadata) {
19138
19155
  const flatMetadata = {};
19139
19156
  for (const key in metadata) {
@@ -19243,6 +19260,9 @@ var BuildingBlockResourceCenter = (function () {
19243
19260
  });
19244
19261
  }
19245
19262
  break;
19263
+ case 'visitorAssist':
19264
+ window.visitorAssist.launch();
19265
+ break;
19246
19266
  }
19247
19267
  // reset chat notification count
19248
19268
  updateNotificationBubbleCount(0, 'chat');
@@ -23828,32 +23848,11 @@ const captureStepRenderStatus = (step, eligible, reason) => {
23828
23848
  Events.stepEligibility.trigger({ stepId: id, guideId, eligible, reason });
23829
23849
  return eligible;
23830
23850
  };
23831
- function isHtmlTooltipStep(step) {
23832
- if (_.get(step, 'attributes.buildingBlockLayoutType') !== 'tooltip')
23833
- return false;
23834
- return Boolean(_.get(step, 'attributes.htmlContent') || step.htmlContent || step.htmlContentUrl);
23835
- }
23836
- function getHtmlTooltipSelector(step) {
23837
- return step.elementPathRule || _.get(step, 'attributes.elementPathRule');
23838
- }
23839
23851
  var canStepBeRendered = function (step) {
23840
23852
  const statusWriter = _.partial(captureStepRenderStatus, step);
23841
23853
  if (isDismissedUntilReload(step)) {
23842
23854
  return statusWriter(false, 'dismissed');
23843
23855
  }
23844
- // HTML guide tooltips don't set step.type === 'tooltip' (they keep the
23845
- // guide-level type, typically 'lightbox') and don't have step.domJson, so
23846
- // the standard tooltip detection below misses them. Without filtering here,
23847
- // an HTML tooltip with a missing or invisible anchor sails through eligibility
23848
- // and silently falls back to a lightbox layout at render time.
23849
- if (isHtmlTooltipStep(step)) {
23850
- var htmlSelector = getHtmlTooltipSelector(step);
23851
- var htmlAnchor = htmlSelector ? SizzleProxy(htmlSelector)[0] : null;
23852
- if (isElementVisible(htmlAnchor)) {
23853
- return statusWriter(true, 'target_element_html_tooltip');
23854
- }
23855
- return statusWriter(wouldBeVisibleAfterAutoScroll(htmlAnchor), 'target_element_html_tooltip_scroll');
23856
- }
23857
23856
  if (!step.elementPathRule && (step.type === 'lightbox' || step.type === 'whatsnew')) {
23858
23857
  return statusWriter(true, '');
23859
23858
  }
@@ -24759,7 +24758,7 @@ var getGuideEventCache = function () {
24759
24758
  };
24760
24759
  function createGuideEventQueue(options) {
24761
24760
  const processSilos = pipeline(filterAnalyticsDisabled, splitSiloOnFieldChange('visitor_id'), splitSiloOnFieldChange('props.source'), filterAccountIdsForSendQueue, compressSilo, errorLogger(), addSiloParams(options), addAccountIdParamIfAdoptPartner, addSourceParamIfPresent, convertSiloToObject);
24762
- const packageSilos = pipeline(fireEventCaptured, eventSequence, siloReducer(options.cache), _.noop // do not move to the silo queue until manual flush
24761
+ const packageSilos = pipeline(filterBrokenTimestamps, fireEventCaptured, eventSequence, siloReducer(options.cache), _.noop // do not move to the silo queue until manual flush
24763
24762
  );
24764
24763
  return new EventQueue(_.extend({ processSilos, packageSilos }, options));
24765
24764
  }
@@ -28443,7 +28442,8 @@ const PluginAPI = {
28443
28442
  },
28444
28443
  guides: {
28445
28444
  GuideFactory,
28446
- GuideStepFactory
28445
+ GuideStepFactory,
28446
+ getElementForGuideStep
28447
28447
  },
28448
28448
  hosts: {
28449
28449
  SERVER
@@ -40846,17 +40846,19 @@ function TextCapture() {
40846
40846
  }
40847
40847
  }
40848
40848
 
40849
- const substitutionRegex = '\\{(?:\\s?)([^.\\s]?visitor|account|parentAccount)\\.([^|\\s/]*)(?:\\s?\\|\\s?([^}]+|[\\/s]+))?(?:\\s?\\/\\s?){1}\\}';
40850
- const skipStepString = '{skipStep:* *(auto|\\d+)\\/}';
40851
- const goToMiddleString = '(?!0)(\\d+)';
40852
- const goToString = `({goto-${goToMiddleString}\\/})`;
40853
- const containerSelector = '[id^="pendo-guide-container"]';
40854
- function lookupGuideButtons(domJson, buttons = []) {
40849
+ var substitutionRegex = '\\{(?:\\s?)([^.\\s]?visitor|account|parentAccount)\\.([^|\\s/]*)(?:\\s?\\|\\s?([^}]+|[\\/s]+))?(?:\\s?\\/\\s?){1}\\}';
40850
+ var skipStepString = '{skipStep:* *(auto|\\d+)\\/}';
40851
+ var goToMiddleString = '(?!0)(\\d+)';
40852
+ var goToString = "({goto-".concat(goToMiddleString, "\\/})");
40853
+ var containerSelector = '[id^="pendo-guide-container"]';
40854
+ function lookupGuideButtons(domJson, buttons) {
40855
+ if (buttons === void 0) { buttons = []; }
40855
40856
  if (domJson.type === 'button' && domJson.actions) {
40856
40857
  buttons.push(domJson);
40857
40858
  }
40858
40859
  if (domJson.children) {
40859
- for (const child of domJson.children) {
40860
+ for (var _i = 0, _a = domJson.children; _i < _a.length; _i++) {
40861
+ var child = _a[_i];
40860
40862
  lookupGuideButtons(child, buttons);
40861
40863
  }
40862
40864
  }
@@ -40885,15 +40887,16 @@ function removeMarkdownSyntax(element, textToReplace, replacementText, pendo) {
40885
40887
  }
40886
40888
  }
40887
40889
  var guideMarkdownUtil = {
40888
- substitutionRegex,
40889
- skipStepString,
40890
- goToString,
40891
- containerSelector,
40892
- lookupGuideButtons,
40893
- removeMarkdownSyntax
40890
+ substitutionRegex: substitutionRegex,
40891
+ skipStepString: skipStepString,
40892
+ goToString: goToString,
40893
+ containerSelector: containerSelector,
40894
+ lookupGuideButtons: lookupGuideButtons,
40895
+ removeMarkdownSyntax: removeMarkdownSyntax
40894
40896
  };
40895
40897
 
40896
- function getZoneSafeMethod(_, method, target = window) {
40898
+ function getZoneSafeMethod(_, method, target) {
40899
+ if (target === void 0) { target = window; }
40897
40900
  var zoneSymbol = '__symbol__';
40898
40901
  /* global Zone */
40899
40902
  if (typeof Zone !== 'undefined' && _.isFunction(Zone[zoneSymbol])) {
@@ -48942,31 +48945,32 @@ var n;
48942
48945
  }(n || (n = {}));
48943
48946
  return record; }
48944
48947
 
48945
- class SessionRecorderBuffer {
48946
- constructor(interval, maxCount = Infinity) {
48948
+ var SessionRecorderBuffer = /** @class */ (function () {
48949
+ function SessionRecorderBuffer(interval, maxCount) {
48950
+ if (maxCount === void 0) { maxCount = Infinity; }
48947
48951
  this.data = [];
48948
48952
  this.sequenceNumber = 0;
48949
48953
  this.interval = interval;
48950
48954
  this.maxCount = maxCount;
48951
48955
  this.doubledMaxCount = maxCount * 2;
48952
48956
  }
48953
- isEmpty() {
48957
+ SessionRecorderBuffer.prototype.isEmpty = function () {
48954
48958
  return this.data.length === 0;
48955
- }
48956
- count() {
48959
+ };
48960
+ SessionRecorderBuffer.prototype.count = function () {
48957
48961
  return this.data.length;
48958
- }
48959
- clear() {
48962
+ };
48963
+ SessionRecorderBuffer.prototype.clear = function () {
48960
48964
  this.data.length = 0;
48961
- }
48962
- clearSequence() {
48965
+ };
48966
+ SessionRecorderBuffer.prototype.clearSequence = function () {
48963
48967
  this.sequenceNumber = 0;
48964
- }
48965
- push(event) {
48968
+ };
48969
+ SessionRecorderBuffer.prototype.push = function (event) {
48966
48970
  this.data.push(event);
48967
48971
  this.checkRateLimit();
48968
- }
48969
- pack(envelope, _) {
48972
+ };
48973
+ SessionRecorderBuffer.prototype.pack = function (envelope, _) {
48970
48974
  var eventsToSend = this.data.splice(0, this.maxCount);
48971
48975
  envelope.recordingPayload = eventsToSend;
48972
48976
  envelope.sequence = this.sequenceNumber;
@@ -48974,8 +48978,8 @@ class SessionRecorderBuffer {
48974
48978
  if (eventsToSend.length) {
48975
48979
  envelope.browserTime = eventsToSend[0].timestamp;
48976
48980
  }
48977
- envelope.recordingPayloadMetadata = _.map(eventsToSend, event => {
48978
- const metadata = _.pick(event, 'type', 'timestamp');
48981
+ envelope.recordingPayloadMetadata = _.map(eventsToSend, function (event) {
48982
+ var metadata = _.pick(event, 'type', 'timestamp');
48979
48983
  if (event.data) {
48980
48984
  metadata.data = _.pick(event.data, 'source', 'type', 'x', 'y', 'id', 'height', 'width', 'href');
48981
48985
  }
@@ -48983,17 +48987,18 @@ class SessionRecorderBuffer {
48983
48987
  });
48984
48988
  this.sequenceNumber += eventsToSend.length;
48985
48989
  return envelope;
48986
- }
48987
- checkRateLimit() {
48988
- const length = this.data.length;
48990
+ };
48991
+ SessionRecorderBuffer.prototype.checkRateLimit = function () {
48992
+ var length = this.data.length;
48989
48993
  if (length >= this.doubledMaxCount && length % this.maxCount === 0) {
48990
- const elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
48994
+ var elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
48991
48995
  if (elapsed <= this.interval && this.onRateLimit) {
48992
48996
  this.onRateLimit();
48993
48997
  }
48994
48998
  }
48995
- }
48996
- }
48999
+ };
49000
+ return SessionRecorderBuffer;
49001
+ }());
48997
49002
 
48998
49003
  function __rest(s, e) {
48999
49004
  var t = {};
@@ -49017,24 +49022,52 @@ function __awaiter(thisArg, _arguments, P, generator) {
49017
49022
  });
49018
49023
  }
49019
49024
 
49025
+ function __generator(thisArg, body) {
49026
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
49027
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
49028
+ function verb(n) { return function (v) { return step([n, v]); }; }
49029
+ function step(op) {
49030
+ if (f) throw new TypeError("Generator is already executing.");
49031
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
49032
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
49033
+ if (y = 0, t) op = [op[0] & 2, t.value];
49034
+ switch (op[0]) {
49035
+ case 0: case 1: t = op; break;
49036
+ case 4: _.label++; return { value: op[1], done: false };
49037
+ case 5: _.label++; y = op[1]; op = [0]; continue;
49038
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
49039
+ default:
49040
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
49041
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49042
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
49043
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49044
+ if (t[2]) _.ops.pop();
49045
+ _.trys.pop(); continue;
49046
+ }
49047
+ op = body.call(thisArg, _);
49048
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49049
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
49050
+ }
49051
+ }
49052
+
49020
49053
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
49021
49054
  var e = new Error(message);
49022
49055
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49023
49056
  };
49024
49057
 
49025
- const RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
49026
- const MAX_SIZE = 2000000;
49027
- const RESOURCE_CACHING$1 = 'resourceCaching';
49028
- class Transport {
49029
- constructor(WorkerClass, pendo, api) {
49058
+ var RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
49059
+ var MAX_SIZE = 2000000;
49060
+ var RESOURCE_CACHING$1 = 'resourceCaching';
49061
+ var Transport = /** @class */ (function () {
49062
+ function Transport(WorkerClass, pendo, api) {
49030
49063
  this.WorkerClass = WorkerClass;
49031
49064
  this.pendo = pendo;
49032
49065
  this.api = api;
49033
49066
  this.maxSize = MAX_SIZE;
49034
- this.lockID = `worker-lock-${this.pendo.randomString(16)}`;
49067
+ this.lockID = "worker-lock-".concat(this.pendo.randomString(16));
49035
49068
  this.isResourceCachingEnabled = this.api.ConfigReader.get(RESOURCE_CACHING$1);
49036
49069
  }
49037
- start(config) {
49070
+ Transport.prototype.start = function (config) {
49038
49071
  if (config.disableWorker)
49039
49072
  return;
49040
49073
  if (!this.worker) {
@@ -49044,7 +49077,7 @@ class Transport {
49044
49077
  this.worker = config.workerOverride;
49045
49078
  }
49046
49079
  else {
49047
- const workerUrl = this.api.ConfigReader.get(RECORDING_CONFIG_WORKERURL$1);
49080
+ var workerUrl = this.api.ConfigReader.get(RECORDING_CONFIG_WORKERURL$1);
49048
49081
  this.usesSelfHostedWorker = workerUrl != null;
49049
49082
  this.worker = workerUrl ? new Worker(workerUrl) : new this.WorkerClass();
49050
49083
  }
@@ -49058,34 +49091,35 @@ class Transport {
49058
49091
  this.worker = null;
49059
49092
  }
49060
49093
  }
49061
- }
49062
- stop() {
49094
+ };
49095
+ Transport.prototype.stop = function () {
49063
49096
  if (this.worker) {
49064
49097
  this.worker.terminate();
49065
49098
  delete this.worker;
49066
49099
  }
49067
- }
49068
- send(envelope, isUnload, failureCount = 0) {
49069
- let { url } = envelope;
49070
- const { payload } = envelope;
49100
+ };
49101
+ Transport.prototype.send = function (envelope, isUnload, failureCount) {
49102
+ if (failureCount === void 0) { failureCount = 0; }
49103
+ var url = envelope.url;
49104
+ var payload = envelope.payload;
49071
49105
  if (failureCount > 0) {
49072
- url = `${url}&rt=${failureCount}`;
49106
+ url = "".concat(url, "&rt=").concat(failureCount);
49073
49107
  }
49074
49108
  if (this.worker && !isUnload && payload) {
49075
- const deferred = {};
49076
- deferred.promise = new Promise$2((resolve, reject) => {
49077
- deferred.resolve = resolve;
49078
- deferred.reject = reject;
49109
+ var deferred_1 = {};
49110
+ deferred_1.promise = new Promise$2(function (resolve, reject) {
49111
+ deferred_1.resolve = resolve;
49112
+ deferred_1.reject = reject;
49079
49113
  });
49080
- this.workerResponse = deferred;
49081
- this.worker.postMessage({ url, payload, shouldCacheResources: this.isResourceCachingEnabled });
49082
- return deferred.promise;
49114
+ this.workerResponse = deferred_1;
49115
+ this.worker.postMessage({ url: url, payload: payload, shouldCacheResources: this.isResourceCachingEnabled });
49116
+ return deferred_1.promise;
49083
49117
  }
49084
49118
  else {
49085
49119
  if (!envelope.body) {
49086
- const strPayload = JSON.stringify(payload);
49120
+ var strPayload = JSON.stringify(payload);
49087
49121
  if (strPayload.length > this.maxSize) {
49088
- const error = new Error('maximum recording payload size exceeded');
49122
+ var error = new Error('maximum recording payload size exceeded');
49089
49123
  error.reason = 'HEAVY_EVENT';
49090
49124
  error.context = {
49091
49125
  size: strPayload.length,
@@ -49096,14 +49130,14 @@ class Transport {
49096
49130
  envelope.body = this.pendo.compress(strPayload, 'binary');
49097
49131
  delete envelope.payload;
49098
49132
  }
49099
- url = `${url}&ct=${new Date().getTime()}`;
49133
+ url = "".concat(url, "&ct=").concat(new Date().getTime());
49100
49134
  return this.post(url, {
49101
49135
  keepalive: isUnload,
49102
49136
  body: envelope.body
49103
49137
  });
49104
49138
  }
49105
- }
49106
- post(url, options) {
49139
+ };
49140
+ Transport.prototype.post = function (url, options) {
49107
49141
  options.method = 'POST';
49108
49142
  if (options.keepalive && this.api.transmit.fetchKeepalive.supported()) {
49109
49143
  return this.api.transmit.fetchKeepalive(url, options);
@@ -49115,46 +49149,57 @@ class Transport {
49115
49149
  else {
49116
49150
  return this.pendo.ajax.post(url, options.body);
49117
49151
  }
49118
- }
49119
- _onMessage(messageEvent) {
49120
- return __awaiter(this, void 0, void 0, function* () {
49121
- if (messageEvent.data && messageEvent.data.ready && navigator.locks) {
49122
- // When the lock is released, we can assume the worker was terminated or closed
49123
- yield navigator.locks.request(this.lockID, () => { });
49124
- this.onWorkerMessage({ type: 'workerDied' });
49125
- }
49126
- // handle non-POST request responses from worker
49127
- if (messageEvent.data && messageEvent.data.type) {
49128
- this.onWorkerMessage(messageEvent.data);
49129
- return;
49130
- }
49131
- // handle POST request response from worker
49132
- if (messageEvent.data && messageEvent.data.error) {
49133
- if ((messageEvent.data.status && messageEvent.data.status < 500) ||
49134
- messageEvent.data.sequence == null) {
49135
- this.api.log.critical('Failed to send recording data from web worker', { error: messageEvent.data.error });
49136
- }
49137
- if (this.workerResponse) {
49138
- this.workerResponse.reject();
49139
- this.workerResponse = null;
49152
+ };
49153
+ Transport.prototype._onMessage = function (messageEvent) {
49154
+ return __awaiter(this, void 0, void 0, function () {
49155
+ return __generator(this, function (_a) {
49156
+ switch (_a.label) {
49157
+ case 0:
49158
+ if (!(messageEvent.data && messageEvent.data.ready && navigator.locks)) return [3 /*break*/, 2];
49159
+ // When the lock is released, we can assume the worker was terminated or closed
49160
+ return [4 /*yield*/, navigator.locks.request(this.lockID, function () { })];
49161
+ case 1:
49162
+ // When the lock is released, we can assume the worker was terminated or closed
49163
+ _a.sent();
49164
+ this.onWorkerMessage({ type: 'workerDied' });
49165
+ _a.label = 2;
49166
+ case 2:
49167
+ // handle non-POST request responses from worker
49168
+ if (messageEvent.data && messageEvent.data.type) {
49169
+ this.onWorkerMessage(messageEvent.data);
49170
+ return [2 /*return*/];
49171
+ }
49172
+ // handle POST request response from worker
49173
+ if (messageEvent.data && messageEvent.data.error) {
49174
+ if ((messageEvent.data.status && messageEvent.data.status < 500) ||
49175
+ messageEvent.data.sequence == null) {
49176
+ this.api.log.critical('Failed to send recording data from web worker', { error: messageEvent.data.error });
49177
+ }
49178
+ if (this.workerResponse) {
49179
+ this.workerResponse.reject();
49180
+ this.workerResponse = null;
49181
+ }
49182
+ }
49183
+ if (this.workerResponse) {
49184
+ this.workerResponse.resolve();
49185
+ this.workerResponse = null;
49186
+ }
49187
+ return [2 /*return*/];
49140
49188
  }
49141
- }
49142
- if (this.workerResponse) {
49143
- this.workerResponse.resolve();
49144
- this.workerResponse = null;
49145
- }
49189
+ });
49146
49190
  });
49147
- }
49148
- _onError() {
49191
+ };
49192
+ Transport.prototype._onError = function () {
49149
49193
  if (this.onError) {
49150
49194
  this.onError();
49151
49195
  }
49152
- }
49153
- }
49196
+ };
49197
+ return Transport;
49198
+ }());
49154
49199
 
49155
- const ELEMENT_NODE = 1;
49156
- const INPUT_MASK = '*'.repeat(10);
49157
- const NUMBER_INPUT_MASK = '0'.repeat(10);
49200
+ var ELEMENT_NODE = 1;
49201
+ var INPUT_MASK = '*'.repeat(10);
49202
+ var NUMBER_INPUT_MASK = '0'.repeat(10);
49158
49203
  function isElementNode(node) {
49159
49204
  if (!node)
49160
49205
  return false;
@@ -49163,10 +49208,12 @@ function isElementNode(node) {
49163
49208
  return true;
49164
49209
  }
49165
49210
  function getParent(elem) {
49166
- const isElementShadowRoot = typeof window.ShadowRoot !== 'undefined' && elem instanceof window.ShadowRoot && elem.host;
49211
+ var isElementShadowRoot = typeof window.ShadowRoot !== 'undefined' && elem instanceof window.ShadowRoot && elem.host;
49167
49212
  return isElementShadowRoot ? elem.host : elem.parentNode;
49168
49213
  }
49169
- function distanceToMatch(node, selector, limit = Infinity, distance = 0) {
49214
+ function distanceToMatch(node, selector, limit, distance) {
49215
+ if (limit === void 0) { limit = Infinity; }
49216
+ if (distance === void 0) { distance = 0; }
49170
49217
  if (distance > limit)
49171
49218
  return -1;
49172
49219
  if (!node)
@@ -49180,13 +49227,13 @@ function distanceToMatch(node, selector, limit = Infinity, distance = 0) {
49180
49227
  return distanceToMatch(getParent(node), selector, limit, distance + 1);
49181
49228
  }
49182
49229
  function shouldMask(node, options) {
49183
- const { maskAllText, maskTextSelector, unmaskTextSelector } = options;
49230
+ var maskAllText = options.maskAllText, maskTextSelector = options.maskTextSelector, unmaskTextSelector = options.unmaskTextSelector;
49184
49231
  try {
49185
- const el = isElementNode(node) ? node : node.parentElement;
49232
+ var el = isElementNode(node) ? node : node.parentElement;
49186
49233
  if (el === null)
49187
49234
  return false;
49188
- let maskDistance = -1;
49189
- let unmaskDistance = -1;
49235
+ var maskDistance = -1;
49236
+ var unmaskDistance = -1;
49190
49237
  if (maskAllText) {
49191
49238
  unmaskDistance = distanceToMatch(el, unmaskTextSelector);
49192
49239
  if (unmaskDistance < 0) {
@@ -49219,8 +49266,8 @@ function isNumberInput(element) {
49219
49266
  }
49220
49267
  function shouldMaskInput(element, maskInputOptions) {
49221
49268
  if (maskInputOptions && isElementNode(element)) {
49222
- const tagName = (element.tagName || '').toLowerCase();
49223
- const type = (element.type || '').toLowerCase();
49269
+ var tagName = (element.tagName || '').toLowerCase();
49270
+ var type = (element.type || '').toLowerCase();
49224
49271
  if (maskInputOptions[tagName] || maskInputOptions[type]) {
49225
49272
  return true;
49226
49273
  }
@@ -49419,9 +49466,15 @@ class SessionRecorder {
49419
49466
  this.api.attachEvent(this.api.Events, 'eventCaptured', bind(this.addRecordingId, this)),
49420
49467
  this.api.attachEvent(this.api.Events, 'transmit:locked', bind(this.stop, this)),
49421
49468
  this.api.attachEvent(this.api.Events, 'transmit:unlocked', bind(this._start, this)),
49422
- this.api.attachEvent(this.api.frames.getChannel(), 'message', bind(this._frameMessage, this)),
49423
49469
  this.api.attachEvent(this.api.Events, 'tabIdChanged:self', bind(this.handleTabIdChange, this))
49424
49470
  ];
49471
+ // APP-153357 Zone.js could bypass filterCrossWindowMessages (don't use attachEvent)
49472
+ const channel = this.api.frames.getChannel();
49473
+ const frameMessageHandler = bind(this._frameMessage, this);
49474
+ channel.addEventListener('message', frameMessageHandler);
49475
+ this.subscriptions.push(() => {
49476
+ channel.removeEventListener('message', frameMessageHandler);
49477
+ });
49425
49478
  if (this.api.store.getters['frames/isReady']()) {
49426
49479
  this.ready();
49427
49480
  }
@@ -50832,12 +50885,12 @@ function createReplayPlugin() {
50832
50885
  * limit of number of keys in an object
50833
50886
  * if an object contains more keys than this limit, we would call its toString function directly
50834
50887
  */
50835
- const NUM_OF_KEYS_LIMIT = 50;
50888
+ var NUM_OF_KEYS_LIMIT = 50;
50836
50889
  /**
50837
50890
  * limit number of depth in an object
50838
50891
  * if an object is too deep, toString process may cause browser OOM
50839
50892
  */
50840
- const DEPTH_OF_LIMIT = 4;
50893
+ var DEPTH_OF_LIMIT = 4;
50841
50894
  /**
50842
50895
  * serialize an HTML element by creating a shallow clone of it with text content
50843
50896
  * and return the resulting outerHTML string (without the subtree)
@@ -50848,8 +50901,8 @@ function serializeHTML(node) {
50848
50901
  if (!node || node.nodeType !== node.ELEMENT_NODE) {
50849
50902
  return '';
50850
50903
  }
50851
- const nodeClone = node.cloneNode(false);
50852
- const { textContent } = node;
50904
+ var nodeClone = node.cloneNode(false);
50905
+ var textContent = node.textContent;
50853
50906
  if (textContent) {
50854
50907
  nodeClone.textContent = textContent;
50855
50908
  }
@@ -50863,7 +50916,7 @@ function isObject(obj) {
50863
50916
  return false;
50864
50917
  if (typeof obj !== 'object')
50865
50918
  return false;
50866
- const proto = Object.getPrototypeOf(obj);
50919
+ var proto = Object.getPrototypeOf(obj);
50867
50920
  return proto === Object.prototype || proto === null;
50868
50921
  }
50869
50922
  /**
@@ -50872,11 +50925,11 @@ function isObject(obj) {
50872
50925
  function isObjTooDeep(obj, limit) {
50873
50926
  if (limit === 0)
50874
50927
  return true;
50875
- const keys = Object.keys(obj);
50928
+ var keys = Object.keys(obj);
50876
50929
  if (keys.length === 0)
50877
50930
  return false;
50878
- return keys.some(key => {
50879
- const value = obj[key];
50931
+ return keys.some(function (key) {
50932
+ var value = obj[key];
50880
50933
  return isObject(value) && isObjTooDeep(value, limit - 1);
50881
50934
  });
50882
50935
  }
@@ -50892,7 +50945,7 @@ function shouldIgnore(_obj) {
50892
50945
  return false;
50893
50946
  }
50894
50947
  // out of keys limit
50895
- const keys = Object.keys(_obj);
50948
+ var keys = Object.keys(_obj);
50896
50949
  if (keys.length > NUM_OF_KEYS_LIMIT) {
50897
50950
  return true;
50898
50951
  }
@@ -50924,7 +50977,7 @@ function stringify(arg) {
50924
50977
  return value.toString ? value.toString() : '[object Object]';
50925
50978
  }
50926
50979
  if (value instanceof ArrayBuffer)
50927
- return `ArrayBuffer { byteLength: ${value.byteLength} }`;
50980
+ return "ArrayBuffer { byteLength: ".concat(value.byteLength, " }");
50928
50981
  if (value instanceof Error)
50929
50982
  return value.name + ': ' + value.message;
50930
50983
  if (value instanceof Node) {
@@ -50932,10 +50985,10 @@ function stringify(arg) {
50932
50985
  }
50933
50986
  // Handle events
50934
50987
  if (value instanceof Event) {
50935
- const eventResult = {};
50988
+ var eventResult = {};
50936
50989
  // eslint-disable-next-line guard-for-in
50937
- for (const eventKey in value) {
50938
- const eventValue = value[eventKey];
50990
+ for (var eventKey in value) {
50991
+ var eventValue = value[eventKey];
50939
50992
  eventResult[eventKey] = Array.isArray(eventValue) && eventValue[0] instanceof HTMLElement
50940
50993
  ? serializeHTML(eventValue[0])
50941
50994
  : eventValue;
@@ -50946,30 +50999,31 @@ function stringify(arg) {
50946
50999
  });
50947
51000
  }
50948
51001
 
50949
- class StackFrame {
50950
- constructor(obj) {
51002
+ var StackFrame = /** @class */ (function () {
51003
+ function StackFrame(obj) {
50951
51004
  this.fileName = obj.fileName || '';
50952
51005
  this.functionName = obj.functionName || '';
50953
51006
  this.lineNumber = obj.lineNumber;
50954
51007
  this.columnNumber = obj.columnNumber;
50955
51008
  }
50956
- toString() {
50957
- const { fileName, functionName, lineNumber = '', columnNumber = '' } = this;
51009
+ StackFrame.prototype.toString = function () {
51010
+ var _a = this, fileName = _a.fileName, functionName = _a.functionName, _b = _a.lineNumber, lineNumber = _b === void 0 ? '' : _b, _c = _a.columnNumber, columnNumber = _c === void 0 ? '' : _c;
50958
51011
  return functionName
50959
- ? `${functionName} (${fileName}:${lineNumber}:${columnNumber})`
50960
- : `${fileName}:${lineNumber}:${columnNumber}`;
50961
- }
50962
- }
50963
- const FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
50964
- const CHROME_EDGE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
50965
- const SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
50966
- const LOCATION_REGEXP = /(.+?)(?::(\d+))?(?::(\d+))?$/;
50967
- const DEFAULT_NUM_FRAMES_TO_SKIP = 5;
50968
- const ErrorStackParser = {
51012
+ ? "".concat(functionName, " (").concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber, ")")
51013
+ : "".concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber);
51014
+ };
51015
+ return StackFrame;
51016
+ }());
51017
+ var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
51018
+ var CHROME_EDGE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
51019
+ var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
51020
+ var LOCATION_REGEXP = /(.+?)(?::(\d+))?(?::(\d+))?$/;
51021
+ var DEFAULT_NUM_FRAMES_TO_SKIP = 5;
51022
+ var ErrorStackParser = {
50969
51023
  /**
50970
51024
  * Given an Error object, extract the most information from it.
50971
51025
  */
50972
- parse(error, maxFramesToSave) {
51026
+ parse: function (error, maxFramesToSave) {
50973
51027
  if (!(error === null || error === void 0 ? void 0 : error.stack))
50974
51028
  return [];
50975
51029
  // Chrome, Edge, Opera ≥15
@@ -50983,24 +51037,25 @@ const ErrorStackParser = {
50983
51037
  return [];
50984
51038
  },
50985
51039
  // Separate line and column numbers from a string of the form: (URI:Line:Column)
50986
- extractLocation(urlLike) {
51040
+ extractLocation: function (urlLike) {
50987
51041
  // Fail-fast but return locations like "(native)"
50988
51042
  if (urlLike.indexOf(':') === -1) {
50989
51043
  return [urlLike];
50990
51044
  }
50991
- const parts = LOCATION_REGEXP.exec(urlLike.replace(/[()]/g, ''));
51045
+ var parts = LOCATION_REGEXP.exec(urlLike.replace(/[()]/g, ''));
50992
51046
  if (!parts)
50993
- throw new Error(`Cannot parse given url: ${urlLike}`);
51047
+ throw new Error("Cannot parse given url: ".concat(urlLike));
50994
51048
  return [parts[1], parts[2] || undefined, parts[3] || undefined];
50995
51049
  },
50996
- parseHelper({ regex, includeMatchedLine }, error, maxFramesToSave, callback) {
50997
- const lines = error.stack.split('\n');
50998
- const frames = [];
50999
- let validFramesFound = 0;
51000
- for (let i = 0; i < lines.length; i++) {
51001
- const line = lines[i];
51002
- const lineMatchesRegex = regex.test(line);
51003
- const shouldSkipLine = (includeMatchedLine && !lineMatchesRegex) || // if line doesn't match regex and we want matched lines, skip it
51050
+ parseHelper: function (_a, error, maxFramesToSave, callback) {
51051
+ var regex = _a.regex, includeMatchedLine = _a.includeMatchedLine;
51052
+ var lines = error.stack.split('\n');
51053
+ var frames = [];
51054
+ var validFramesFound = 0;
51055
+ for (var i = 0; i < lines.length; i++) {
51056
+ var line = lines[i];
51057
+ var lineMatchesRegex = regex.test(line);
51058
+ var shouldSkipLine = (includeMatchedLine && !lineMatchesRegex) || // if line doesn't match regex and we want matched lines, skip it
51004
51059
  (!includeMatchedLine && lineMatchesRegex); // if line does match regex but we don't want matched lines, skip it
51005
51060
  if (shouldSkipLine)
51006
51061
  continue;
@@ -51015,11 +51070,12 @@ const ErrorStackParser = {
51015
51070
  }
51016
51071
  return frames;
51017
51072
  },
51018
- parseChromiumStack(error, maxFramesToSave) {
51019
- return this.parseHelper({ regex: CHROME_EDGE_STACK_REGEXP, includeMatchedLine: true }, error, maxFramesToSave, (line, frames) => {
51020
- let sanitizedLine;
51073
+ parseChromiumStack: function (error, maxFramesToSave) {
51074
+ var _this = this;
51075
+ return this.parseHelper({ regex: CHROME_EDGE_STACK_REGEXP, includeMatchedLine: true }, error, maxFramesToSave, function (line, frames) {
51076
+ var sanitizedLine;
51021
51077
  if (line.indexOf('(eval ') > -1) {
51022
- const processedLine = line
51078
+ var processedLine = line
51023
51079
  .replace(/eval code/g, 'eval')
51024
51080
  .replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
51025
51081
  sanitizedLine = processedLine.replace(/^\s+/, '').replace(/\(eval code/g, '(');
@@ -51029,7 +51085,7 @@ const ErrorStackParser = {
51029
51085
  }
51030
51086
  // capture and preserve the parenthesized location "(/foo/my bar.js:12:87)"
51031
51087
  // in case it has spaces in it, as the string is split on \s+ later on
51032
- let location;
51088
+ var location;
51033
51089
  if (sanitizedLine.indexOf('(') > -1 && sanitizedLine.indexOf('):') > -1) {
51034
51090
  location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
51035
51091
  }
@@ -51037,22 +51093,23 @@ const ErrorStackParser = {
51037
51093
  sanitizedLine = location
51038
51094
  ? sanitizedLine.replace(location[0], '')
51039
51095
  : sanitizedLine;
51040
- const tokens = sanitizedLine.split(/\s+/).slice(1);
51096
+ var tokens = sanitizedLine.split(/\s+/).slice(1);
51041
51097
  // if a location was matched, pass it to extractLocation() otherwise pop the last token
51042
- const locationParts = this.extractLocation(location ? location[1] : tokens.pop() || '');
51043
- const functionName = tokens.join(' ') || undefined;
51044
- const fileName = (locationParts[0] === 'eval' || locationParts[0] === '<anonymous>') ? undefined : locationParts[0];
51098
+ var locationParts = _this.extractLocation(location ? location[1] : tokens.pop() || '');
51099
+ var functionName = tokens.join(' ') || undefined;
51100
+ var fileName = (locationParts[0] === 'eval' || locationParts[0] === '<anonymous>') ? undefined : locationParts[0];
51045
51101
  frames.push(new StackFrame({
51046
- functionName,
51047
- fileName,
51102
+ functionName: functionName,
51103
+ fileName: fileName,
51048
51104
  lineNumber: locationParts[1],
51049
51105
  columnNumber: locationParts[2]
51050
51106
  }));
51051
51107
  });
51052
51108
  },
51053
- parseFirefoxSafariStack(error, maxFramesToSave) {
51054
- return this.parseHelper({ regex: SAFARI_NATIVE_CODE_REGEXP, includeMatchedLine: false }, error, maxFramesToSave, (line, frames) => {
51055
- let processedLine = line;
51109
+ parseFirefoxSafariStack: function (error, maxFramesToSave) {
51110
+ var _this = this;
51111
+ return this.parseHelper({ regex: SAFARI_NATIVE_CODE_REGEXP, includeMatchedLine: false }, error, maxFramesToSave, function (line, frames) {
51112
+ var processedLine = line;
51056
51113
  // Throw away eval information until we implement stacktrace.js/stackframe#8
51057
51114
  if (processedLine.indexOf(' > eval') > -1) {
51058
51115
  processedLine = processedLine.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
@@ -51064,12 +51121,12 @@ const ErrorStackParser = {
51064
51121
  }));
51065
51122
  return;
51066
51123
  }
51067
- const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
51068
- const matches = processedLine.match(functionNameRegex);
51069
- const functionName = matches && matches[1] ? matches[1] : undefined;
51070
- const locationParts = this.extractLocation(processedLine.replace(functionNameRegex, ''));
51124
+ var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
51125
+ var matches = processedLine.match(functionNameRegex);
51126
+ var functionName = matches && matches[1] ? matches[1] : undefined;
51127
+ var locationParts = _this.extractLocation(processedLine.replace(functionNameRegex, ''));
51071
51128
  frames.push(new StackFrame({
51072
- functionName,
51129
+ functionName: functionName,
51073
51130
  fileName: locationParts[0],
51074
51131
  lineNumber: locationParts[1],
51075
51132
  columnNumber: locationParts[2]
@@ -52171,18 +52228,20 @@ function NetworkCapture() {
52171
52228
  }
52172
52229
  }
52173
52230
 
52174
- const PREDICT_STEP_REGEX = /\$\$predict\$\$/;
52175
- const DRAG_THRESHOLD = 5;
52176
- const STYLE_ID = 'pendo-predict-plugin-styles';
52177
- const PREDICT_BASE_URL = 'https://predict.pendo.io';
52178
- const GUIDE_BUTTON_IDENTIFIER = 'button:contains("token")';
52179
- const pluginVersion = '1.0.1';
52180
- const $ = (id) => document.getElementById(id);
52181
- const createElement = (tag, attrs = {}, parent = null) => {
52182
- const el = document.createElement(tag);
52183
- const entries = Object.entries(attrs);
52184
- for (let i = 0; i < entries.length; i++) {
52185
- const [key, value] = entries[i];
52231
+ var PREDICT_STEP_REGEX = /\$\$predict\$\$/;
52232
+ var DRAG_THRESHOLD = 5;
52233
+ var STYLE_ID = 'pendo-predict-plugin-styles';
52234
+ var PREDICT_BASE_URL = 'https://predict.pendo.io';
52235
+ var GUIDE_BUTTON_IDENTIFIER = 'button:contains("token")';
52236
+ var pluginVersion = '1.0.1';
52237
+ var $ = function (id) { return document.getElementById(id); };
52238
+ var createElement = function (tag, attrs, parent) {
52239
+ if (attrs === void 0) { attrs = {}; }
52240
+ if (parent === void 0) { parent = null; }
52241
+ var el = document.createElement(tag);
52242
+ var entries = Object.entries(attrs);
52243
+ for (var i = 0; i < entries.length; i++) {
52244
+ var _a = entries[i], key = _a[0], value = _a[1];
52186
52245
  if (key === 'className')
52187
52246
  el.className = value;
52188
52247
  else if (key === 'innerHTML')
@@ -52194,69 +52253,28 @@ const createElement = (tag, attrs = {}, parent = null) => {
52194
52253
  parent.appendChild(el);
52195
52254
  return el;
52196
52255
  };
52197
- const injectStyles = (pendoContainerId, log = () => { }) => {
52198
- const styleId = `${STYLE_ID}-${pendoContainerId}`;
52256
+ var injectStyles = function (pendoContainerId, log) {
52257
+ if (log === void 0) { log = function () { }; }
52258
+ var styleId = "".concat(STYLE_ID, "-").concat(pendoContainerId);
52199
52259
  if ($(styleId)) {
52200
- log(`[predict] style already exists, skipping: ${styleId}`);
52260
+ log("[predict] style already exists, skipping: ".concat(styleId));
52201
52261
  return;
52202
52262
  }
52203
- log(`[predict] injecting styles: ${styleId}`);
52263
+ log("[predict] injecting styles: ".concat(styleId));
52204
52264
  createElement('style', {
52205
52265
  id: styleId,
52206
- textContent: `
52207
- #${pendoContainerId} {
52208
- display: none !important;
52209
- }
52210
- .frame-explanation {
52211
- aspect-ratio: 16/9; overflow: hidden; min-height: 300px;
52212
- width: 100vw; height: 100vh; background: transparent;
52213
- position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;
52214
- visibility: hidden; opacity: 0; pointer-events: none;
52215
- transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
52216
- display: none;
52217
- }
52218
- .frame-explanation.is-visible {
52219
- visibility: visible; opacity: 1; pointer-events: auto;
52220
- transition: opacity 0.1s ease-out, visibility 0s linear 0s;
52221
- }
52222
- .frame-explanation.is-exists {
52223
- display: block !important;
52224
- }
52225
- .floating-modal-container {
52226
- position: fixed; top: 20px; right: 20px; z-index: 500000;
52227
- visibility: hidden; opacity: 0; pointer-events: none;
52228
- transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
52229
- border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
52230
- overflow: hidden; width: 384px; height: 176px;
52231
- }
52232
- .floating-modal-container.is-visible {
52233
- visibility: visible; opacity: 1; pointer-events: auto;
52234
- transition: opacity 0.1s ease-out, visibility 0s linear 0s;
52235
- }
52236
- .floating-modal-container.is-dragging { will-change: left, top; }
52237
- .floating-modal-drag-handle {
52238
- position: absolute; left: 50%; transform: translateX(-50%);
52239
- top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;
52240
- z-index: 9999; transition: left 0.2s ease, right 0.2s ease;
52241
- display: flex; justify-content: center; align-items: center;
52242
- }
52243
- .floating-modal-drag-handle svg g { fill: #A0A0A0; }
52244
- .floating-modal-drag-handle:hover { cursor: grab; }
52245
- .floating-modal-drag-handle:hover svg g { fill: #1f2937; }
52246
- .floating-modal-drag-handle.is-dragging { cursor: grabbing; }
52247
- .floating-modal-drag-handle.is-collapsed { top: 0px; }
52248
- .frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }
52249
- `
52266
+ textContent: "\n #".concat(pendoContainerId, " {\n display: none !important;\n }\n .frame-explanation {\n aspect-ratio: 16/9; overflow: hidden; min-height: 300px;\n width: 100vw; height: 100vh; background: transparent;\n position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n display: none;\n }\n .frame-explanation.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .frame-explanation.is-exists {\n display: block !important;\n }\n .floating-modal-container {\n position: fixed; top: 20px; right: 20px; z-index: 500000;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);\n overflow: hidden; width: 384px; height: 176px;\n }\n .floating-modal-container.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .floating-modal-container.is-dragging { will-change: left, top; }\n .floating-modal-drag-handle {\n position: absolute; left: 50%; transform: translateX(-50%);\n top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;\n z-index: 9999; transition: left 0.2s ease, right 0.2s ease;\n display: flex; justify-content: center; align-items: center;\n }\n .floating-modal-drag-handle svg g { fill: #A0A0A0; }\n .floating-modal-drag-handle:hover { cursor: grab; }\n .floating-modal-drag-handle:hover svg g { fill: #1f2937; }\n .floating-modal-drag-handle.is-dragging { cursor: grabbing; }\n .floating-modal-drag-handle.is-collapsed { top: 0px; }\n .frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }\n ")
52250
52267
  }, document.head);
52251
52268
  };
52252
- const getRecordIdFromUrl = (recordRegex, log = () => { }) => {
52269
+ var getRecordIdFromUrl = function (recordRegex, log) {
52253
52270
  var _a;
52254
- const match = window.location.href.match(recordRegex);
52255
- const recordId = (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;
52256
- log(`[predict] recordId found: ${recordId}`);
52271
+ if (log === void 0) { log = function () { }; }
52272
+ var match = window.location.href.match(recordRegex);
52273
+ var recordId = (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;
52274
+ log("[predict] recordId found: ".concat(recordId));
52257
52275
  return recordId;
52258
52276
  };
52259
- const safeStringify = (value, fallback) => {
52277
+ var safeStringify = function (value, fallback) {
52260
52278
  try {
52261
52279
  return JSON.stringify(value);
52262
52280
  }
@@ -52264,21 +52282,22 @@ const safeStringify = (value, fallback) => {
52264
52282
  return fallback !== null && fallback !== void 0 ? fallback : '';
52265
52283
  }
52266
52284
  };
52267
- const safeParse = (value, fallback, log = () => { }) => {
52285
+ var safeParse = function (value, fallback, log) {
52286
+ if (log === void 0) { log = function () { }; }
52268
52287
  try {
52269
52288
  return JSON.parse(value);
52270
52289
  }
52271
52290
  catch (error) {
52272
- log(`[predict] JSON parse error: ${error}`);
52291
+ log("[predict] JSON parse error: ".concat(error));
52273
52292
  return fallback;
52274
52293
  }
52275
52294
  };
52276
- const buildQueryParams = (params) => {
52277
- const urlParams = new URLSearchParams();
52278
- const entries = Object.entries(params);
52295
+ var buildQueryParams = function (params) {
52296
+ var urlParams = new URLSearchParams();
52297
+ var entries = Object.entries(params);
52279
52298
  urlParams.set('pluginVersion', pluginVersion);
52280
- for (let i = 0; i < entries.length; i++) {
52281
- const [key, value] = entries[i];
52299
+ for (var i = 0; i < entries.length; i++) {
52300
+ var _a = entries[i], key = _a[0], value = _a[1];
52282
52301
  if (value != null) {
52283
52302
  urlParams.set(key, typeof value === 'object' ? safeStringify(value) : String(value));
52284
52303
  }
@@ -52286,17 +52305,17 @@ const buildQueryParams = (params) => {
52286
52305
  return urlParams.toString();
52287
52306
  };
52288
52307
  // ----- Drag & Drop -----
52289
- const setupDragAndDrop = (handle, container) => {
52290
- let isDragging = false;
52291
- let hasMoved = false;
52292
- let isCollapsed = false;
52293
- let startX = 0;
52294
- let startY = 0;
52295
- let initialLeft = 0;
52296
- let initialTop = 0;
52297
- let rafId = null;
52298
- const iframe = container.querySelector('iframe');
52299
- const onMouseDown = (e) => {
52308
+ var setupDragAndDrop = function (handle, container) {
52309
+ var isDragging = false;
52310
+ var hasMoved = false;
52311
+ var isCollapsed = false;
52312
+ var startX = 0;
52313
+ var startY = 0;
52314
+ var initialLeft = 0;
52315
+ var initialTop = 0;
52316
+ var rafId = null;
52317
+ var iframe = container.querySelector('iframe');
52318
+ var onMouseDown = function (e) {
52300
52319
  if (e.button !== 0)
52301
52320
  return;
52302
52321
  e.preventDefault();
@@ -52306,35 +52325,35 @@ const setupDragAndDrop = (handle, container) => {
52306
52325
  container.classList.add('is-dragging');
52307
52326
  if (iframe)
52308
52327
  iframe.style.pointerEvents = 'none';
52309
- const rect = container.getBoundingClientRect();
52328
+ var rect = container.getBoundingClientRect();
52310
52329
  initialLeft = rect.left;
52311
52330
  initialTop = rect.top;
52312
- container.style.left = `${initialLeft}px`;
52331
+ container.style.left = "".concat(initialLeft, "px");
52313
52332
  container.style.right = 'auto';
52314
52333
  startX = e.clientX;
52315
52334
  startY = e.clientY;
52316
52335
  document.addEventListener('mousemove', onMouseMove);
52317
52336
  document.addEventListener('mouseup', onMouseUp);
52318
52337
  };
52319
- const onMouseMove = (e) => {
52338
+ var onMouseMove = function (e) {
52320
52339
  if (!isDragging)
52321
52340
  return;
52322
- const deltaX = e.clientX - startX;
52323
- const deltaY = e.clientY - startY;
52341
+ var deltaX = e.clientX - startX;
52342
+ var deltaY = e.clientY - startY;
52324
52343
  if (Math.abs(deltaX) > DRAG_THRESHOLD || Math.abs(deltaY) > DRAG_THRESHOLD) {
52325
52344
  hasMoved = true;
52326
52345
  }
52327
52346
  if (rafId)
52328
52347
  cancelAnimationFrame(rafId);
52329
- rafId = requestAnimationFrame(() => {
52330
- const rect = container.getBoundingClientRect();
52331
- const newLeft = Math.max(0, Math.min(initialLeft + deltaX, window.innerWidth - rect.width));
52332
- const newTop = Math.max(0, Math.min(initialTop + deltaY, window.innerHeight - rect.height));
52333
- container.style.left = `${newLeft}px`;
52334
- container.style.top = `${newTop}px`;
52348
+ rafId = requestAnimationFrame(function () {
52349
+ var rect = container.getBoundingClientRect();
52350
+ var newLeft = Math.max(0, Math.min(initialLeft + deltaX, window.innerWidth - rect.width));
52351
+ var newTop = Math.max(0, Math.min(initialTop + deltaY, window.innerHeight - rect.height));
52352
+ container.style.left = "".concat(newLeft, "px");
52353
+ container.style.top = "".concat(newTop, "px");
52335
52354
  });
52336
52355
  };
52337
- const onMouseUp = (e) => {
52356
+ var onMouseUp = function (e) {
52338
52357
  var _a;
52339
52358
  if (!isDragging)
52340
52359
  return;
@@ -52352,12 +52371,12 @@ const setupDragAndDrop = (handle, container) => {
52352
52371
  (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage({ type: 'TRIGGER_EXPAND' }, PREDICT_BASE_URL);
52353
52372
  }
52354
52373
  };
52355
- handle.setCollapsedState = (collapsed) => {
52374
+ handle.setCollapsedState = function (collapsed) {
52356
52375
  isCollapsed = collapsed;
52357
52376
  handle.classList.toggle('is-collapsed', collapsed);
52358
52377
  };
52359
52378
  handle.addEventListener('mousedown', onMouseDown);
52360
- handle.cleanup = () => {
52379
+ handle.cleanup = function () {
52361
52380
  handle.removeEventListener('mousedown', onMouseDown);
52362
52381
  document.removeEventListener('mousemove', onMouseMove);
52363
52382
  document.removeEventListener('mouseup', onMouseUp);
@@ -52367,12 +52386,13 @@ const setupDragAndDrop = (handle, container) => {
52367
52386
  return handle;
52368
52387
  };
52369
52388
  // ----- Explanation Iframe Creation -----
52370
- const createExplanationIframe = ({ analysisId, recordId, configuration }) => {
52371
- var _a;
52372
- const frameId = `frameExplanation-${analysisId}`;
52373
- (_a = $(frameId)) === null || _a === void 0 ? void 0 : _a.remove();
52374
- const base = `${PREDICT_BASE_URL}/external/analysis/${analysisId}/prediction/drilldown/${recordId}`;
52375
- const params = buildQueryParams(configuration);
52389
+ var createExplanationIframe = function (_a) {
52390
+ var _b;
52391
+ var analysisId = _a.analysisId, recordId = _a.recordId, configuration = _a.configuration;
52392
+ var frameId = "frameExplanation-".concat(analysisId);
52393
+ (_b = $(frameId)) === null || _b === void 0 ? void 0 : _b.remove();
52394
+ var base = "".concat(PREDICT_BASE_URL, "/external/analysis/").concat(analysisId, "/prediction/drilldown/").concat(recordId);
52395
+ var params = buildQueryParams(configuration);
52376
52396
  createElement('iframe', {
52377
52397
  id: frameId,
52378
52398
  className: 'frame-explanation',
@@ -52380,28 +52400,24 @@ const createExplanationIframe = ({ analysisId, recordId, configuration }) => {
52380
52400
  loading: 'lazy',
52381
52401
  referrerPolicy: 'strict-origin-when-cross-origin',
52382
52402
  allowFullscreen: true,
52383
- src: `${base}?${params}`
52403
+ src: "".concat(base, "?").concat(params)
52384
52404
  }, document.body);
52385
52405
  };
52386
52406
  // ----- Floating Modal Creation -----
52387
- const createFloatingModal = ({ recordId, configuration }) => {
52388
- var _a;
52389
- const flatIds = (_a = configuration.analysisIds) === null || _a === void 0 ? void 0 : _a.flat(Infinity);
52390
- for (let i = 0; i < flatIds.length; i++) {
52391
- createExplanationIframe({ analysisId: flatIds[i], recordId, configuration });
52392
- }
52393
- const container = createElement('div', { id: 'floatingModalContainer', className: 'floating-modal-container' }, document.body);
52394
- const dragHandle = createElement('div', {
52407
+ var createFloatingModal = function (_a) {
52408
+ var _b;
52409
+ var recordId = _a.recordId, configuration = _a.configuration;
52410
+ var flatIds = (_b = configuration.analysisIds) === null || _b === void 0 ? void 0 : _b.flat(Infinity);
52411
+ for (var i = 0; i < flatIds.length; i++) {
52412
+ createExplanationIframe({ analysisId: flatIds[i], recordId: recordId, configuration: configuration });
52413
+ }
52414
+ var container = createElement('div', { id: 'floatingModalContainer', className: 'floating-modal-container' }, document.body);
52415
+ var dragHandle = createElement('div', {
52395
52416
  className: 'floating-modal-drag-handle',
52396
- innerHTML: `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
52397
- <g fill="#EBEBEB">
52398
- <circle cx="3.33" cy="6" r="1.5"/><circle cx="8" cy="6" r="1.5"/><circle cx="12.67" cy="6" r="1.5"/>
52399
- <circle cx="3.33" cy="10" r="1.5"/><circle cx="8" cy="10" r="1.5"/><circle cx="12.67" cy="10" r="1.5"/>
52400
- </g>
52401
- </svg>`
52417
+ innerHTML: "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"#EBEBEB\">\n <circle cx=\"3.33\" cy=\"6\" r=\"1.5\"/><circle cx=\"8\" cy=\"6\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"6\" r=\"1.5\"/>\n <circle cx=\"3.33\" cy=\"10\" r=\"1.5\"/><circle cx=\"8\" cy=\"10\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"10\" r=\"1.5\"/>\n </g>\n </svg>"
52402
52418
  }, container);
52403
- const baseUrl = `${PREDICT_BASE_URL}/external/analysis/prediction/summary/${recordId}`;
52404
- const params = buildQueryParams(configuration);
52419
+ var baseUrl = "".concat(PREDICT_BASE_URL, "/external/analysis/prediction/summary/").concat(recordId);
52420
+ var params = buildQueryParams(configuration);
52405
52421
  createElement('iframe', {
52406
52422
  id: 'frameFloatingModal',
52407
52423
  className: 'frame-floating-modal',
@@ -52409,133 +52425,136 @@ const createFloatingModal = ({ recordId, configuration }) => {
52409
52425
  referrerPolicy: 'strict-origin-when-cross-origin',
52410
52426
  allowFullscreen: true,
52411
52427
  title: 'Floating Modal',
52412
- src: `${baseUrl}?${params}`
52428
+ src: "".concat(baseUrl, "?").concat(params)
52413
52429
  }, container);
52414
52430
  container.dragHandle = setupDragAndDrop(dragHandle, container);
52415
- return () => {
52431
+ return function () {
52416
52432
  var _a, _b;
52417
52433
  (_b = (_a = container.dragHandle) === null || _a === void 0 ? void 0 : _a.cleanup) === null || _b === void 0 ? void 0 : _b.call(_a);
52418
52434
  container.remove();
52419
- for (let i = 0; i < flatIds.length; i++) {
52420
- const frame = $(`frameExplanation-${flatIds[i]}`);
52435
+ for (var i = 0; i < flatIds.length; i++) {
52436
+ var frame = $("frameExplanation-".concat(flatIds[i]));
52421
52437
  if (frame)
52422
52438
  frame.remove();
52423
52439
  }
52424
52440
  };
52425
52441
  };
52426
- const setupMessageListener = ({ token, forceAccountId, cleanup, pendo }) => {
52427
- const messageHandler = ({ origin, data }) => {
52428
- var _a;
52442
+ var setupMessageListener = function (_a) {
52443
+ var token = _a.token, forceAccountId = _a.forceAccountId, cleanup = _a.cleanup, pendo = _a.pendo;
52444
+ var messageHandler = function (_a) {
52445
+ var _b;
52446
+ var origin = _a.origin, data = _a.data;
52429
52447
  if (origin !== PREDICT_BASE_URL || !data || typeof data !== 'object')
52430
52448
  return;
52431
- const { type, analysisId, height, width } = data;
52432
- const explanationFrame = $(`frameExplanation-${analysisId}`);
52433
- const floatingModal = $('floatingModalContainer');
52434
- const setFloatingModalSize = () => {
52449
+ var _c = data, type = _c.type, analysisId = _c.analysisId, height = _c.height, width = _c.width;
52450
+ var explanationFrame = $("frameExplanation-".concat(analysisId));
52451
+ var floatingModal = $('floatingModalContainer');
52452
+ var setFloatingModalSize = function () {
52435
52453
  if (floatingModal) {
52436
- floatingModal.style.height = `${height}px`;
52437
- floatingModal.style.width = `${width}px`;
52454
+ floatingModal.style.height = "".concat(height, "px");
52455
+ floatingModal.style.width = "".concat(width, "px");
52438
52456
  }
52439
52457
  };
52440
- const setFloatingModalCollapsedState = (collapsed) => {
52458
+ var setFloatingModalCollapsedState = function (collapsed) {
52441
52459
  var _a, _b;
52442
52460
  if (floatingModal)
52443
52461
  (_b = (_a = floatingModal.dragHandle) === null || _a === void 0 ? void 0 : _a.setCollapsedState) === null || _b === void 0 ? void 0 : _b.call(_a, collapsed);
52444
52462
  };
52445
- const actions = {
52446
- MODAL_INITIALIZED: () => {
52463
+ var actions = {
52464
+ MODAL_INITIALIZED: function () {
52447
52465
  var _a, _b, _c;
52448
- const iframe = $('frameFloatingModal');
52466
+ var iframe = $('frameFloatingModal');
52449
52467
  if (iframe) {
52450
- let idToken = null;
52451
- let extensionAPIKeys = null;
52452
- const retrieveIDPToken = pendo.getConfigValue('retrieveIDPToken');
52468
+ var idToken = null;
52469
+ var extensionAPIKeys = null;
52470
+ var retrieveIDPToken = pendo.getConfigValue('retrieveIDPToken');
52453
52471
  if (pendo._.isFunction(retrieveIDPToken)) {
52454
- const result = retrieveIDPToken();
52472
+ var result = retrieveIDPToken();
52455
52473
  if (result) {
52456
52474
  idToken = result.idToken;
52457
52475
  extensionAPIKeys = result.extensionAPIKeys;
52458
52476
  }
52459
52477
  }
52460
- const visitorId = (_a = pendo === null || pendo === void 0 ? void 0 : pendo.getVisitorId) === null || _a === void 0 ? void 0 : _a.call(pendo);
52461
- const accountId = forceAccountId !== null && forceAccountId !== void 0 ? forceAccountId : (_b = pendo === null || pendo === void 0 ? void 0 : pendo.getAccountId) === null || _b === void 0 ? void 0 : _b.call(pendo);
52462
- (_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token, idToken, extensionAPIKeys, visitorId, accountId }, PREDICT_BASE_URL);
52478
+ var visitorId = (_a = pendo === null || pendo === void 0 ? void 0 : pendo.getVisitorId) === null || _a === void 0 ? void 0 : _a.call(pendo);
52479
+ var accountId = forceAccountId !== null && forceAccountId !== void 0 ? forceAccountId : (_b = pendo === null || pendo === void 0 ? void 0 : pendo.getAccountId) === null || _b === void 0 ? void 0 : _b.call(pendo);
52480
+ (_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token: token, idToken: idToken, extensionAPIKeys: extensionAPIKeys, visitorId: visitorId, accountId: accountId }, PREDICT_BASE_URL);
52463
52481
  }
52464
52482
  },
52465
- OPEN_EXPLANATION: () => {
52483
+ OPEN_EXPLANATION: function () {
52466
52484
  var _a;
52467
52485
  explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.add('is-visible');
52468
52486
  (_a = explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(data, PREDICT_BASE_URL);
52469
52487
  },
52470
- CLOSE_EXPLANATION: () => explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible'),
52471
- AUTH_ERROR_EXPLANATION: () => {
52488
+ CLOSE_EXPLANATION: function () { return explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible'); },
52489
+ AUTH_ERROR_EXPLANATION: function () {
52472
52490
  explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible');
52473
- const iframe = $('frameFloatingModal');
52491
+ var iframe = $('frameFloatingModal');
52474
52492
  // eslint-disable-next-line no-self-assign
52475
52493
  if (iframe)
52476
52494
  iframe.src = iframe.src;
52477
52495
  },
52478
- DATA_READY: () => {
52496
+ DATA_READY: function () {
52479
52497
  floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
52480
52498
  setFloatingModalSize();
52481
52499
  // Use analysisIds from the message data if available, otherwise use all IDs
52482
- const idsToShow = data.analysisIds || [];
52483
- for (let i = 0; i < idsToShow.length; i++) {
52484
- const frame = $(`frameExplanation-${idsToShow[i]}`);
52500
+ var idsToShow = data.analysisIds || [];
52501
+ for (var i = 0; i < idsToShow.length; i++) {
52502
+ var frame = $("frameExplanation-".concat(idsToShow[i]));
52485
52503
  if (frame)
52486
52504
  frame.classList.add('is-exists');
52487
52505
  }
52488
52506
  },
52489
- AUTH_ERROR: () => {
52507
+ AUTH_ERROR: function () {
52490
52508
  floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
52491
52509
  setFloatingModalSize();
52492
52510
  },
52493
52511
  CLOSE_FLOATING_MODAL: cleanup,
52494
- EXPAND_FLOATING_MODAL: () => {
52512
+ EXPAND_FLOATING_MODAL: function () {
52495
52513
  setFloatingModalSize();
52496
52514
  setFloatingModalCollapsedState(false);
52497
52515
  },
52498
- COLLAPSE_FLOATING_MODAL: () => {
52516
+ COLLAPSE_FLOATING_MODAL: function () {
52499
52517
  setFloatingModalSize();
52500
52518
  setFloatingModalCollapsedState(true);
52501
52519
  }
52502
52520
  };
52503
52521
  if (type && type in actions) {
52504
- (_a = actions === null || actions === void 0 ? void 0 : actions[type]) === null || _a === void 0 ? void 0 : _a.call(actions);
52522
+ (_b = actions === null || actions === void 0 ? void 0 : actions[type]) === null || _b === void 0 ? void 0 : _b.call(actions);
52505
52523
  }
52506
52524
  };
52507
52525
  window.addEventListener('message', messageHandler);
52508
- return () => window.removeEventListener('message', messageHandler);
52526
+ return function () { return window.removeEventListener('message', messageHandler); };
52509
52527
  };
52510
- const predictGuidesScript = ({ step, pendo, cleanupArray, cleanup, log }) => {
52511
- var _a;
52528
+ var predictGuidesScript = function (_a) {
52529
+ var _b;
52530
+ var step = _a.step, pendo = _a.pendo, cleanupArray = _a.cleanupArray, cleanup = _a.cleanup, log = _a.log;
52512
52531
  log('[predict] initializing');
52513
52532
  // Before anything else, inject styles so that the guide will be hidden
52514
- const pendoContainerId = step === null || step === void 0 ? void 0 : step.containerId;
52533
+ var pendoContainerId = step === null || step === void 0 ? void 0 : step.containerId;
52515
52534
  injectStyles(pendoContainerId, log);
52516
52535
  if (cleanupArray.length > 0) {
52517
52536
  log('[predict] cleanupArray is not empty');
52518
52537
  return;
52519
52538
  }
52520
52539
  // ----- Extract Configuration -----
52521
- const guideButton = (_a = step.guideElement.find(GUIDE_BUTTON_IDENTIFIER)) === null || _a === void 0 ? void 0 : _a[0];
52540
+ var guideButton = (_b = step.guideElement.find(GUIDE_BUTTON_IDENTIFIER)) === null || _b === void 0 ? void 0 : _b[0];
52522
52541
  if (!guideButton) {
52523
52542
  log('[predict] no guide button found, aborting');
52524
52543
  return;
52525
52544
  }
52526
- const _b = safeParse(guideButton.textContent, {}, log), { token } = _b, configuration = __rest(_b, ["token"]);
52545
+ var _c = safeParse(guideButton.textContent, {}, log), token = _c.token, configuration = __rest(_c, ["token"]);
52527
52546
  if (!configuration || !token) {
52528
52547
  log('[predict] no configuration found, aborting');
52529
52548
  return;
52530
52549
  }
52531
- const recordRegex = new RegExp(`/${configuration.recordRegexName}/([a-zA-Z0-9]+)(?:/|$)`);
52532
- const recordId = getRecordIdFromUrl(recordRegex, log);
52550
+ var recordRegex = new RegExp("/".concat(configuration.recordRegexName, "/([a-zA-Z0-9]+)(?:/|$)"));
52551
+ var recordId = getRecordIdFromUrl(recordRegex, log);
52533
52552
  if (!recordId) {
52534
52553
  log('[predict] no recordId found in URL, aborting');
52535
52554
  return;
52536
52555
  }
52537
- cleanupArray.push(setupMessageListener({ token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup, pendo }));
52538
- cleanupArray.push(createFloatingModal({ recordId, configuration }));
52556
+ cleanupArray.push(setupMessageListener({ token: token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup: cleanup, pendo: pendo }));
52557
+ cleanupArray.push(createFloatingModal({ recordId: recordId, configuration: configuration }));
52539
52558
  };
52540
52559
 
52541
52560
  const PredictGuides = () => {