PageSourceSearch

https://plus.badi.com/wp-content/themes/dot/js/vendor/InertiaPlugin.min.js

js badi.com collected 2026-09-24 09:06:56 UTC 12,755 bytes, 575 lines download raw bytes

1/*!
2 * InertiaPlugin 3.11.4
3 * https://greensock.com
4 *
5 * @license Copyright 2022, GreenSock. All rights reserved.
6 * This plugin is a membership benefit of Club GreenSock and is only authorized for use in sites/apps/products developed by individuals/companies with an active Club GreenSock membership. See https://greensock.com/club
7 * @author: Jack Doyle, [email protected]
8 */
9
10!(function (t, e) {
11	'object' == typeof exports && 'undefined' != typeof module
12		? e(exports)
13		: 'function' == typeof define && define.amd
14		? define(['exports'], e)
15		: e(((t = t || self).window = t.window || {}));
16})(this, function (e) {
17	'use strict';
18	function m() {
19		return i || ('undefined' != typeof window && (i = window.gsap));
20	}
21	function p(t) {
22		return c(t).id;
23	}
24	function q(t) {
25		return f[p('string' == typeof t ? g(t)[0] : t)];
26	}
27	function r(t) {
28		var e,
29			r = o;
30		if (0.05 <= t - s)
31			for (s = t; r; )
32				((e = r.g(r.t, r.p)) !== r.v1 || 0.2 < t - r.t1) &&
33					((r.v2 = r.v1), (r.v1 = e), (r.t2 = r.t1), (r.t1 = t)),
34					(r = r._next);
35	}
36	function t() {
37		(i = m()) &&
38			((g = i.utils.toArray),
39			(n = i.utils.getUnit),
40			(c = i.core.getCache),
41			(a = i.ticker),
42			(l = 1));
43	}
44	function u(t, e, r, i) {
45		(this.t = t),
46			(this.p = e),
47			(this.g = t._gsap.get),
48			(this.rCap = v[r || n(this.g(t, e))]),
49			(this.v1 = this.v2 = 0),
50			(this.t1 = this.t2 = a.time),
51			i && ((this._next = i)._prev = this);
52	}
53	var i,
54		l,
55		g,
56		n,
57		o,
58		a,
59		s,
60		c,
61		f = {},
62		v = { deg: 360, rad: 2 * Math.PI },
63		d = (function () {
64			function VelocityTracker(e, r) {
65				l || t(),
66					(this.target = g(e)[0]),
67					((f[p(this.target)] = this)._props = {}),
68					r && this.add(r);
69			}
70			VelocityTracker.register = function register(e) {
71				(i = e), t();
72			};
73			var e = VelocityTracker.prototype;
74			return (
75				(e.get = function get(t, e) {
76					var r,
77						i,
78						n =
79							this._props[t] ||
80							console.warn('Not tracking ' + t + ' velocity.');
81					return (
82						(r =
83							parseFloat(e ? n.v1 : n.g(n.t, n.p)) -
84							parseFloat(n.v2)),
85						(i = n.rCap) &&
86							(r %= i) !== r % (i / 2) &&
87							(r = r < 0 ? r + i : r - i),
88						(function _round(t) {
89							return Math.round(1e4 * t) / 1e4;
90						})(r / ((e ? n.t1 : a.time) - n.t2))
91					);
92				}),
93				(e.getAll = function getAll() {
94					var t,
95						e = {},
96						r = this._props;
97					for (t in r) e[t] = this.get(t);
98					return e;
99				}),
100				(e.isTracking = function isTracking(t) {
101					return t in this._props;
102				}),
103				(e.add = function add(t, e) {
104					t in this._props ||
105						(o || (a.add(r), (s = a.time)),
106						(o = this._props[t] = new u(this.target, t, e, o)));
107				}),
108				(e.remove = function remove(t) {
109					var e,
110						i,
111						n = this._props[t];
112					n &&
113						((e = n._prev),
114						(i = n._next),
115						e && (e._next = i),
116						i ? (i._prev = e) : o === n && (a.remove(r), (o = 0)),
117						delete this._props[t]);
118				}),
119				(e.kill = function kill(t) {
120					for (var e in this._props) this.remove(e);
121					t || delete f[p(this.target)];
122				}),
123				(VelocityTracker.track = function track(e, r, i) {
124					l || t();
125					for (
126						var n,
127							o,
128							a = [],
129							s = g(e),
130							c = r.split(','),
131							u = (i || '').split(','),
132							f = s.length;
133						f--;
134
135					) {
136						for (
137							n = q(s[f]) || new VelocityTracker(s[f]),
138								o = c.length;
139							o--;
140
141						)
142							n.add(c[o], u[o] || u[0]);
143						a.push(n);
144					}
145					return a;
146				}),
147				(VelocityTracker.untrack = function untrack(t, e) {
148					var r = (e || '').split(',');
149					g(t).forEach(function (t) {
150						var e = q(t);
151						e &&
152							(r.length
153								? r.forEach(function (t) {
154										return e.remove(t);
155								  })
156								: e.kill(1));
157					});
158				}),
159				(VelocityTracker.isTracking = function isTracking(t, e) {
160					var r = q(t);
161					return r && r.isTracking(e);
162				}),
163				(VelocityTracker.getVelocity = function getVelocity(t, e) {
164					var r = q(t);
165					return r && r.isTracking(e)
166						? r.get(e)
167						: console.warn('Not tracking velocity of ' + e);
168				}),
169				VelocityTracker
170			);
171		})();
172	(d.getByTarget = q), m() && i.registerPlugin(d);
173	function L() {
174		return (
175			h ||
176			('undefined' != typeof window &&
177				(h = window.gsap) &&
178				h.registerPlugin &&
179				h)
180		);
181	}
182	function N(t) {
183		return 'number' == typeof t;
184	}
185	function O(t) {
186		return 'object' == typeof t;
187	}
188	function P(t) {
189		return 'function' == typeof t;
190	}
191	function S(t) {
192		return t;
193	}
194	function W(t) {
195		return Math.round(1e4 * t) / 1e4;
196	}
197	function X(t, e, r) {
198		for (var i in e) i in t || i === r || (t[i] = e[i]);
199		return t;
200	}
201	function Y(t) {
202		var e,
203			r,
204			i = {};
205		for (e in t) i[e] = O((r = t[e])) && !I(r) ? Y(r) : r;
206		return i;
207	}
208	function Z(t, e, r, i, n) {
209		var o,
210			a,
211			s,
212			c,
213			u = e.length,
214			f = 0,
215			l = R;
216		if (O(t)) {
217			for (; u--; ) {
218				for (s in ((o = e[u]), (a = 0), t)) a += (c = o[s] - t[s]) * c;
219				a < l && ((f = u), (l = a));
220			}
221			if ((n || R) < R && n < Math.sqrt(l)) return t;
222		} else for (; u--; ) (a = (o = e[u]) - t) < 0 && (a = -a), a < l && i <= o && o <= r && ((f = u), (l = a));
223		return e[f];
224	}
225	function $(t, e, r, i, n, o, a) {
226		if ('auto' === t.end) return t;
227		var s,
228			c,
229			u = t.end;
230		if (((r = isNaN(r) ? R : r), (i = isNaN(i) ? -R : i), O(e))) {
231			if (
232				((s = e.calculated
233					? e
234					: (P(u) ? u(e, a) : Z(e, u, r, i, o)) || e),
235				!e.calculated)
236			) {
237				for (c in s) e[c] = s[c];
238				e.calculated = !0;
239			}
240			s = s[n];
241		} else s = P(u) ? u(e, a) : I(u) ? Z(e, u, r, i, o) : parseFloat(u);
242		return (
243			r < s ? (s = r) : s < i && (s = i),
244			{ max: s, min: s, unitFactor: t.unitFactor }
245		);
246	}
247	function _(t, e, r) {
248		return isNaN(t[e]) ? r : +t[e];
249	}
250	function aa(t, e) {
251		return (0.05 * e * t) / T;
252	}
253	function ba(t, e, r) {
254		return Math.abs(((e - t) * T) / r / 0.05);
255	}
256	function da(t, e, r, i) {
257		if (e.linkedProps) {
258			var n,
259				o,
260				a,
261				s,
262				c,
263				u,
264				f = e.linkedProps.split(','),
265				l = {};
266			for (n = 0; n < f.length; n++)
267				(a = e[(o = f[n])]) &&
268					((s = N(a.velocity)
269						? a.velocity
270						: (c = c || B(t)) && c.isTracking(o)
271						? c.get(o)
272						: 0),
273					(u = Math.abs(s / _(a, 'resistance', i))),
274					(l[o] = parseFloat(r(t, o)) + aa(s, u)));
275			return l;
276		}
277	}
278	function fa() {
279		(h = L()) &&
280			((y = h.parseEase),
281			(F = h.utils.toArray),
282			(b = h.utils.getUnit),
283			(A = h.core.getCache),
284			(E = h.utils.clamp),
285			(C = h.core.getStyleSaver),
286			(w = h.core.reverting || function () {}),
287			(k = y('power3')),
288			(T = k(0.05)),
289			(M = h.core.PropTween),
290			h.config({
291				resistance: 100,
292				unitFactors: {
293					time: 1e3,
294					totalTime: 1e3,
295					progress: 1e3,
296					totalProgress: 1e3,
297				},
298			}),
299			(V = h.config()),
300			h.registerPlugin(d),
301			(x = 1));
302	}
303	var h,
304		x,
305		y,
306		F,
307		k,
308		V,
309		b,
310		M,
311		A,
312		T,
313		E,
314		j,
315		C,
316		w,
317		B = d.getByTarget,
318		I = Array.isArray,
319		R = 1e10,
320		U = {
321			resistance: 1,
322			checkpoint: 1,
323			preventOvershoot: 1,
324			linkedProps: 1,
325			radius: 1,
326			duration: 1,
327		},
328		D = {
329			version: '3.11.4',
330			name: 'inertia',
331			register: function register(t) {
332				(h = t), fa();
333			},
334			init: function init(t, e, r, i, n) {
335				x || fa();
336				var o = B(t);
337				if ('auto' === e) {
338					if (!o)
339						return void console.warn(
340							'No inertia tracking on ' +
341								t +
342								'. InertiaPlugin.track(target) first.'
343						);
344					e = o.getAll();
345				}
346				(this.styles = C && 'object' == typeof t.style && C(t)),
347					(this.target = t),
348					(this.tween = r),
349					(j = e);
350				var a,
351					s,
352					c,
353					u,
354					f,
355					l,
356					p,
357					g,
358					v,
359					d = t._gsap,
360					h = d.get,
361					y = e.duration,
362					m = O(y),
363					k = e.preventOvershoot || (m && 0 === y.overshoot),
364					T = _(e, 'resistance', V.resistance),
365					w = N(y)
366						? y
367						: (function _calculateTweenDuration(t, e, r, i, n, o) {
368								if (
369									(void 0 === r && (r = 10),
370									void 0 === i && (i = 0.2),
371									void 0 === n && (n = 1),
372									void 0 === o && (o = 0),
373									(function _isString(t) {
374										return 'string' == typeof t;
375									})(t) && (t = F(t)[0]),
376									!t)
377								)
378									return 0;
379								var a,
380									s,
381									c,
382									u,
383									f,
384									l,
385									p,
386									g,
387									v,
388									d,
389									h = 0,
390									y = R,
391									m = e.inertia || e,
392									k = A(t).get,
393									T = _(m, 'resistance', V.resistance);
394								for (a in ((d = da(t, m, k, T)), m))
395									U[a] ||
396										((s = m[a]),
397										O(s) ||
398											((g = g || B(t)) && g.isTracking(a)
399												? (s = N(s)
400														? { velocity: s }
401														: {
402																velocity:
403																	g.get(a),
404														  })
405												: ((u = +s || 0),
406												  (c = Math.abs(u / T)))),
407										O(s) &&
408											((u = N(s.velocity)
409												? s.velocity
410												: (g = g || B(t)) &&
411												  g.isTracking(a)
412												? g.get(a)
413												: 0),
414											(c = E(
415												i,
416												r,
417												Math.abs(
418													u / _(s, 'resistance', T)
419												)
420											)),
421											(l =
422												(f = parseFloat(k(t, a)) || 0) +
423												aa(u, c)),
424											'end' in s &&
425												((s = $(
426													s,
427													d && a in d ? d : l,
428													s.max,
429													s.min,
430													a,
431													m.radius,
432													u
433												)),
434												o &&
435													(j === e && (j = m = Y(e)),
436													(m[a] = X(
437														s,
438														m[a],
439														'end'
440													)))),
441											'max' in s && l > +s.max + 1e-10
442												? ((v =
443														s.unitFactor ||
444														V.unitFactors[a] ||
445														1),
446												  (p =
447														(f > s.max &&
448															s.min !== s.max) ||
449														(-15 < u * v &&
450															u * v < 45)
451															? i + 0.1 * (r - i)
452															: ba(f, s.max, u)) +
453														n <
454														y && (y = p + n))
455												: 'min' in s &&
456												  l < s.min - 1e-10 &&
457												  ((v =
458														s.unitFactor ||
459														V.unitFactors[a] ||
460														1),
461												  (p =
462														(f < s.min &&
463															s.min !== s.max) ||
464														(-45 < u * v &&
465															u * v < 15)
466															? i + 0.1 * (r - i)
467															: ba(f, s.min, u)) +
468														n <
469														y && (y = p + n)),
470											h < p && (h = p)),
471										h < c && (h = c));
472								return (
473									y < h && (h = y), r < h ? r : h < i ? i : h
474								);
475						  })(
476								t,
477								e,
478								(m && y.max) || 10,
479								(m && y.min) || 0.2,
480								m && 'overshoot' in y
481									? +y.overshoot
482									: k
483									? 0
484									: 1,
485								!0
486						  );
487				for (a in ((e = j), (j = 0), (v = da(t, e, h, T)), e))
488					U[a] ||
489						((s = e[a]),
490						P(s) && (s = s(i, t, n)),
491						N(s)
492							? (f = s)
493							: O(s) && !isNaN(s.velocity)
494							? (f = +s.velocity)
495							: o && o.isTracking(a)
496							? (f = o.get(a))
497							: console.warn(
498									'ERROR: No velocity was defined for ' +
499										t +
500										' property: ' +
501										a
502							  ),
503						(l = aa(f, w)),
504						(g = 0),
505						(c = h(t, a)),
506						(u = b(c)),
507						(c = parseFloat(c)),
508						O(s) &&
509							((p = c + l),
510							'end' in s &&
511								(s = $(
512									s,
513									v && a in v ? v : p,
514									s.max,
515									s.min,
516									a,
517									e.radius,
518									f
519								)),
520							'max' in s && +s.max < p
521								? k || s.preventOvershoot
522									? (l = s.max - c)
523									: (g = s.max - c - l)
524								: 'min' in s &&
525								  +s.min > p &&
526								  (k || s.preventOvershoot
527										? (l = s.min - c)
528										: (g = s.min - c - l))),
529						this._props.push(a),
530						this.styles && this.styles.save(a),
531						(this._pt = new M(
532							this._pt,
533							t,
534							a,
535							c,
536							0,
537							S,
538							0,
539							d.set(t, a, this)
540						)),
541						(this._pt.u = u || 0),
542						(this._pt.c1 = l),
543						(this._pt.c2 = g));
544				return r.duration(w), 1;
545			},
546			render: function render(t, e) {
547				var r = e._pt;
548				if ((t = k(e.tween._time / e.tween._dur)) || !w())
549					for (; r; )
550						r.set(
551							r.t,
552							r.p,
553							W(r.s + r.c1 * t + r.c2 * t * t) + r.u,
554							r.d,
555							t
556						),
557							(r = r._next);
558				else e.styles.revert();
559			},
560		};
561	'track,untrack,isTracking,getVelocity,getByTarget'
562		.split(',')
563		.forEach(function (t) {
564			return (D[t] = d[t]);
565		}),
566		L() && h.registerPlugin(D),
567		(e.InertiaPlugin = D),
568		(e.VelocityTracker = d),
569		(e.default = D);
570	if (typeof window === 'undefined' || window !== e) {
571		Object.defineProperty(e, '__esModule', { value: !0 });
572	} else {
573		delete e.default;
574	}
575});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.