@behold/widget 0.5.57 → 0.5.59

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,454 +0,0 @@
1
- var e,
2
- t = [],
3
- n = 'ResizeObserver loop completed with undelivered notifications.';
4
- !(function (e) {
5
- (e.BORDER_BOX = 'border-box'),
6
- (e.CONTENT_BOX = 'content-box'),
7
- (e.DEVICE_PIXEL_CONTENT_BOX = 'device-pixel-content-box');
8
- })(e || (e = {}));
9
- var r,
10
- i = function (e) {
11
- return Object.freeze(e)
12
- },
13
- o = function (e, t) {
14
- (this.inlineSize = e), (this.blockSize = t), i(this);
15
- },
16
- s = (function () {
17
- function e(e, t, n, r) {
18
- return (
19
- (this.x = e),
20
- (this.y = t),
21
- (this.width = n),
22
- (this.height = r),
23
- (this.top = this.y),
24
- (this.left = this.x),
25
- (this.bottom = this.top + this.height),
26
- (this.right = this.left + this.width),
27
- i(this)
28
- )
29
- }
30
- return (
31
- (e.prototype.toJSON = function () {
32
- var e = this;
33
- return {
34
- x: e.x,
35
- y: e.y,
36
- top: e.top,
37
- right: e.right,
38
- bottom: e.bottom,
39
- left: e.left,
40
- width: e.width,
41
- height: e.height,
42
- }
43
- }),
44
- (e.fromRect = function (t) {
45
- return new e(t.x, t.y, t.width, t.height)
46
- }),
47
- e
48
- )
49
- })(),
50
- a = function (e) {
51
- return e instanceof SVGElement && 'getBBox' in e
52
- },
53
- c = function (e) {
54
- if (a(e)) {
55
- var t = e.getBBox(),
56
- n = t.width,
57
- r = t.height;
58
- return !n && !r
59
- }
60
- var i = e,
61
- o = i.offsetWidth,
62
- s = i.offsetHeight;
63
- return !(o || s || e.getClientRects().length)
64
- },
65
- u = function (e) {
66
- var t;
67
- if (e instanceof Element) return !0
68
- var n =
69
- null === (t = null == e ? void 0 : e.ownerDocument) || void 0 === t
70
- ? void 0
71
- : t.defaultView;
72
- return !!(n && e instanceof n.Element)
73
- },
74
- h = 'undefined' != typeof window ? window : {},
75
- f = new WeakMap(),
76
- d = /auto|scroll/,
77
- v = /^tb|vertical/,
78
- l = /msie|trident/i.test(h.navigator && h.navigator.userAgent),
79
- p = function (e) {
80
- return parseFloat(e || '0')
81
- },
82
- g = function (e, t, n) {
83
- return (
84
- void 0 === e && (e = 0),
85
- void 0 === t && (t = 0),
86
- void 0 === n && (n = !1),
87
- new o((n ? t : e) || 0, (n ? e : t) || 0)
88
- )
89
- },
90
- b = i({
91
- devicePixelContentBoxSize: g(),
92
- borderBoxSize: g(),
93
- contentBoxSize: g(),
94
- contentRect: new s(0, 0, 0, 0),
95
- }),
96
- w = function (e, t) {
97
- if ((void 0 === t && (t = !1), f.has(e) && !t)) return f.get(e)
98
- if (c(e)) return f.set(e, b), b
99
- var n = getComputedStyle(e),
100
- r = a(e) && e.ownerSVGElement && e.getBBox(),
101
- o = !l && 'border-box' === n.boxSizing,
102
- u = v.test(n.writingMode || ''),
103
- h = !r && d.test(n.overflowY || ''),
104
- w = !r && d.test(n.overflowX || ''),
105
- x = r ? 0 : p(n.paddingTop),
106
- E = r ? 0 : p(n.paddingRight),
107
- T = r ? 0 : p(n.paddingBottom),
108
- m = r ? 0 : p(n.paddingLeft),
109
- y = r ? 0 : p(n.borderTopWidth),
110
- z = r ? 0 : p(n.borderRightWidth),
111
- B = r ? 0 : p(n.borderBottomWidth),
112
- S = m + E,
113
- O = x + T,
114
- R = (r ? 0 : p(n.borderLeftWidth)) + z,
115
- C = y + B,
116
- k = w ? e.offsetHeight - C - e.clientHeight : 0,
117
- N = h ? e.offsetWidth - R - e.clientWidth : 0,
118
- D = o ? S + R : 0,
119
- M = o ? O + C : 0,
120
- P = r ? r.width : p(n.width) - D - N,
121
- _ = r ? r.height : p(n.height) - M - k,
122
- F = P + S + N + R,
123
- I = _ + O + k + C,
124
- L = i({
125
- devicePixelContentBoxSize: g(
126
- Math.round(P * devicePixelRatio),
127
- Math.round(_ * devicePixelRatio),
128
- u,
129
- ),
130
- borderBoxSize: g(F, I, u),
131
- contentBoxSize: g(P, _, u),
132
- contentRect: new s(m, x, P, _),
133
- });
134
- return f.set(e, L), L
135
- },
136
- x = function (t, n, r) {
137
- var i = w(t, r),
138
- o = i.borderBoxSize,
139
- s = i.contentBoxSize,
140
- a = i.devicePixelContentBoxSize;
141
- switch (n) {
142
- case e.DEVICE_PIXEL_CONTENT_BOX:
143
- return a
144
- case e.BORDER_BOX:
145
- return o
146
- default:
147
- return s
148
- }
149
- },
150
- E = function (e) {
151
- var t = w(e)
152
- ;(this.target = e),
153
- (this.contentRect = t.contentRect),
154
- (this.borderBoxSize = i([t.borderBoxSize])),
155
- (this.contentBoxSize = i([t.contentBoxSize])),
156
- (this.devicePixelContentBoxSize = i([t.devicePixelContentBoxSize]));
157
- },
158
- T = function (e) {
159
- if (c(e)) return 1 / 0
160
- for (var t = 0, n = e.parentNode; n; ) (t += 1), (n = n.parentNode);
161
- return t
162
- },
163
- m = function () {
164
- var e = 1 / 0,
165
- n = [];
166
- t.forEach(function (t) {
167
- if (0 !== t.activeTargets.length) {
168
- var r = [];
169
- t.activeTargets.forEach(function (t) {
170
- var n = new E(t.target),
171
- i = T(t.target);
172
- r.push(n),
173
- (t.lastReportedSize = x(t.target, t.observedBox)),
174
- i < e && (e = i);
175
- }),
176
- n.push(function () {
177
- t.callback.call(t.observer, r, t.observer);
178
- }),
179
- t.activeTargets.splice(0, t.activeTargets.length);
180
- }
181
- });
182
- for (var r = 0, i = n; r < i.length; r++) {
183
- (0, i[r])();
184
- }
185
- return e
186
- },
187
- y = function (e) {
188
- t.forEach(function (t) {
189
- t.activeTargets.splice(0, t.activeTargets.length),
190
- t.skippedTargets.splice(0, t.skippedTargets.length),
191
- t.observationTargets.forEach(function (n) {
192
- n.isActive() &&
193
- (T(n.target) > e
194
- ? t.activeTargets.push(n)
195
- : t.skippedTargets.push(n));
196
- });
197
- });
198
- },
199
- z = function () {
200
- var e,
201
- r = 0;
202
- for (
203
- y(r);
204
- t.some(function (e) {
205
- return e.activeTargets.length > 0
206
- });
207
-
208
- )
209
- (r = m()), y(r);
210
- return (
211
- t.some(function (e) {
212
- return e.skippedTargets.length > 0
213
- }) &&
214
- ('function' == typeof ErrorEvent
215
- ? (e = new ErrorEvent('error', { message: n }))
216
- : ((e = document.createEvent('Event')).initEvent('error', !1, !1),
217
- (e.message = n)),
218
- window.dispatchEvent(e)),
219
- r > 0
220
- )
221
- },
222
- B = [],
223
- S = function (e) {
224
- if (!r) {
225
- var t = 0,
226
- n = document.createTextNode('');
227
- new MutationObserver(function () {
228
- return B.splice(0).forEach(function (e) {
229
- return e()
230
- })
231
- }).observe(n, { characterData: !0 }),
232
- (r = function () {
233
- n.textContent = ''.concat(t ? t-- : t++);
234
- });
235
- }
236
- B.push(e), r();
237
- },
238
- O = 0,
239
- R = { attributes: !0, characterData: !0, childList: !0, subtree: !0 },
240
- C = [
241
- 'resize',
242
- 'load',
243
- 'transitionend',
244
- 'animationend',
245
- 'animationstart',
246
- 'animationiteration',
247
- 'keyup',
248
- 'keydown',
249
- 'mouseup',
250
- 'mousedown',
251
- 'mouseover',
252
- 'mouseout',
253
- 'blur',
254
- 'focus',
255
- ],
256
- k = function (e) {
257
- return void 0 === e && (e = 0), Date.now() + e
258
- },
259
- N = !1,
260
- D = new ((function () {
261
- function e() {
262
- var e = this
263
- ;(this.stopped = !0),
264
- (this.listener = function () {
265
- return e.schedule()
266
- });
267
- }
268
- return (
269
- (e.prototype.run = function (e) {
270
- var t = this;
271
- if ((void 0 === e && (e = 250), !N)) {
272
- N = !0;
273
- var n,
274
- r = k(e)
275
- ;(n = function () {
276
- var n = !1;
277
- try {
278
- n = z();
279
- } finally {
280
- if (((N = !1), (e = r - k()), !O)) return
281
- n ? t.run(1e3) : e > 0 ? t.run(e) : t.start();
282
- }
283
- }),
284
- S(function () {
285
- requestAnimationFrame(n);
286
- });
287
- }
288
- }),
289
- (e.prototype.schedule = function () {
290
- this.stop(), this.run();
291
- }),
292
- (e.prototype.observe = function () {
293
- var e = this,
294
- t = function () {
295
- return e.observer && e.observer.observe(document.body, R)
296
- };
297
- document.body ? t() : h.addEventListener('DOMContentLoaded', t);
298
- }),
299
- (e.prototype.start = function () {
300
- var e = this;
301
- this.stopped &&
302
- ((this.stopped = !1),
303
- (this.observer = new MutationObserver(this.listener)),
304
- this.observe(),
305
- C.forEach(function (t) {
306
- return h.addEventListener(t, e.listener, !0)
307
- }));
308
- }),
309
- (e.prototype.stop = function () {
310
- var e = this;
311
- this.stopped ||
312
- (this.observer && this.observer.disconnect(),
313
- C.forEach(function (t) {
314
- return h.removeEventListener(t, e.listener, !0)
315
- }),
316
- (this.stopped = !0));
317
- }),
318
- e
319
- )
320
- })())(),
321
- M = function (e) {
322
- !O && e > 0 && D.start(), !(O += e) && D.stop();
323
- },
324
- P = (function () {
325
- function t(t, n) {
326
- (this.target = t),
327
- (this.observedBox = n || e.CONTENT_BOX),
328
- (this.lastReportedSize = { inlineSize: 0, blockSize: 0 });
329
- }
330
- return (
331
- (t.prototype.isActive = function () {
332
- var e,
333
- t = x(this.target, this.observedBox, !0);
334
- return (
335
- (e = this.target),
336
- a(e) ||
337
- (function (e) {
338
- switch (e.tagName) {
339
- case 'INPUT':
340
- if ('image' !== e.type) break
341
- case 'VIDEO':
342
- case 'AUDIO':
343
- case 'EMBED':
344
- case 'OBJECT':
345
- case 'CANVAS':
346
- case 'IFRAME':
347
- case 'IMG':
348
- return !0
349
- }
350
- return !1
351
- })(e) ||
352
- 'inline' !== getComputedStyle(e).display ||
353
- (this.lastReportedSize = t),
354
- this.lastReportedSize.inlineSize !== t.inlineSize ||
355
- this.lastReportedSize.blockSize !== t.blockSize
356
- )
357
- }),
358
- t
359
- )
360
- })(),
361
- _ = function (e, t) {
362
- (this.activeTargets = []),
363
- (this.skippedTargets = []),
364
- (this.observationTargets = []),
365
- (this.observer = e),
366
- (this.callback = t);
367
- },
368
- F = new WeakMap(),
369
- I = function (e, t) {
370
- for (var n = 0; n < e.length; n += 1) if (e[n].target === t) return n
371
- return -1
372
- },
373
- L = (function () {
374
- function e() {}
375
- return (
376
- (e.connect = function (e, t) {
377
- var n = new _(e, t);
378
- F.set(e, n);
379
- }),
380
- (e.observe = function (e, n, r) {
381
- var i = F.get(e),
382
- o = 0 === i.observationTargets.length;
383
- I(i.observationTargets, n) < 0 &&
384
- (o && t.push(i),
385
- i.observationTargets.push(new P(n, r && r.box)),
386
- M(1),
387
- D.schedule());
388
- }),
389
- (e.unobserve = function (e, n) {
390
- var r = F.get(e),
391
- i = I(r.observationTargets, n),
392
- o = 1 === r.observationTargets.length;
393
- i >= 0 &&
394
- (o && t.splice(t.indexOf(r), 1),
395
- r.observationTargets.splice(i, 1),
396
- M(-1));
397
- }),
398
- (e.disconnect = function (e) {
399
- var t = this,
400
- n = F.get(e);
401
- n.observationTargets.slice().forEach(function (n) {
402
- return t.unobserve(e, n.target)
403
- }),
404
- n.activeTargets.splice(0, n.activeTargets.length);
405
- }),
406
- e
407
- )
408
- })(),
409
- W = (function () {
410
- function e(e) {
411
- if (0 === arguments.length)
412
- throw new TypeError(
413
- "Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.",
414
- )
415
- if ('function' != typeof e)
416
- throw new TypeError(
417
- "Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.",
418
- )
419
- L.connect(this, e);
420
- }
421
- return (
422
- (e.prototype.observe = function (e, t) {
423
- if (0 === arguments.length)
424
- throw new TypeError(
425
- "Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.",
426
- )
427
- if (!u(e))
428
- throw new TypeError(
429
- "Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element",
430
- )
431
- L.observe(this, e, t);
432
- }),
433
- (e.prototype.unobserve = function (e) {
434
- if (0 === arguments.length)
435
- throw new TypeError(
436
- "Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.",
437
- )
438
- if (!u(e))
439
- throw new TypeError(
440
- "Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element",
441
- )
442
- L.unobserve(this, e);
443
- }),
444
- (e.prototype.disconnect = function () {
445
- L.disconnect(this);
446
- }),
447
- (e.toString = function () {
448
- return 'function ResizeObserver () { [polyfill code] }'
449
- }),
450
- e
451
- )
452
- })();
453
-
454
- export { W as ResizeObserver, E as ResizeObserverEntry, o as ResizeObserverSize };