@atlaskit/react-ufo 4.14.0 → 4.14.2

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.
@@ -18,7 +18,7 @@ var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
18
18
  var _intersectionObserver = require("./intersection-observer");
19
19
  var _mutationObserver = _interopRequireDefault(require("./mutation-observer"));
20
20
  var _performanceObserver = _interopRequireDefault(require("./performance-observer"));
21
- var _checkWithinComponent3 = _interopRequireWildcard(require("./utils/check-within-component"));
21
+ var _checkWithinComponent2 = _interopRequireWildcard(require("./utils/check-within-component"));
22
22
  var _getMutatedElements = require("./utils/get-mutated-elements");
23
23
  var _isElementVisible = require("./utils/is-element-visible");
24
24
  var _isInVcIgnoreIfNoLayoutShiftMarker = _interopRequireDefault(require("./utils/is-in-vc-ignore-if-no-layout-shift-marker"));
@@ -82,9 +82,9 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
82
82
  });
83
83
  (0, _defineProperty2.default)(this, "handleChildListMutation", /*#__PURE__*/function () {
84
84
  var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref4) {
85
- var target, addedNodes, removedNodes, timestamp, removedNodeRects, targetNode, _iterator, _step, _loop, _ret;
86
- return _regenerator.default.wrap(function _callee$(_context3) {
87
- while (1) switch (_context3.prev = _context3.next) {
85
+ var target, addedNodes, removedNodes, timestamp, removedNodeRects, targetNode, _iterator, _step, addedNodeRef, addedNode, _iterator2, _step2, _loop, _ret;
86
+ return _regenerator.default.wrap(function _callee$(_context2) {
87
+ while (1) switch (_context2.prev = _context2.next) {
88
88
  case 0:
89
89
  target = _ref4.target, addedNodes = _ref4.addedNodes, removedNodes = _ref4.removedNodes, timestamp = _ref4.timestamp;
90
90
  removedNodeRects = removedNodes.map(function (ref) {
@@ -96,179 +96,31 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
96
96
  });
97
97
  targetNode = target.deref();
98
98
  _iterator = _createForOfIteratorHelper(addedNodes);
99
- _context3.prev = 4;
99
+ _context2.prev = 4;
100
+ _iterator.s();
101
+ case 6:
102
+ if ((_step = _iterator.n()).done) {
103
+ _context2.next = 32;
104
+ break;
105
+ }
106
+ addedNodeRef = _step.value;
107
+ addedNode = addedNodeRef.deref();
108
+ if (addedNode) {
109
+ _context2.next = 11;
110
+ break;
111
+ }
112
+ return _context2.abrupt("continue", 30);
113
+ case 11:
114
+ _iterator2 = _createForOfIteratorHelper((0, _getMutatedElements.getMutatedElements)(addedNode));
115
+ _context2.prev = 12;
100
116
  _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
101
- var addedNodeRef, addedNode, _iterator2, _step2, _loop2, _ret2, ssrState, SSRStateEnum, _this$intersectionObs0, _this$intersectionObs1, ssrPlaceholderHandler, _this$intersectionObs10, result, _this$intersectionObs11, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs12, _this$intersectionObs13, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs14, _iterator3, _step3, _step3$value, isDisplayContentsElementChildren, element, _this$intersectionObs15, _this$intersectionObs16;
102
- return _regenerator.default.wrap(function _loop$(_context2) {
103
- while (1) switch (_context2.prev = _context2.next) {
117
+ var _step2$value, isDisplayContentsElementChildren, element, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _ref6, isWithinThirdPartySegment, _this$intersectionObs7, _this$intersectionObs8, _this$intersectionObs9;
118
+ return _regenerator.default.wrap(function _loop$(_context) {
119
+ while (1) switch (_context.prev = _context.next) {
104
120
  case 0:
105
- addedNodeRef = _step.value;
106
- addedNode = addedNodeRef.deref();
107
- if (addedNode) {
108
- _context2.next = 4;
109
- break;
110
- }
111
- return _context2.abrupt("return", 0);
112
- case 4:
113
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_ssr_placeholders_for_display_contents')) {
114
- _context2.next = 26;
115
- break;
116
- }
117
- _iterator2 = _createForOfIteratorHelper((0, _getMutatedElements.getMutatedElements)(addedNode));
118
- _context2.prev = 6;
119
- _loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
120
- var _step2$value, isDisplayContentsElementChildren, element, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _ref6, isWithinThirdPartySegment, _this$intersectionObs7, _this$intersectionObs8, _this$intersectionObs9;
121
- return _regenerator.default.wrap(function _loop2$(_context) {
122
- while (1) switch (_context.prev = _context.next) {
123
- case 0:
124
- _step2$value = _step2.value, isDisplayContentsElementChildren = _step2$value.isDisplayContentsElementChildren, element = _step2$value.element;
125
- if (!_this.getSSRState) {
126
- _context.next = 16;
127
- break;
128
- }
129
- ssrState = _this.getSSRState();
130
- SSRStateEnum = {
131
- normal: 1,
132
- waitingForFirstRender: 2,
133
- ignoring: 3
134
- };
135
- if (!(ssrState.state === SSRStateEnum.waitingForFirstRender && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
136
- _context.next = 9;
137
- break;
138
- }
139
- ssrState.state = SSRStateEnum.ignoring;
140
- if (ssrState.renderStop === -1) {
141
- // arbitrary 500ms DOM update window
142
- ssrState.renderStop = timestamp + 500;
143
- }
144
- (_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.watchAndTag(element, 'ssr-hydration');
145
- return _context.abrupt("return", 0);
146
- case 9:
147
- if (!(ssrState.state === SSRStateEnum.ignoring && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
148
- _context.next = 16;
149
- break;
150
- }
151
- if (!(timestamp <= ssrState.renderStop)) {
152
- _context.next = 15;
153
- break;
154
- }
155
- (_this$intersectionObs2 = _this.intersectionObserver) === null || _this$intersectionObs2 === void 0 || _this$intersectionObs2.watchAndTag(element, 'ssr-hydration');
156
- return _context.abrupt("return", 0);
157
- case 15:
158
- ssrState.state = SSRStateEnum.normal;
159
- case 16:
160
- if (!_this.getSSRPlaceholderHandler) {
161
- _context.next = 30;
162
- break;
163
- }
164
- ssrPlaceholderHandler = _this.getSSRPlaceholderHandler();
165
- if (!ssrPlaceholderHandler) {
166
- _context.next = 30;
167
- break;
168
- }
169
- if (!(ssrPlaceholderHandler.isPlaceholder(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
170
- _context.next = 23;
171
- break;
172
- }
173
- if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(element)) {
174
- _context.next = 23;
175
- break;
176
- }
177
- (_this$intersectionObs3 = _this.intersectionObserver) === null || _this$intersectionObs3 === void 0 || _this$intersectionObs3.watchAndTag(element, 'mutation:ssr-placeholder');
178
- return _context.abrupt("return", 0);
179
- case 23:
180
- if (!(ssrPlaceholderHandler.isPlaceholderReplacement(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
181
- _context.next = 30;
182
- break;
183
- }
184
- _context.next = 26;
185
- return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(element);
186
- case 26:
187
- result = _context.sent;
188
- if (!(result !== false)) {
189
- _context.next = 30;
190
- break;
191
- }
192
- (_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(element, 'mutation:ssr-placeholder');
193
- return _context.abrupt("return", 0);
194
- case 30:
195
- sameDeletedNode = removedNodes.find(function (ref) {
196
- var n = ref.deref();
197
- if (!n || !element) {
198
- return false;
199
- }
200
- return n.isEqualNode(element);
201
- });
202
- isInIgnoreLsMarker = element instanceof HTMLElement ? (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(element) : false;
203
- if (!(sameDeletedNode && isInIgnoreLsMarker)) {
204
- _context.next = 35;
205
- break;
206
- }
207
- (_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(element, 'mutation:remount');
208
- return _context.abrupt("return", 0);
209
- case 35:
210
- if (!(0, _vcUtils.isContainedWithinMediaWrapper)(element)) {
211
- _context.next = 38;
212
- break;
213
- }
214
- (_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(element, 'mutation:media');
215
- return _context.abrupt("return", 0);
216
- case 38:
217
- _ref6 = element instanceof HTMLElement ? (0, _checkWithinComponent3.default)(element, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
218
- isWithin: false
219
- }, isWithinThirdPartySegment = _ref6.isWithin;
220
- if (!isWithinThirdPartySegment) {
221
- _context.next = 42;
222
- break;
223
- }
224
- (_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(element, 'mutation:third-party-element');
225
- return _context.abrupt("return", 0);
226
- case 42:
227
- if (isDisplayContentsElementChildren) {
228
- (_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(element, 'mutation:display-contents-children-element');
229
- } else {
230
- (_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(element, createElementMutationsWatcher(removedNodeRects));
231
- }
232
- case 43:
233
- case "end":
234
- return _context.stop();
235
- }
236
- }, _loop2);
237
- });
238
- _iterator2.s();
239
- case 9:
240
- if ((_step2 = _iterator2.n()).done) {
241
- _context2.next = 16;
242
- break;
243
- }
244
- return _context2.delegateYield(_loop2(), "t0", 11);
245
- case 11:
246
- _ret2 = _context2.t0;
247
- if (!(_ret2 === 0)) {
248
- _context2.next = 14;
249
- break;
250
- }
251
- return _context2.abrupt("continue", 14);
252
- case 14:
253
- _context2.next = 9;
254
- break;
255
- case 16:
256
- _context2.next = 21;
257
- break;
258
- case 18:
259
- _context2.prev = 18;
260
- _context2.t1 = _context2["catch"](6);
261
- _iterator2.e(_context2.t1);
262
- case 21:
263
- _context2.prev = 21;
264
- _iterator2.f();
265
- return _context2.finish(21);
266
- case 24:
267
- _context2.next = 69;
268
- break;
269
- case 26:
121
+ _step2$value = _step2.value, isDisplayContentsElementChildren = _step2$value.isDisplayContentsElementChildren, element = _step2$value.element;
270
122
  if (!_this.getSSRState) {
271
- _context2.next = 41;
123
+ _context.next = 16;
272
124
  break;
273
125
  }
274
126
  ssrState = _this.getSSRState();
@@ -278,7 +130,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
278
130
  ignoring: 3
279
131
  };
280
132
  if (!(ssrState.state === SSRStateEnum.waitingForFirstRender && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
281
- _context2.next = 34;
133
+ _context.next = 9;
282
134
  break;
283
135
  }
284
136
  ssrState.state = SSRStateEnum.ignoring;
@@ -286,153 +138,159 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
286
138
  // arbitrary 500ms DOM update window
287
139
  ssrState.renderStop = timestamp + 500;
288
140
  }
289
- (_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(addedNode, 'ssr-hydration');
290
- return _context2.abrupt("return", 0);
291
- case 34:
141
+ (_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.watchAndTag(element, 'ssr-hydration');
142
+ return _context.abrupt("return", 0);
143
+ case 9:
292
144
  if (!(ssrState.state === SSRStateEnum.ignoring && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
293
- _context2.next = 41;
145
+ _context.next = 16;
294
146
  break;
295
147
  }
296
148
  if (!(timestamp <= ssrState.renderStop)) {
297
- _context2.next = 40;
149
+ _context.next = 15;
298
150
  break;
299
151
  }
300
- (_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(addedNode, 'ssr-hydration');
301
- return _context2.abrupt("return", 0);
302
- case 40:
152
+ (_this$intersectionObs2 = _this.intersectionObserver) === null || _this$intersectionObs2 === void 0 || _this$intersectionObs2.watchAndTag(element, 'ssr-hydration');
153
+ return _context.abrupt("return", 0);
154
+ case 15:
303
155
  ssrState.state = SSRStateEnum.normal;
304
- case 41:
156
+ case 16:
305
157
  if (!_this.getSSRPlaceholderHandler) {
306
- _context2.next = 55;
158
+ _context.next = 30;
307
159
  break;
308
160
  }
309
161
  ssrPlaceholderHandler = _this.getSSRPlaceholderHandler();
310
162
  if (!ssrPlaceholderHandler) {
311
- _context2.next = 55;
163
+ _context.next = 30;
312
164
  break;
313
165
  }
314
- if (!(ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode))) {
315
- _context2.next = 48;
166
+ if (!(ssrPlaceholderHandler.isPlaceholder(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
167
+ _context.next = 23;
316
168
  break;
317
169
  }
318
- if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(addedNode)) {
319
- _context2.next = 48;
170
+ if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(element)) {
171
+ _context.next = 23;
320
172
  break;
321
173
  }
322
- (_this$intersectionObs10 = _this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.watchAndTag(addedNode, 'mutation:ssr-placeholder');
323
- return _context2.abrupt("return", 0);
324
- case 48:
325
- if (!(ssrPlaceholderHandler.isPlaceholderReplacement(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode))) {
326
- _context2.next = 55;
174
+ (_this$intersectionObs3 = _this.intersectionObserver) === null || _this$intersectionObs3 === void 0 || _this$intersectionObs3.watchAndTag(element, 'mutation:ssr-placeholder');
175
+ return _context.abrupt("return", 0);
176
+ case 23:
177
+ if (!(ssrPlaceholderHandler.isPlaceholderReplacement(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
178
+ _context.next = 30;
327
179
  break;
328
180
  }
329
- _context2.next = 51;
330
- return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(addedNode);
331
- case 51:
332
- result = _context2.sent;
181
+ _context.next = 26;
182
+ return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(element);
183
+ case 26:
184
+ result = _context.sent;
333
185
  if (!(result !== false)) {
334
- _context2.next = 55;
186
+ _context.next = 30;
335
187
  break;
336
188
  }
337
- (_this$intersectionObs11 = _this.intersectionObserver) === null || _this$intersectionObs11 === void 0 || _this$intersectionObs11.watchAndTag(addedNode, 'mutation:ssr-placeholder');
338
- return _context2.abrupt("return", 0);
339
- case 55:
189
+ (_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(element, 'mutation:ssr-placeholder');
190
+ return _context.abrupt("return", 0);
191
+ case 30:
340
192
  sameDeletedNode = removedNodes.find(function (ref) {
341
193
  var n = ref.deref();
342
- if (!n || !addedNode) {
194
+ if (!n || !element) {
343
195
  return false;
344
196
  }
345
- return n.isEqualNode(addedNode);
197
+ return n.isEqualNode(element);
346
198
  });
347
- isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(addedNode);
199
+ isInIgnoreLsMarker = element instanceof HTMLElement ? (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(element) : false;
348
200
  if (!(sameDeletedNode && isInIgnoreLsMarker)) {
349
- _context2.next = 60;
201
+ _context.next = 35;
350
202
  break;
351
203
  }
352
- (_this$intersectionObs12 = _this.intersectionObserver) === null || _this$intersectionObs12 === void 0 || _this$intersectionObs12.watchAndTag(addedNode, 'mutation:remount');
353
- return _context2.abrupt("return", 0);
354
- case 60:
355
- if (!(0, _vcUtils.isContainedWithinMediaWrapper)(addedNode)) {
356
- _context2.next = 63;
204
+ (_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(element, 'mutation:remount');
205
+ return _context.abrupt("return", 0);
206
+ case 35:
207
+ if (!(0, _vcUtils.isContainedWithinMediaWrapper)(element)) {
208
+ _context.next = 38;
357
209
  break;
358
210
  }
359
- (_this$intersectionObs13 = _this.intersectionObserver) === null || _this$intersectionObs13 === void 0 || _this$intersectionObs13.watchAndTag(addedNode, 'mutation:media');
360
- return _context2.abrupt("return", 0);
361
- case 63:
362
- _checkWithinComponent = (0, _checkWithinComponent3.default)(addedNode, 'UFOThirdPartySegment', _this.mapIs3pResult), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
211
+ (_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(element, 'mutation:media');
212
+ return _context.abrupt("return", 0);
213
+ case 38:
214
+ _ref6 = element instanceof HTMLElement ? (0, _checkWithinComponent2.default)(element, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
215
+ isWithin: false
216
+ }, isWithinThirdPartySegment = _ref6.isWithin;
363
217
  if (!isWithinThirdPartySegment) {
364
- _context2.next = 67;
218
+ _context.next = 42;
365
219
  break;
366
220
  }
367
- (_this$intersectionObs14 = _this.intersectionObserver) === null || _this$intersectionObs14 === void 0 || _this$intersectionObs14.watchAndTag(addedNode, 'mutation:third-party-element');
368
- return _context2.abrupt("return", 0);
369
- case 67:
370
- _iterator3 = _createForOfIteratorHelper((0, _getMutatedElements.getMutatedElements)(addedNode));
371
- try {
372
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
373
- _step3$value = _step3.value, isDisplayContentsElementChildren = _step3$value.isDisplayContentsElementChildren, element = _step3$value.element;
374
- if (isDisplayContentsElementChildren) {
375
- (_this$intersectionObs15 = _this.intersectionObserver) === null || _this$intersectionObs15 === void 0 || _this$intersectionObs15.watchAndTag(element, 'mutation:display-contents-children-element');
376
- } else {
377
- (_this$intersectionObs16 = _this.intersectionObserver) === null || _this$intersectionObs16 === void 0 || _this$intersectionObs16.watchAndTag(element, createElementMutationsWatcher(removedNodeRects));
378
- }
379
- }
380
- } catch (err) {
381
- _iterator3.e(err);
382
- } finally {
383
- _iterator3.f();
221
+ (_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(element, 'mutation:third-party-element');
222
+ return _context.abrupt("return", 0);
223
+ case 42:
224
+ if (isDisplayContentsElementChildren) {
225
+ (_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(element, 'mutation:display-contents-children-element');
226
+ } else {
227
+ (_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(element, createElementMutationsWatcher(removedNodeRects));
384
228
  }
385
- case 69:
229
+ case 43:
386
230
  case "end":
387
- return _context2.stop();
231
+ return _context.stop();
388
232
  }
389
- }, _loop, null, [[6, 18, 21, 24]]);
233
+ }, _loop);
390
234
  });
391
- _iterator.s();
392
- case 7:
393
- if ((_step = _iterator.n()).done) {
394
- _context3.next = 14;
235
+ _iterator2.s();
236
+ case 15:
237
+ if ((_step2 = _iterator2.n()).done) {
238
+ _context2.next = 22;
395
239
  break;
396
240
  }
397
- return _context3.delegateYield(_loop(), "t0", 9);
398
- case 9:
399
- _ret = _context3.t0;
241
+ return _context2.delegateYield(_loop(), "t0", 17);
242
+ case 17:
243
+ _ret = _context2.t0;
400
244
  if (!(_ret === 0)) {
401
- _context3.next = 12;
245
+ _context2.next = 20;
402
246
  break;
403
247
  }
404
- return _context3.abrupt("continue", 12);
405
- case 12:
406
- _context3.next = 7;
248
+ return _context2.abrupt("continue", 20);
249
+ case 20:
250
+ _context2.next = 15;
407
251
  break;
408
- case 14:
409
- _context3.next = 19;
252
+ case 22:
253
+ _context2.next = 27;
410
254
  break;
411
- case 16:
412
- _context3.prev = 16;
413
- _context3.t1 = _context3["catch"](4);
414
- _iterator.e(_context3.t1);
415
- case 19:
416
- _context3.prev = 19;
255
+ case 24:
256
+ _context2.prev = 24;
257
+ _context2.t1 = _context2["catch"](12);
258
+ _iterator2.e(_context2.t1);
259
+ case 27:
260
+ _context2.prev = 27;
261
+ _iterator2.f();
262
+ return _context2.finish(27);
263
+ case 30:
264
+ _context2.next = 6;
265
+ break;
266
+ case 32:
267
+ _context2.next = 37;
268
+ break;
269
+ case 34:
270
+ _context2.prev = 34;
271
+ _context2.t2 = _context2["catch"](4);
272
+ _iterator.e(_context2.t2);
273
+ case 37:
274
+ _context2.prev = 37;
417
275
  _iterator.f();
418
- return _context3.finish(19);
419
- case 22:
276
+ return _context2.finish(37);
277
+ case 40:
420
278
  case "end":
421
- return _context3.stop();
279
+ return _context2.stop();
422
280
  }
423
- }, _callee, null, [[4, 16, 19, 22]]);
281
+ }, _callee, null, [[4, 34, 37, 40], [12, 24, 27, 30]]);
424
282
  }));
425
283
  return function (_x) {
426
284
  return _ref5.apply(this, arguments);
427
285
  };
428
286
  }());
429
287
  (0, _defineProperty2.default)(this, "handleAttributeMutation", function (_ref7) {
430
- var _this$intersectionObs17;
288
+ var _this$intersectionObs0;
431
289
  var target = _ref7.target,
432
290
  attributeName = _ref7.attributeName,
433
291
  oldValue = _ref7.oldValue,
434
292
  newValue = _ref7.newValue;
435
- (_this$intersectionObs17 = _this.intersectionObserver) === null || _this$intersectionObs17 === void 0 || _this$intersectionObs17.watchAndTag(target, function (_ref8) {
293
+ (_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(target, function (_ref8) {
436
294
  var target = _ref8.target,
437
295
  rect = _ref8.rect;
438
296
  if ((0, _vcUtils.isContainedWithinMediaWrapper)(target)) {
@@ -446,8 +304,8 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
446
304
  };
447
305
  }
448
306
  if ((0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_attribute_changes')) {
449
- var _checkWithinComponent2 = (0, _checkWithinComponent3.default)(target, 'UFOThirdPartySegment', _this.mapIs3pResult),
450
- isWithinThirdPartySegment = _checkWithinComponent2.isWithin;
307
+ var _checkWithinComponent = (0, _checkWithinComponent2.default)(target, 'UFOThirdPartySegment', _this.mapIs3pResult),
308
+ isWithinThirdPartySegment = _checkWithinComponent.isWithin;
451
309
  if (isWithinThirdPartySegment) {
452
310
  return {
453
311
  type: 'mutation:third-party-attribute',
@@ -508,11 +366,11 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
508
366
  (0, _defineProperty2.default)(this, "handleLayoutShift", function (_ref9) {
509
367
  var time = _ref9.time,
510
368
  changedRects = _ref9.changedRects;
511
- var _iterator4 = _createForOfIteratorHelper(changedRects),
512
- _step4;
369
+ var _iterator3 = _createForOfIteratorHelper(changedRects),
370
+ _step3;
513
371
  try {
514
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
515
- var changedRect = _step4.value;
372
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
373
+ var changedRect = _step3.value;
516
374
  var target = changedRect.node;
517
375
  if (target) {
518
376
  var isSameCurrentAndPreviousRects = (0, _isSameRectDimensions.isSameRectDimensions)(changedRect.rect, changedRect.previousRect);
@@ -527,9 +385,9 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
527
385
  }
528
386
  }
529
387
  } catch (err) {
530
- _iterator4.e(err);
388
+ _iterator3.e(err);
531
389
  } finally {
532
- _iterator4.f();
390
+ _iterator3.f();
533
391
  }
534
392
  });
535
393
  this.mapVisibleNodeRects = new WeakMap();
@@ -586,16 +444,16 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
586
444
  }, {
587
445
  key: "stop",
588
446
  value: function stop() {
589
- var _this$mutationObserve2, _this$intersectionObs18, _this$performanceObse2;
447
+ var _this$mutationObserve2, _this$intersectionObs1, _this$performanceObse2;
590
448
  if (!this.isStarted) {
591
449
  return;
592
450
  }
593
451
  (_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
594
- (_this$intersectionObs18 = this.intersectionObserver) === null || _this$intersectionObs18 === void 0 || _this$intersectionObs18.disconnect();
452
+ (_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.disconnect();
595
453
  (_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
596
454
  this.isStarted = false;
597
455
  // Clean up caches when stopping
598
- (0, _checkWithinComponent3.cleanupCaches)(this.mapIs3pResult);
456
+ (0, _checkWithinComponent2.cleanupCaches)(this.mapIs3pResult);
599
457
  }
600
458
  }]);
601
459
  }();
@@ -774,7 +774,7 @@ export function tryComplete(interactionId, endTime) {
774
774
  if ((_getConfig1 = getConfig()) !== null && _getConfig1 !== void 0 && (_getConfig1$extraInte = _getConfig1.extraInteractionMetrics) !== null && _getConfig1$extraInte !== void 0 && _getConfig1$extraInte.enabled) {
775
775
  interactionExtraMetrics.updateFinishedInteraction(interaction);
776
776
  }
777
- if ((_getConfig10 = getConfig()) !== null && _getConfig10 !== void 0 && (_getConfig10$extraSea = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10$extraSea !== void 0 && _getConfig10$extraSea.enabled && interaction.ufoName === ((_getConfig11 = getConfig()) === null || _getConfig11 === void 0 ? void 0 : (_getConfig11$extraSea = _getConfig11.extraSearchPageInteraction) === null || _getConfig11$extraSea === void 0 ? void 0 : _getConfig11$extraSea.searchPageMetricName) && fg('react_ufo_unified_search_ignoring_sain_metric')) {
777
+ if ((_getConfig10 = getConfig()) !== null && _getConfig10 !== void 0 && (_getConfig10$extraSea = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10$extraSea !== void 0 && _getConfig10$extraSea.enabled && interaction.ufoName === ((_getConfig11 = getConfig()) === null || _getConfig11 === void 0 ? void 0 : (_getConfig11$extraSea = _getConfig11.extraSearchPageInteraction) === null || _getConfig11$extraSea === void 0 ? void 0 : _getConfig11$extraSea.searchPageMetricName)) {
778
778
  onSearchPageInteractionComplete(interactionId, interaction);
779
779
  }
780
780
  activeSubmitted = true;
@@ -799,7 +799,7 @@ export function tryComplete(interactionId, endTime) {
799
799
  if (!activeSubmitted) {
800
800
  var _getConfig13, _getConfig13$extraSea, _getConfig14, _getConfig14$extraSea;
801
801
  finishInteraction(interactionId, interaction, endTime);
802
- if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13$extraSea = _getConfig13.extraSearchPageInteraction) !== null && _getConfig13$extraSea !== void 0 && _getConfig13$extraSea.enabled && interaction.ufoName === ((_getConfig14 = getConfig()) === null || _getConfig14 === void 0 ? void 0 : (_getConfig14$extraSea = _getConfig14.extraSearchPageInteraction) === null || _getConfig14$extraSea === void 0 ? void 0 : _getConfig14$extraSea.searchPageMetricName) && fg('react_ufo_unified_search_ignoring_sain_metric')) {
802
+ if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13$extraSea = _getConfig13.extraSearchPageInteraction) !== null && _getConfig13$extraSea !== void 0 && _getConfig13$extraSea.enabled && interaction.ufoName === ((_getConfig14 = getConfig()) === null || _getConfig14 === void 0 ? void 0 : (_getConfig14$extraSea = _getConfig14.extraSearchPageInteraction) === null || _getConfig14$extraSea === void 0 ? void 0 : _getConfig14$extraSea.searchPageMetricName)) {
803
803
  onSearchPageInteractionComplete(interactionId, interaction);
804
804
  }
805
805
  activeSubmitted = true;
@@ -159,7 +159,7 @@ export function init(analyticsWebClientAsync, config) {
159
159
  if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled && fg('platform_ufo_enable_ttai_with_3p')) {
160
160
  sinkInteractionExtraMetrics(instance, createInteractionExtraMetricsPayloadPackage.default);
161
161
  }
162
- if (config !== null && config !== void 0 && (_config$extraSearchPa = config.extraSearchPageInteraction) !== null && _config$extraSearchPa !== void 0 && _config$extraSearchPa.enabled && fg('react_ufo_unified_search_ignoring_sain_metric')) {
162
+ if (config !== null && config !== void 0 && (_config$extraSearchPa = config.extraSearchPageInteraction) !== null && _config$extraSearchPa !== void 0 && _config$extraSearchPa.enabled) {
163
163
  sinkExtraSearchPageInteraction(instance, payloadPackage);
164
164
  }
165
165
  });