@spscommerce/positioning 6.37.3 → 7.0.1
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.
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +491 -872
- package/lib/positioning.service.d.ts +2 -2
- package/package.json +6 -7
package/lib/index.es.js
CHANGED
|
@@ -1,512 +1,273 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { onNextTick, lockedToAnimationFrames } from "@spscommerce/utils";
|
|
21
|
-
var Position;
|
|
22
|
-
(function(Position2) {
|
|
23
|
-
Position2["TOP_LEFT"] = "top left";
|
|
24
|
-
Position2["TOP_MIDDLE"] = "top middle";
|
|
25
|
-
Position2["TOP_RIGHT"] = "top right";
|
|
26
|
-
Position2["RIGHT_TOP"] = "right top";
|
|
27
|
-
Position2["RIGHT_MIDDLE"] = "right middle";
|
|
28
|
-
Position2["RIGHT_BOTTOM"] = "right bottom";
|
|
29
|
-
Position2["BOTTOM_RIGHT"] = "bottom right";
|
|
30
|
-
Position2["BOTTOM_MIDDLE"] = "bottom middle";
|
|
31
|
-
Position2["BOTTOM_LEFT"] = "bottom left";
|
|
32
|
-
Position2["LEFT_BOTTOM"] = "left bottom";
|
|
33
|
-
Position2["LEFT_MIDDLE"] = "left middle";
|
|
34
|
-
Position2["LEFT_TOP"] = "left top";
|
|
35
|
-
})(Position || (Position = {}));
|
|
36
|
-
var PositionAnchor;
|
|
37
|
-
(function(PositionAnchor2) {
|
|
38
|
-
PositionAnchor2["TOP_LEFT"] = "top left";
|
|
39
|
-
PositionAnchor2["TOP_RIGHT"] = "top right";
|
|
40
|
-
PositionAnchor2["BOTTOM_LEFT"] = "bottom left";
|
|
41
|
-
PositionAnchor2["BOTTOM_RIGHT"] = "bottom right";
|
|
42
|
-
})(PositionAnchor || (PositionAnchor = {}));
|
|
43
|
-
const DEFAULT_POSITIONING_OPTIONS = {
|
|
44
|
-
anchor: PositionAnchor.TOP_LEFT,
|
|
1
|
+
var H = Object.defineProperty;
|
|
2
|
+
var N = (e, r, s) => r in e ? H(e, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[r] = s;
|
|
3
|
+
var k = (e, r, s) => (N(e, typeof r != "symbol" ? r + "" : r, s), s);
|
|
4
|
+
import { onNextTick as U, lockedToAnimationFrames as j } from "@spscommerce/utils";
|
|
5
|
+
var F = /* @__PURE__ */ ((e) => (e.TOP_LEFT = "top left", e.TOP_MIDDLE = "top middle", e.TOP_RIGHT = "top right", e.RIGHT_TOP = "right top", e.RIGHT_MIDDLE = "right middle", e.RIGHT_BOTTOM = "right bottom", e.BOTTOM_RIGHT = "bottom right", e.BOTTOM_MIDDLE = "bottom middle", e.BOTTOM_LEFT = "bottom left", e.LEFT_BOTTOM = "left bottom", e.LEFT_MIDDLE = "left middle", e.LEFT_TOP = "left top", e))(F || {}), P = /* @__PURE__ */ ((e) => (e.TOP_LEFT = "top left", e.TOP_RIGHT = "top right", e.BOTTOM_LEFT = "bottom left", e.BOTTOM_RIGHT = "bottom right", e))(P || {});
|
|
6
|
+
const V = {
|
|
7
|
+
anchor: P.TOP_LEFT,
|
|
45
8
|
offsets: [],
|
|
46
|
-
position:
|
|
9
|
+
position: F.TOP_LEFT
|
|
47
10
|
};
|
|
48
11
|
(function() {
|
|
49
|
-
if (typeof window
|
|
12
|
+
if (typeof window != "object")
|
|
50
13
|
return;
|
|
51
|
-
}
|
|
52
14
|
if ("IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype) {
|
|
53
|
-
|
|
54
|
-
|
|
15
|
+
"isIntersecting" in window.IntersectionObserverEntry.prototype || Object.defineProperty(
|
|
16
|
+
window.IntersectionObserverEntry.prototype,
|
|
17
|
+
"isIntersecting",
|
|
18
|
+
{
|
|
55
19
|
get: function() {
|
|
56
20
|
return this.intersectionRatio > 0;
|
|
57
21
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
22
|
+
}
|
|
23
|
+
);
|
|
60
24
|
return;
|
|
61
25
|
}
|
|
62
|
-
function
|
|
26
|
+
function e(t) {
|
|
63
27
|
try {
|
|
64
|
-
return
|
|
65
|
-
} catch
|
|
28
|
+
return t.defaultView && t.defaultView.frameElement || null;
|
|
29
|
+
} catch {
|
|
66
30
|
return null;
|
|
67
31
|
}
|
|
68
32
|
}
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var registry = [];
|
|
79
|
-
var crossOriginUpdater = null;
|
|
80
|
-
var crossOriginRect = null;
|
|
81
|
-
function IntersectionObserverEntry2(entry) {
|
|
82
|
-
this.time = entry.time;
|
|
83
|
-
this.target = entry.target;
|
|
84
|
-
this.rootBounds = ensureDOMRect(entry.rootBounds);
|
|
85
|
-
this.boundingClientRect = ensureDOMRect(entry.boundingClientRect);
|
|
86
|
-
this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect());
|
|
87
|
-
this.isIntersecting = !!entry.intersectionRect;
|
|
88
|
-
var targetRect = this.boundingClientRect;
|
|
89
|
-
var targetArea = targetRect.width * targetRect.height;
|
|
90
|
-
var intersectionRect = this.intersectionRect;
|
|
91
|
-
var intersectionArea = intersectionRect.width * intersectionRect.height;
|
|
92
|
-
if (targetArea) {
|
|
93
|
-
this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));
|
|
94
|
-
} else {
|
|
95
|
-
this.intersectionRatio = this.isIntersecting ? 1 : 0;
|
|
96
|
-
}
|
|
33
|
+
var r = function(t) {
|
|
34
|
+
for (var n = t, o = e(n); o; )
|
|
35
|
+
n = o.ownerDocument, o = e(n);
|
|
36
|
+
return n;
|
|
37
|
+
}(window.document), s = [], f = null, g = null;
|
|
38
|
+
function b(t) {
|
|
39
|
+
this.time = t.time, this.target = t.target, this.rootBounds = m(t.rootBounds), this.boundingClientRect = m(t.boundingClientRect), this.intersectionRect = m(t.intersectionRect || w()), this.isIntersecting = !!t.intersectionRect;
|
|
40
|
+
var n = this.boundingClientRect, o = n.width * n.height, a = this.intersectionRect, c = a.width * a.height;
|
|
41
|
+
o ? this.intersectionRatio = Number((c / o).toFixed(4)) : this.intersectionRatio = this.isIntersecting ? 1 : 0;
|
|
97
42
|
}
|
|
98
|
-
function
|
|
99
|
-
var
|
|
100
|
-
if (typeof
|
|
43
|
+
function l(t, n) {
|
|
44
|
+
var o = n || {};
|
|
45
|
+
if (typeof t != "function")
|
|
101
46
|
throw new Error("callback must be a function");
|
|
102
|
-
|
|
103
|
-
if (options.root && options.root.nodeType != 1 && options.root.nodeType != 9) {
|
|
47
|
+
if (o.root && o.root.nodeType != 1 && o.root.nodeType != 9)
|
|
104
48
|
throw new Error("root must be a Document or Element");
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this._observationTargets = []
|
|
109
|
-
|
|
110
|
-
this.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (!crossOriginUpdater) {
|
|
124
|
-
crossOriginUpdater = function(boundingClientRect, intersectionRect) {
|
|
125
|
-
if (!boundingClientRect || !intersectionRect) {
|
|
126
|
-
crossOriginRect = getEmptyRect();
|
|
127
|
-
} else {
|
|
128
|
-
crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect);
|
|
129
|
-
}
|
|
130
|
-
registry.forEach(function(observer) {
|
|
131
|
-
observer._checkForIntersections();
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return crossOriginUpdater;
|
|
136
|
-
};
|
|
137
|
-
IntersectionObserver2._resetCrossOriginUpdater = function() {
|
|
138
|
-
crossOriginUpdater = null;
|
|
139
|
-
crossOriginRect = null;
|
|
140
|
-
};
|
|
141
|
-
IntersectionObserver2.prototype.observe = function(target) {
|
|
142
|
-
var isTargetAlreadyObserved = this._observationTargets.some(function(item) {
|
|
143
|
-
return item.element == target;
|
|
144
|
-
});
|
|
145
|
-
if (isTargetAlreadyObserved) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (!(target && target.nodeType == 1)) {
|
|
149
|
-
throw new Error("target must be an Element");
|
|
150
|
-
}
|
|
151
|
-
this._registerInstance();
|
|
152
|
-
this._observationTargets.push({ element: target, entry: null });
|
|
153
|
-
this._monitorIntersections(target.ownerDocument);
|
|
154
|
-
this._checkForIntersections();
|
|
155
|
-
};
|
|
156
|
-
IntersectionObserver2.prototype.unobserve = function(target) {
|
|
157
|
-
this._observationTargets = this._observationTargets.filter(function(item) {
|
|
158
|
-
return item.element != target;
|
|
49
|
+
this._checkForIntersections = d(
|
|
50
|
+
this._checkForIntersections.bind(this),
|
|
51
|
+
this.THROTTLE_TIMEOUT
|
|
52
|
+
), this._callback = t, this._observationTargets = [], this._queuedEntries = [], this._rootMarginValues = this._parseRootMargin(o.rootMargin), this.thresholds = this._initThresholds(o.threshold), this.root = o.root || null, this.rootMargin = this._rootMarginValues.map(function(a) {
|
|
53
|
+
return a.value + a.unit;
|
|
54
|
+
}).join(" "), this._monitoringDocuments = [], this._monitoringUnsubscribes = [];
|
|
55
|
+
}
|
|
56
|
+
l.prototype.THROTTLE_TIMEOUT = 100, l.prototype.POLL_INTERVAL = null, l.prototype.USE_MUTATION_OBSERVER = !0, l._setupCrossOriginUpdater = function() {
|
|
57
|
+
return f || (f = function(t, n) {
|
|
58
|
+
!t || !n ? g = w() : g = x(t, n), s.forEach(function(o) {
|
|
59
|
+
o._checkForIntersections();
|
|
60
|
+
});
|
|
61
|
+
}), f;
|
|
62
|
+
}, l._resetCrossOriginUpdater = function() {
|
|
63
|
+
f = null, g = null;
|
|
64
|
+
}, l.prototype.observe = function(t) {
|
|
65
|
+
var n = this._observationTargets.some(function(o) {
|
|
66
|
+
return o.element == t;
|
|
159
67
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this._observationTargets =
|
|
167
|
-
|
|
168
|
-
this._unregisterInstance();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
this._queuedEntries
|
|
173
|
-
return
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
threshold = [threshold];
|
|
179
|
-
return threshold.sort().filter(function(t, i, a) {
|
|
180
|
-
if (typeof t != "number" || isNaN(t) || t < 0 || t > 1) {
|
|
68
|
+
if (!n) {
|
|
69
|
+
if (!(t && t.nodeType == 1))
|
|
70
|
+
throw new Error("target must be an Element");
|
|
71
|
+
this._registerInstance(), this._observationTargets.push({ element: t, entry: null }), this._monitorIntersections(t.ownerDocument), this._checkForIntersections();
|
|
72
|
+
}
|
|
73
|
+
}, l.prototype.unobserve = function(t) {
|
|
74
|
+
this._observationTargets = this._observationTargets.filter(function(n) {
|
|
75
|
+
return n.element != t;
|
|
76
|
+
}), this._unmonitorIntersections(t.ownerDocument), this._observationTargets.length == 0 && this._unregisterInstance();
|
|
77
|
+
}, l.prototype.disconnect = function() {
|
|
78
|
+
this._observationTargets = [], this._unmonitorAllIntersections(), this._unregisterInstance();
|
|
79
|
+
}, l.prototype.takeRecords = function() {
|
|
80
|
+
var t = this._queuedEntries.slice();
|
|
81
|
+
return this._queuedEntries = [], t;
|
|
82
|
+
}, l.prototype._initThresholds = function(t) {
|
|
83
|
+
var n = t || [0];
|
|
84
|
+
return Array.isArray(n) || (n = [n]), n.sort().filter(function(o, a, c) {
|
|
85
|
+
if (typeof o != "number" || isNaN(o) || o < 0 || o > 1)
|
|
181
86
|
throw new Error("threshold must be a number between 0 and 1 inclusively");
|
|
182
|
-
|
|
183
|
-
return t !== a[i - 1];
|
|
87
|
+
return o !== c[a - 1];
|
|
184
88
|
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin);
|
|
190
|
-
if (!parts) {
|
|
89
|
+
}, l.prototype._parseRootMargin = function(t) {
|
|
90
|
+
var n = t || "0px", o = n.split(/\s+/).map(function(a) {
|
|
91
|
+
var c = /^(-?\d*\.?\d+)(px|%)$/.exec(a);
|
|
92
|
+
if (!c)
|
|
191
93
|
throw new Error("rootMargin must be specified in pixels or percent");
|
|
192
|
-
}
|
|
193
|
-
return { value: parseFloat(parts[1]), unit: parts[2] };
|
|
194
|
-
});
|
|
195
|
-
margins[1] = margins[1] || margins[0];
|
|
196
|
-
margins[2] = margins[2] || margins[0];
|
|
197
|
-
margins[3] = margins[3] || margins[1];
|
|
198
|
-
return margins;
|
|
199
|
-
};
|
|
200
|
-
IntersectionObserver2.prototype._monitorIntersections = function(doc) {
|
|
201
|
-
var win = doc.defaultView;
|
|
202
|
-
if (!win) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (this._monitoringDocuments.indexOf(doc) != -1) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
var callback = this._checkForIntersections;
|
|
209
|
-
var monitoringInterval = null;
|
|
210
|
-
var domObserver = null;
|
|
211
|
-
if (this.POLL_INTERVAL) {
|
|
212
|
-
monitoringInterval = win.setInterval(callback, this.POLL_INTERVAL);
|
|
213
|
-
} else {
|
|
214
|
-
addEvent(win, "resize", callback, true);
|
|
215
|
-
addEvent(doc, "scroll", callback, true);
|
|
216
|
-
if (this.USE_MUTATION_OBSERVER && "MutationObserver" in win) {
|
|
217
|
-
domObserver = new win.MutationObserver(callback);
|
|
218
|
-
domObserver.observe(doc, {
|
|
219
|
-
attributes: true,
|
|
220
|
-
childList: true,
|
|
221
|
-
characterData: true,
|
|
222
|
-
subtree: true
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
this._monitoringDocuments.push(doc);
|
|
227
|
-
this._monitoringUnsubscribes.push(function() {
|
|
228
|
-
var win2 = doc.defaultView;
|
|
229
|
-
if (win2) {
|
|
230
|
-
if (monitoringInterval) {
|
|
231
|
-
win2.clearInterval(monitoringInterval);
|
|
232
|
-
}
|
|
233
|
-
removeEvent(win2, "resize", callback, true);
|
|
234
|
-
}
|
|
235
|
-
removeEvent(doc, "scroll", callback, true);
|
|
236
|
-
if (domObserver) {
|
|
237
|
-
domObserver.disconnect();
|
|
238
|
-
}
|
|
94
|
+
return { value: parseFloat(c[1]), unit: c[2] };
|
|
239
95
|
});
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
96
|
+
return o[1] = o[1] || o[0], o[2] = o[2] || o[0], o[3] = o[3] || o[1], o;
|
|
97
|
+
}, l.prototype._monitorIntersections = function(t) {
|
|
98
|
+
var n = t.defaultView;
|
|
99
|
+
if (!!n && this._monitoringDocuments.indexOf(t) == -1) {
|
|
100
|
+
var o = this._checkForIntersections, a = null, c = null;
|
|
101
|
+
this.POLL_INTERVAL ? a = n.setInterval(o, this.POLL_INTERVAL) : (u(n, "resize", o, !0), u(t, "scroll", o, !0), this.USE_MUTATION_OBSERVER && "MutationObserver" in n && (c = new n.MutationObserver(o), c.observe(t, {
|
|
102
|
+
attributes: !0,
|
|
103
|
+
childList: !0,
|
|
104
|
+
characterData: !0,
|
|
105
|
+
subtree: !0
|
|
106
|
+
}))), this._monitoringDocuments.push(t), this._monitoringUnsubscribes.push(function() {
|
|
107
|
+
var O = t.defaultView;
|
|
108
|
+
O && (a && O.clearInterval(a), p(O, "resize", o, !0)), p(t, "scroll", o, !0), c && c.disconnect();
|
|
109
|
+
});
|
|
110
|
+
var E = this.root && (this.root.ownerDocument || this.root) || r;
|
|
111
|
+
if (t != E) {
|
|
112
|
+
var y = e(t);
|
|
113
|
+
y && this._monitorIntersections(y.ownerDocument);
|
|
245
114
|
}
|
|
246
115
|
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
while (itemDoc && itemDoc != rootDoc) {
|
|
260
|
-
var frame2 = getFrameElement(itemDoc);
|
|
261
|
-
itemDoc = frame2 && frame2.ownerDocument;
|
|
262
|
-
if (itemDoc == doc) {
|
|
263
|
-
return true;
|
|
116
|
+
}, l.prototype._unmonitorIntersections = function(t) {
|
|
117
|
+
var n = this._monitoringDocuments.indexOf(t);
|
|
118
|
+
if (n != -1) {
|
|
119
|
+
var o = this.root && (this.root.ownerDocument || this.root) || r, a = this._observationTargets.some(function(y) {
|
|
120
|
+
var O = y.element.ownerDocument;
|
|
121
|
+
if (O == t)
|
|
122
|
+
return !0;
|
|
123
|
+
for (; O && O != o; ) {
|
|
124
|
+
var R = e(O);
|
|
125
|
+
if (O = R && R.ownerDocument, O == t)
|
|
126
|
+
return !0;
|
|
264
127
|
}
|
|
265
|
-
|
|
266
|
-
return false;
|
|
267
|
-
});
|
|
268
|
-
if (hasDependentTargets) {
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
var unsubscribe = this._monitoringUnsubscribes[index];
|
|
272
|
-
this._monitoringDocuments.splice(index, 1);
|
|
273
|
-
this._monitoringUnsubscribes.splice(index, 1);
|
|
274
|
-
unsubscribe();
|
|
275
|
-
if (doc != rootDoc) {
|
|
276
|
-
var frame = getFrameElement(doc);
|
|
277
|
-
if (frame) {
|
|
278
|
-
this._unmonitorIntersections(frame.ownerDocument);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
IntersectionObserver2.prototype._unmonitorAllIntersections = function() {
|
|
283
|
-
var unsubscribes = this._monitoringUnsubscribes.slice(0);
|
|
284
|
-
this._monitoringDocuments.length = 0;
|
|
285
|
-
this._monitoringUnsubscribes.length = 0;
|
|
286
|
-
for (var i = 0; i < unsubscribes.length; i++) {
|
|
287
|
-
unsubscribes[i]();
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
IntersectionObserver2.prototype._checkForIntersections = function() {
|
|
291
|
-
if (!this.root && crossOriginUpdater && !crossOriginRect) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
var rootIsInDom = this._rootIsInDom();
|
|
295
|
-
var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();
|
|
296
|
-
this._observationTargets.forEach(function(item) {
|
|
297
|
-
var target = item.element;
|
|
298
|
-
var targetRect = getBoundingClientRect(target);
|
|
299
|
-
var rootContainsTarget = this._rootContainsTarget(target);
|
|
300
|
-
var oldEntry = item.entry;
|
|
301
|
-
var intersectionRect = rootIsInDom && rootContainsTarget && this._computeTargetAndRootIntersection(target, targetRect, rootRect);
|
|
302
|
-
var rootBounds = null;
|
|
303
|
-
if (!this._rootContainsTarget(target)) {
|
|
304
|
-
rootBounds = getEmptyRect();
|
|
305
|
-
} else if (!crossOriginUpdater || this.root) {
|
|
306
|
-
rootBounds = rootRect;
|
|
307
|
-
}
|
|
308
|
-
var newEntry = item.entry = new IntersectionObserverEntry2({
|
|
309
|
-
time: now(),
|
|
310
|
-
target,
|
|
311
|
-
boundingClientRect: targetRect,
|
|
312
|
-
rootBounds,
|
|
313
|
-
intersectionRect
|
|
128
|
+
return !1;
|
|
314
129
|
});
|
|
315
|
-
if (!
|
|
316
|
-
this.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
this.
|
|
320
|
-
}
|
|
321
|
-
} else {
|
|
322
|
-
if (oldEntry && oldEntry.isIntersecting) {
|
|
323
|
-
this._queuedEntries.push(newEntry);
|
|
130
|
+
if (!a) {
|
|
131
|
+
var c = this._monitoringUnsubscribes[n];
|
|
132
|
+
if (this._monitoringDocuments.splice(n, 1), this._monitoringUnsubscribes.splice(n, 1), c(), t != o) {
|
|
133
|
+
var E = e(t);
|
|
134
|
+
E && this._unmonitorIntersections(E.ownerDocument);
|
|
324
135
|
}
|
|
325
136
|
}
|
|
326
|
-
}, this);
|
|
327
|
-
if (this._queuedEntries.length) {
|
|
328
|
-
this._callback(this.takeRecords(), this);
|
|
329
137
|
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
} else {
|
|
364
|
-
parent = null;
|
|
365
|
-
intersectionRect = null;
|
|
138
|
+
}, l.prototype._unmonitorAllIntersections = function() {
|
|
139
|
+
var t = this._monitoringUnsubscribes.slice(0);
|
|
140
|
+
this._monitoringDocuments.length = 0, this._monitoringUnsubscribes.length = 0;
|
|
141
|
+
for (var n = 0; n < t.length; n++)
|
|
142
|
+
t[n]();
|
|
143
|
+
}, l.prototype._checkForIntersections = function() {
|
|
144
|
+
if (!(!this.root && f && !g)) {
|
|
145
|
+
var t = this._rootIsInDom(), n = t ? this._getRootRect() : w();
|
|
146
|
+
this._observationTargets.forEach(function(o) {
|
|
147
|
+
var a = o.element, c = T(a), E = this._rootContainsTarget(a), y = o.entry, O = t && E && this._computeTargetAndRootIntersection(a, c, n), R = null;
|
|
148
|
+
this._rootContainsTarget(a) ? (!f || this.root) && (R = n) : R = w();
|
|
149
|
+
var D = o.entry = new b({
|
|
150
|
+
time: _(),
|
|
151
|
+
target: a,
|
|
152
|
+
boundingClientRect: c,
|
|
153
|
+
rootBounds: R,
|
|
154
|
+
intersectionRect: O
|
|
155
|
+
});
|
|
156
|
+
y ? t && E ? this._hasCrossedThreshold(y, D) && this._queuedEntries.push(D) : y && y.isIntersecting && this._queuedEntries.push(D) : this._queuedEntries.push(D);
|
|
157
|
+
}, this), this._queuedEntries.length && this._callback(this.takeRecords(), this);
|
|
158
|
+
}
|
|
159
|
+
}, l.prototype._computeTargetAndRootIntersection = function(t, n, o) {
|
|
160
|
+
if (window.getComputedStyle(t).display != "none") {
|
|
161
|
+
for (var a = n, c = I(t), E = !1; !E && c; ) {
|
|
162
|
+
var y = null, O = c.nodeType == 1 ? window.getComputedStyle(c) : {};
|
|
163
|
+
if (O.display == "none")
|
|
164
|
+
return null;
|
|
165
|
+
if (c == this.root || c.nodeType == 9)
|
|
166
|
+
if (E = !0, c == this.root || c == r)
|
|
167
|
+
f && !this.root ? !g || g.width == 0 && g.height == 0 ? (c = null, y = null, a = null) : y = g : y = o;
|
|
168
|
+
else {
|
|
169
|
+
var R = I(c), D = R && T(R), C = R && this._computeTargetAndRootIntersection(R, D, o);
|
|
170
|
+
D && C ? (c = R, y = x(D, C)) : (c = null, a = null);
|
|
366
171
|
}
|
|
172
|
+
else {
|
|
173
|
+
var A = c.ownerDocument;
|
|
174
|
+
c != A.body && c != A.documentElement && O.overflow != "visible" && (y = T(c));
|
|
367
175
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
parentRect = getBoundingClientRect(parent);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
if (parentRect) {
|
|
375
|
-
intersectionRect = computeRectIntersection(parentRect, intersectionRect);
|
|
176
|
+
if (y && (a = v(y, a)), !a)
|
|
177
|
+
break;
|
|
178
|
+
c = c && I(c);
|
|
376
179
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
rootRect = getBoundingClientRect(this.root);
|
|
387
|
-
} else {
|
|
388
|
-
var doc = isDoc(this.root) ? this.root : document2;
|
|
389
|
-
var html = doc.documentElement;
|
|
390
|
-
var body = doc.body;
|
|
391
|
-
rootRect = {
|
|
180
|
+
return a;
|
|
181
|
+
}
|
|
182
|
+
}, l.prototype._getRootRect = function() {
|
|
183
|
+
var t;
|
|
184
|
+
if (this.root && !L(this.root))
|
|
185
|
+
t = T(this.root);
|
|
186
|
+
else {
|
|
187
|
+
var n = L(this.root) ? this.root : r, o = n.documentElement, a = n.body;
|
|
188
|
+
t = {
|
|
392
189
|
top: 0,
|
|
393
190
|
left: 0,
|
|
394
|
-
right:
|
|
395
|
-
width:
|
|
396
|
-
bottom:
|
|
397
|
-
height:
|
|
191
|
+
right: o.clientWidth || a.clientWidth,
|
|
192
|
+
width: o.clientWidth || a.clientWidth,
|
|
193
|
+
bottom: o.clientHeight || a.clientHeight,
|
|
194
|
+
height: o.clientHeight || a.clientHeight
|
|
398
195
|
};
|
|
399
196
|
}
|
|
400
|
-
return this._expandRectByRootMargin(
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
bottom: rect.bottom + margins[2],
|
|
410
|
-
left: rect.left - margins[3]
|
|
197
|
+
return this._expandRectByRootMargin(t);
|
|
198
|
+
}, l.prototype._expandRectByRootMargin = function(t) {
|
|
199
|
+
var n = this._rootMarginValues.map(function(a, c) {
|
|
200
|
+
return a.unit == "px" ? a.value : a.value * (c % 2 ? t.width : t.height) / 100;
|
|
201
|
+
}), o = {
|
|
202
|
+
top: t.top - n[0],
|
|
203
|
+
right: t.right + n[1],
|
|
204
|
+
bottom: t.bottom + n[2],
|
|
205
|
+
left: t.left - n[3]
|
|
411
206
|
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
return;
|
|
421
|
-
for (var i = 0; i < this.thresholds.length; i++) {
|
|
422
|
-
var threshold = this.thresholds[i];
|
|
423
|
-
if (threshold == oldRatio || threshold == newRatio || threshold < oldRatio !== threshold < newRatio) {
|
|
424
|
-
return true;
|
|
207
|
+
return o.width = o.right - o.left, o.height = o.bottom - o.top, o;
|
|
208
|
+
}, l.prototype._hasCrossedThreshold = function(t, n) {
|
|
209
|
+
var o = t && t.isIntersecting ? t.intersectionRatio || 0 : -1, a = n.isIntersecting ? n.intersectionRatio || 0 : -1;
|
|
210
|
+
if (o !== a)
|
|
211
|
+
for (var c = 0; c < this.thresholds.length; c++) {
|
|
212
|
+
var E = this.thresholds[c];
|
|
213
|
+
if (E == o || E == a || E < o != E < a)
|
|
214
|
+
return !0;
|
|
425
215
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
if (registry.indexOf(this) < 0) {
|
|
437
|
-
registry.push(this);
|
|
438
|
-
}
|
|
216
|
+
}, l.prototype._rootIsInDom = function() {
|
|
217
|
+
return !this.root || h(r, this.root);
|
|
218
|
+
}, l.prototype._rootContainsTarget = function(t) {
|
|
219
|
+
var n = this.root && (this.root.ownerDocument || this.root) || r;
|
|
220
|
+
return h(n, t) && (!this.root || n == t.ownerDocument);
|
|
221
|
+
}, l.prototype._registerInstance = function() {
|
|
222
|
+
s.indexOf(this) < 0 && s.push(this);
|
|
223
|
+
}, l.prototype._unregisterInstance = function() {
|
|
224
|
+
var t = s.indexOf(this);
|
|
225
|
+
t != -1 && s.splice(t, 1);
|
|
439
226
|
};
|
|
440
|
-
|
|
441
|
-
var index = registry.indexOf(this);
|
|
442
|
-
if (index != -1)
|
|
443
|
-
registry.splice(index, 1);
|
|
444
|
-
};
|
|
445
|
-
function now() {
|
|
227
|
+
function _() {
|
|
446
228
|
return window.performance && performance.now && performance.now();
|
|
447
229
|
}
|
|
448
|
-
function
|
|
449
|
-
var
|
|
230
|
+
function d(t, n) {
|
|
231
|
+
var o = null;
|
|
450
232
|
return function() {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
timer = null;
|
|
455
|
-
}, timeout);
|
|
456
|
-
}
|
|
233
|
+
o || (o = setTimeout(function() {
|
|
234
|
+
t(), o = null;
|
|
235
|
+
}, n));
|
|
457
236
|
};
|
|
458
237
|
}
|
|
459
|
-
function
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
var top = Math.max(rect1.top, rect2.top);
|
|
475
|
-
var bottom = Math.min(rect1.bottom, rect2.bottom);
|
|
476
|
-
var left = Math.max(rect1.left, rect2.left);
|
|
477
|
-
var right = Math.min(rect1.right, rect2.right);
|
|
478
|
-
var width = right - left;
|
|
479
|
-
var height = bottom - top;
|
|
480
|
-
return width >= 0 && height >= 0 && {
|
|
481
|
-
top,
|
|
482
|
-
bottom,
|
|
483
|
-
left,
|
|
484
|
-
right,
|
|
485
|
-
width,
|
|
486
|
-
height
|
|
238
|
+
function u(t, n, o, a) {
|
|
239
|
+
typeof t.addEventListener == "function" ? t.addEventListener(n, o, a || !1) : typeof t.attachEvent == "function" && t.attachEvent("on" + n, o);
|
|
240
|
+
}
|
|
241
|
+
function p(t, n, o, a) {
|
|
242
|
+
typeof t.removeEventListener == "function" ? t.removeEventListener(n, o, a || !1) : typeof t.detatchEvent == "function" && t.detatchEvent("on" + n, o);
|
|
243
|
+
}
|
|
244
|
+
function v(t, n) {
|
|
245
|
+
var o = Math.max(t.top, n.top), a = Math.min(t.bottom, n.bottom), c = Math.max(t.left, n.left), E = Math.min(t.right, n.right), y = E - c, O = a - o;
|
|
246
|
+
return y >= 0 && O >= 0 && {
|
|
247
|
+
top: o,
|
|
248
|
+
bottom: a,
|
|
249
|
+
left: c,
|
|
250
|
+
right: E,
|
|
251
|
+
width: y,
|
|
252
|
+
height: O
|
|
487
253
|
} || null;
|
|
488
254
|
}
|
|
489
|
-
function
|
|
490
|
-
var
|
|
255
|
+
function T(t) {
|
|
256
|
+
var n;
|
|
491
257
|
try {
|
|
492
|
-
|
|
493
|
-
} catch
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
return rect;
|
|
508
|
-
}
|
|
509
|
-
function getEmptyRect() {
|
|
258
|
+
n = t.getBoundingClientRect();
|
|
259
|
+
} catch {
|
|
260
|
+
}
|
|
261
|
+
return n ? (n.width && n.height || (n = {
|
|
262
|
+
top: n.top,
|
|
263
|
+
right: n.right,
|
|
264
|
+
bottom: n.bottom,
|
|
265
|
+
left: n.left,
|
|
266
|
+
width: n.right - n.left,
|
|
267
|
+
height: n.bottom - n.top
|
|
268
|
+
}), n) : w();
|
|
269
|
+
}
|
|
270
|
+
function w() {
|
|
510
271
|
return {
|
|
511
272
|
top: 0,
|
|
512
273
|
bottom: 0,
|
|
@@ -516,383 +277,262 @@ const DEFAULT_POSITIONING_OPTIONS = {
|
|
|
516
277
|
height: 0
|
|
517
278
|
};
|
|
518
279
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
right: rect.right,
|
|
530
|
-
width: rect.width,
|
|
531
|
-
height: rect.height
|
|
280
|
+
function m(t) {
|
|
281
|
+
return !t || "x" in t ? t : {
|
|
282
|
+
top: t.top,
|
|
283
|
+
y: t.top,
|
|
284
|
+
bottom: t.bottom,
|
|
285
|
+
left: t.left,
|
|
286
|
+
x: t.left,
|
|
287
|
+
right: t.right,
|
|
288
|
+
width: t.width,
|
|
289
|
+
height: t.height
|
|
532
290
|
};
|
|
533
291
|
}
|
|
534
|
-
function
|
|
535
|
-
var
|
|
536
|
-
var left = parentIntersectionRect.left - parentBoundingRect.left;
|
|
292
|
+
function x(t, n) {
|
|
293
|
+
var o = n.top - t.top, a = n.left - t.left;
|
|
537
294
|
return {
|
|
538
|
-
top,
|
|
539
|
-
left,
|
|
540
|
-
height:
|
|
541
|
-
width:
|
|
542
|
-
bottom:
|
|
543
|
-
right:
|
|
295
|
+
top: o,
|
|
296
|
+
left: a,
|
|
297
|
+
height: n.height,
|
|
298
|
+
width: n.width,
|
|
299
|
+
bottom: o + n.height,
|
|
300
|
+
right: a + n.width
|
|
544
301
|
};
|
|
545
302
|
}
|
|
546
|
-
function
|
|
547
|
-
var
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
node = getParentNode(node);
|
|
303
|
+
function h(t, n) {
|
|
304
|
+
for (var o = n; o; ) {
|
|
305
|
+
if (o == t)
|
|
306
|
+
return !0;
|
|
307
|
+
o = I(o);
|
|
552
308
|
}
|
|
553
|
-
return
|
|
309
|
+
return !1;
|
|
554
310
|
}
|
|
555
|
-
function
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
return getFrameElement(node);
|
|
559
|
-
}
|
|
560
|
-
if (parent && parent.assignedSlot) {
|
|
561
|
-
parent = parent.assignedSlot.parentNode;
|
|
562
|
-
}
|
|
563
|
-
if (parent && parent.nodeType == 11 && parent.host) {
|
|
564
|
-
return parent.host;
|
|
565
|
-
}
|
|
566
|
-
return parent;
|
|
311
|
+
function I(t) {
|
|
312
|
+
var n = t.parentNode;
|
|
313
|
+
return t.nodeType == 9 && t != r ? e(t) : (n && n.assignedSlot && (n = n.assignedSlot.parentNode), n && n.nodeType == 11 && n.host ? n.host : n);
|
|
567
314
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
315
|
+
function L(t) {
|
|
316
|
+
return t && t.nodeType === 9;
|
|
570
317
|
}
|
|
571
|
-
window.IntersectionObserver =
|
|
572
|
-
window.IntersectionObserverEntry = IntersectionObserverEntry2;
|
|
318
|
+
window.IntersectionObserver = l, window.IntersectionObserverEntry = b;
|
|
573
319
|
})();
|
|
574
|
-
var
|
|
575
|
-
(function(
|
|
576
|
-
var
|
|
577
|
-
function
|
|
578
|
-
}
|
|
579
|
-
if (Object.create) {
|
|
580
|
-
Events.prototype = Object.create(null);
|
|
581
|
-
if (!new Events().__proto__)
|
|
582
|
-
prefix = false;
|
|
320
|
+
var S = { exports: {} };
|
|
321
|
+
(function(e) {
|
|
322
|
+
var r = Object.prototype.hasOwnProperty, s = "~";
|
|
323
|
+
function f() {
|
|
583
324
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
this.context =
|
|
587
|
-
this.once = once || false;
|
|
325
|
+
Object.create && (f.prototype = /* @__PURE__ */ Object.create(null), new f().__proto__ || (s = !1));
|
|
326
|
+
function g(d, u, p) {
|
|
327
|
+
this.fn = d, this.context = u, this.once = p || !1;
|
|
588
328
|
}
|
|
589
|
-
function
|
|
590
|
-
if (typeof
|
|
329
|
+
function b(d, u, p, v, T) {
|
|
330
|
+
if (typeof p != "function")
|
|
591
331
|
throw new TypeError("The listener must be a function");
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
if (!emitter._events[evt])
|
|
595
|
-
emitter._events[evt] = listener, emitter._eventsCount++;
|
|
596
|
-
else if (!emitter._events[evt].fn)
|
|
597
|
-
emitter._events[evt].push(listener);
|
|
598
|
-
else
|
|
599
|
-
emitter._events[evt] = [emitter._events[evt], listener];
|
|
600
|
-
return emitter;
|
|
332
|
+
var w = new g(p, v || d, T), m = s ? s + u : u;
|
|
333
|
+
return d._events[m] ? d._events[m].fn ? d._events[m] = [d._events[m], w] : d._events[m].push(w) : (d._events[m] = w, d._eventsCount++), d;
|
|
601
334
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
604
|
-
emitter._events = new Events();
|
|
605
|
-
else
|
|
606
|
-
delete emitter._events[evt];
|
|
335
|
+
function l(d, u) {
|
|
336
|
+
--d._eventsCount === 0 ? d._events = new f() : delete d._events[u];
|
|
607
337
|
}
|
|
608
|
-
function
|
|
609
|
-
this._events = new
|
|
610
|
-
this._eventsCount = 0;
|
|
338
|
+
function _() {
|
|
339
|
+
this._events = new f(), this._eventsCount = 0;
|
|
611
340
|
}
|
|
612
|
-
|
|
613
|
-
var
|
|
341
|
+
_.prototype.eventNames = function() {
|
|
342
|
+
var u = [], p, v;
|
|
614
343
|
if (this._eventsCount === 0)
|
|
615
|
-
return
|
|
616
|
-
for (
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
return names;
|
|
624
|
-
};
|
|
625
|
-
EventEmitter.prototype.listeners = function listeners(event) {
|
|
626
|
-
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
|
627
|
-
if (!handlers)
|
|
344
|
+
return u;
|
|
345
|
+
for (v in p = this._events)
|
|
346
|
+
r.call(p, v) && u.push(s ? v.slice(1) : v);
|
|
347
|
+
return Object.getOwnPropertySymbols ? u.concat(Object.getOwnPropertySymbols(p)) : u;
|
|
348
|
+
}, _.prototype.listeners = function(u) {
|
|
349
|
+
var p = s ? s + u : u, v = this._events[p];
|
|
350
|
+
if (!v)
|
|
628
351
|
return [];
|
|
629
|
-
if (
|
|
630
|
-
return [
|
|
631
|
-
for (var
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
645
|
-
var evt = prefix ? prefix + event : event;
|
|
646
|
-
if (!this._events[evt])
|
|
647
|
-
return false;
|
|
648
|
-
var listeners = this._events[evt], len = arguments.length, args, i;
|
|
649
|
-
if (listeners.fn) {
|
|
650
|
-
if (listeners.once)
|
|
651
|
-
this.removeListener(event, listeners.fn, void 0, true);
|
|
652
|
-
switch (len) {
|
|
352
|
+
if (v.fn)
|
|
353
|
+
return [v.fn];
|
|
354
|
+
for (var T = 0, w = v.length, m = new Array(w); T < w; T++)
|
|
355
|
+
m[T] = v[T].fn;
|
|
356
|
+
return m;
|
|
357
|
+
}, _.prototype.listenerCount = function(u) {
|
|
358
|
+
var p = s ? s + u : u, v = this._events[p];
|
|
359
|
+
return v ? v.fn ? 1 : v.length : 0;
|
|
360
|
+
}, _.prototype.emit = function(u, p, v, T, w, m) {
|
|
361
|
+
var x = s ? s + u : u;
|
|
362
|
+
if (!this._events[x])
|
|
363
|
+
return !1;
|
|
364
|
+
var h = this._events[x], I = arguments.length, L, t;
|
|
365
|
+
if (h.fn) {
|
|
366
|
+
switch (h.once && this.removeListener(u, h.fn, void 0, !0), I) {
|
|
653
367
|
case 1:
|
|
654
|
-
return
|
|
368
|
+
return h.fn.call(h.context), !0;
|
|
655
369
|
case 2:
|
|
656
|
-
return
|
|
370
|
+
return h.fn.call(h.context, p), !0;
|
|
657
371
|
case 3:
|
|
658
|
-
return
|
|
372
|
+
return h.fn.call(h.context, p, v), !0;
|
|
659
373
|
case 4:
|
|
660
|
-
return
|
|
374
|
+
return h.fn.call(h.context, p, v, T), !0;
|
|
661
375
|
case 5:
|
|
662
|
-
return
|
|
376
|
+
return h.fn.call(h.context, p, v, T, w), !0;
|
|
663
377
|
case 6:
|
|
664
|
-
return
|
|
378
|
+
return h.fn.call(h.context, p, v, T, w, m), !0;
|
|
665
379
|
}
|
|
666
|
-
for (
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
listeners.fn.apply(listeners.context, args);
|
|
380
|
+
for (t = 1, L = new Array(I - 1); t < I; t++)
|
|
381
|
+
L[t - 1] = arguments[t];
|
|
382
|
+
h.fn.apply(h.context, L);
|
|
670
383
|
} else {
|
|
671
|
-
var
|
|
672
|
-
for (
|
|
673
|
-
|
|
674
|
-
this.removeListener(event, listeners[i].fn, void 0, true);
|
|
675
|
-
switch (len) {
|
|
384
|
+
var n = h.length, o;
|
|
385
|
+
for (t = 0; t < n; t++)
|
|
386
|
+
switch (h[t].once && this.removeListener(u, h[t].fn, void 0, !0), I) {
|
|
676
387
|
case 1:
|
|
677
|
-
|
|
388
|
+
h[t].fn.call(h[t].context);
|
|
678
389
|
break;
|
|
679
390
|
case 2:
|
|
680
|
-
|
|
391
|
+
h[t].fn.call(h[t].context, p);
|
|
681
392
|
break;
|
|
682
393
|
case 3:
|
|
683
|
-
|
|
394
|
+
h[t].fn.call(h[t].context, p, v);
|
|
684
395
|
break;
|
|
685
396
|
case 4:
|
|
686
|
-
|
|
397
|
+
h[t].fn.call(h[t].context, p, v, T);
|
|
687
398
|
break;
|
|
688
399
|
default:
|
|
689
|
-
if (!
|
|
690
|
-
for (
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
listeners[i].fn.apply(listeners[i].context, args);
|
|
400
|
+
if (!L)
|
|
401
|
+
for (o = 1, L = new Array(I - 1); o < I; o++)
|
|
402
|
+
L[o - 1] = arguments[o];
|
|
403
|
+
h[t].fn.apply(h[t].context, L);
|
|
694
404
|
}
|
|
695
|
-
}
|
|
696
405
|
}
|
|
697
|
-
return
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
706
|
-
var evt = prefix ? prefix + event : event;
|
|
707
|
-
if (!this._events[evt])
|
|
708
|
-
return this;
|
|
709
|
-
if (!fn) {
|
|
710
|
-
clearEvent(this, evt);
|
|
406
|
+
return !0;
|
|
407
|
+
}, _.prototype.on = function(u, p, v) {
|
|
408
|
+
return b(this, u, p, v, !1);
|
|
409
|
+
}, _.prototype.once = function(u, p, v) {
|
|
410
|
+
return b(this, u, p, v, !0);
|
|
411
|
+
}, _.prototype.removeListener = function(u, p, v, T) {
|
|
412
|
+
var w = s ? s + u : u;
|
|
413
|
+
if (!this._events[w])
|
|
711
414
|
return this;
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
events.push(listeners[i]);
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
if (events.length)
|
|
725
|
-
this._events[evt] = events.length === 1 ? events[0] : events;
|
|
726
|
-
else
|
|
727
|
-
clearEvent(this, evt);
|
|
728
|
-
}
|
|
729
|
-
return this;
|
|
730
|
-
};
|
|
731
|
-
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
732
|
-
var evt;
|
|
733
|
-
if (event) {
|
|
734
|
-
evt = prefix ? prefix + event : event;
|
|
735
|
-
if (this._events[evt])
|
|
736
|
-
clearEvent(this, evt);
|
|
737
|
-
} else {
|
|
738
|
-
this._events = new Events();
|
|
739
|
-
this._eventsCount = 0;
|
|
415
|
+
if (!p)
|
|
416
|
+
return l(this, w), this;
|
|
417
|
+
var m = this._events[w];
|
|
418
|
+
if (m.fn)
|
|
419
|
+
m.fn === p && (!T || m.once) && (!v || m.context === v) && l(this, w);
|
|
420
|
+
else {
|
|
421
|
+
for (var x = 0, h = [], I = m.length; x < I; x++)
|
|
422
|
+
(m[x].fn !== p || T && !m[x].once || v && m[x].context !== v) && h.push(m[x]);
|
|
423
|
+
h.length ? this._events[w] = h.length === 1 ? h[0] : h : l(this, w);
|
|
740
424
|
}
|
|
741
425
|
return this;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
var __defProp2 = Object.defineProperty;
|
|
752
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
753
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
754
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
755
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
756
|
-
if (decorator = decorators[i])
|
|
757
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
758
|
-
if (kind && result)
|
|
759
|
-
__defProp2(target, key, result);
|
|
760
|
-
return result;
|
|
426
|
+
}, _.prototype.removeAllListeners = function(u) {
|
|
427
|
+
var p;
|
|
428
|
+
return u ? (p = s ? s + u : u, this._events[p] && l(this, p)) : (this._events = new f(), this._eventsCount = 0), this;
|
|
429
|
+
}, _.prototype.off = _.prototype.removeListener, _.prototype.addListener = _.prototype.on, _.prefixed = s, _.EventEmitter = _, e.exports = _;
|
|
430
|
+
})(S);
|
|
431
|
+
var G = Object.defineProperty, z = Object.getOwnPropertyDescriptor, W = (e, r, s, f) => {
|
|
432
|
+
for (var g = f > 1 ? void 0 : f ? z(r, s) : r, b = e.length - 1, l; b >= 0; b--)
|
|
433
|
+
(l = e[b]) && (g = (f ? l(r, s, g) : l(g)) || g);
|
|
434
|
+
return f && g && G(r, s, g), g;
|
|
761
435
|
};
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
const
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
if (otherBounds.left <= bounds.right && otherBounds.right >= bounds.left && otherBounds.top <= bounds.bottom && otherBounds.bottom >= bounds.top) {
|
|
781
|
-
collisions.push(otherElement);
|
|
782
|
-
}
|
|
436
|
+
const B = 60;
|
|
437
|
+
var M;
|
|
438
|
+
const i = (M = class {
|
|
439
|
+
static on(e, r) {
|
|
440
|
+
i.events.on(e, r);
|
|
441
|
+
}
|
|
442
|
+
static off(e, r) {
|
|
443
|
+
i.events.off(e, r);
|
|
444
|
+
}
|
|
445
|
+
static once(e, r) {
|
|
446
|
+
i.events.once(e, r);
|
|
447
|
+
}
|
|
448
|
+
static checkCollisions(e, r) {
|
|
449
|
+
const s = r || Array.from(i.elements.keys()), f = e.getBoundingClientRect(), g = [];
|
|
450
|
+
for (const b of s)
|
|
451
|
+
if (b !== e) {
|
|
452
|
+
const l = b.getBoundingClientRect();
|
|
453
|
+
l.left <= f.right && l.right >= f.left && l.top <= f.bottom && l.bottom >= f.top && g.push(b);
|
|
783
454
|
}
|
|
784
|
-
|
|
785
|
-
if (collisions.length) {
|
|
786
|
-
_PositioningService.onElementIntersection(element, collisions);
|
|
787
|
-
}
|
|
455
|
+
g.length && i.onElementIntersection(e, g);
|
|
788
456
|
}
|
|
789
|
-
static isPositioned(
|
|
790
|
-
return
|
|
457
|
+
static isPositioned(e) {
|
|
458
|
+
return i.elements.has(e);
|
|
791
459
|
}
|
|
792
|
-
static getPositioningOptions(
|
|
793
|
-
|
|
794
|
-
return _PositioningService.elements.get(element);
|
|
795
|
-
}
|
|
796
|
-
return null;
|
|
460
|
+
static getPositioningOptions(e) {
|
|
461
|
+
return i.elements.has(e) ? i.elements.get(e) : null;
|
|
797
462
|
}
|
|
798
|
-
static position(
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
e.addEventListener("scroll", _PositioningService.update);
|
|
808
|
-
}
|
|
463
|
+
static position(e, r = {}) {
|
|
464
|
+
const s = {
|
|
465
|
+
...V,
|
|
466
|
+
...r
|
|
467
|
+
};
|
|
468
|
+
let f = e;
|
|
469
|
+
for (; f !== document.body; )
|
|
470
|
+
if (f = f.parentElement, f.classList.contains("sps-focused-task")) {
|
|
471
|
+
s.scrollParent = f, i.registeredScrollParents.has(f) || (i.registeredScrollParents.add(f), f.addEventListener("scroll", i.update));
|
|
809
472
|
break;
|
|
810
473
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
if (!opts.relativeTo) {
|
|
818
|
-
throw new Error("You must provide an element for the relativeTo option to position an element.");
|
|
819
|
-
}
|
|
820
|
-
_PositioningService.elements.set(element, opts);
|
|
821
|
-
onNextTick(() => {
|
|
822
|
-
_PositioningService.fixElementPosition(element);
|
|
823
|
-
_PositioningService.viewportObserver.observe(element);
|
|
824
|
-
element.style.visibility = "";
|
|
825
|
-
_PositioningService.checkCollisions(element);
|
|
474
|
+
if (e.style.visibility = "hidden", i.elements.size === 0 && (window.addEventListener("resize", i.update), window.addEventListener("scroll", i.update)), !s.relativeTo)
|
|
475
|
+
throw new Error(
|
|
476
|
+
"You must provide an element for the relativeTo option to position an element."
|
|
477
|
+
);
|
|
478
|
+
i.elements.set(e, s), U(() => {
|
|
479
|
+
i.fixElementPosition(e), i.viewportObserver.observe(e), e.style.visibility = "", i.checkCollisions(e);
|
|
826
480
|
});
|
|
827
481
|
}
|
|
828
|
-
static release(
|
|
829
|
-
if (
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
options.scrollParent.removeEventListener("scroll", _PositioningService.update);
|
|
834
|
-
_PositioningService.registeredScrollParents.delete(options.scrollParent);
|
|
835
|
-
}
|
|
836
|
-
_PositioningService.elements.delete(element);
|
|
837
|
-
if (_PositioningService.elements.size === 0) {
|
|
838
|
-
window.removeEventListener("resize", _PositioningService.update);
|
|
839
|
-
window.removeEventListener("scroll", _PositioningService.update);
|
|
840
|
-
}
|
|
841
|
-
_PositioningService.viewportObserver.unobserve(element);
|
|
482
|
+
static release(e) {
|
|
483
|
+
if (i.elements.has(e)) {
|
|
484
|
+
i.clearStyles(e);
|
|
485
|
+
const r = i.elements.get(e);
|
|
486
|
+
r.scrollParent && (r.scrollParent.removeEventListener("scroll", i.update), i.registeredScrollParents.delete(r.scrollParent)), i.elements.delete(e), i.elements.size === 0 && (window.removeEventListener("resize", i.update), window.removeEventListener("scroll", i.update)), i.viewportObserver.unobserve(e);
|
|
842
487
|
}
|
|
843
488
|
}
|
|
844
489
|
static releaseAll() {
|
|
845
|
-
for (const
|
|
846
|
-
|
|
847
|
-
}
|
|
490
|
+
for (const e of i.elements.keys())
|
|
491
|
+
i.release(e);
|
|
848
492
|
}
|
|
849
|
-
static refresh(
|
|
850
|
-
|
|
851
|
-
_PositioningService.clearStyles(element);
|
|
852
|
-
_PositioningService.fixElementPosition(element);
|
|
853
|
-
_PositioningService.checkCollisions(element);
|
|
854
|
-
}
|
|
493
|
+
static refresh(e) {
|
|
494
|
+
i.elements.has(e) && (i.clearStyles(e), i.fixElementPosition(e), i.checkCollisions(e));
|
|
855
495
|
}
|
|
856
496
|
static refreshAll() {
|
|
857
|
-
for (const
|
|
858
|
-
|
|
859
|
-
}
|
|
497
|
+
for (const e of i.elements.keys())
|
|
498
|
+
i.refresh(e);
|
|
860
499
|
}
|
|
861
|
-
static reposition(
|
|
862
|
-
if (
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
_PositioningService.refresh(element);
|
|
500
|
+
static reposition(e, r) {
|
|
501
|
+
if (i.elements.has(e)) {
|
|
502
|
+
const s = i.elements.get(e);
|
|
503
|
+
i.elements.set(e, Object.assign(s, r)), i.refresh(e);
|
|
866
504
|
}
|
|
867
505
|
}
|
|
868
|
-
static onViewportIntersection(
|
|
869
|
-
for (const
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
506
|
+
static onViewportIntersection(e) {
|
|
507
|
+
for (const r of e) {
|
|
508
|
+
const s = Object.keys(IntersectionObserverEntry.prototype).reduce(
|
|
509
|
+
(f, g) => ({
|
|
510
|
+
...f,
|
|
511
|
+
[g]: r[g]
|
|
512
|
+
}),
|
|
513
|
+
{}
|
|
514
|
+
);
|
|
515
|
+
s.rootBounds = s.rootBounds || i.getRootBounds(), i.events.emit("viewportIntersection", Object.freeze(s));
|
|
875
516
|
}
|
|
876
517
|
}
|
|
877
|
-
static onElementIntersection(
|
|
878
|
-
|
|
518
|
+
static onElementIntersection(e, r) {
|
|
519
|
+
i.events.emit("elementIntersection", { target: e, intersectingWith: r });
|
|
879
520
|
}
|
|
880
521
|
static getRootBounds() {
|
|
881
|
-
const
|
|
882
|
-
const rootHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
522
|
+
const e = Math.max(document.documentElement.clientWidth, window.innerWidth || 0), r = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
883
523
|
return {
|
|
884
524
|
x: 0,
|
|
885
|
-
y:
|
|
525
|
+
y: B,
|
|
886
526
|
left: 0,
|
|
887
|
-
top:
|
|
888
|
-
right:
|
|
889
|
-
bottom:
|
|
890
|
-
height:
|
|
891
|
-
width:
|
|
527
|
+
top: B,
|
|
528
|
+
right: e,
|
|
529
|
+
bottom: r,
|
|
530
|
+
height: r - B,
|
|
531
|
+
width: e
|
|
892
532
|
};
|
|
893
533
|
}
|
|
894
|
-
static clearStyles(
|
|
895
|
-
Object.assign(
|
|
534
|
+
static clearStyles(e) {
|
|
535
|
+
Object.assign(e.style, {
|
|
896
536
|
position: "",
|
|
897
537
|
width: "",
|
|
898
538
|
top: "",
|
|
@@ -903,161 +543,140 @@ const _PositioningService = class {
|
|
|
903
543
|
zIndex: ""
|
|
904
544
|
});
|
|
905
545
|
}
|
|
906
|
-
static fixElementPosition(
|
|
907
|
-
if (!this.elements.has(
|
|
546
|
+
static fixElementPosition(e, r) {
|
|
547
|
+
if (!this.elements.has(e))
|
|
908
548
|
return;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
const positionedElementBounds = element.getBoundingClientRect();
|
|
913
|
-
const relativeTargetBounds = opts.relativeTo.getBoundingClientRect();
|
|
914
|
-
const { width } = opts.useRelativeTargetWidth ? relativeTargetBounds : positionedElementBounds;
|
|
915
|
-
Object.assign(element.style, {
|
|
916
|
-
minWidth: `${width}px`,
|
|
549
|
+
const s = r || this.elements.get(e), f = this.getRootBounds(), g = e.getBoundingClientRect(), b = s.relativeTo.getBoundingClientRect(), { width: l } = s.useRelativeTargetWidth ? b : g;
|
|
550
|
+
Object.assign(e.style, {
|
|
551
|
+
minWidth: `${l}px`,
|
|
917
552
|
position: "fixed",
|
|
918
|
-
zIndex:
|
|
553
|
+
zIndex: s.zIndex || ""
|
|
919
554
|
});
|
|
920
|
-
let
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
const offsetA = opts.offsets[0] || 0;
|
|
924
|
-
const offsetB = opts.offsets[1] || 0;
|
|
925
|
-
top = 0;
|
|
926
|
-
left = 0;
|
|
927
|
-
switch (positionRelativeToTarget[0]) {
|
|
555
|
+
let _, d;
|
|
556
|
+
const u = s.position.split(" "), p = s.offsets[0] || 0, v = s.offsets[1] || 0;
|
|
557
|
+
switch (_ = 0, d = 0, u[0]) {
|
|
928
558
|
case "top":
|
|
929
|
-
|
|
559
|
+
_ = b.top - g.height - p;
|
|
930
560
|
break;
|
|
931
561
|
case "left":
|
|
932
|
-
|
|
562
|
+
d = b.left - l - p;
|
|
933
563
|
break;
|
|
934
564
|
case "right":
|
|
935
|
-
|
|
565
|
+
d = b.right + p;
|
|
936
566
|
break;
|
|
937
567
|
case "bottom":
|
|
938
|
-
|
|
568
|
+
_ = b.bottom + p;
|
|
939
569
|
break;
|
|
940
570
|
default:
|
|
941
|
-
throw new Error(`${
|
|
571
|
+
throw new Error(`${s.position} is not a valid position`);
|
|
942
572
|
}
|
|
943
|
-
switch (
|
|
573
|
+
switch (u[1]) {
|
|
944
574
|
case "left":
|
|
945
|
-
|
|
575
|
+
d = b.left - v;
|
|
946
576
|
break;
|
|
947
577
|
case "top":
|
|
948
|
-
|
|
578
|
+
_ = b.top - v;
|
|
949
579
|
break;
|
|
950
580
|
case "middle":
|
|
951
|
-
|
|
952
|
-
left = relativeTargetBounds.left + relativeTargetBounds.width / 2 - width / 2 + offsetB;
|
|
953
|
-
} else if (positionRelativeToTarget[0] === "left" || positionRelativeToTarget[0] === "right") {
|
|
954
|
-
top = relativeTargetBounds.top + relativeTargetBounds.height / 2 - positionedElementBounds.height / 2 + offsetB;
|
|
955
|
-
}
|
|
581
|
+
u[0] === "top" || u[0] === "bottom" ? d = b.left + b.width / 2 - l / 2 + v : (u[0] === "left" || u[0] === "right") && (_ = b.top + b.height / 2 - g.height / 2 + v);
|
|
956
582
|
break;
|
|
957
583
|
case "bottom":
|
|
958
|
-
|
|
584
|
+
_ = b.bottom - g.height + v;
|
|
959
585
|
break;
|
|
960
586
|
case "right":
|
|
961
|
-
|
|
587
|
+
d = b.right - l + v;
|
|
962
588
|
break;
|
|
963
589
|
default:
|
|
964
|
-
throw new Error(`${
|
|
590
|
+
throw new Error(`${s.position} is not a valid position`);
|
|
965
591
|
}
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
const rightPx = `${Math.round(rootBounds.right - right)}px`;
|
|
972
|
-
switch (opts.anchor) {
|
|
973
|
-
case PositionAnchor.TOP_LEFT:
|
|
974
|
-
Object.assign(element.style, {
|
|
975
|
-
top: topPx,
|
|
592
|
+
const T = _ + g.height, w = d + g.width, m = `${Math.round(_)}px`, x = `${Math.round(f.bottom - T)}px`, h = `${Math.round(d)}px`, I = `${Math.round(f.right - w)}px`;
|
|
593
|
+
switch (s.anchor) {
|
|
594
|
+
case P.TOP_LEFT:
|
|
595
|
+
Object.assign(e.style, {
|
|
596
|
+
top: m,
|
|
976
597
|
bottom: "auto",
|
|
977
|
-
left:
|
|
598
|
+
left: h,
|
|
978
599
|
right: "auto"
|
|
979
600
|
});
|
|
980
601
|
break;
|
|
981
|
-
case
|
|
982
|
-
Object.assign(
|
|
983
|
-
top:
|
|
602
|
+
case P.TOP_RIGHT:
|
|
603
|
+
Object.assign(e.style, {
|
|
604
|
+
top: m,
|
|
984
605
|
bottom: "auto",
|
|
985
606
|
left: "auto",
|
|
986
|
-
right:
|
|
607
|
+
right: I
|
|
987
608
|
});
|
|
988
609
|
break;
|
|
989
|
-
case
|
|
990
|
-
Object.assign(
|
|
610
|
+
case P.BOTTOM_LEFT:
|
|
611
|
+
Object.assign(e.style, {
|
|
991
612
|
top: "auto",
|
|
992
|
-
bottom:
|
|
993
|
-
left:
|
|
613
|
+
bottom: x,
|
|
614
|
+
left: h,
|
|
994
615
|
right: "auto"
|
|
995
616
|
});
|
|
996
617
|
break;
|
|
997
|
-
case
|
|
998
|
-
Object.assign(
|
|
618
|
+
case P.BOTTOM_RIGHT:
|
|
619
|
+
Object.assign(e.style, {
|
|
999
620
|
top: "auto",
|
|
1000
|
-
bottom:
|
|
621
|
+
bottom: x,
|
|
1001
622
|
left: "auto",
|
|
1002
|
-
right:
|
|
623
|
+
right: I
|
|
1003
624
|
});
|
|
1004
625
|
break;
|
|
1005
626
|
}
|
|
1006
627
|
}
|
|
1007
|
-
static update(
|
|
1008
|
-
const
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
if (!event || event.target === document || event.target === options.scrollParent || event.target === window) {
|
|
1012
|
-
_PositioningService.fixElementPosition(element, options);
|
|
1013
|
-
_PositioningService.checkCollisions(element, updatedElements);
|
|
1014
|
-
updatedElements.push(element);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
628
|
+
static update(e) {
|
|
629
|
+
const r = i.elements.entries(), s = [];
|
|
630
|
+
for (const [f, g] of r)
|
|
631
|
+
(!e || e.target === document || e.target === g.scrollParent || e.target === window) && (i.fixElementPosition(f, g), i.checkCollisions(f, s), s.push(f));
|
|
1017
632
|
}
|
|
1018
|
-
on(
|
|
1019
|
-
|
|
633
|
+
on(e, r) {
|
|
634
|
+
i.on(e, r);
|
|
1020
635
|
}
|
|
1021
|
-
off(
|
|
1022
|
-
|
|
636
|
+
off(e, r) {
|
|
637
|
+
i.off(e, r);
|
|
1023
638
|
}
|
|
1024
|
-
once(
|
|
1025
|
-
|
|
639
|
+
once(e, r) {
|
|
640
|
+
i.once(e, r);
|
|
1026
641
|
}
|
|
1027
|
-
isPositioned(
|
|
1028
|
-
return
|
|
642
|
+
isPositioned(e) {
|
|
643
|
+
return i.isPositioned(e);
|
|
1029
644
|
}
|
|
1030
|
-
getPositioningOptions(
|
|
1031
|
-
return
|
|
645
|
+
getPositioningOptions(e) {
|
|
646
|
+
return i.getPositioningOptions(e);
|
|
1032
647
|
}
|
|
1033
|
-
position(
|
|
1034
|
-
|
|
648
|
+
position(e, r = {}) {
|
|
649
|
+
i.position(e, r);
|
|
1035
650
|
}
|
|
1036
|
-
release(
|
|
1037
|
-
|
|
651
|
+
release(e) {
|
|
652
|
+
i.release(e);
|
|
1038
653
|
}
|
|
1039
654
|
releaseAll() {
|
|
1040
|
-
|
|
655
|
+
i.releaseAll();
|
|
1041
656
|
}
|
|
1042
|
-
refresh(
|
|
1043
|
-
|
|
657
|
+
refresh(e) {
|
|
658
|
+
i.refresh(e);
|
|
1044
659
|
}
|
|
1045
660
|
refreshAll() {
|
|
1046
|
-
|
|
661
|
+
i.refreshAll();
|
|
1047
662
|
}
|
|
1048
|
-
reposition(
|
|
1049
|
-
|
|
663
|
+
reposition(e, r) {
|
|
664
|
+
i.reposition(e, r);
|
|
1050
665
|
}
|
|
666
|
+
}, k(M, "elements", /* @__PURE__ */ new Map()), k(M, "registeredScrollParents", /* @__PURE__ */ new Set()), k(M, "events", new S.exports.EventEmitter()), k(M, "viewportObserver", new IntersectionObserver(
|
|
667
|
+
i.onViewportIntersection,
|
|
668
|
+
{
|
|
669
|
+
rootMargin: `-${B}px 0px 0px`,
|
|
670
|
+
threshold: 1
|
|
671
|
+
}
|
|
672
|
+
)), M);
|
|
673
|
+
let $ = i;
|
|
674
|
+
W([
|
|
675
|
+
j
|
|
676
|
+
], $, "update", 1);
|
|
677
|
+
export {
|
|
678
|
+
V as DEFAULT_POSITIONING_OPTIONS,
|
|
679
|
+
F as Position,
|
|
680
|
+
P as PositionAnchor,
|
|
681
|
+
$ as PositioningService
|
|
1051
682
|
};
|
|
1052
|
-
let PositioningService = _PositioningService;
|
|
1053
|
-
PositioningService.elements = new Map();
|
|
1054
|
-
PositioningService.registeredScrollParents = new Set();
|
|
1055
|
-
PositioningService.events = new eventemitter3.exports.EventEmitter();
|
|
1056
|
-
PositioningService.viewportObserver = new IntersectionObserver(_PositioningService.onViewportIntersection, {
|
|
1057
|
-
rootMargin: `-${NAVBAR_HEIGHT}px 0px 0px`,
|
|
1058
|
-
threshold: 1
|
|
1059
|
-
});
|
|
1060
|
-
__decorateClass([
|
|
1061
|
-
lockedToAnimationFrames
|
|
1062
|
-
], PositioningService, "update", 1);
|
|
1063
|
-
export { DEFAULT_POSITIONING_OPTIONS, Position, PositionAnchor, PositioningService };
|