https://dialog-pr.com//wp-content/plugins/eventfive-wordpress-plug…/libs/gsap/umd/gsap.js?ver=7.0.62
vendor: 4,802 bytes, lines 1-157
1(function (global, factory) { 2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 3 typeof define === 'function' && define.amd ? define(['exports'], factory) : 4 (global = global || self, factory(window)); 5}(this, (function (exports) { 'use strict'; 6 7 function _inheritsLoose(subClass, superClass) { 8 subClass.prototype = Object.create(superClass.prototype); 9 subClass.prototype.constructor = subClass; 10 subClass.__proto__ = superClass; 11 } 12 13 function _assertThisInitialized(self) { 14 if (self === void 0) { 15 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 16 } 17 18 return self; 19 } 20 21 /*! 22 * GSAP 3.12.5 23 * https://gsap.com 24 * 25 * @license Copyright 2008-2024, GreenSock. All rights reserved. 26 * Subject to the terms at https://gsap.com/standard-license or for 27 * Club GSAP members, the agreement issued with that membership. 28 * @author: Jack Doyle, [email protected] 29 */ 30 var _config = { 31 autoSleep: 120, 32 force3D: "auto", 33 nullTargetWarn: 1, 34 units: { 35 lineHeight: "" 36 } 37 }, 38 _defaults = { 39 duration: .5, 40 overwrite: false, 41 delay: 0 42 }, 43 _suppressOverwrites, 44 _reverting, 45 _context, 46 _bigNum = 1e8, 47 _tinyNum = 1 / _bigNum, 48 _2PI = Math.PI * 2, 49 _HALF_PI = _2PI / 4, 50 _gsID = 0, 51 _sqrt = Math.sqrt, 52 _cos = Math.cos, 53 _sin = Math.sin, 54 _isString = function _isString(value) { 55 return typeof value === "string"; 56 }, 57 _isFunction = function _isFunction(value) { 58 return typeof value === "function"; 59 }, 60 _isNumber = function _isNumber(value) { 61 return typeof value === "number"; 62 }, 63 _isUndefined = function _isUndefined(value) { 64 return typeof value === "undefined"; 65 }, 66 _isObject = function _isObject(value) { 67 return typeof value === "object"; 68 }, 69 _isNotFalse = function _isNotFalse(value) { 70 return value !== false; 71 }, 72 _windowExists = function _windowExists() { 73 return typeof window !== "undefined"; 74 }, 75 _isFuncOrString = function _isFuncOrString(value) { 76 return _isFunction(value) || _isString(value); 77 }, 78 _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function () {}, 79 _isArray = Array.isArray, 80 _strictNumExp = /(?:-?\.?\d|\.)+/gi, 81 _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g, 82 _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g, 83 _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi, 84 _relExp = /[+-]=-?[.\d]+/, 85 _delimitedValueExp = /[^,'"\[\]\s]+/gi, 86 _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i, 87 _globalTimeline, 88 _win, 89 _coreInitted, 90 _doc, 91 _globals = {}, 92 _installScope = {}, 93 _coreReady, 94 _install = function _install(scope) { 95 return (_installScope = _merge(scope, _globals)) && gsap; 96 }, 97 _missingPlugin = function _missingPlugin(property, value) { 98 return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()"); 99 }, 100 _warn = function _warn(message, suppress) { 101 return !suppress && console.warn(message); 102 }, 103 _addGlobal = function _addGlobal(name, obj) { 104 return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals; 105 }, 106 _emptyFunc = function _emptyFunc() { 107 return 0; 108 }, 109 _startAtRevertConfig = { 110 suppressEvents: true, 111 isStart: true, 112 kill: false 113 }, 114 _revertConfigNoKill = { 115 suppressEvents: true, 116 kill: false 117 }, 118 _revertConfig = { 119 suppressEvents: true 120 }, 121 _reservedProps = {}, 122 _lazyTweens = [], 123 _lazyLookup = {}, 124 _lastRenderedFrame, 125 _plugins = {}, 126 _effects = {}, 127 _nextGCFrame = 30, 128 _harnessPlugins = [], 129 _callbackNames = "", 130 _harness = function _harness(targets) { 131 var target = targets[0], 132 harnessPlugin, 133 i; 134 _isObject(target) || _isFunction(target) || (targets = [targets]); 135 136 if (!(harnessPlugin = (target._gsap || {}).harness)) { 137 i = _harnessPlugins.length; 138 139 while (i-- && !_harnessPlugins[i].targetTest(target)) {} 140 141 harnessPlugin = _harnessPlugins[i]; 142 } 143 144 i = targets.length; 145 146 while (i--) { 147 targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1); 148 } 149 150 return targets; 151 }, 152 _getCache = function _getCache(target) { 153 return target._gsap || _harness(toArray(target))[0]._gsap; 154 }, 155 _getProperty = function _getProperty(target, property, v) { 156 return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v; 157 },
vendor: 6,338 bytes, lines 158-367
158 _forEachName = function _forEachName(names, func) { 159 return (names = names.split(",")).forEach(func) || names; 160 }, 161 _round = function _round(value) { 162 return Math.round(value * 100000) / 100000 || 0; 163 }, 164 _roundPrecise = function _roundPrecise(value) { 165 return Math.round(value * 10000000) / 10000000 || 0; 166 }, 167 _parseRelative = function _parseRelative(start, value) { 168 var operator = value.charAt(0), 169 end = parseFloat(value.substr(2)); 170 start = parseFloat(start); 171 return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end; 172 }, 173 _arrayContainsAny = function _arrayContainsAny(toSearch, toFind) { 174 var l = toFind.length, 175 i = 0; 176 177 for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l;) {} 178 179 return i < l; 180 }, 181 _lazyRender = function _lazyRender() { 182 var l = _lazyTweens.length, 183 a = _lazyTweens.slice(0), 184 i, 185 tween; 186 187 _lazyLookup = {}; 188 _lazyTweens.length = 0; 189 190 for (i = 0; i < l; i++) { 191 tween = a[i]; 192 tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0); 193 } 194 }, 195 _lazySafeRender = function _lazySafeRender(animation, time, suppressEvents, force) { 196 _lazyTweens.length && !_reverting && _lazyRender(); 197 animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt)); 198 _lazyTweens.length && !_reverting && _lazyRender(); 199 }, 200 _numericIfPossible = function _numericIfPossible(value) { 201 var n = parseFloat(value); 202 return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value; 203 }, 204 _passThrough = function _passThrough(p) { 205 return p; 206 }, 207 _setDefaults = function _setDefaults(obj, defaults) { 208 for (var p in defaults) { 209 p in obj || (obj[p] = defaults[p]); 210 } 211 212 return obj; 213 }, 214 _setKeyframeDefaults = function _setKeyframeDefaults(excludeDuration) { 215 return function (obj, defaults) { 216 for (var p in defaults) { 217 p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults[p]); 218 } 219 }; 220 }, 221 _merge = function _merge(base, toMerge) { 222 for (var p in toMerge) { 223 base[p] = toMerge[p]; 224 } 225 226 return base; 227 }, 228 _mergeDeep = function _mergeDeep(base, toMerge) { 229 for (var p in toMerge) { 230 p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]); 231 } 232 233 return base; 234 }, 235 _copyExcluding = function _copyExcluding(obj, excluding) { 236 var copy = {}, 237 p; 238 239 for (p in obj) { 240 p in excluding || (copy[p] = obj[p]); 241 } 242 243 return copy; 244 }, 245 _inheritDefaults = function _inheritDefaults(vars) { 246 var parent = vars.parent || _globalTimeline, 247 func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults; 248 249 if (_isNotFalse(vars.inherit)) { 250 while (parent) { 251 func(vars, parent.vars.defaults); 252 parent = parent.parent || parent._dp; 253 } 254 } 255 256 return vars; 257 }, 258 _arraysMatch = function _arraysMatch(a1, a2) { 259 var i = a1.length, 260 match = i === a2.length; 261 262 while (match && i-- && a1[i] === a2[i]) {} 263 264 return i < 0; 265 }, 266 _addLinkedListItem = function _addLinkedListItem(parent, child, firstProp, lastProp, sortBy) { 267 if (firstProp === void 0) { 268 firstProp = "_first"; 269 } 270 271 if (lastProp === void 0) { 272 lastProp = "_last"; 273 } 274 275 var prev = parent[lastProp], 276 t; 277 278 if (sortBy) { 279 t = child[sortBy]; 280 281 while (prev && prev[sortBy] > t) { 282 prev = prev._prev; 283 } 284 } 285 286 if (prev) { 287 child._next = prev._next; 288 prev._next = child; 289 } else { 290 child._next = parent[firstProp]; 291 parent[firstProp] = child; 292 } 293 294 if (child._next) { 295 child._next._prev = child; 296 } else { 297 parent[lastProp] = child; 298 } 299 300 child._prev = prev; 301 child.parent = child._dp = parent; 302 return child; 303 }, 304 _removeLinkedListItem = function _removeLinkedListItem(parent, child, firstProp, lastProp) { 305 if (firstProp === void 0) { 306 firstProp = "_first"; 307 } 308 309 if (lastProp === void 0) { 310 lastProp = "_last"; 311 } 312 313 var prev = child._prev, 314 next = child._next; 315 316 if (prev) { 317 prev._next = next; 318 } else if (parent[firstProp] === child) { 319 parent[firstProp] = next; 320 } 321 322 if (next) { 323 next._prev = prev; 324 } else if (parent[lastProp] === child) { 325 parent[lastProp] = prev; 326 } 327 328 child._next = child._prev = child.parent = null; 329 }, 330 _removeFromParent = function _removeFromParent(child, onlyIfParentHasAutoRemove) { 331 child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child); 332 child._act = 0; 333 }, 334 _uncache = function _uncache(animation, child) { 335 if (animation && (!child || child._end > animation._dur || child._start < 0)) { 336 var a = animation; 337 338 while (a) { 339 a._dirty = 1; 340 a = a.parent; 341 } 342 } 343 344 return animation; 345 }, 346 _recacheAncestors = function _recacheAncestors(animation) { 347 var parent = animation.parent; 348 349 while (parent && parent.parent) { 350 parent._dirty = 1; 351 parent.totalDuration(); 352 parent = parent.parent; 353 } 354 355 return animation; 356 }, 357 _rewindStartAt = function _rewindStartAt(tween, totalTime, suppressEvents, force) { 358 return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force)); 359 }, 360 _hasNoPausedAncestors = function _hasNoPausedAncestors(animation) { 361 return !animation || animation._ts && _hasNoPausedAncestors(animation.parent); 362 }, 363 _elapsedCycleDuration = function _elapsedCycleDuration(animation) { 364 return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0; 365 }, 366 _animationCycle = function _animationCycle(tTime, cycleDuration) { 367 var whole = Math.floor(tTime /= cycleDuration
vendor: 17,487 bytes, lines 367-835
367); 368 return tTime && whole === tTime ? whole - 1 : whole; 369 }, 370 _parentToChildTotalTime = function _parentToChildTotalTime(parentTime, child) { 371 return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur); 372 }, 373 _setEnd = function _setEnd(animation) { 374 return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0)); 375 }, 376 _alignPlayhead = function _alignPlayhead(animation, totalTime) { 377 var parent = animation._dp; 378 379 if (parent && parent.smoothChildTiming && animation._ts) { 380 animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts)); 381 382 _setEnd(animation); 383 384 parent._dirty || _uncache(parent, animation); 385 } 386 387 return animation; 388 }, 389 _postAddChecks = function _postAddChecks(timeline, child) { 390 var t; 391 392 if (child._time || !child._dur && child._initted || child._start < timeline._time && (child._dur || !child.add)) { 393 t = _parentToChildTotalTime(timeline.rawTime(), child); 394 395 if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) { 396 child.render(t, true); 397 } 398 } 399 400 if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) { 401 if (timeline._dur < timeline.duration()) { 402 t = timeline; 403 404 while (t._dp) { 405 t.rawTime() >= 0 && t.totalTime(t._tTime); 406 t = t._dp; 407 } 408 } 409 410 timeline._zTime = -_tinyNum; 411 } 412 }, 413 _addToTimeline = function _addToTimeline(timeline, child, position, skipChecks) { 414 child.parent && _removeFromParent(child); 415 child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay); 416 child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0)); 417 418 _addLinkedListItem(timeline, child, "_first", "_last", timeline._sort ? "_start" : 0); 419 420 _isFromOrFromStart(child) || (timeline._recent = child); 421 skipChecks || _postAddChecks(timeline, child); 422 timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); 423 return timeline; 424 }, 425 _scrollTrigger = function _scrollTrigger(animation, trigger) { 426 return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation); 427 }, 428 _attemptInitTween = function _attemptInitTween(tween, time, force, suppressEvents, tTime) { 429 _initTween(tween, time, tTime); 430 431 if (!tween._initted) { 432 return 1; 433 } 434 435 if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) { 436 _lazyTweens.push(tween); 437 438 tween._lazy = [tTime, suppressEvents]; 439 return 1; 440 } 441 }, 442 _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart(_ref) { 443 var parent = _ref.parent; 444 return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart(parent)); 445 }, 446 _isFromOrFromStart = function _isFromOrFromStart(_ref2) { 447 var data = _ref2.data; 448 return data === "isFromStart" || data === "isStart"; 449 }, 450 _renderZeroDurationTween = function _renderZeroDurationTween(tween, totalTime, suppressEvents, force) { 451 var prevRatio = tween.ratio, 452 ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, 453 repeatDelay = tween._rDelay, 454 tTime = 0, 455 pt, 456 iteration, 457 prevIteration; 458 459 if (repeatDelay && tween._repeat) { 460 tTime = _clamp(0, tween._tDur, totalTime); 461 iteration = _animationCycle(tTime, repeatDelay); 462 tween._yoyo && iteration & 1 && (ratio = 1 - ratio); 463 464 if (iteration !== _animationCycle(tween._tTime, repeatDelay)) { 465 prevRatio = 1 - ratio; 466 tween.vars.repeatRefresh && tween._initted && tween.invalidate(); 467 } 468 } 469 470 if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) { 471 if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) { 472 return; 473 } 474 475 prevIteration = tween._zTime; 476 tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); 477 suppressEvents || (suppressEvents = totalTime && !prevIteration); 478 tween.ratio = ratio; 479 tween._from && (ratio = 1 - ratio); 480 tween._time = 0; 481 tween._tTime = tTime; 482 pt = tween._pt; 483 484 while (pt) { 485 pt.r(ratio, pt.d); 486 pt = pt._next; 487 } 488 489 totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true); 490 tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate"); 491 tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat"); 492 493 if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) { 494 ratio && _removeFromParent(tween, 1); 495 496 if (!suppressEvents && !_reverting) { 497 _callback(tween, ratio ? "onComplete" : "onReverseComplete", true); 498 499 tween._prom && tween._prom(); 500 } 501 } 502 } else if (!tween._zTime) { 503 tween._zTime = totalTime; 504 } 505 }, 506 _findNextPauseTween = function _findNextPauseTween(animation, prevTime, time) { 507 var child; 508 509 if (time > prevTime) { 510 child = animation._first; 511 512 while (child && child._start <= time) { 513 if (child.data === "isPause" && child._start > prevTime) { 514 return child; 515 } 516 517 child = child._next; 518 } 519 } else { 520 child = animation._last; 521 522 while (child && child._start >= time) { 523 if (child.data === "isPause" && child._start < prevTime) { 524 return child; 525 } 526 527 child = child._prev; 528 } 529 } 530 }, 531 _setDuration = function _setDuration(animation, duration, skipUncache, leavePlayhead) { 532 var repeat = animation._repeat, 533 dur = _roundPrecise(duration) || 0, 534 totalProgress = animation._tTime / animation._tDur; 535 totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur); 536 animation._dur = dur; 537 animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat); 538 totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress); 539 animation.parent && _setEnd(animation); 540 skipUncache || _uncache(animation.parent, animation); 541 return animation; 542 }, 543 _onUpdateTotalDuration = function _onUpdateTotalDuration(animation) { 544 return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur); 545 }, 546 _zeroPosition = { 547 _start: 0, 548 endTime: _emptyFunc, 549 totalDuration: _emptyFunc 550 }, 551 _parsePosition = function _parsePosition(animation, position, percentAnimation) { 552 var labels = animation.labels, 553 recent = animation._recent || _zeroPosition, 554 clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, 555 i, 556 offset, 557 isPercent; 558 559 if (_isString(position) && (isNaN(position) || position in labels)) { 560 offset = position.charAt(0); 561 isPercent = position.substr(-1) === "%"; 562 i = position.indexOf("="); 563 564 if (offset === "<" || offset === ">") { 565 i >= 0 && (position = position.replace(/=/, "")); 566 return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1); 567 } 568 569 if (i < 0) { 570 position in labels || (labels[position] = clippedDuration); 571 return labels[position]; 572 } 573 574 offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1)); 575 576 if (isPercent && percentAnimation) { 577 offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration(); 578 } 579 580 return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset; 581 } 582 583 return position == null ? clippedDuration : +position; 584 }, 585 _createTweenType = function _createTweenType(type, params, timeline) { 586 var isLegacy = _isNumber(params[1]), 587 varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), 588 vars = params[varsIndex], 589 irVars, 590 parent; 591 592 isLegacy && (vars.duration = params[1]); 593 vars.parent = timeline; 594 595 if (type) { 596 irVars = vars; 597 parent = timeline; 598 599 while (parent && !("immediateRender" in irVars)) { 600 irVars = parent.vars.defaults || {}; 601 parent = _isNotFalse(parent.vars.inherit) && parent.parent; 602 } 603 604 vars.immediateRender = _isNotFalse(irVars.immediateRender); 605 type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; 606 } 607 608 return new Tween(params[0], vars, params[varsIndex + 1]); 609 }, 610 _conditionalReturn = function _conditionalReturn(value, func) { 611 return value || value === 0 ? func(value) : func; 612 }, 613 _clamp = function _clamp(min, max, value) { 614 return value < min ? min : value > max ? max : value; 615 }, 616 getUnit = function getUnit(value, v) { 617 return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1]; 618 }, 619 clamp = function clamp(min, max, value) { 620 return _conditionalReturn(value, function (v) { 621 return _clamp(min, max, v); 622 }); 623 }, 624 _slice = [].slice, 625 _isArrayLike = function _isArrayLike(value, nonEmpty) { 626 return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win; 627 }, 628 _flatten = function _flatten(ar, leaveStrings, accumulator) { 629 if (accumulator === void 0) { 630 accumulator = []; 631 } 632 633 return ar.forEach(function (value) { 634 var _accumulator; 635 636 return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value); 637 }) || accumulator; 638 }, 639 toArray = function toArray(value, scope, leaveStrings) { 640 return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : []; 641 }, 642 selector = function selector(value) { 643 value = toArray(value)[0] || _warn("Invalid scope") || {}; 644 return function (v) { 645 var el = value.current || value.nativeElement || value; 646 return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value); 647 }; 648 }, 649 shuffle = function shuffle(a) { 650 return a.sort(function () { 651 return .5 - Math.random(); 652 }); 653 }, 654 distribute = function distribute(v) { 655 if (_isFunction(v)) { 656 return v; 657 } 658 659 var vars = _isObject(v) ? v : { 660 each: v 661 }, 662 ease = _parseEase(vars.ease), 663 from = vars.from || 0, 664 base = parseFloat(vars.base) || 0, 665 cache = {}, 666 isDecimal = from > 0 && from < 1, 667 ratios = isNaN(from) || isDecimal, 668 axis = vars.axis, 669 ratioX = from, 670 ratioY = from; 671 672 if (_isString(from)) { 673 ratioX = ratioY = { 674 center: .5, 675 edges: .5, 676 end: 1 677 }[from] || 0; 678 } else if (!isDecimal && ratios) { 679 ratioX = from[0]; 680 ratioY = from[1]; 681 } 682 683 return function (i, target, a) { 684 var l = (a || vars).length, 685 distances = cache[l], 686 originX, 687 originY, 688 x, 689 y, 690 d, 691 j, 692 max, 693 min, 694 wrapAt; 695 696 if (!distances) { 697 wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1]; 698 699 if (!wrapAt) { 700 max = -_bigNum; 701 702 while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {} 703 704 wrapAt < l && wrapAt--; 705 } 706 707 distances = cache[l] = []; 708 originX = ratios ? Math.min(wrapAt, l) * ratioX - .5 : from % wrapAt; 709 originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - .5 : from / wrapAt | 0; 710 max = 0; 711 min = _bigNum; 712 713 for (j = 0; j < l; j++) { 714 x = j % wrapAt - originX; 715 y = originY - (j / wrapAt | 0); 716 distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x); 717 d > max && (max = d); 718 d < min && (min = d); 719 } 720 721 from === "random" && shuffle(distances); 722 distances.max = max - min; 723 distances.min = min; 724 distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === "y" ? l / wrapAt : wrapAt) || 0) * (from === "edges" ? -1 : 1); 725 distances.b = l < 0 ? base - l : base; 726 distances.u = getUnit(vars.amount || vars.each) || 0; 727 ease = ease && l < 0 ? _invertEase(ease) : ease; 728 } 729 730 l = (distances[i] - distances.min) / distances.max || 0; 731 return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; 732 }; 733 }, 734 _roundModifier = function _roundModifier(v) { 735 var p = Math.pow(10, ((v + "").split(".")[1] || "").length); 736 return function (raw) { 737 var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p); 738 739 return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); 740 }; 741 }, 742 snap = function snap(snapTo, value) { 743 var isArray = _isArray(snapTo), 744 radius, 745 is2D; 746 747 if (!isArray && _isObject(snapTo)) { 748 radius = isArray = snapTo.radius || _bigNum; 749 750 if (snapTo.values) { 751 snapTo = toArray(snapTo.values); 752 753 if (is2D = !_isNumber(snapTo[0])) { 754 radius *= radius; 755 } 756 } else { 757 snapTo = _roundModifier(snapTo.increment); 758 } 759 } 760 761 return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function (raw) { 762 is2D = snapTo(raw); 763 return Math.abs(is2D - raw) <= radius ? is2D : raw; 764 } : function (raw) { 765 var x = parseFloat(is2D ? raw.x : raw), 766 y = parseFloat(is2D ? raw.y : 0), 767 min = _bigNum, 768 closest = 0, 769 i = snapTo.length, 770 dx, 771 dy; 772 773 while (i--) { 774 if (is2D) { 775 dx = snapTo[i].x - x; 776 dy = snapTo[i].y - y; 777 dx = dx * dx + dy * dy; 778 } else { 779 dx = Math.abs(snapTo[i] - x); 780 } 781 782 if (dx < min) { 783 min = dx; 784 closest = i; 785 } 786 } 787 788 closest = !radius || min <= radius ? snapTo[closest] : raw; 789 return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw); 790 }); 791 }, 792 random = function random(min, max, roundingIncrement, returnFunction) { 793 return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function () { 794 return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * .99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction; 795 }); 796 }, 797 pipe = function pipe() { 798 for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) { 799 functions[_key] = arguments[_key]; 800 } 801 802 return function (value) { 803 return functions.reduce(function (v, f) { 804 return f(v); 805 }, value); 806 }; 807 }, 808 unitize = function unitize(func, unit) { 809 return function (value) { 810 return func(parseFloat(value)) + (unit || getUnit(value)); 811 }; 812 }, 813 normalize = function normalize(min, max, value) { 814 return mapRange(min, max, 0, 1, value); 815 }, 816 _wrapArray = function _wrapArray(a, wrapper, value) { 817 return _conditionalReturn(value, function (index) { 818 return a[~~wrapper(index)]; 819 }); 820 }, 821 wrap = function wrap(min, max, value) { 822 var range = max - min; 823 return _isArray(min) ? _wrapArray(min, wrap(0, min.length), max) : _conditionalReturn(value, function (value) { 824 return (range + (value - min) % range) % range + min; 825 }); 826 }, 827 wrapYoyo = function wrapYoyo(min, max, value) { 828 var range = max - min, 829 total = range * 2; 830 return _isArray(min) ? _wrapArray(min, wrapYoyo(0, min.length - 1), max) : _conditionalReturn(value, function (value) { 831 value = (total + (value - min) % total) % total || 0; 832 return min + (value > range ? total - value : value); 833 }); 834 }, 835 _replaceRandom = function _replaceRandom(
vendor: 531 bytes, lines 835-851
835value) { 836 var prev = 0, 837 s = "", 838 i, 839 nums, 840 end, 841 isArray; 842 843 while (~(i = value.indexOf("random(", prev))) { 844 end = value.indexOf(")", i); 845 isArray = value.charAt(i + 7) === "["; 846 nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp); 847 s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5); 848 prev = end + 1; 849 } 850 851 return s + value.substr(prev, value.length - prev
vendor: 14,290 bytes, lines 851-1367
851); 852 }, 853 mapRange = function mapRange(inMin, inMax, outMin, outMax, value) { 854 var inRange = inMax - inMin, 855 outRange = outMax - outMin; 856 return _conditionalReturn(value, function (value) { 857 return outMin + ((value - inMin) / inRange * outRange || 0); 858 }); 859 }, 860 interpolate = function interpolate(start, end, progress, mutate) { 861 var func = isNaN(start + end) ? 0 : function (p) { 862 return (1 - p) * start + p * end; 863 }; 864 865 if (!func) { 866 var isString = _isString(start), 867 master = {}, 868 p, 869 i, 870 interpolators, 871 l, 872 il; 873 874 progress === true && (mutate = 1) && (progress = null); 875 876 if (isString) { 877 start = { 878 p: start 879 }; 880 end = { 881 p: end 882 }; 883 } else if (_isArray(start) && !_isArray(end)) { 884 interpolators = []; 885 l = start.length; 886 il = l - 2; 887 888 for (i = 1; i < l; i++) { 889 interpolators.push(interpolate(start[i - 1], start[i])); 890 } 891 892 l--; 893 894 func = function func(p) { 895 p *= l; 896 var i = Math.min(il, ~~p); 897 return interpolators[i](p - i); 898 }; 899 900 progress = end; 901 } else if (!mutate) { 902 start = _merge(_isArray(start) ? [] : {}, start); 903 } 904 905 if (!interpolators) { 906 for (p in end) { 907 _addPropTween.call(master, start, p, "get", end[p]); 908 } 909 910 func = function func(p) { 911 return _renderPropTweens(p, master) || (isString ? start.p : start); 912 }; 913 } 914 } 915 916 return _conditionalReturn(progress, func); 917 }, 918 _getLabelInDirection = function _getLabelInDirection(timeline, fromTime, backward) { 919 var labels = timeline.labels, 920 min = _bigNum, 921 p, 922 distance, 923 label; 924 925 for (p in labels) { 926 distance = labels[p] - fromTime; 927 928 if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) { 929 label = p; 930 min = distance; 931 } 932 } 933 934 return label; 935 }, 936 _callback = function _callback(animation, type, executeLazyFirst) { 937 var v = animation.vars, 938 callback = v[type], 939 prevContext = _context, 940 context = animation._ctx, 941 params, 942 scope, 943 result; 944 945 if (!callback) { 946 return; 947 } 948 949 params = v[type + "Params"]; 950 scope = v.callbackScope || animation; 951 executeLazyFirst && _lazyTweens.length && _lazyRender(); 952 context && (_context = context); 953 result = params ? callback.apply(scope, params) : callback.call(scope); 954 _context = prevContext; 955 return result; 956 }, 957 _interrupt = function _interrupt(animation) { 958 _removeFromParent(animation); 959 960 animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting); 961 animation.progress() < 1 && _callback(animation, "onInterrupt"); 962 return animation; 963 }, 964 _quickTween, 965 _registerPluginQueue = [], 966 _createPlugin = function _createPlugin(config) { 967 if (!config) return; 968 config = !config.name && config["default"] || config; 969 970 if (_windowExists() || config.headless) { 971 var name = config.name, 972 isFunc = _isFunction(config), 973 Plugin = name && !isFunc && config.init ? function () { 974 this._props = []; 975 } : config, 976 instanceDefaults = { 977 init: _emptyFunc, 978 render: _renderPropTweens, 979 add: _addPropTween, 980 kill: _killPropTweensOf, 981 modifier: _addPluginModifier, 982 rawVars: 0 983 }, 984 statics = { 985 targetTest: 0, 986 get: 0, 987 getSetter: _getSetter, 988 aliases: {}, 989 register: 0 990 }; 991 992 _wake(); 993 994 if (config !== Plugin) { 995 if (_plugins[name]) { 996 return; 997 } 998 999 _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); 1000 1001 _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); 1002 1003 _plugins[Plugin.prop = name] = Plugin; 1004 1005 if (config.targetTest) { 1006 _harnessPlugins.push(Plugin); 1007 1008 _reservedProps[name] = 1; 1009 } 1010 1011 name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin"; 1012 } 1013 1014 _addGlobal(name, Plugin); 1015 1016 config.register && config.register(gsap, Plugin, PropTween); 1017 } else { 1018 _registerPluginQueue.push(config); 1019 } 1020 }, 1021 _255 = 255, 1022 _colorLookup = { 1023 aqua: [0, _255, _255], 1024 lime: [0, _255, 0], 1025 silver: [192, 192, 192], 1026 black: [0, 0, 0], 1027 maroon: [128, 0, 0], 1028 teal: [0, 128, 128], 1029 blue: [0, 0, _255], 1030 navy: [0, 0, 128], 1031 white: [_255, _255, _255], 1032 olive: [128, 128, 0], 1033 yellow: [_255, _255, 0], 1034 orange: [_255, 165, 0], 1035 gray: [128, 128, 128], 1036 purple: [128, 0, 128], 1037 green: [0, 128, 0], 1038 red: [_255, 0, 0], 1039 pink: [_255, 192, 203], 1040 cyan: [0, _255, _255], 1041 transparent: [_255, _255, _255, 0] 1042 }, 1043 _hue = function _hue(h, m1, m2) { 1044 h += h < 0 ? 1 : h > 1 ? -1 : 0; 1045 return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < .5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + .5 | 0; 1046 }, 1047 splitColor = function splitColor(v, toHSL, forceAlpha) { 1048 var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, 1049 r, 1050 g, 1051 b, 1052 h, 1053 s, 1054 l, 1055 max, 1056 min, 1057 d, 1058 wasHSL; 1059 1060 if (!a) { 1061 if (v.substr(-1) === ",") { 1062 v = v.substr(0, v.length - 1); 1063 } 1064 1065 if (_colorLookup[v]) { 1066 a = _colorLookup[v]; 1067 } else if (v.charAt(0) === "#") { 1068 if (v.length < 6) { 1069 r = v.charAt(1); 1070 g = v.charAt(2); 1071 b = v.charAt(3); 1072 v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : ""); 1073 } 1074 1075 if (v.length === 9) { 1076 a = parseInt(v.substr(1, 6), 16); 1077 return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255]; 1078 } 1079 1080 v = parseInt(v.substr(1), 16); 1081 a = [v >> 16, v >> 8 & _255, v & _255]; 1082 } else if (v.substr(0, 3) === "hsl") { 1083 a = wasHSL = v.match(_strictNumExp); 1084 1085 if (!toHSL) { 1086 h = +a[0] % 360 / 360; 1087 s = +a[1] / 100; 1088 l = +a[2] / 100; 1089 g = l <= .5 ? l * (s + 1) : l + s - l * s; 1090 r = l * 2 - g; 1091 a.length > 3 && (a[3] *= 1); 1092 a[0] = _hue(h + 1 / 3, r, g); 1093 a[1] = _hue(h, r, g); 1094 a[2] = _hue(h - 1 / 3, r, g); 1095 } else if (~v.indexOf("=")) { 1096 a = v.match(_numExp); 1097 forceAlpha && a.length < 4 && (a[3] = 1); 1098 return a; 1099 } 1100 } else { 1101 a = v.match(_strictNumExp) || _colorLookup.transparent; 1102 } 1103 1104 a = a.map(Number); 1105 } 1106 1107 if (toHSL && !wasHSL) { 1108 r = a[0] / _255; 1109 g = a[1] / _255; 1110 b = a[2] / _255; 1111 max = Math.max(r, g, b); 1112 min = Math.min(r, g, b); 1113 l = (max + min) / 2; 1114 1115 if (max === min) { 1116 h = s = 0; 1117 } else { 1118 d = max - min; 1119 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 1120 h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4; 1121 h *= 60; 1122 } 1123 1124 a[0] = ~~(h + .5); 1125 a[1] = ~~(s * 100 + .5); 1126 a[2] = ~~(l * 100 + .5); 1127 } 1128 1129 forceAlpha && a.length < 4 && (a[3] = 1); 1130 return a; 1131 }, 1132 _colorOrderData = function _colorOrderData(v) { 1133 var values = [], 1134 c = [], 1135 i = -1; 1136 v.split(_colorExp).forEach(function (v) { 1137 var a = v.match(_numWithUnitExp) || []; 1138 values.push.apply(values, a); 1139 c.push(i += a.length + 1); 1140 }); 1141 values.c = c; 1142 return values; 1143 }, 1144 _formatColors = function _formatColors(s, toHSL, orderMatchData) { 1145 var result = "", 1146 colors = (s + result).match(_colorExp), 1147 type = toHSL ? "hsla(" : "rgba(", 1148 i = 0, 1149 c, 1150 shell, 1151 d, 1152 l; 1153 1154 if (!colors) { 1155 return s; 1156 } 1157 1158 colors = colors.map(function (color) { 1159 return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")"; 1160 }); 1161 1162 if (orderMatchData) { 1163 d = _colorOrderData(s); 1164 c = orderMatchData.c; 1165 1166 if (c.join(result) !== d.c.join(result)) { 1167 shell = s.replace(_colorExp, "1").split(_numWithUnitExp); 1168 l = shell.length - 1; 1169 1170 for (; i < l; i++) { 1171 result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift()); 1172 } 1173 } 1174 } 1175 1176 if (!shell) { 1177 shell = s.split(_colorExp); 1178 l = shell.length - 1; 1179 1180 for (; i < l; i++) { 1181 result += shell[i] + colors[i]; 1182 } 1183 } 1184 1185 return result + shell[l]; 1186 }, 1187 _colorExp = function () { 1188 var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", 1189 p; 1190 1191 for (p in _colorLookup) { 1192 s += "|" + p + "\\b"; 1193 } 1194 1195 return new RegExp(s + ")", "gi"); 1196 }(), 1197 _hslExp = /hsl[a]?\(/, 1198 _colorStringFilter = function _colorStringFilter(a) { 1199 var combined = a.join(" "), 1200 toHSL; 1201 _colorExp.lastIndex = 0; 1202 1203 if (_colorExp.test(combined)) { 1204 toHSL = _hslExp.test(combined); 1205 a[1] = _formatColors(a[1], toHSL); 1206 a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); 1207 return true; 1208 } 1209 }, 1210 _tickerActive, 1211 _ticker = function () { 1212 var _getTime = Date.now, 1213 _lagThreshold = 500, 1214 _adjustedLag = 33, 1215 _startTime = _getTime(), 1216 _lastUpdate = _startTime, 1217 _gap = 1000 / 240, 1218 _nextTime = _gap, 1219 _listeners = [], 1220 _id, 1221 _req, 1222 _raf, 1223 _self, 1224 _delta, 1225 _i, 1226 _tick = function _tick(v) { 1227 var elapsed = _getTime() - _lastUpdate, 1228 manual = v === true, 1229 overlap, 1230 dispatch, 1231 time, 1232 frame; 1233 1234 (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag); 1235 _lastUpdate += elapsed; 1236 time = _lastUpdate - _startTime; 1237 overlap = time - _nextTime; 1238 1239 if (overlap > 0 || manual) { 1240 frame = ++_self.frame; 1241 _delta = time - _self.time * 1000; 1242 _self.time = time = time / 1000; 1243 _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap); 1244 dispatch = 1; 1245 } 1246 1247 manual || (_id = _req(_tick)); 1248 1249 if (dispatch) { 1250 for (_i = 0; _i < _listeners.length; _i++) { 1251 _listeners[_i](time, _delta, frame, v); 1252 } 1253 } 1254 }; 1255 1256 _self = { 1257 time: 0, 1258 frame: 0, 1259 tick: function tick() { 1260 _tick(true); 1261 }, 1262 deltaRatio: function deltaRatio(fps) { 1263 return _delta / (1000 / (fps || 60)); 1264 }, 1265 wake: function wake() { 1266 if (_coreReady) { 1267 if (!_coreInitted && _windowExists()) { 1268 _win = _coreInitted = window; 1269 _doc = _win.document || {}; 1270 _globals.gsap = gsap; 1271 (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version); 1272 1273 _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {}); 1274 1275 _registerPluginQueue.forEach(_createPlugin); 1276 } 1277 1278 _raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame; 1279 _id && _self.sleep(); 1280 1281 _req = _raf || function (f) { 1282 return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0); 1283 }; 1284 1285 _tickerActive = 1; 1286 1287 _tick(2); 1288 } 1289 }, 1290 sleep: function sleep() { 1291 (_raf ? cancelAnimationFrame : clearTimeout)(_id); 1292 _tickerActive = 0; 1293 _req = _emptyFunc; 1294 }, 1295 lagSmoothing: function lagSmoothing(threshold, adjustedLag) { 1296 _lagThreshold = threshold || Infinity; 1297 _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold); 1298 }, 1299 fps: function fps(_fps) { 1300 _gap = 1000 / (_fps || 240); 1301 _nextTime = _self.time * 1000 + _gap; 1302 }, 1303 add: function add(callback, once, prioritize) { 1304 var func = once ? function (t, d, f, v) { 1305 callback(t, d, f, v); 1306 1307 _self.remove(func); 1308 } : callback; 1309 1310 _self.remove(callback); 1311 1312 _listeners[prioritize ? "unshift" : "push"](func); 1313 1314 _wake(); 1315 1316 return func; 1317 }, 1318 remove: function remove(callback, i) { 1319 ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--; 1320 }, 1321 _listeners: _listeners 1322 }; 1323 return _self; 1324 }(), 1325 _wake = function _wake() { 1326 return !_tickerActive && _ticker.wake(); 1327 }, 1328 _easeMap = {}, 1329 _customEaseExp = /^[\d.\-M][\d.\-,\s]/, 1330 _quotesExp = /["']/g, 1331 _parseObjectInString = function _parseObjectInString(value) { 1332 var obj = {}, 1333 split = value.substr(1, value.length - 3).split(":"), 1334 key = split[0], 1335 i = 1, 1336 l = split.length, 1337 index, 1338 val, 1339 parsedVal; 1340 1341 for (; i < l; i++) { 1342 val = split[i]; 1343 index = i !== l - 1 ? val.lastIndexOf(",") : val.length; 1344 parsedVal = val.substr(0, index); 1345 obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal; 1346 key = val.substr(index + 1).trim(); 1347 } 1348 1349 return obj; 1350 }, 1351 _valueInParentheses = function _valueInParentheses(value) { 1352 var open = value.indexOf("(") + 1, 1353 close = value.indexOf(")"), 1354 nested = value.indexOf("(", open); 1355 return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close); 1356 }, 1357 _configEaseFromString = function _configEaseFromString(name) { 1358 var split = (name + "").split("("), 1359 ease = _easeMap[split[0]]; 1360 return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf("{") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(",").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE("", name) : ease; 1361 }, 1362 _invertEase = function _invertEase(ease) { 1363 return function (p) { 1364 return 1 - ease(1 - p); 1365 }; 1366 }, 1367 _p
1367ropagateYoyoEase = function _propagateYoyoEase(timeline, isYoyo) { 1368 var child = timeline._first, 1369 ease; 1370 1371 while (child) { 1372 if (child instanceof Timeline) { 1373 _propagateYoyoEase(child, isYoyo); 1374 } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) { 1375 if (child.timeline) { 1376 _propagateYoyoEase(child.timeline, isYoyo); 1377 } else { 1378 ease = child._ease; 1379 child._ease = child._yEase; 1380 child._yEase = ease; 1381 child._yoyo = isYoyo; 1382 } 1383 } 1384 1385 child = child._next; 1386 }
vendor: 3,445 bytes, lines 1386-1497
1386 1387 }, 1388 _parseEase = function _parseEase(ease, defaultEase) { 1389 return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase; 1390 }, 1391 _insertEase = function _insertEase(names, easeIn, easeOut, easeInOut) { 1392 if (easeOut === void 0) { 1393 easeOut = function easeOut(p) { 1394 return 1 - easeIn(1 - p); 1395 }; 1396 } 1397 1398 if (easeInOut === void 0) { 1399 easeInOut = function easeInOut(p) { 1400 return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2; 1401 }; 1402 } 1403 1404 var ease = { 1405 easeIn: easeIn, 1406 easeOut: easeOut, 1407 easeInOut: easeInOut 1408 }, 1409 lowercaseName; 1410 1411 _forEachName(names, function (name) { 1412 _easeMap[name] = _globals[name] = ease; 1413 _easeMap[lowercaseName = name.toLowerCase()] = easeOut; 1414 1415 for (var p in ease) { 1416 _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p]; 1417 } 1418 }); 1419 1420 return ease; 1421 }, 1422 _easeInOutFromOut = function _easeInOutFromOut(easeOut) { 1423 return function (p) { 1424 return p < .5 ? (1 - easeOut(1 - p * 2)) / 2 : .5 + easeOut((p - .5) * 2) / 2; 1425 }; 1426 }, 1427 _configElastic = function _configElastic(type, amplitude, period) { 1428 var p1 = amplitude >= 1 ? amplitude : 1, 1429 p2 = (period || (type ? .3 : .45)) / (amplitude < 1 ? amplitude : 1), 1430 p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), 1431 easeOut = function easeOut(p) { 1432 return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1; 1433 }, 1434 ease = type === "out" ? easeOut : type === "in" ? function (p) { 1435 return 1 - easeOut(1 - p); 1436 } : _easeInOutFromOut(easeOut); 1437 1438 p2 = _2PI / p2; 1439 1440 ease.config = function (amplitude, period) { 1441 return _configElastic(type, amplitude, period); 1442 }; 1443 1444 return ease; 1445 }, 1446 _configBack = function _configBack(type, overshoot) { 1447 if (overshoot === void 0) { 1448 overshoot = 1.70158; 1449 } 1450 1451 var easeOut = function easeOut(p) { 1452 return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0; 1453 }, 1454 ease = type === "out" ? easeOut : type === "in" ? function (p) { 1455 return 1 - easeOut(1 - p); 1456 } : _easeInOutFromOut(easeOut); 1457 1458 ease.config = function (overshoot) { 1459 return _configBack(type, overshoot); 1460 }; 1461 1462 return ease; 1463 }; 1464 1465 _forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function (name, i) { 1466 var power = i < 5 ? i + 1 : i; 1467 1468 _insertEase(name + ",Power" + (power - 1), i ? function (p) { 1469 return Math.pow(p, power); 1470 } : function (p) { 1471 return p; 1472 }, function (p) { 1473 return 1 - Math.pow(1 - p, power); 1474 }, function (p) { 1475 return p < .5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2; 1476 }); 1477 }); 1478 1479 _easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn; 1480 1481 _insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic()); 1482 1483 (function (n, c) { 1484 var n1 = 1 / c, 1485 n2 = 2 * n1, 1486 n3 = 2.5 * n1, 1487 easeOut = function easeOut(p) { 1488 return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + .75 : p < n3 ? n * (p -= 2.25 / c) * p + .9375 : n * Math.pow(p - 2.625 / c, 2) + .984375; 1489 }; 1490 1491 _insertEase("Bounce", function (p) { 1492 return 1 - easeOut(1 - p); 1493 }, easeOut); 1494 })(7.5625, 2.75); 1495 1496 _insertEase("Expo", function (p) { 1497 return
vendor: 18,509 bytes, lines 1497-2072
1497p ? Math.pow(2, 10 * (p - 1)) : 0; 1498 }); 1499 1500 _insertEase("Circ", function (p) { 1501 return -(_sqrt(1 - p * p) - 1); 1502 }); 1503 1504 _insertEase("Sine", function (p) { 1505 return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1; 1506 }); 1507 1508 _insertEase("Back", _configBack("in"), _configBack("out"), _configBack()); 1509 1510 _easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = { 1511 config: function config(steps, immediateStart) { 1512 if (steps === void 0) { 1513 steps = 1; 1514 } 1515 1516 var p1 = 1 / steps, 1517 p2 = steps + (immediateStart ? 0 : 1), 1518 p3 = immediateStart ? 1 : 0, 1519 max = 1 - _tinyNum; 1520 return function (p) { 1521 return ((p2 * _clamp(0, max, p) | 0) + p3) * p1; 1522 }; 1523 } 1524 }; 1525 _defaults.ease = _easeMap["quad.out"]; 1526 1527 _forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function (name) { 1528 return _callbackNames += name + "," + name + "Params,"; 1529 }); 1530 1531 var GSCache = function GSCache(target, harness) { 1532 this.id = _gsID++; 1533 target._gsap = this; 1534 this.target = target; 1535 this.harness = harness; 1536 this.get = harness ? harness.get : _getProperty; 1537 this.set = harness ? harness.getSetter : _getSetter; 1538 }; 1539 var Animation = function () { 1540 function Animation(vars) { 1541 this.vars = vars; 1542 this._delay = +vars.delay || 0; 1543 1544 if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) { 1545 this._rDelay = vars.repeatDelay || 0; 1546 this._yoyo = !!vars.yoyo || !!vars.yoyoEase; 1547 } 1548 1549 this._ts = 1; 1550 1551 _setDuration(this, +vars.duration, 1, 1); 1552 1553 this.data = vars.data; 1554 1555 if (_context) { 1556 this._ctx = _context; 1557 1558 _context.data.push(this); 1559 } 1560 1561 _tickerActive || _ticker.wake(); 1562 } 1563 1564 var _proto = Animation.prototype; 1565 1566 _proto.delay = function delay(value) { 1567 if (value || value === 0) { 1568 this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay); 1569 this._delay = value; 1570 return this; 1571 } 1572 1573 return this._delay; 1574 }; 1575 1576 _proto.duration = function duration(value) { 1577 return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur; 1578 }; 1579 1580 _proto.totalDuration = function totalDuration(value) { 1581 if (!arguments.length) { 1582 return this._tDur; 1583 } 1584 1585 this._dirty = 0; 1586 return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1)); 1587 }; 1588 1589 _proto.totalTime = function totalTime(_totalTime, suppressEvents) { 1590 _wake(); 1591 1592 if (!arguments.length) { 1593 return this._tTime; 1594 } 1595 1596 var parent = this._dp; 1597 1598 if (parent && parent.smoothChildTiming && this._ts) { 1599 _alignPlayhead(this, _totalTime); 1600 1601 !parent._dp || parent.parent || _postAddChecks(parent, this); 1602 1603 while (parent && parent.parent) { 1604 if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) { 1605 parent.totalTime(parent._tTime, true); 1606 } 1607 1608 parent = parent.parent; 1609 } 1610 1611 if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) { 1612 _addToTimeline(this._dp, this, this._start - this._delay); 1613 } 1614 } 1615 1616 if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) { 1617 this._ts || (this._pTime = _totalTime); 1618 1619 _lazySafeRender(this, _totalTime, suppressEvents); 1620 } 1621 1622 return this; 1623 }; 1624 1625 _proto.time = function time(value, suppressEvents) { 1626 return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; 1627 }; 1628 1629 _proto.totalProgress = function totalProgress(value, suppressEvents) { 1630 return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0; 1631 }; 1632 1633 _proto.progress = function progress(value, suppressEvents) { 1634 return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0; 1635 }; 1636 1637 _proto.iteration = function iteration(value, suppressEvents) { 1638 var cycleDuration = this.duration() + this._rDelay; 1639 1640 return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1; 1641 }; 1642 1643 _proto.timeScale = function timeScale(value, suppressEvents) { 1644 if (!arguments.length) { 1645 return this._rts === -_tinyNum ? 0 : this._rts; 1646 } 1647 1648 if (this._rts === value) { 1649 return this; 1650 } 1651 1652 var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; 1653 this._rts = +value || 0; 1654 this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; 1655 this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false); 1656 1657 _setEnd(this); 1658 1659 return _recacheAncestors(this); 1660 }; 1661 1662 _proto.paused = function paused(value) { 1663 if (!arguments.length) { 1664 return this._ps; 1665 } 1666 1667 if (this._ps !== value) { 1668 this._ps = value; 1669 1670 if (value) { 1671 this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); 1672 this._ts = this._act = 0; 1673 } else { 1674 _wake(); 1675 1676 this._ts = this._rts; 1677 this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); 1678 } 1679 } 1680 1681 return this; 1682 }; 1683 1684 _proto.startTime = function startTime(value) { 1685 if (arguments.length) { 1686 this._start = value; 1687 var parent = this.parent || this._dp; 1688 parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay); 1689 return this; 1690 } 1691 1692 return this._start; 1693 }; 1694 1695 _proto.endTime = function endTime(includeRepeats) { 1696 return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1); 1697 }; 1698 1699 _proto.rawTime = function rawTime(wrapRepeats) { 1700 var parent = this.parent || this._dp; 1701 return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this); 1702 }; 1703 1704 _proto.revert = function revert(config) { 1705 if (config === void 0) { 1706 config = _revertConfig; 1707 } 1708 1709 var prevIsReverting = _reverting; 1710 _reverting = config; 1711 1712 if (this._initted || this._startAt) { 1713 this.timeline && this.timeline.revert(config); 1714 this.totalTime(-0.01, config.suppressEvents); 1715 } 1716 1717 this.data !== "nested" && config.kill !== false && this.kill(); 1718 _reverting = prevIsReverting; 1719 return this; 1720 }; 1721 1722 _proto.globalTime = function globalTime(rawTime) { 1723 var animation = this, 1724 time = arguments.length ? rawTime : animation.rawTime(); 1725 1726 while (animation) { 1727 time = animation._start + time / (Math.abs(animation._ts) || 1); 1728 animation = animation._dp; 1729 } 1730 1731 return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; 1732 }; 1733 1734 _proto.repeat = function repeat(value) { 1735 if (arguments.length) { 1736 this._repeat = value === Infinity ? -2 : value; 1737 return _onUpdateTotalDuration(this); 1738 } 1739 1740 return this._repeat === -2 ? Infinity : this._repeat; 1741 }; 1742 1743 _proto.repeatDelay = function repeatDelay(value) { 1744 if (arguments.length) { 1745 var time = this._time; 1746 this._rDelay = value; 1747 1748 _onUpdateTotalDuration(this); 1749 1750 return time ? this.time(time) : this; 1751 } 1752 1753 return this._rDelay; 1754 }; 1755 1756 _proto.yoyo = function yoyo(value) { 1757 if (arguments.length) { 1758 this._yoyo = value; 1759 return this; 1760 } 1761 1762 return this._yoyo; 1763 }; 1764 1765 _proto.seek = function seek(position, suppressEvents) { 1766 return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents)); 1767 }; 1768 1769 _proto.restart = function restart(includeDelay, suppressEvents) { 1770 return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents)); 1771 }; 1772 1773 _proto.play = function play(from, suppressEvents) { 1774 from != null && this.seek(from, suppressEvents); 1775 return this.reversed(false).paused(false); 1776 }; 1777 1778 _proto.reverse = function reverse(from, suppressEvents) { 1779 from != null && this.seek(from || this.totalDuration(), suppressEvents); 1780 return this.reversed(true).paused(false); 1781 }; 1782 1783 _proto.pause = function pause(atTime, suppressEvents) { 1784 atTime != null && this.seek(atTime, suppressEvents); 1785 return this.paused(true); 1786 }; 1787 1788 _proto.resume = function resume() { 1789 return this.paused(false); 1790 }; 1791 1792 _proto.reversed = function reversed(value) { 1793 if (arguments.length) { 1794 !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); 1795 return this; 1796 } 1797 1798 return this._rts < 0; 1799 }; 1800 1801 _proto.invalidate = function invalidate() { 1802 this._initted = this._act = 0; 1803 this._zTime = -_tinyNum; 1804 return this; 1805 }; 1806 1807 _proto.isActive = function isActive() { 1808 var parent = this.parent || this._dp, 1809 start = this._start, 1810 rawTime; 1811 return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum); 1812 }; 1813 1814 _proto.eventCallback = function eventCallback(type, callback, params) { 1815 var vars = this.vars; 1816 1817 if (arguments.length > 1) { 1818 if (!callback) { 1819 delete vars[type]; 1820 } else { 1821 vars[type] = callback; 1822 params && (vars[type + "Params"] = params); 1823 type === "onUpdate" && (this._onUpdate = callback); 1824 } 1825 1826 return this; 1827 } 1828 1829 return vars[type]; 1830 }; 1831 1832 _proto.then = function then(onFulfilled) { 1833 var self = this; 1834 return new Promise(function (resolve) { 1835 var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, 1836 _resolve = function _resolve() { 1837 var _then = self.then; 1838 self.then = null; 1839 _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then); 1840 resolve(f); 1841 self.then = _then; 1842 }; 1843 1844 if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) { 1845 _resolve(); 1846 } else { 1847 self._prom = _resolve; 1848 } 1849 }); 1850 }; 1851 1852 _proto.kill = function kill() { 1853 _interrupt(this); 1854 }; 1855 1856 return Animation; 1857 }(); 1858 1859 _setDefaults(Animation.prototype, { 1860 _time: 0, 1861 _start: 0, 1862 _end: 0, 1863 _tTime: 0, 1864 _tDur: 0, 1865 _dirty: 0, 1866 _repeat: 0, 1867 _yoyo: false, 1868 parent: null, 1869 _initted: false, 1870 _rDelay: 0, 1871 _ts: 1, 1872 _dp: 0, 1873 ratio: 0, 1874 _zTime: -_tinyNum, 1875 _prom: 0, 1876 _ps: false, 1877 _rts: 1 1878 }); 1879 1880 var Timeline = function (_Animation) { 1881 _inheritsLoose(Timeline, _Animation); 1882 1883 function Timeline(vars, position) { 1884 var _this; 1885 1886 if (vars === void 0) { 1887 vars = {}; 1888 } 1889 1890 _this = _Animation.call(this, vars) || this; 1891 _this.labels = {}; 1892 _this.smoothChildTiming = !!vars.smoothChildTiming; 1893 _this.autoRemoveChildren = !!vars.autoRemoveChildren; 1894 _this._sort = _isNotFalse(vars.sortChildren); 1895 _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position); 1896 vars.reversed && _this.reverse(); 1897 vars.paused && _this.paused(true); 1898 vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger); 1899 return _this; 1900 } 1901 1902 var _proto2 = Timeline.prototype; 1903 1904 _proto2.to = function to(targets, vars, position) { 1905 _createTweenType(0, arguments, this); 1906 1907 return this; 1908 }; 1909 1910 _proto2.from = function from(targets, vars, position) { 1911 _createTweenType(1, arguments, this); 1912 1913 return this; 1914 }; 1915 1916 _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) { 1917 _createTweenType(2, arguments, this); 1918 1919 return this; 1920 }; 1921 1922 _proto2.set = function set(targets, vars, position) { 1923 vars.duration = 0; 1924 vars.parent = this; 1925 _inheritDefaults(vars).repeatDelay || (vars.repeat = 0); 1926 vars.immediateRender = !!vars.immediateRender; 1927 new Tween(targets, vars, _parsePosition(this, position), 1); 1928 return this; 1929 }; 1930 1931 _proto2.call = function call(callback, params, position) { 1932 return _addToTimeline(this, Tween.delayedCall(0, callback, params), position); 1933 }; 1934 1935 _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1936 vars.duration = duration; 1937 vars.stagger = vars.stagger || stagger; 1938 vars.onComplete = onCompleteAll; 1939 vars.onCompleteParams = onCompleteAllParams; 1940 vars.parent = this; 1941 new Tween(targets, vars, _parsePosition(this, position)); 1942 return this; 1943 }; 1944 1945 _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1946 vars.runBackwards = 1; 1947 _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender); 1948 return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams); 1949 }; 1950 1951 _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) { 1952 toVars.startAt = fromVars; 1953 _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender); 1954 return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams); 1955 }; 1956 1957 _proto2.render = function render(totalTime, suppressEvents, force) { 1958 var prevTime = this._time, 1959 tDur = this._dirty ? this.totalDuration() : this._tDur, 1960 dur = this._dur, 1961 tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), 1962 crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), 1963 time, 1964 child, 1965 next, 1966 iteration, 1967 cycleDuration, 1968 prevPaused, 1969 pauseTween, 1970 timeScale, 1971 prevStart, 1972 prevIteration, 1973 yoyo, 1974 isYoyo; 1975 this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur); 1976 1977 if (tTime !== this._tTime || force || crossingStart) { 1978 if (prevTime !== this._time && dur) { 1979 tTime += this._time - prevTime; 1980 totalTime += this._time - prevTime; 1981 } 1982 1983 time = tTime; 1984 prevStart = this._start; 1985 timeScale = this._ts; 1986 prevPaused = !timeScale; 1987 1988 if (crossingStart) { 1989 dur || (prevTime = this._zTime); 1990 (totalTime || !suppressEvents) && (this._zTime = totalTime); 1991 } 1992 1993 if (this._repeat) { 1994 yoyo = this._yoyo; 1995 cycleDuration = dur + this._rDelay; 1996 1997 if (this._repeat < -1 && totalTime < 0) { 1998 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 1999 } 2000 2001 time = _roundPrecise(tTime % cycleDuration); 2002 2003 if (tTime === tDur) { 2004 iteration = this._repeat; 2005 time = dur; 2006 } else { 2007 iteration = ~~(tTime / cycleDuration); 2008 2009 if (iteration && iteration === tTime / cycleDuration) { 2010 time = dur; 2011 iteration--; 2012 } 2013 2014 time > dur && (time = dur); 2015 } 2016 2017 prevIteration = _animationCycle(this._tTime, cycleDuration); 2018 !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); 2019 2020 if (yoyo && iteration & 1) { 2021 time = dur - time; 2022 isYoyo = 1; 2023 } 2024 2025 if (iteration !== prevIteration && !this._lock) { 2026 var rewinding = yoyo && prevIteration & 1, 2027 doesWrap = rewinding === (yoyo && iteration & 1); 2028 iteration < prevIteration && (rewinding = !rewinding); 2029 prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; 2030 this._lock = 1; 2031 this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0; 2032 this._tTime = tTime; 2033 !suppressEvents && this.parent && _callback(this, "onRepeat"); 2034 this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1); 2035 2036 if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) { 2037 return this; 2038 } 2039 2040 dur = this._dur; 2041 tDur = this._tDur; 2042 2043 if (doesWrap) { 2044 this._lock = 2; 2045 prevTime = rewinding ? dur : -0.0001; 2046 this.render(prevTime, true); 2047 this.vars.repeatRefresh && !isYoyo && this.invalidate(); 2048 } 2049 2050 this._lock = 0; 2051 2052 if (!this._ts && !prevPaused) { 2053 return this; 2054 } 2055 2056 _propagateYoyoEase(this, isYoyo); 2057 } 2058 } 2059 2060 if (this._hasPause && !this._forcing && this._lock < 2) { 2061 pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time)); 2062 2063 if (pauseTween) { 2064 tTime -= time - (time = pauseTween._start); 2065 } 2066 } 2067 2068 this._tTime = tTime; 2069 this._time = time; 2070 this._act = !timeScale; 2071 2072 if (!this._initted) {
vendor: 15,202 bytes, lines 2073-2605
2073 this._onUpdate = this.vars.onUpdate; 2074 this._initted = 1; 2075 this._zTime = totalTime; 2076 prevTime = 0; 2077 } 2078 2079 if (!prevTime && time && !suppressEvents && !iteration) { 2080 _callback(this, "onStart"); 2081 2082 if (this._tTime !== tTime) { 2083 return this; 2084 } 2085 } 2086 2087 if (time >= prevTime && totalTime >= 0) { 2088 child = this._first; 2089 2090 while (child) { 2091 next = child._next; 2092 2093 if ((child._act || time >= child._start) && child._ts && pauseTween !== child) { 2094 if (child.parent !== this) { 2095 return this.render(totalTime, suppressEvents, force); 2096 } 2097 2098 child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force); 2099 2100 if (time !== this._time || !this._ts && !prevPaused) { 2101 pauseTween = 0; 2102 next && (tTime += this._zTime = -_tinyNum); 2103 break; 2104 } 2105 } 2106 2107 child = next; 2108 } 2109 } else { 2110 child = this._last; 2111 var adjustedTime = totalTime < 0 ? totalTime : time; 2112 2113 while (child) { 2114 next = child._prev; 2115 2116 if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) { 2117 if (child.parent !== this) { 2118 return this.render(totalTime, suppressEvents, force); 2119 } 2120 2121 child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && (child._initted || child._startAt)); 2122 2123 if (time !== this._time || !this._ts && !prevPaused) { 2124 pauseTween = 0; 2125 next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); 2126 break; 2127 } 2128 } 2129 2130 child = next; 2131 } 2132 } 2133 2134 if (pauseTween && !suppressEvents) { 2135 this.pause(); 2136 pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1; 2137 2138 if (this._ts) { 2139 this._start = prevStart; 2140 2141 _setEnd(this); 2142 2143 return this.render(totalTime, suppressEvents, force); 2144 } 2145 } 2146 2147 this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true); 2148 if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) if (!this._lock) { 2149 (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 2150 2151 if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) { 2152 _callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true); 2153 2154 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 2155 } 2156 } 2157 } 2158 2159 return this; 2160 }; 2161 2162 _proto2.add = function add(child, position) { 2163 var _this2 = this; 2164 2165 _isNumber(position) || (position = _parsePosition(this, position, child)); 2166 2167 if (!(child instanceof Animation)) { 2168 if (_isArray(child)) { 2169 child.forEach(function (obj) { 2170 return _this2.add(obj, position); 2171 }); 2172 return this; 2173 } 2174 2175 if (_isString(child)) { 2176 return this.addLabel(child, position); 2177 } 2178 2179 if (_isFunction(child)) { 2180 child = Tween.delayedCall(0, child); 2181 } else { 2182 return this; 2183 } 2184 } 2185 2186 return this !== child ? _addToTimeline(this, child, position) : this; 2187 }; 2188 2189 _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) { 2190 if (nested === void 0) { 2191 nested = true; 2192 } 2193 2194 if (tweens === void 0) { 2195 tweens = true; 2196 } 2197 2198 if (timelines === void 0) { 2199 timelines = true; 2200 } 2201 2202 if (ignoreBeforeTime === void 0) { 2203 ignoreBeforeTime = -_bigNum; 2204 } 2205 2206 var a = [], 2207 child = this._first; 2208 2209 while (child) { 2210 if (child._start >= ignoreBeforeTime) { 2211 if (child instanceof Tween) { 2212 tweens && a.push(child); 2213 } else { 2214 timelines && a.push(child); 2215 nested && a.push.apply(a, child.getChildren(true, tweens, timelines)); 2216 } 2217 } 2218 2219 child = child._next; 2220 } 2221 2222 return a; 2223 }; 2224 2225 _proto2.getById = function getById(id) { 2226 var animations = this.getChildren(1, 1, 1), 2227 i = animations.length; 2228 2229 while (i--) { 2230 if (animations[i].vars.id === id) { 2231 return animations[i]; 2232 } 2233 } 2234 }; 2235 2236 _proto2.remove = function remove(child) { 2237 if (_isString(child)) { 2238 return this.removeLabel(child); 2239 } 2240 2241 if (_isFunction(child)) { 2242 return this.killTweensOf(child); 2243 } 2244 2245 _removeLinkedListItem(this, child); 2246 2247 if (child === this._recent) { 2248 this._recent = this._last; 2249 } 2250 2251 return _uncache(this); 2252 }; 2253 2254 _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) { 2255 if (!arguments.length) { 2256 return this._tTime; 2257 } 2258 2259 this._forcing = 1; 2260 2261 if (!this._dp && this._ts) { 2262 this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts)); 2263 } 2264 2265 _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents); 2266 2267 this._forcing = 0; 2268 return this; 2269 }; 2270 2271 _proto2.addLabel = function addLabel(label, position) { 2272 this.labels[label] = _parsePosition(this, position); 2273 return this; 2274 }; 2275 2276 _proto2.removeLabel = function removeLabel(label) { 2277 delete this.labels[label]; 2278 return this; 2279 }; 2280 2281 _proto2.addPause = function addPause(position, callback, params) { 2282 var t = Tween.delayedCall(0, callback || _emptyFunc, params); 2283 t.data = "isPause"; 2284 this._hasPause = 1; 2285 return _addToTimeline(this, t, _parsePosition(this, position)); 2286 }; 2287 2288 _proto2.removePause = function removePause(position) { 2289 var child = this._first; 2290 position = _parsePosition(this, position); 2291 2292 while (child) { 2293 if (child._start === position && child.data === "isPause") { 2294 _removeFromParent(child); 2295 } 2296 2297 child = child._next; 2298 } 2299 }; 2300 2301 _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) { 2302 var tweens = this.getTweensOf(targets, onlyActive), 2303 i = tweens.length; 2304 2305 while (i--) { 2306 _overwritingTween !== tweens[i] && tweens[i].kill(targets, props); 2307 } 2308 2309 return this; 2310 }; 2311 2312 _proto2.getTweensOf = function getTweensOf(targets, onlyActive) { 2313 var a = [], 2314 parsedTargets = toArray(targets), 2315 child = this._first, 2316 isGlobalTime = _isNumber(onlyActive), 2317 children; 2318 2319 while (child) { 2320 if (child instanceof Tween) { 2321 if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) { 2322 a.push(child); 2323 } 2324 } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) { 2325 a.push.apply(a, children); 2326 } 2327 2328 child = child._next; 2329 } 2330 2331 return a; 2332 }; 2333 2334 _proto2.tweenTo = function tweenTo(position, vars) { 2335 vars = vars || {}; 2336 2337 var tl = this, 2338 endTime = _parsePosition(tl, position), 2339 _vars = vars, 2340 startAt = _vars.startAt, 2341 _onStart = _vars.onStart, 2342 onStartParams = _vars.onStartParams, 2343 immediateRender = _vars.immediateRender, 2344 initted, 2345 tween = Tween.to(tl, _setDefaults({ 2346 ease: vars.ease || "none", 2347 lazy: false, 2348 immediateRender: false, 2349 time: endTime, 2350 overwrite: "auto", 2351 duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum, 2352 onStart: function onStart() { 2353 tl.pause(); 2354 2355 if (!initted) { 2356 var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()); 2357 tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true); 2358 initted = 1; 2359 } 2360 2361 _onStart && _onStart.apply(tween, onStartParams || []); 2362 } 2363 }, vars)); 2364 2365 return immediateRender ? tween.render(0) : tween; 2366 }; 2367 2368 _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) { 2369 return this.tweenTo(toPosition, _setDefaults({ 2370 startAt: { 2371 time: _parsePosition(this, fromPosition) 2372 } 2373 }, vars)); 2374 }; 2375 2376 _proto2.recent = function recent() { 2377 return this._recent; 2378 }; 2379 2380 _proto2.nextLabel = function nextLabel(afterTime) { 2381 if (afterTime === void 0) { 2382 afterTime = this._time; 2383 } 2384 2385 return _getLabelInDirection(this, _parsePosition(this, afterTime)); 2386 }; 2387 2388 _proto2.previousLabel = function previousLabel(beforeTime) { 2389 if (beforeTime === void 0) { 2390 beforeTime = this._time; 2391 } 2392 2393 return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1); 2394 }; 2395 2396 _proto2.currentLabel = function currentLabel(value) { 2397 return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum); 2398 }; 2399 2400 _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) { 2401 if (ignoreBeforeTime === void 0) { 2402 ignoreBeforeTime = 0; 2403 } 2404 2405 var child = this._first, 2406 labels = this.labels, 2407 p; 2408 2409 while (child) { 2410 if (child._start >= ignoreBeforeTime) { 2411 child._start += amount; 2412 child._end += amount; 2413 } 2414 2415 child = child._next; 2416 } 2417 2418 if (adjustLabels) { 2419 for (p in labels) { 2420 if (labels[p] >= ignoreBeforeTime) { 2421 labels[p] += amount; 2422 } 2423 } 2424 } 2425 2426 return _uncache(this); 2427 }; 2428 2429 _proto2.invalidate = function invalidate(soft) { 2430 var child = this._first; 2431 this._lock = 0; 2432 2433 while (child) { 2434 child.invalidate(soft); 2435 child = child._next; 2436 } 2437 2438 return _Animation.prototype.invalidate.call(this, soft); 2439 }; 2440 2441 _proto2.clear = function clear(includeLabels) { 2442 if (includeLabels === void 0) { 2443 includeLabels = true; 2444 } 2445 2446 var child = this._first, 2447 next; 2448 2449 while (child) { 2450 next = child._next; 2451 this.remove(child); 2452 child = next; 2453 } 2454 2455 this._dp && (this._time = this._tTime = this._pTime = 0); 2456 includeLabels && (this.labels = {}); 2457 return _uncache(this); 2458 }; 2459 2460 _proto2.totalDuration = function totalDuration(value) { 2461 var max = 0, 2462 self = this, 2463 child = self._last, 2464 prevStart = _bigNum, 2465 prev, 2466 start, 2467 parent; 2468 2469 if (arguments.length) { 2470 return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value)); 2471 } 2472 2473 if (self._dirty) { 2474 parent = self.parent; 2475 2476 while (child) { 2477 prev = child._prev; 2478 child._dirty && child.totalDuration(); 2479 start = child._start; 2480 2481 if (start > prevStart && self._sort && child._ts && !self._lock) { 2482 self._lock = 1; 2483 _addToTimeline(self, child, start - child._delay, 1)._lock = 0; 2484 } else { 2485 prevStart = start; 2486 } 2487 2488 if (start < 0 && child._ts) { 2489 max -= start; 2490 2491 if (!parent && !self._dp || parent && parent.smoothChildTiming) { 2492 self._start += start / self._ts; 2493 self._time -= start; 2494 self._tTime -= start; 2495 } 2496 2497 self.shiftChildren(-start, false, -1e999); 2498 prevStart = 0; 2499 } 2500 2501 child._end > max && child._ts && (max = child._end); 2502 child = prev; 2503 } 2504 2505 _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1); 2506 2507 self._dirty = 0; 2508 } 2509 2510 return self._tDur; 2511 }; 2512 2513 Timeline.updateRoot = function updateRoot(time) { 2514 if (_globalTimeline._ts) { 2515 _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline)); 2516 2517 _lastRenderedFrame = _ticker.frame; 2518 } 2519 2520 if (_ticker.frame >= _nextGCFrame) { 2521 _nextGCFrame += _config.autoSleep || 120; 2522 var child = _globalTimeline._first; 2523 if (!child || !child._ts) if (_config.autoSleep && _ticker._listeners.length < 2) { 2524 while (child && !child._ts) { 2525 child = child._next; 2526 } 2527 2528 child || _ticker.sleep(); 2529 } 2530 } 2531 }; 2532 2533 return Timeline; 2534 }(Animation); 2535 2536 _setDefaults(Timeline.prototype, { 2537 _lock: 0, 2538 _hasPause: 0, 2539 _forcing: 0 2540 }); 2541 2542 var _addComplexStringPropTween = function _addComplexStringPropTween(target, prop, start, end, setter, stringFilter, funcParam) { 2543 var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), 2544 index = 0, 2545 matchIndex = 0, 2546 result, 2547 startNums, 2548 color, 2549 endNum, 2550 chunk, 2551 startNum, 2552 hasRandom, 2553 a; 2554 pt.b = start; 2555 pt.e = end; 2556 start += ""; 2557 end += ""; 2558 2559 if (hasRandom = ~end.indexOf("random(")) { 2560 end = _replaceRandom(end); 2561 } 2562 2563 if (stringFilter) { 2564 a = [start, end]; 2565 stringFilter(a, target, prop); 2566 start = a[0]; 2567 end = a[1]; 2568 } 2569 2570 startNums = start.match(_complexStringNumExp) || []; 2571 2572 while (result = _complexStringNumExp.exec(end)) { 2573 endNum = result[0]; 2574 chunk = end.substring(index, result.index); 2575 2576 if (color) { 2577 color = (color + 1) % 5; 2578 } else if (chunk.substr(-5) === "rgba(") { 2579 color = 1; 2580 } 2581 2582 if (endNum !== startNums[matchIndex++]) { 2583 startNum = parseFloat(startNums[matchIndex - 1]) || 0; 2584 pt._pt = { 2585 _next: pt._pt, 2586 p: chunk || matchIndex === 1 ? chunk : ",", 2587 s: startNum, 2588 c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum, 2589 m: color && color < 4 ? Math.round : 0 2590 }; 2591 index = _complexStringNumExp.lastIndex; 2592 } 2593 } 2594 2595 pt.c = index < end.length ? end.substring(index, end.length) : ""; 2596 pt.fp = funcParam; 2597 2598 if (_relExp.test(end) || hasRandom) { 2599 pt.e = 0; 2600 } 2601 2602 this._pt = pt; 2603 return pt; 2604 }, 2605 _addPropTween = function _addPropTween(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {
vendor: 9,840 bytes, lines 2606-2892
2606 _isFunction(end) && (end = end(index || 0, target, targets)); 2607 var currentValue = target[prop], 2608 parsedStart = start !== "get" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), 2609 setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, 2610 pt; 2611 2612 if (_isString(end)) { 2613 if (~end.indexOf("random(")) { 2614 end = _replaceRandom(end); 2615 } 2616 2617 if (end.charAt(1) === "=") { 2618 pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0); 2619 2620 if (pt || pt === 0) { 2621 end = pt; 2622 } 2623 } 2624 } 2625 2626 if (!optional || parsedStart !== end || _forceAllPropTweens) { 2627 if (!isNaN(parsedStart * end) && end !== "") { 2628 pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter); 2629 funcParam && (pt.fp = funcParam); 2630 modifier && pt.modifier(modifier, this, target); 2631 return this._pt = pt; 2632 } 2633 2634 !currentValue && !(prop in target) && _missingPlugin(prop, end); 2635 return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam); 2636 } 2637 }, 2638 _processVars = function _processVars(vars, index, target, targets, tween) { 2639 _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets)); 2640 2641 if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) { 2642 return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars; 2643 } 2644 2645 var copy = {}, 2646 p; 2647 2648 for (p in vars) { 2649 copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets); 2650 } 2651 2652 return copy; 2653 }, 2654 _checkPlugin = function _checkPlugin(property, vars, tween, index, target, targets) { 2655 var plugin, pt, ptLookup, i; 2656 2657 if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) { 2658 tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority); 2659 2660 if (tween !== _quickTween) { 2661 ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; 2662 i = plugin._props.length; 2663 2664 while (i--) { 2665 ptLookup[plugin._props[i]] = pt; 2666 } 2667 } 2668 } 2669 2670 return plugin; 2671 }, 2672 _overwritingTween, 2673 _forceAllPropTweens, 2674 _initTween = function _initTween(tween, time, tTime) { 2675 var vars = tween.vars, 2676 ease = vars.ease, 2677 startAt = vars.startAt, 2678 immediateRender = vars.immediateRender, 2679 lazy = vars.lazy, 2680 onUpdate = vars.onUpdate, 2681 runBackwards = vars.runBackwards, 2682 yoyoEase = vars.yoyoEase, 2683 keyframes = vars.keyframes, 2684 autoRevert = vars.autoRevert, 2685 dur = tween._dur, 2686 prevStartAt = tween._startAt, 2687 targets = tween._targets, 2688 parent = tween.parent, 2689 fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, 2690 autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, 2691 tl = tween.timeline, 2692 cleanVars, 2693 i, 2694 p, 2695 pt, 2696 target, 2697 hasPriority, 2698 gsData, 2699 harness, 2700 plugin, 2701 ptLookup, 2702 index, 2703 harnessVars, 2704 overwritten; 2705 tl && (!keyframes || !ease) && (ease = "none"); 2706 tween._ease = _parseEase(ease, _defaults.ease); 2707 tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0; 2708 2709 if (yoyoEase && tween._yoyo && !tween._repeat) { 2710 yoyoEase = tween._yEase; 2711 tween._yEase = tween._ease; 2712 tween._ease = yoyoEase; 2713 } 2714 2715 tween._from = !tl && !!vars.runBackwards; 2716 2717 if (!tl || keyframes && !vars.stagger) { 2718 harness = targets[0] ? _getCache(targets[0]).harness : 0; 2719 harnessVars = harness && vars[harness.prop]; 2720 cleanVars = _copyExcluding(vars, _reservedProps); 2721 2722 if (prevStartAt) { 2723 prevStartAt._zTime < 0 && prevStartAt.progress(1); 2724 time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); 2725 prevStartAt._lazy = 0; 2726 } 2727 2728 if (startAt) { 2729 _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({ 2730 data: "isStart", 2731 overwrite: false, 2732 parent: parent, 2733 immediateRender: true, 2734 lazy: !prevStartAt && _isNotFalse(lazy), 2735 startAt: null, 2736 delay: 0, 2737 onUpdate: onUpdate && function () { 2738 return _callback(tween, "onUpdate"); 2739 }, 2740 stagger: 0 2741 }, startAt))); 2742 2743 tween._startAt._dp = 0; 2744 tween._startAt._sat = tween; 2745 time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); 2746 2747 if (immediateRender) { 2748 if (dur && time <= 0 && tTime <= 0) { 2749 time && (tween._zTime = time); 2750 return; 2751 } 2752 } 2753 } else if (runBackwards && dur) { 2754 if (!prevStartAt) { 2755 time && (immediateRender = false); 2756 p = _setDefaults({ 2757 overwrite: false, 2758 data: "isFromStart", 2759 lazy: immediateRender && !prevStartAt && _isNotFalse(lazy), 2760 immediateRender: immediateRender, 2761 stagger: 0, 2762 parent: parent 2763 }, cleanVars); 2764 harnessVars && (p[harness.prop] = harnessVars); 2765 2766 _removeFromParent(tween._startAt = Tween.set(targets, p)); 2767 2768 tween._startAt._dp = 0; 2769 tween._startAt._sat = tween; 2770 time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true)); 2771 tween._zTime = time; 2772 2773 if (!immediateRender) { 2774 _initTween(tween._startAt, _tinyNum, _tinyNum); 2775 } else if (!time) { 2776 return; 2777 } 2778 } 2779 } 2780 2781 tween._pt = tween._ptCache = 0; 2782 lazy = dur && _isNotFalse(lazy) || lazy && !dur; 2783 2784 for (i = 0; i < targets.length; i++) { 2785 target = targets[i]; 2786 gsData = target._gsap || _harness(targets)[i]._gsap; 2787 tween._ptLookup[i] = ptLookup = {}; 2788 _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); 2789 index = fullTargets === targets ? i : fullTargets.indexOf(target); 2790 2791 if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) { 2792 tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority); 2793 2794 plugin._props.forEach(function (name) { 2795 ptLookup[name] = pt; 2796 }); 2797 2798 plugin.priority && (hasPriority = 1); 2799 } 2800 2801 if (!harness || harnessVars) { 2802 for (p in cleanVars) { 2803 if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) { 2804 plugin.priority && (hasPriority = 1); 2805 } else { 2806 ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter); 2807 } 2808 } 2809 } 2810 2811 tween._op && tween._op[i] && tween.kill(target, tween._op[i]); 2812 2813 if (autoOverwrite && tween._pt) { 2814 _overwritingTween = tween; 2815 2816 _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); 2817 2818 overwritten = !tween.parent; 2819 _overwritingTween = 0; 2820 } 2821 2822 tween._pt && lazy && (_lazyLookup[gsData.id] = 1); 2823 } 2824 2825 hasPriority && _sortPropTweensByPriority(tween); 2826 tween._onInit && tween._onInit(tween); 2827 } 2828 2829 tween._onUpdate = onUpdate; 2830 tween._initted = (!tween._op || tween._pt) && !overwritten; 2831 keyframes && time <= 0 && tl.render(_bigNum, true, true); 2832 }, 2833 _updatePropTweens = function _updatePropTweens(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) { 2834 var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], 2835 pt, 2836 rootPT, 2837 lookup, 2838 i; 2839 2840 if (!ptCache) { 2841 ptCache = tween._ptCache[property] = []; 2842 lookup = tween._ptLookup; 2843 i = tween._targets.length; 2844 2845 while (i--) { 2846 pt = lookup[i][property]; 2847 2848 if (pt && pt.d && pt.d._pt) { 2849 pt = pt.d._pt; 2850 2851 while (pt && pt.p !== property && pt.fp !== property) { 2852 pt = pt._next; 2853 } 2854 } 2855 2856 if (!pt) { 2857 _forceAllPropTweens = 1; 2858 tween.vars[property] = "+=0"; 2859 2860 _initTween(tween, time); 2861 2862 _forceAllPropTweens = 0; 2863 return skipRecursion ? _warn(property + " not eligible for reset") : 1; 2864 } 2865 2866 ptCache.push(pt); 2867 } 2868 } 2869 2870 i = ptCache.length; 2871 2872 while (i--) { 2873 rootPT = ptCache[i]; 2874 pt = rootPT._pt || rootPT; 2875 pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c; 2876 pt.c = value - pt.s; 2877 rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); 2878 rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); 2879 } 2880 }, 2881 _addAliasesToVars = function _addAliasesToVars(targets, vars) { 2882 var harness = targets[0] ? _getCache(targets[0]).harness : 0, 2883 propertyAliases = harness && harness.aliases, 2884 copy, 2885 p, 2886 i, 2887 aliases; 2888 2889 if (!propertyAliases) { 2890 return vars; 2891 } 2892
vendor: 4,984 bytes, lines 2893-3035
2893 copy = _merge({}, vars); 2894 2895 for (p in propertyAliases) { 2896 if (p in copy) { 2897 aliases = propertyAliases[p].split(","); 2898 i = aliases.length; 2899 2900 while (i--) { 2901 copy[aliases[i]] = copy[p]; 2902 } 2903 } 2904 } 2905 2906 return copy; 2907 }, 2908 _parseKeyframe = function _parseKeyframe(prop, obj, allProps, easeEach) { 2909 var ease = obj.ease || easeEach || "power1.inOut", 2910 p, 2911 a; 2912 2913 if (_isArray(obj)) { 2914 a = allProps[prop] || (allProps[prop] = []); 2915 obj.forEach(function (value, i) { 2916 return a.push({ 2917 t: i / (obj.length - 1) * 100, 2918 v: value, 2919 e: ease 2920 }); 2921 }); 2922 } else { 2923 for (p in obj) { 2924 a = allProps[p] || (allProps[p] = []); 2925 p === "ease" || a.push({ 2926 t: parseFloat(prop), 2927 v: obj[p], 2928 e: ease 2929 }); 2930 } 2931 } 2932 }, 2933 _parseFuncOrString = function _parseFuncOrString(value, tween, i, target, targets) { 2934 return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value; 2935 }, 2936 _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert", 2937 _staggerPropsToSkip = {}; 2938 2939 _forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function (name) { 2940 return _staggerPropsToSkip[name] = 1; 2941 }); 2942 2943 var Tween = function (_Animation2) { 2944 _inheritsLoose(Tween, _Animation2); 2945 2946 function Tween(targets, vars, position, skipInherit) { 2947 var _this3; 2948 2949 if (typeof vars === "number") { 2950 position.duration = vars; 2951 vars = position; 2952 position = null; 2953 } 2954 2955 _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this; 2956 var _this3$vars = _this3.vars, 2957 duration = _this3$vars.duration, 2958 delay = _this3$vars.delay, 2959 immediateRender = _this3$vars.immediateRender, 2960 stagger = _this3$vars.stagger, 2961 overwrite = _this3$vars.overwrite, 2962 keyframes = _this3$vars.keyframes, 2963 defaults = _this3$vars.defaults, 2964 scrollTrigger = _this3$vars.scrollTrigger, 2965 yoyoEase = _this3$vars.yoyoEase, 2966 parent = vars.parent || _globalTimeline, 2967 parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), 2968 tl, 2969 i, 2970 copy, 2971 l, 2972 p, 2973 curTarget, 2974 staggerFunc, 2975 staggerVarsToMerge; 2976 _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || []; 2977 _this3._ptLookup = []; 2978 _this3._overwrite = overwrite; 2979 2980 if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { 2981 vars = _this3.vars; 2982 tl = _this3.timeline = new Timeline({ 2983 data: "nested", 2984 defaults: defaults || {}, 2985 targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets 2986 }); 2987 tl.kill(); 2988 tl.parent = tl._dp = _assertThisInitialized(_this3); 2989 tl._start = 0; 2990 2991 if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { 2992 l = parsedTargets.length; 2993 staggerFunc = stagger && distribute(stagger); 2994 2995 if (_isObject(stagger)) { 2996 for (p in stagger) { 2997 if (~_staggerTweenProps.indexOf(p)) { 2998 staggerVarsToMerge || (staggerVarsToMerge = {}); 2999 staggerVarsToMerge[p] = stagger[p]; 3000 } 3001 } 3002 } 3003 3004 for (i = 0; i < l; i++) { 3005 copy = _copyExcluding(vars, _staggerPropsToSkip); 3006 copy.stagger = 0; 3007 yoyoEase && (copy.yoyoEase = yoyoEase); 3008 staggerVarsToMerge && _merge(copy, staggerVarsToMerge); 3009 curTarget = parsedTargets[i]; 3010 copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets); 3011 copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay; 3012 3013 if (!stagger && l === 1 && copy.delay) { 3014 _this3._delay = delay = copy.delay; 3015 _this3._start += delay; 3016 copy.delay = 0; 3017 } 3018 3019 tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0); 3020 tl._ease = _easeMap.none; 3021 } 3022 3023 tl.duration() ? duration = delay = 0 : _this3.timeline = 0; 3024 } else if (keyframes) { 3025 _inheritDefaults(_setDefaults(tl.vars.defaults, { 3026 ease: "none" 3027 })); 3028 3029 tl._ease = _parseEase(keyframes.ease || vars.ease || "none"); 3030 var time = 0, 3031 a, 3032 kf, 3033 v; 3034 3035 if (_isArray(keyframes)) {
vendor: 6,477 bytes, lines 3036-3242
3036 keyframes.forEach(function (frame) { 3037 return tl.to(parsedTargets, frame, ">"); 3038 }); 3039 tl.duration(); 3040 } else { 3041 copy = {}; 3042 3043 for (p in keyframes) { 3044 p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach); 3045 } 3046 3047 for (p in copy) { 3048 a = copy[p].sort(function (a, b) { 3049 return a.t - b.t; 3050 }); 3051 time = 0; 3052 3053 for (i = 0; i < a.length; i++) { 3054 kf = a[i]; 3055 v = { 3056 ease: kf.e, 3057 duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration 3058 }; 3059 v[p] = kf.v; 3060 tl.to(parsedTargets, v, time); 3061 time += v.duration; 3062 } 3063 } 3064 3065 tl.duration() < duration && tl.to({}, { 3066 duration: duration - tl.duration() 3067 }); 3068 } 3069 } 3070 3071 duration || _this3.duration(duration = tl.duration()); 3072 } else { 3073 _this3.timeline = 0; 3074 } 3075 3076 if (overwrite === true && !_suppressOverwrites) { 3077 _overwritingTween = _assertThisInitialized(_this3); 3078 3079 _globalTimeline.killTweensOf(parsedTargets); 3080 3081 _overwritingTween = 0; 3082 } 3083 3084 _addToTimeline(parent, _assertThisInitialized(_this3), position); 3085 3086 vars.reversed && _this3.reverse(); 3087 vars.paused && _this3.paused(true); 3088 3089 if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") { 3090 _this3._tTime = -_tinyNum; 3091 3092 _this3.render(Math.max(0, -delay) || 0); 3093 } 3094 3095 scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger); 3096 return _this3; 3097 } 3098 3099 var _proto3 = Tween.prototype; 3100 3101 _proto3.render = function render(totalTime, suppressEvents, force) { 3102 var prevTime = this._time, 3103 tDur = this._tDur, 3104 dur = this._dur, 3105 isNegative = totalTime < 0, 3106 tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, 3107 time, 3108 pt, 3109 iteration, 3110 cycleDuration, 3111 prevIteration, 3112 isYoyo, 3113 ratio, 3114 timeline, 3115 yoyoEase; 3116 3117 if (!dur) { 3118 _renderZeroDurationTween(this, totalTime, suppressEvents, force); 3119 } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) { 3120 time = tTime; 3121 timeline = this.timeline; 3122 3123 if (this._repeat) { 3124 cycleDuration = dur + this._rDelay; 3125 3126 if (this._repeat < -1 && isNegative) { 3127 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 3128 } 3129 3130 time = _roundPrecise(tTime % cycleDuration); 3131 3132 if (tTime === tDur) { 3133 iteration = this._repeat; 3134 time = dur; 3135 } else { 3136 iteration = ~~(tTime / cycleDuration); 3137 3138 if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) { 3139 time = dur; 3140 iteration--; 3141 } 3142 3143 time > dur && (time = dur); 3144 } 3145 3146 isYoyo = this._yoyo && iteration & 1; 3147 3148 if (isYoyo) { 3149 yoyoEase = this._yEase; 3150 time = dur - time; 3151 } 3152 3153 prevIteration = _animationCycle(this._tTime, cycleDuration); 3154 3155 if (time === prevTime && !force && this._initted && iteration === prevIteration) { 3156 this._tTime = tTime; 3157 return this; 3158 } 3159 3160 if (iteration !== prevIteration) { 3161 timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); 3162 3163 if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) { 3164 this._lock = force = 1; 3165 this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0; 3166 } 3167 } 3168 } 3169 3170 if (!this._initted) { 3171 if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) { 3172 this._tTime = 0; 3173 return this; 3174 } 3175 3176 if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) { 3177 return this; 3178 } 3179 3180 if (dur !== this._dur) { 3181 return this.render(totalTime, suppressEvents, force); 3182 } 3183 } 3184 3185 this._tTime = tTime; 3186 this._time = time; 3187 3188 if (!this._act && this._ts) { 3189 this._act = 1; 3190 this._lazy = 0; 3191 } 3192 3193 this.ratio = ratio = (yoyoEase || this._ease)(time / dur); 3194 3195 if (this._from) { 3196 this.ratio = ratio = 1 - ratio; 3197 } 3198 3199 if (time && !prevTime && !suppressEvents && !iteration) { 3200 _callback(this, "onStart"); 3201 3202 if (this._tTime !== tTime) { 3203 return this; 3204 } 3205 } 3206 3207 pt = this._pt; 3208 3209 while (pt) { 3210 pt.r(ratio, pt.d); 3211 pt = pt._next; 3212 } 3213 3214 timeline && timeline.render(totalTime < 0 ? totalTime : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime); 3215 3216 if (this._onUpdate && !suppressEvents) { 3217 isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); 3218 3219 _callback(this, "onUpdate"); 3220 } 3221 3222 this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat"); 3223 3224 if ((tTime === this._tDur || !tTime) && this._tTime === tTime) { 3225 isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true); 3226 (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 3227 3228 if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) { 3229 _callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true); 3230 3231 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 3232 } 3233 } 3234 } 3235 3236 return this; 3237 }; 3238 3239 _proto3.targets = function targets() { 3240 return this._targets; 3241 }; 3242
vendor: 1,310 bytes, lines 3243-3276
3243 _proto3.invalidate = function invalidate(soft) { 3244 (!soft || !this.vars.runBackwards) && (this._startAt = 0); 3245 this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0; 3246 this._ptLookup = []; 3247 this.timeline && this.timeline.invalidate(soft); 3248 return _Animation2.prototype.invalidate.call(this, soft); 3249 }; 3250 3251 _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) { 3252 _tickerActive || _ticker.wake(); 3253 this._ts || this.play(); 3254 var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), 3255 ratio; 3256 this._initted || _initTween(this, time); 3257 ratio = this._ease(time / this._dur); 3258 3259 if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) { 3260 return this.resetTo(property, value, start, startIsRelative, 1); 3261 } 3262 3263 _alignPlayhead(this, 0); 3264 3265 this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0); 3266 return this.render(0); 3267 }; 3268 3269 _proto3.kill = function kill(targets, vars) { 3270 if (vars === void 0) { 3271 vars = "all"; 3272 } 3273 3274 if (!targets && (!vars || vars === "all")) { 3275 this._lazy = this._pt = 0; 3276 return this.parent ? _interrupt(this) :
vendor: 16,527 bytes, lines 3276-3878
3276 this; 3277 } 3278 3279 if (this.timeline) { 3280 var tDur = this.timeline.totalDuration(); 3281 this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); 3282 this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); 3283 return this; 3284 } 3285 3286 var parsedTargets = this._targets, 3287 killingTargets = targets ? toArray(targets) : parsedTargets, 3288 propTweenLookup = this._ptLookup, 3289 firstPT = this._pt, 3290 overwrittenProps, 3291 curLookup, 3292 curOverwriteProps, 3293 props, 3294 p, 3295 pt, 3296 i; 3297 3298 if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) { 3299 vars === "all" && (this._pt = 0); 3300 return _interrupt(this); 3301 } 3302 3303 overwrittenProps = this._op = this._op || []; 3304 3305 if (vars !== "all") { 3306 if (_isString(vars)) { 3307 p = {}; 3308 3309 _forEachName(vars, function (name) { 3310 return p[name] = 1; 3311 }); 3312 3313 vars = p; 3314 } 3315 3316 vars = _addAliasesToVars(parsedTargets, vars); 3317 } 3318 3319 i = parsedTargets.length; 3320 3321 while (i--) { 3322 if (~killingTargets.indexOf(parsedTargets[i])) { 3323 curLookup = propTweenLookup[i]; 3324 3325 if (vars === "all") { 3326 overwrittenProps[i] = vars; 3327 props = curLookup; 3328 curOverwriteProps = {}; 3329 } else { 3330 curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {}; 3331 props = vars; 3332 } 3333 3334 for (p in props) { 3335 pt = curLookup && curLookup[p]; 3336 3337 if (pt) { 3338 if (!("kill" in pt.d) || pt.d.kill(p) === true) { 3339 _removeLinkedListItem(this, pt, "_pt"); 3340 } 3341 3342 delete curLookup[p]; 3343 } 3344 3345 if (curOverwriteProps !== "all") { 3346 curOverwriteProps[p] = 1; 3347 } 3348 } 3349 } 3350 } 3351 3352 this._initted && !this._pt && firstPT && _interrupt(this); 3353 return this; 3354 }; 3355 3356 Tween.to = function to(targets, vars) { 3357 return new Tween(targets, vars, arguments[2]); 3358 }; 3359 3360 Tween.from = function from(targets, vars) { 3361 return _createTweenType(1, arguments); 3362 }; 3363 3364 Tween.delayedCall = function delayedCall(delay, callback, params, scope) { 3365 return new Tween(callback, 0, { 3366 immediateRender: false, 3367 lazy: false, 3368 overwrite: false, 3369 delay: delay, 3370 onComplete: callback, 3371 onReverseComplete: callback, 3372 onCompleteParams: params, 3373 onReverseCompleteParams: params, 3374 callbackScope: scope 3375 }); 3376 }; 3377 3378 Tween.fromTo = function fromTo(targets, fromVars, toVars) { 3379 return _createTweenType(2, arguments); 3380 }; 3381 3382 Tween.set = function set(targets, vars) { 3383 vars.duration = 0; 3384 vars.repeatDelay || (vars.repeat = 0); 3385 return new Tween(targets, vars); 3386 }; 3387 3388 Tween.killTweensOf = function killTweensOf(targets, props, onlyActive) { 3389 return _globalTimeline.killTweensOf(targets, props, onlyActive); 3390 }; 3391 3392 return Tween; 3393 }(Animation); 3394 3395 _setDefaults(Tween.prototype, { 3396 _targets: [], 3397 _lazy: 0, 3398 _startAt: 0, 3399 _op: 0, 3400 _onInit: 0 3401 }); 3402 3403 _forEachName("staggerTo,staggerFrom,staggerFromTo", function (name) { 3404 Tween[name] = function () { 3405 var tl = new Timeline(), 3406 params = _slice.call(arguments, 0); 3407 3408 params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0); 3409 return tl[name].apply(tl, params); 3410 }; 3411 }); 3412 3413 var _setterPlain = function _setterPlain(target, property, value) { 3414 return target[property] = value; 3415 }, 3416 _setterFunc = function _setterFunc(target, property, value) { 3417 return target[property](value); 3418 }, 3419 _setterFuncWithParam = function _setterFuncWithParam(target, property, value, data) { 3420 return target[property](data.fp, value); 3421 }, 3422 _setterAttribute = function _setterAttribute(target, property, value) { 3423 return target.setAttribute(property, value); 3424 }, 3425 _getSetter = function _getSetter(target, property) { 3426 return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain; 3427 }, 3428 _renderPlain = function _renderPlain(ratio, data) { 3429 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1000000) / 1000000, data); 3430 }, 3431 _renderBoolean = function _renderBoolean(ratio, data) { 3432 return data.set(data.t, data.p, !!(data.s + data.c * ratio), data); 3433 }, 3434 _renderComplexString = function _renderComplexString(ratio, data) { 3435 var pt = data._pt, 3436 s = ""; 3437 3438 if (!ratio && data.b) { 3439 s = data.b; 3440 } else if (ratio === 1 && data.e) { 3441 s = data.e; 3442 } else { 3443 while (pt) { 3444 s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 10000) / 10000) + s; 3445 pt = pt._next; 3446 } 3447 3448 s += data.c; 3449 } 3450 3451 data.set(data.t, data.p, s, data); 3452 }, 3453 _renderPropTweens = function _renderPropTweens(ratio, data) { 3454 var pt = data._pt; 3455 3456 while (pt) { 3457 pt.r(ratio, pt.d); 3458 pt = pt._next; 3459 } 3460 }, 3461 _addPluginModifier = function _addPluginModifier(modifier, tween, target, property) { 3462 var pt = this._pt, 3463 next; 3464 3465 while (pt) { 3466 next = pt._next; 3467 pt.p === property && pt.modifier(modifier, tween, target); 3468 pt = next; 3469 } 3470 }, 3471 _killPropTweensOf = function _killPropTweensOf(property) { 3472 var pt = this._pt, 3473 hasNonDependentRemaining, 3474 next; 3475 3476 while (pt) { 3477 next = pt._next; 3478 3479 if (pt.p === property && !pt.op || pt.op === property) { 3480 _removeLinkedListItem(this, pt, "_pt"); 3481 } else if (!pt.dep) { 3482 hasNonDependentRemaining = 1; 3483 } 3484 3485 pt = next; 3486 } 3487 3488 return !hasNonDependentRemaining; 3489 }, 3490 _setterWithModifier = function _setterWithModifier(target, property, value, data) { 3491 data.mSet(target, property, data.m.call(data.tween, value, data.mt), data); 3492 }, 3493 _sortPropTweensByPriority = function _sortPropTweensByPriority(parent) { 3494 var pt = parent._pt, 3495 next, 3496 pt2, 3497 first, 3498 last; 3499 3500 while (pt) { 3501 next = pt._next; 3502 pt2 = first; 3503 3504 while (pt2 && pt2.pr > pt.pr) { 3505 pt2 = pt2._next; 3506 } 3507 3508 if (pt._prev = pt2 ? pt2._prev : last) { 3509 pt._prev._next = pt; 3510 } else { 3511 first = pt; 3512 } 3513 3514 if (pt._next = pt2) { 3515 pt2._prev = pt; 3516 } else { 3517 last = pt; 3518 } 3519 3520 pt = next; 3521 } 3522 3523 parent._pt = first; 3524 }; 3525 3526 var PropTween = function () { 3527 function PropTween(next, target, prop, start, change, renderer, data, setter, priority) { 3528 this.t = target; 3529 this.s = start; 3530 this.c = change; 3531 this.p = prop; 3532 this.r = renderer || _renderPlain; 3533 this.d = data || this; 3534 this.set = setter || _setterPlain; 3535 this.pr = priority || 0; 3536 this._next = next; 3537 3538 if (next) { 3539 next._prev = this; 3540 } 3541 } 3542 3543 var _proto4 = PropTween.prototype; 3544 3545 _proto4.modifier = function modifier(func, tween, target) { 3546 this.mSet = this.mSet || this.set; 3547 this.set = _setterWithModifier; 3548 this.m = func; 3549 this.mt = target; 3550 this.tween = tween; 3551 }; 3552 3553 return PropTween; 3554 }(); 3555 3556 _forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function (name) { 3557 return _reservedProps[name] = 1; 3558 }); 3559 3560 _globals.TweenMax = _globals.TweenLite = Tween; 3561 _globals.TimelineLite = _globals.TimelineMax = Timeline; 3562 _globalTimeline = new Timeline({ 3563 sortChildren: false, 3564 defaults: _defaults, 3565 autoRemoveChildren: true, 3566 id: "root", 3567 smoothChildTiming: true 3568 }); 3569 _config.stringFilter = _colorStringFilter; 3570 3571 var _media = [], 3572 _listeners = {}, 3573 _emptyArray = [], 3574 _lastMediaTime = 0, 3575 _contextID = 0, 3576 _dispatch = function _dispatch(type) { 3577 return (_listeners[type] || _emptyArray).map(function (f) { 3578 return f(); 3579 }); 3580 }, 3581 _onMediaChange = function _onMediaChange() { 3582 var time = Date.now(), 3583 matches = []; 3584 3585 if (time - _lastMediaTime > 2) { 3586 _dispatch("matchMediaInit"); 3587 3588 _media.forEach(function (c) { 3589 var queries = c.queries, 3590 conditions = c.conditions, 3591 match, 3592 p, 3593 anyMatch, 3594 toggled; 3595 3596 for (p in queries) { 3597 match = _win.matchMedia(queries[p]).matches; 3598 match && (anyMatch = 1); 3599 3600 if (match !== conditions[p]) { 3601 conditions[p] = match; 3602 toggled = 1; 3603 } 3604 } 3605 3606 if (toggled) { 3607 c.revert(); 3608 anyMatch && matches.push(c); 3609 } 3610 }); 3611 3612 _dispatch("matchMediaRevert"); 3613 3614 matches.forEach(function (c) { 3615 return c.onMatch(c, function (func) { 3616 return c.add(null, func); 3617 }); 3618 }); 3619 _lastMediaTime = time; 3620 3621 _dispatch("matchMedia"); 3622 } 3623 }; 3624 3625 var Context = function () { 3626 function Context(func, scope) { 3627 this.selector = scope && selector(scope); 3628 this.data = []; 3629 this._r = []; 3630 this.isReverted = false; 3631 this.id = _contextID++; 3632 func && this.add(func); 3633 } 3634 3635 var _proto5 = Context.prototype; 3636 3637 _proto5.add = function add(name, func, scope) { 3638 if (_isFunction(name)) { 3639 scope = func; 3640 func = name; 3641 name = _isFunction; 3642 } 3643 3644 var self = this, 3645 f = function f() { 3646 var prev = _context, 3647 prevSelector = self.selector, 3648 result; 3649 prev && prev !== self && prev.data.push(self); 3650 scope && (self.selector = selector(scope)); 3651 _context = self; 3652 result = func.apply(self, arguments); 3653 _isFunction(result) && self._r.push(result); 3654 _context = prev; 3655 self.selector = prevSelector; 3656 self.isReverted = false; 3657 return result; 3658 }; 3659 3660 self.last = f; 3661 return name === _isFunction ? f(self, function (func) { 3662 return self.add(null, func); 3663 }) : name ? self[name] = f : f; 3664 }; 3665 3666 _proto5.ignore = function ignore(func) { 3667 var prev = _context; 3668 _context = null; 3669 func(this); 3670 _context = prev; 3671 }; 3672 3673 _proto5.getTweens = function getTweens() { 3674 var a = []; 3675 this.data.forEach(function (e) { 3676 return e instanceof Context ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e); 3677 }); 3678 return a; 3679 }; 3680 3681 _proto5.clear = function clear() { 3682 this._r.length = this.data.length = 0; 3683 }; 3684 3685 _proto5.kill = function kill(revert, matchMedia) { 3686 var _this4 = this; 3687 3688 if (revert) { 3689 (function () { 3690 var tweens = _this4.getTweens(), 3691 i = _this4.data.length, 3692 t; 3693 3694 while (i--) { 3695 t = _this4.data[i]; 3696 3697 if (t.data === "isFlip") { 3698 t.revert(); 3699 t.getChildren(true, true, false).forEach(function (tween) { 3700 return tweens.splice(tweens.indexOf(tween), 1); 3701 }); 3702 } 3703 } 3704 3705 tweens.map(function (t) { 3706 return { 3707 g: t._dur || t._delay || t._sat && !t._sat.vars.immediateRender ? t.globalTime(0) : -Infinity, 3708 t: t 3709 }; 3710 }).sort(function (a, b) { 3711 return b.g - a.g || -Infinity; 3712 }).forEach(function (o) { 3713 return o.t.revert(revert); 3714 }); 3715 i = _this4.data.length; 3716 3717 while (i--) { 3718 t = _this4.data[i]; 3719 3720 if (t instanceof Timeline) { 3721 if (t.data !== "nested") { 3722 t.scrollTrigger && t.scrollTrigger.revert(); 3723 t.kill(); 3724 } 3725 } else { 3726 !(t instanceof Tween) && t.revert && t.revert(revert); 3727 } 3728 } 3729 3730 _this4._r.forEach(function (f) { 3731 return f(revert, _this4); 3732 }); 3733 3734 _this4.isReverted = true; 3735 })(); 3736 } else { 3737 this.data.forEach(function (e) { 3738 return e.kill && e.kill(); 3739 }); 3740 } 3741 3742 this.clear(); 3743 3744 if (matchMedia) { 3745 var i = _media.length; 3746 3747 while (i--) { 3748 _media[i].id === this.id && _media.splice(i, 1); 3749 } 3750 } 3751 }; 3752 3753 _proto5.revert = function revert(config) { 3754 this.kill(config || {}); 3755 }; 3756 3757 return Context; 3758 }(); 3759 3760 var MatchMedia = function () { 3761 function MatchMedia(scope) { 3762 this.contexts = []; 3763 this.scope = scope; 3764 _context && _context.data.push(this); 3765 } 3766 3767 var _proto6 = MatchMedia.prototype; 3768 3769 _proto6.add = function add(conditions, func, scope) { 3770 _isObject(conditions) || (conditions = { 3771 matches: conditions 3772 }); 3773 var context = new Context(0, scope || this.scope), 3774 cond = context.conditions = {}, 3775 mq, 3776 p, 3777 active; 3778 _context && !context.selector && (context.selector = _context.selector); 3779 this.contexts.push(context); 3780 func = context.add("onMatch", func); 3781 context.queries = conditions; 3782 3783 for (p in conditions) { 3784 if (p === "all") { 3785 active = 1; 3786 } else { 3787 mq = _win.matchMedia(conditions[p]); 3788 3789 if (mq) { 3790 _media.indexOf(context) < 0 && _media.push(context); 3791 (cond[p] = mq.matches) && (active = 1); 3792 mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange); 3793 } 3794 } 3795 } 3796 3797 active && func(context, function (f) { 3798 return context.add(null, f); 3799 }); 3800 return this; 3801 }; 3802 3803 _proto6.revert = function revert(config) { 3804 this.kill(config || {}); 3805 }; 3806 3807 _proto6.kill = function kill(revert) { 3808 this.contexts.forEach(function (c) { 3809 return c.kill(revert, true); 3810 }); 3811 }; 3812 3813 return MatchMedia; 3814 }(); 3815 3816 var _gsap = { 3817 registerPlugin: function registerPlugin() { 3818 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 3819 args[_key2] = arguments[_key2]; 3820 } 3821 3822 args.forEach(function (config) { 3823 return _createPlugin(config); 3824 }); 3825 }, 3826 timeline: function timeline(vars) { 3827 return new Timeline(vars); 3828 }, 3829 getTweensOf: function getTweensOf(targets, onlyActive) { 3830 return _globalTimeline.getTweensOf(targets, onlyActive); 3831 }, 3832 getProperty: function getProperty(target, property, unit, uncache) { 3833 _isString(target) && (target = toArray(target)[0]); 3834 3835 var getter = _getCache(target || {}).get, 3836 format = unit ? _passThrough : _numericIfPossible; 3837 3838 unit === "native" && (unit = ""); 3839 return !target ? target : !property ? function (property, unit, uncache) { 3840 return format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); 3841 } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); 3842 }, 3843 quickSetter: function quickSetter(target, property, unit) { 3844 target = toArray(target); 3845 3846 if (target.length > 1) { 3847 var setters = target.map(function (t) { 3848 return gsap.quickSetter(t, property, unit); 3849 }), 3850 l = setters.length; 3851 return function (value) { 3852 var i = l; 3853 3854 while (i--) { 3855 setters[i](value); 3856 } 3857 }; 3858 } 3859 3860 target = target[0] || {}; 3861 3862 var Plugin = _plugins[property], 3863 cache = _getCache(target), 3864 p = cache.harness && (cache.harness.aliases || {})[property] || property, 3865 setter = Plugin ? function (value) { 3866 var p = new Plugin(); 3867 _quickTween._pt = 0; 3868 p.init(target, unit ? value + unit : value, _quickTween, 0, [target]); 3869 p.render(1, p); 3870 _quickTween._pt && _renderPropTweens(1, _quickTween); 3871 } : cache.set(target, p); 3872 3873 return Plugin ? setter : function (value) { 3874 return setter(target, p, unit ? value + unit : value, cache, 1); 3875 }; 3876 }, 3877 quickTo: function quickTo(target, property, vars) { 3878 var _
3878merge2; 3879 3880 var tween = gsap.to(target, _merge((_merge2 = {}, _merge2[property] = "+=0.1", _merge2.paused = true, _merge
vendor: 5,649 bytes, lines 3880-4082
38802), vars || {})), 3881 func = function func(value, start, startIsRelative) { 3882 return tween.resetTo(property, value, start, startIsRelative); 3883 }; 3884 3885 func.tween = tween; 3886 return func; 3887 }, 3888 isTweening: function isTweening(targets) { 3889 return _globalTimeline.getTweensOf(targets, true).length > 0; 3890 }, 3891 defaults: function defaults(value) { 3892 value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease)); 3893 return _mergeDeep(_defaults, value || {}); 3894 }, 3895 config: function config(value) { 3896 return _mergeDeep(_config, value || {}); 3897 }, 3898 registerEffect: function registerEffect(_ref3) { 3899 var name = _ref3.name, 3900 effect = _ref3.effect, 3901 plugins = _ref3.plugins, 3902 defaults = _ref3.defaults, 3903 extendTimeline = _ref3.extendTimeline; 3904 (plugins || "").split(",").forEach(function (pluginName) { 3905 return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin."); 3906 }); 3907 3908 _effects[name] = function (targets, vars, tl) { 3909 return effect(toArray(targets), _setDefaults(vars || {}, defaults), tl); 3910 }; 3911 3912 if (extendTimeline) { 3913 Timeline.prototype[name] = function (targets, vars, position) { 3914 return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position); 3915 }; 3916 } 3917 }, 3918 registerEase: function registerEase(name, ease) { 3919 _easeMap[name] = _parseEase(ease); 3920 }, 3921 parseEase: function parseEase(ease, defaultEase) { 3922 return arguments.length ? _parseEase(ease, defaultEase) : _easeMap; 3923 }, 3924 getById: function getById(id) { 3925 return _globalTimeline.getById(id); 3926 }, 3927 exportRoot: function exportRoot(vars, includeDelayedCalls) { 3928 if (vars === void 0) { 3929 vars = {}; 3930 } 3931 3932 var tl = new Timeline(vars), 3933 child, 3934 next; 3935 tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming); 3936 3937 _globalTimeline.remove(tl); 3938 3939 tl._dp = 0; 3940 tl._time = tl._tTime = _globalTimeline._time; 3941 child = _globalTimeline._first; 3942 3943 while (child) { 3944 next = child._next; 3945 3946 if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) { 3947 _addToTimeline(tl, child, child._start - child._delay); 3948 } 3949 3950 child = next; 3951 } 3952 3953 _addToTimeline(_globalTimeline, tl, 0); 3954 3955 return tl; 3956 }, 3957 context: function context(func, scope) { 3958 return func ? new Context(func, scope) : _context; 3959 }, 3960 matchMedia: function matchMedia(scope) { 3961 return new MatchMedia(scope); 3962 }, 3963 matchMediaRefresh: function matchMediaRefresh() { 3964 return _media.forEach(function (c) { 3965 var cond = c.conditions, 3966 found, 3967 p; 3968 3969 for (p in cond) { 3970 if (cond[p]) { 3971 cond[p] = false; 3972 found = 1; 3973 } 3974 } 3975 3976 found && c.revert(); 3977 }) || _onMediaChange(); 3978 }, 3979 addEventListener: function addEventListener(type, callback) { 3980 var a = _listeners[type] || (_listeners[type] = []); 3981 ~a.indexOf(callback) || a.push(callback); 3982 }, 3983 removeEventListener: function removeEventListener(type, callback) { 3984 var a = _listeners[type], 3985 i = a && a.indexOf(callback); 3986 i >= 0 && a.splice(i, 1); 3987 }, 3988 utils: { 3989 wrap: wrap, 3990 wrapYoyo: wrapYoyo, 3991 distribute: distribute, 3992 random: random, 3993 snap: snap, 3994 normalize: normalize, 3995 getUnit: getUnit, 3996 clamp: clamp, 3997 splitColor: splitColor, 3998 toArray: toArray, 3999 selector: selector, 4000 mapRange: mapRange, 4001 pipe: pipe, 4002 unitize: unitize, 4003 interpolate: interpolate, 4004 shuffle: shuffle 4005 }, 4006 install: _install, 4007 effects: _effects, 4008 ticker: _ticker, 4009 updateRoot: Timeline.updateRoot, 4010 plugins: _plugins, 4011 globalTimeline: _globalTimeline, 4012 core: { 4013 PropTween: PropTween, 4014 globals: _addGlobal, 4015 Tween: Tween, 4016 Timeline: Timeline, 4017 Animation: Animation, 4018 getCache: _getCache, 4019 _removeLinkedListItem: _removeLinkedListItem, 4020 reverting: function reverting() { 4021 return _reverting; 4022 }, 4023 context: function context(toAdd) { 4024 if (toAdd && _context) { 4025 _context.data.push(toAdd); 4026 4027 toAdd._ctx = _context; 4028 } 4029 4030 return _context; 4031 }, 4032 suppressOverwrites: function suppressOverwrites(value) { 4033 return _suppressOverwrites = value; 4034 } 4035 } 4036 }; 4037 4038 _forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function (name) { 4039 return _gsap[name] = Tween[name]; 4040 }); 4041 4042 _ticker.add(Timeline.updateRoot); 4043 4044 _quickTween = _gsap.to({}, { 4045 duration: 0 4046 }); 4047 4048 var _getPluginPropTween = function _getPluginPropTween(plugin, prop) { 4049 var pt = plugin._pt; 4050 4051 while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) { 4052 pt = pt._next; 4053 } 4054 4055 return pt; 4056 }, 4057 _addModifiers = function _addModifiers(tween, modifiers) { 4058 var targets = tween._targets, 4059 p, 4060 i, 4061 pt; 4062 4063 for (p in modifiers) { 4064 i = targets.length; 4065 4066 while (i--) { 4067 pt = tween._ptLookup[i][p]; 4068 4069 if (pt && (pt = pt.d)) { 4070 if (pt._pt) { 4071 pt = _getPluginPropTween(pt, p); 4072 } 4073 4074 pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p); 4075 } 4076 } 4077 } 4078 }, 4079 _buildModifierPlugin = function _buildModifierPlugin(name, modifier) { 4080 return { 4081 name: name, 4082
vendor: 21,125 bytes, lines 4082-4733
4082rawVars: 1, 4083 init: function init(target, vars, tween) { 4084 tween._onInit = function (tween) { 4085 var temp, p; 4086 4087 if (_isString(vars)) { 4088 temp = {}; 4089 4090 _forEachName(vars, function (name) { 4091 return temp[name] = 1; 4092 }); 4093 4094 vars = temp; 4095 } 4096 4097 if (modifier) { 4098 temp = {}; 4099 4100 for (p in vars) { 4101 temp[p] = modifier(vars[p]); 4102 } 4103 4104 vars = temp; 4105 } 4106 4107 _addModifiers(tween, vars); 4108 }; 4109 } 4110 }; 4111 }; 4112 4113 var gsap = _gsap.registerPlugin({ 4114 name: "attr", 4115 init: function init(target, vars, tween, index, targets) { 4116 var p, pt, v; 4117 this.tween = tween; 4118 4119 for (p in vars) { 4120 v = target.getAttribute(p) || ""; 4121 pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p); 4122 pt.op = p; 4123 pt.b = v; 4124 4125 this._props.push(p); 4126 } 4127 }, 4128 render: function render(ratio, data) { 4129 var pt = data._pt; 4130 4131 while (pt) { 4132 _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); 4133 pt = pt._next; 4134 } 4135 } 4136 }, { 4137 name: "endArray", 4138 init: function init(target, value) { 4139 var i = value.length; 4140 4141 while (i--) { 4142 this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1); 4143 } 4144 } 4145 }, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap; 4146 Tween.version = Timeline.version = gsap.version = "3.12.5"; 4147 _coreReady = 1; 4148 _windowExists() && _wake(); 4149 var Power0 = _easeMap.Power0, 4150 Power1 = _easeMap.Power1, 4151 Power2 = _easeMap.Power2, 4152 Power3 = _easeMap.Power3, 4153 Power4 = _easeMap.Power4, 4154 Linear = _easeMap.Linear, 4155 Quad = _easeMap.Quad, 4156 Cubic = _easeMap.Cubic, 4157 Quart = _easeMap.Quart, 4158 Quint = _easeMap.Quint, 4159 Strong = _easeMap.Strong, 4160 Elastic = _easeMap.Elastic, 4161 Back = _easeMap.Back, 4162 SteppedEase = _easeMap.SteppedEase, 4163 Bounce = _easeMap.Bounce, 4164 Sine = _easeMap.Sine, 4165 Expo = _easeMap.Expo, 4166 Circ = _easeMap.Circ; 4167 4168 var _win$1, 4169 _doc$1, 4170 _docElement, 4171 _pluginInitted, 4172 _tempDiv, 4173 _tempDivStyler, 4174 _recentSetterPlugin, 4175 _reverting$1, 4176 _windowExists$1 = function _windowExists() { 4177 return typeof window !== "undefined"; 4178 }, 4179 _transformProps = {}, 4180 _RAD2DEG = 180 / Math.PI, 4181 _DEG2RAD = Math.PI / 180, 4182 _atan2 = Math.atan2, 4183 _bigNum$1 = 1e8, 4184 _capsExp = /([A-Z])/g, 4185 _horizontalExp = /(left|right|width|margin|padding|x)/i, 4186 _complexExp = /[\s,\(]\S/, 4187 _propertyAliases = { 4188 autoAlpha: "opacity,visibility", 4189 scale: "scaleX,scaleY", 4190 alpha: "opacity" 4191 }, 4192 _renderCSSProp = function _renderCSSProp(ratio, data) { 4193 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data); 4194 }, 4195 _renderPropWithEnd = function _renderPropWithEnd(ratio, data) { 4196 return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data); 4197 }, 4198 _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) { 4199 return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data); 4200 }, 4201 _renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) { 4202 var value = data.s + data.c * ratio; 4203 data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data); 4204 }, 4205 _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) { 4206 return data.set(data.t, data.p, ratio ? data.e : data.b, data); 4207 }, 4208 _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) { 4209 return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data); 4210 }, 4211 _setterCSSStyle = function _setterCSSStyle(target, property, value) { 4212 return target.style[property] = value; 4213 }, 4214 _setterCSSProp = function _setterCSSProp(target, property, value) { 4215 return target.style.setProperty(property, value); 4216 }, 4217 _setterTransform = function _setterTransform(target, property, value) { 4218 return target._gsap[property] = value; 4219 }, 4220 _setterScale = function _setterScale(target, property, value) { 4221 return target._gsap.scaleX = target._gsap.scaleY = value; 4222 }, 4223 _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) { 4224 var cache = target._gsap; 4225 cache.scaleX = cache.scaleY = value; 4226 cache.renderTransform(ratio, cache); 4227 }, 4228 _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) { 4229 var cache = target._gsap; 4230 cache[property] = value; 4231 cache.renderTransform(ratio, cache); 4232 }, 4233 _transformProp = "transform", 4234 _transformOriginProp = _transformProp + "Origin", 4235 _saveStyle = function _saveStyle(property, isNotCSS) { 4236 var _this = this; 4237 4238 var target = this.target, 4239 style = target.style, 4240 cache = target._gsap; 4241 4242 if (property in _transformProps && style) { 4243 this.tfm = this.tfm || {}; 4244 4245 if (property !== "transform") { 4246 property = _propertyAliases[property] || property; 4247 ~property.indexOf(",") ? property.split(",").forEach(function (a) { 4248 return _this.tfm[a] = _get(target, a); 4249 }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); 4250 property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin); 4251 } else { 4252 return _propertyAliases.transform.split(",").forEach(function (p) { 4253 return _saveStyle.call(_this, p, isNotCSS); 4254 }); 4255 } 4256 4257 if (this.props.indexOf(_transformProp) >= 0) { 4258 return; 4259 } 4260 4261 if (cache.svg) { 4262 this.svgo = target.getAttribute("data-svg-origin"); 4263 this.props.push(_transformOriginProp, isNotCSS, ""); 4264 } 4265 4266 property = _transformProp; 4267 } 4268 4269 (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]); 4270 }, 4271 _removeIndependentTransforms = function _removeIndependentTransforms(style) { 4272 if (style.translate) { 4273 style.removeProperty("translate"); 4274 style.removeProperty("scale"); 4275 style.removeProperty("rotate"); 4276 } 4277 }, 4278 _revertStyle = function _revertStyle() { 4279 var props = this.props, 4280 target = this.target, 4281 style = target.style, 4282 cache = target._gsap, 4283 i, 4284 p; 4285 4286 for (i = 0; i < props.length; i += 3) { 4287 props[i + 1] ? target[props[i]] = props[i + 2] : props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === "--" ? props[i] : props[i].replace(_capsExp, "-$1").toLowerCase()); 4288 } 4289 4290 if (this.tfm) { 4291 for (p in this.tfm) { 4292 cache[p] = this.tfm[p]; 4293 } 4294 4295 if (cache.svg) { 4296 cache.renderTransform(); 4297 target.setAttribute("data-svg-origin", this.svgo || ""); 4298 } 4299 4300 i = _reverting$1(); 4301 4302 if ((!i || !i.isStart) && !style[_transformProp]) { 4303 _removeIndependentTransforms(style); 4304 4305 if (cache.zOrigin && style[_transformOriginProp]) { 4306 style[_transformOriginProp] += " " + cache.zOrigin + "px"; 4307 cache.zOrigin = 0; 4308 cache.renderTransform(); 4309 } 4310 4311 cache.uncache = 1; 4312 } 4313 } 4314 }, 4315 _getStyleSaver = function _getStyleSaver(target, properties) { 4316 var saver = { 4317 target: target, 4318 props: [], 4319 revert: _revertStyle, 4320 save: _saveStyle 4321 }; 4322 target._gsap || gsap.core.getCache(target); 4323 properties && properties.split(",").forEach(function (p) { 4324 return saver.save(p); 4325 }); 4326 return saver; 4327 }, 4328 _supports3D, 4329 _createElement = function _createElement(type, ns) { 4330 var e = _doc$1.createElementNS ? _doc$1.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc$1.createElement(type); 4331 return e && e.style ? e : _doc$1.createElement(type); 4332 }, 4333 _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) { 4334 var cs = getComputedStyle(target); 4335 return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || ""; 4336 }, 4337 _prefixes = "O,Moz,ms,Ms,Webkit".split(","), 4338 _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) { 4339 var e = element || _tempDiv, 4340 s = e.style, 4341 i = 5; 4342 4343 if (property in s && !preferPrefix) { 4344 return property; 4345 } 4346 4347 property = property.charAt(0).toUpperCase() + property.substr(1); 4348 4349 while (i-- && !(_prefixes[i] + property in s)) {} 4350 4351 return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property; 4352 }, 4353 _initCore = function _initCore() { 4354 if (_windowExists$1() && window.document) { 4355 _win$1 = window; 4356 _doc$1 = _win$1.document; 4357 _docElement = _doc$1.documentElement; 4358 _tempDiv = _createElement("div") || { 4359 style: {} 4360 }; 4361 _tempDivStyler = _createElement("div"); 4362 _transformProp = _checkPropPrefix(_transformProp); 4363 _transformOriginProp = _transformProp + "Origin"; 4364 _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0"; 4365 _supports3D = !!_checkPropPrefix("perspective"); 4366 _reverting$1 = gsap.core.reverting; 4367 _pluginInitted = 1; 4368 } 4369 }, 4370 _getBBoxHack = function _getBBoxHack(swapIfPossible) { 4371 var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), 4372 oldParent = this.parentNode, 4373 oldSibling = this.nextSibling, 4374 oldCSS = this.style.cssText, 4375 bbox; 4376 4377 _docElement.appendChild(svg); 4378 4379 svg.appendChild(this); 4380 this.style.display = "block"; 4381 4382 if (swapIfPossible) { 4383 try { 4384 bbox = this.getBBox(); 4385 this._gsapBBox = this.getBBox; 4386 this.getBBox = _getBBoxHack; 4387 } catch (e) {} 4388 } else if (this._gsapBBox) { 4389 bbox = this._gsapBBox(); 4390 } 4391 4392 if (oldParent) { 4393 if (oldSibling) { 4394 oldParent.insertBefore(this, oldSibling); 4395 } else { 4396 oldParent.appendChild(this); 4397 } 4398 } 4399 4400 _docElement.removeChild(svg); 4401 4402 this.style.cssText = oldCSS; 4403 return bbox; 4404 }, 4405 _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) { 4406 var i = attributesArray.length; 4407 4408 while (i--) { 4409 if (target.hasAttribute(attributesArray[i])) { 4410 return target.getAttribute(attributesArray[i]); 4411 } 4412 } 4413 }, 4414 _getBBox = function _getBBox(target) { 4415 var bounds; 4416 4417 try { 4418 bounds = target.getBBox(); 4419 } catch (error) { 4420 bounds = _getBBoxHack.call(target, true); 4421 } 4422 4423 bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true)); 4424 return bounds && !bounds.width && !bounds.x && !bounds.y ? { 4425 x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0, 4426 y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0, 4427 width: 0, 4428 height: 0 4429 } : bounds; 4430 }, 4431 _isSVG = function _isSVG(e) { 4432 return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); 4433 }, 4434 _removeProperty = function _removeProperty(target, property) { 4435 if (property) { 4436 var style = target.style, 4437 first2Chars; 4438 4439 if (property in _transformProps && property !== _transformOriginProp) { 4440 property = _transformProp; 4441 } 4442 4443 if (style.removeProperty) { 4444 first2Chars = property.substr(0, 2); 4445 4446 if (first2Chars === "ms" || property.substr(0, 6) === "webkit") { 4447 property = "-" + property; 4448 } 4449 4450 style.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp, "-$1").toLowerCase()); 4451 } else { 4452 style.removeAttribute(property); 4453 } 4454 } 4455 }, 4456 _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) { 4457 var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue); 4458 plugin._pt = pt; 4459 pt.b = beginning; 4460 pt.e = end; 4461 4462 plugin._props.push(property); 4463 4464 return pt; 4465 }, 4466 _nonConvertibleUnits = { 4467 deg: 1, 4468 rad: 1, 4469 turn: 1 4470 }, 4471 _nonStandardLayouts = { 4472 grid: 1, 4473 flex: 1 4474 }, 4475 _convertToUnit = function _convertToUnit(target, property, value, unit) { 4476 var curValue = parseFloat(value) || 0, 4477 curUnit = (value + "").trim().substr((curValue + "").length) || "px", 4478 style = _tempDiv.style, 4479 horizontal = _horizontalExp.test(property), 4480 isRootSVG = target.tagName.toLowerCase() === "svg", 4481 measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), 4482 amount = 100, 4483 toPixels = unit === "px", 4484 toPercent = unit === "%", 4485 px, 4486 parent, 4487 cache, 4488 isSVG; 4489 4490 if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) { 4491 return curValue; 4492 } 4493 4494 curUnit !== "px" && !toPixels && (curValue = _convertToUnit(target, property, value, "px")); 4495 isSVG = target.getCTM && _isSVG(target); 4496 4497 if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) { 4498 px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty]; 4499 return _round(toPercent ? curValue / px * amount : curValue / 100 * px); 4500 } 4501 4502 style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit); 4503 parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode; 4504 4505 if (isSVG) { 4506 parent = (target.ownerSVGElement || {}).parentNode; 4507 } 4508 4509 if (!parent || parent === _doc$1 || !parent.appendChild) { 4510 parent = _doc$1.body; 4511 } 4512 4513 cache = parent._gsap; 4514 4515 if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) { 4516 return _round(curValue / cache.width * amount); 4517 } else { 4518 if (toPercent && (property === "height" || property === "width")) { 4519 var v = target.style[property]; 4520 target.style[property] = amount + unit; 4521 px = target[measureProperty]; 4522 v ? target.style[property] = v : _removeProperty(target, property); 4523 } else { 4524 (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position")); 4525 parent === target && (style.position = "static"); 4526 parent.appendChild(_tempDiv); 4527 px = _tempDiv[measureProperty]; 4528 parent.removeChild(_tempDiv); 4529 style.position = "absolute"; 4530 } 4531 4532 if (horizontal && toPercent) { 4533 cache = _getCache(parent); 4534 cache.time = _ticker.time; 4535 cache.width = parent[measureProperty]; 4536 } 4537 } 4538 4539 return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0); 4540 }, 4541 _get = function _get(target, property, unit, uncache) { 4542 var value; 4543 _pluginInitted || _initCore(); 4544 4545 if (property in _propertyAliases && property !== "transform") { 4546 property = _propertyAliases[property]; 4547 4548 if (~property.indexOf(",")) { 4549 property = property.split(",")[0]; 4550 } 4551 } 4552 4553 if (_transformProps[property] && property !== "transform") { 4554 value = _parseTransform(target, uncache); 4555 value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px"; 4556 } else { 4557 value = target.style[property]; 4558 4559 if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) { 4560 value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0); 4561 } 4562 } 4563 4564 return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value; 4565 }, 4566 _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) { 4567 if (!start || start === "none") { 4568 var p = _checkPropPrefix(prop, target, 1), 4569 s = p && _getComputedProperty(target, p, 1); 4570 4571 if (s && s !== start) { 4572 prop = p; 4573 start = s; 4574 } else if (prop === "borderColor") { 4575 start = _getComputedProperty(target, "borderTopColor"); 4576 } 4577 } 4578 4579 var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), 4580 index = 0, 4581 matchIndex = 0, 4582 a, 4583 result, 4584 startValues, 4585 startNum, 4586 color, 4587 startValue, 4588 endValue, 4589 endNum, 4590 chunk, 4591 endUnit, 4592 startUnit, 4593 endValues; 4594 pt.b = start; 4595 pt.e = end; 4596 start += ""; 4597 end += ""; 4598 4599 if (end === "auto") { 4600 startValue = target.style[prop]; 4601 target.style[prop] = end; 4602 end = _getComputedProperty(target, prop) || end; 4603 startValue ? target.style[prop] = startValue : _removeProperty(target, prop); 4604 } 4605 4606 a = [start, end]; 4607 4608 _colorStringFilter(a); 4609 4610 start = a[0]; 4611 end = a[1]; 4612 startValues = start.match(_numWithUnitExp) || []; 4613 endValues = end.match(_numWithUnitExp) || []; 4614 4615 if (endValues.length) { 4616 while (result = _numWithUnitExp.exec(end)) { 4617 endValue = result[0]; 4618 chunk = end.substring(index, result.index); 4619 4620 if (color) { 4621 color = (color + 1) % 5; 4622 } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") { 4623 color = 1; 4624 } 4625 4626 if (endValue !== (startValue = startValues[matchIndex++] || "")) { 4627 startNum = parseFloat(startValue) || 0; 4628 startUnit = startValue.substr((startNum + "").length); 4629 endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit); 4630 endNum = parseFloat(endValue); 4631 endUnit = endValue.substr((endNum + "").length); 4632 index = _numWithUnitExp.lastIndex - endUnit.length; 4633 4634 if (!endUnit) { 4635 endUnit = endUnit || _config.units[prop] || startUnit; 4636 4637 if (index === end.length) { 4638 end += endUnit; 4639 pt.e += endUnit; 4640 } 4641 } 4642 4643 if (startUnit !== endUnit) { 4644 startNum = _convertToUnit(target, prop, startValue, endUnit) || 0; 4645 } 4646 4647 pt._pt = { 4648 _next: pt._pt, 4649 p: chunk || matchIndex === 1 ? chunk : ",", 4650 s: startNum, 4651 c: endNum - startNum, 4652 m: color && color < 4 || prop === "zIndex" ? Math.round : 0 4653 }; 4654 } 4655 } 4656 4657 pt.c = index < end.length ? end.substring(index, end.length) : ""; 4658 } else { 4659 pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue; 4660 } 4661 4662 _relExp.test(end) && (pt.e = 0); 4663 this._pt = pt; 4664 return pt; 4665 }, 4666 _keywordToPercent = { 4667 top: "0%", 4668 bottom: "100%", 4669 left: "0%", 4670 right: "100%", 4671 center: "50%" 4672 }, 4673 _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) { 4674 var split = value.split(" "), 4675 x = split[0], 4676 y = split[1] || "50%"; 4677 4678 if (x === "top" || x === "bottom" || y === "left" || y === "right") { 4679 value = x; 4680 x = y; 4681 y = value; 4682 } 4683 4684 split[0] = _keywordToPercent[x] || x; 4685 split[1] = _keywordToPercent[y] || y; 4686 return split.join(" "); 4687 }, 4688 _renderClearProps = function _renderClearProps(ratio, data) { 4689 if (data.tween && data.tween._time === data.tween._dur) { 4690 var target = data.t, 4691 style = target.style, 4692 props = data.u, 4693 cache = target._gsap, 4694 prop, 4695 clearTransforms, 4696 i; 4697 4698 if (props === "all" || props === true) { 4699 style.cssText = ""; 4700 clearTransforms = 1; 4701 } else { 4702 props = props.split(","); 4703 i = props.length; 4704 4705 while (--i > -1) { 4706 prop = props[i]; 4707 4708 if (_transformProps[prop]) { 4709 clearTransforms = 1; 4710 prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp; 4711 } 4712 4713 _removeProperty(target, prop); 4714 } 4715 } 4716 4717 if (clearTransforms) { 4718 _removeProperty(target, _transformProp); 4719 4720 if (cache) { 4721 cache.svg && target.removeAttribute("transform"); 4722 4723 _parseTransform(target, 1); 4724 4725 cache.uncache = 1; 4726 4727 _removeIndependentTransforms(style); 4728 } 4729 } 4730 } 4731 }, 4732 _specialProps = { 4733 clearProps: function clearProps(plugin, target, property, endValue, tween) {
vendor: 1,580 bytes, lines 4734-4774
4734 if (tween.data !== "isFromStart") { 4735 var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps); 4736 pt.u = endValue; 4737 pt.pr = -10; 4738 pt.tween = tween; 4739 4740 plugin._props.push(property); 4741 4742 return 1; 4743 } 4744 } 4745 }, 4746 _identity2DMatrix = [1, 0, 0, 1, 0, 0], 4747 _rotationalProperties = {}, 4748 _isNullTransform = function _isNullTransform(value) { 4749 return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value; 4750 }, 4751 _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) { 4752 var matrixString = _getComputedProperty(target, _transformProp); 4753 4754 return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round); 4755 }, 4756 _getMatrix = function _getMatrix(target, force2D) { 4757 var cache = target._gsap || _getCache(target), 4758 style = target.style, 4759 matrix = _getComputedTransformMatrixAsArray(target), 4760 parent, 4761 nextSibling, 4762 temp, 4763 addedToDOM; 4764 4765 if (cache.svg && target.getAttribute("transform")) { 4766 temp = target.transform.baseVal.consolidate().matrix; 4767 matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f]; 4768 return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix; 4769 } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) { 4770 temp = style.display; 4771 style.display = "block"; 4772 parent = target.parentNode; 4773 4774 if (!parent || !target.offsetParent
vendor: 18,926 bytes, lines 4774-5371
4774) { 4775 addedToDOM = 1; 4776 nextSibling = target.nextElementSibling; 4777 4778 _docElement.appendChild(target); 4779 } 4780 4781 matrix = _getComputedTransformMatrixAsArray(target); 4782 temp ? style.display = temp : _removeProperty(target, "display"); 4783 4784 if (addedToDOM) { 4785 nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target); 4786 } 4787 } 4788 4789 return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix; 4790 }, 4791 _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) { 4792 var cache = target._gsap, 4793 matrix = matrixArray || _getMatrix(target, true), 4794 xOriginOld = cache.xOrigin || 0, 4795 yOriginOld = cache.yOrigin || 0, 4796 xOffsetOld = cache.xOffset || 0, 4797 yOffsetOld = cache.yOffset || 0, 4798 a = matrix[0], 4799 b = matrix[1], 4800 c = matrix[2], 4801 d = matrix[3], 4802 tx = matrix[4], 4803 ty = matrix[5], 4804 originSplit = origin.split(" "), 4805 xOrigin = parseFloat(originSplit[0]) || 0, 4806 yOrigin = parseFloat(originSplit[1]) || 0, 4807 bounds, 4808 determinant, 4809 x, 4810 y; 4811 4812 if (!originIsAbsolute) { 4813 bounds = _getBBox(target); 4814 xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin); 4815 yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin); 4816 } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) { 4817 x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant; 4818 y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant; 4819 xOrigin = x; 4820 yOrigin = y; 4821 } 4822 4823 if (smooth || smooth !== false && cache.smooth) { 4824 tx = xOrigin - xOriginOld; 4825 ty = yOrigin - yOriginOld; 4826 cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx; 4827 cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty; 4828 } else { 4829 cache.xOffset = cache.yOffset = 0; 4830 } 4831 4832 cache.xOrigin = xOrigin; 4833 cache.yOrigin = yOrigin; 4834 cache.smooth = !!smooth; 4835 cache.origin = origin; 4836 cache.originIsAbsolute = !!originIsAbsolute; 4837 target.style[_transformOriginProp] = "0px 0px"; 4838 4839 if (pluginToAddPropTweensTo) { 4840 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin); 4841 4842 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin); 4843 4844 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset); 4845 4846 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset); 4847 } 4848 4849 target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin); 4850 }, 4851 _parseTransform = function _parseTransform(target, uncache) { 4852 var cache = target._gsap || new GSCache(target); 4853 4854 if ("x" in cache && !uncache && !cache.uncache) { 4855 return cache; 4856 } 4857 4858 var style = target.style, 4859 invertedScaleX = cache.scaleX < 0, 4860 px = "px", 4861 deg = "deg", 4862 cs = getComputedStyle(target), 4863 origin = _getComputedProperty(target, _transformOriginProp) || "0", 4864 x, 4865 y, 4866 z, 4867 scaleX, 4868 scaleY, 4869 rotation, 4870 rotationX, 4871 rotationY, 4872 skewX, 4873 skewY, 4874 perspective, 4875 xOrigin, 4876 yOrigin, 4877 matrix, 4878 angle, 4879 cos, 4880 sin, 4881 a, 4882 b, 4883 c, 4884 d, 4885 a12, 4886 a22, 4887 t1, 4888 t2, 4889 t3, 4890 a13, 4891 a23, 4892 a33, 4893 a42, 4894 a43, 4895 a32; 4896 x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0; 4897 scaleX = scaleY = 1; 4898 cache.svg = !!(target.getCTM && _isSVG(target)); 4899 4900 if (cs.translate) { 4901 if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") { 4902 style[_transformProp] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp] !== "none" ? cs[_transformProp] : ""); 4903 } 4904 4905 style.scale = style.rotate = style.translate = "none"; 4906 } 4907 4908 matrix = _getMatrix(target, cache.svg); 4909 4910 if (cache.svg) { 4911 if (cache.uncache) { 4912 t2 = target.getBBox(); 4913 origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px"; 4914 t1 = ""; 4915 } else { 4916 t1 = !uncache && target.getAttribute("data-svg-origin"); 4917 } 4918 4919 _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix); 4920 } 4921 4922 xOrigin = cache.xOrigin || 0; 4923 yOrigin = cache.yOrigin || 0; 4924 4925 if (matrix !== _identity2DMatrix) { 4926 a = matrix[0]; 4927 b = matrix[1]; 4928 c = matrix[2]; 4929 d = matrix[3]; 4930 x = a12 = matrix[4]; 4931 y = a22 = matrix[5]; 4932 4933 if (matrix.length === 6) { 4934 scaleX = Math.sqrt(a * a + b * b); 4935 scaleY = Math.sqrt(d * d + c * c); 4936 rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; 4937 skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0; 4938 skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD))); 4939 4940 if (cache.svg) { 4941 x -= xOrigin - (xOrigin * a + yOrigin * c); 4942 y -= yOrigin - (xOrigin * b + yOrigin * d); 4943 } 4944 } else { 4945 a32 = matrix[6]; 4946 a42 = matrix[7]; 4947 a13 = matrix[8]; 4948 a23 = matrix[9]; 4949 a33 = matrix[10]; 4950 a43 = matrix[11]; 4951 x = matrix[12]; 4952 y = matrix[13]; 4953 z = matrix[14]; 4954 angle = _atan2(a32, a33); 4955 rotationX = angle * _RAD2DEG; 4956 4957 if (angle) { 4958 cos = Math.cos(-angle); 4959 sin = Math.sin(-angle); 4960 t1 = a12 * cos + a13 * sin; 4961 t2 = a22 * cos + a23 * sin; 4962 t3 = a32 * cos + a33 * sin; 4963 a13 = a12 * -sin + a13 * cos; 4964 a23 = a22 * -sin + a23 * cos; 4965 a33 = a32 * -sin + a33 * cos; 4966 a43 = a42 * -sin + a43 * cos; 4967 a12 = t1; 4968 a22 = t2; 4969 a32 = t3; 4970 } 4971 4972 angle = _atan2(-c, a33); 4973 rotationY = angle * _RAD2DEG; 4974 4975 if (angle) { 4976 cos = Math.cos(-angle); 4977 sin = Math.sin(-angle); 4978 t1 = a * cos - a13 * sin; 4979 t2 = b * cos - a23 * sin; 4980 t3 = c * cos - a33 * sin; 4981 a43 = d * sin + a43 * cos; 4982 a = t1; 4983 b = t2; 4984 c = t3; 4985 } 4986 4987 angle = _atan2(b, a); 4988 rotation = angle * _RAD2DEG; 4989 4990 if (angle) { 4991 cos = Math.cos(angle); 4992 sin = Math.sin(angle); 4993 t1 = a * cos + b * sin; 4994 t2 = a12 * cos + a22 * sin; 4995 b = b * cos - a * sin; 4996 a22 = a22 * cos - a12 * sin; 4997 a = t1; 4998 a12 = t2; 4999 } 5000 5001 if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) { 5002 rotationX = rotation = 0; 5003 rotationY = 180 - rotationY; 5004 } 5005 5006 scaleX = _round(Math.sqrt(a * a + b * b + c * c)); 5007 scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32)); 5008 angle = _atan2(a12, a22); 5009 skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0; 5010 perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0; 5011 } 5012 5013 if (cache.svg) { 5014 t1 = target.getAttribute("transform"); 5015 cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp)); 5016 t1 && target.setAttribute("transform", t1); 5017 } 5018 } 5019 5020 if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { 5021 if (invertedScaleX) { 5022 scaleX *= -1; 5023 skewX += rotation <= 0 ? 180 : -180; 5024 rotation += rotation <= 0 ? 180 : -180; 5025 } else { 5026 scaleY *= -1; 5027 skewX += skewX <= 0 ? 180 : -180; 5028 } 5029 } 5030 5031 uncache = uncache || cache.uncache; 5032 cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px; 5033 cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px; 5034 cache.z = z + px; 5035 cache.scaleX = _round(scaleX); 5036 cache.scaleY = _round(scaleY); 5037 cache.rotation = _round(rotation) + deg; 5038 cache.rotationX = _round(rotationX) + deg; 5039 cache.rotationY = _round(rotationY) + deg; 5040 cache.skewX = skewX + deg; 5041 cache.skewY = skewY + deg; 5042 cache.transformPerspective = perspective + px; 5043 5044 if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) { 5045 style[_transformOriginProp] = _firstTwoOnly(origin); 5046 } 5047 5048 cache.xOffset = cache.yOffset = 0; 5049 cache.force3D = _config.force3D; 5050 cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms; 5051 cache.uncache = 0; 5052 return cache; 5053 }, 5054 _firstTwoOnly = function _firstTwoOnly(value) { 5055 return (value = value.split(" "))[0] + " " + value[1]; 5056 }, 5057 _addPxTranslate = function _addPxTranslate(target, start, value) { 5058 var unit = getUnit(start); 5059 return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit; 5060 }, 5061 _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) { 5062 cache.z = "0px"; 5063 cache.rotationY = cache.rotationX = "0deg"; 5064 cache.force3D = 0; 5065 5066 _renderCSSTransforms(ratio, cache); 5067 }, 5068 _zeroDeg = "0deg", 5069 _zeroPx = "0px", 5070 _endParenthesis = ") ", 5071 _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) { 5072 var _ref = cache || this, 5073 xPercent = _ref.xPercent, 5074 yPercent = _ref.yPercent, 5075 x = _ref.x, 5076 y = _ref.y, 5077 z = _ref.z, 5078 rotation = _ref.rotation, 5079 rotationY = _ref.rotationY, 5080 rotationX = _ref.rotationX, 5081 skewX = _ref.skewX, 5082 skewY = _ref.skewY, 5083 scaleX = _ref.scaleX, 5084 scaleY = _ref.scaleY, 5085 transformPerspective = _ref.transformPerspective, 5086 force3D = _ref.force3D, 5087 target = _ref.target, 5088 zOrigin = _ref.zOrigin, 5089 transforms = "", 5090 use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true; 5091 5092 if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) { 5093 var angle = parseFloat(rotationY) * _DEG2RAD, 5094 a13 = Math.sin(angle), 5095 a33 = Math.cos(angle), 5096 cos; 5097 5098 angle = parseFloat(rotationX) * _DEG2RAD; 5099 cos = Math.cos(angle); 5100 x = _addPxTranslate(target, x, a13 * cos * -zOrigin); 5101 y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin); 5102 z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin); 5103 } 5104 5105 if (transformPerspective !== _zeroPx) { 5106 transforms += "perspective(" + transformPerspective + _endParenthesis; 5107 } 5108 5109 if (xPercent || yPercent) { 5110 transforms += "translate(" + xPercent + "%, " + yPercent + "%) "; 5111 } 5112 5113 if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) { 5114 transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis; 5115 } 5116 5117 if (rotation !== _zeroDeg) { 5118 transforms += "rotate(" + rotation + _endParenthesis; 5119 } 5120 5121 if (rotationY !== _zeroDeg) { 5122 transforms += "rotateY(" + rotationY + _endParenthesis; 5123 } 5124 5125 if (rotationX !== _zeroDeg) { 5126 transforms += "rotateX(" + rotationX + _endParenthesis; 5127 } 5128 5129 if (skewX !== _zeroDeg || skewY !== _zeroDeg) { 5130 transforms += "skew(" + skewX + ", " + skewY + _endParenthesis; 5131 } 5132 5133 if (scaleX !== 1 || scaleY !== 1) { 5134 transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis; 5135 } 5136 5137 target.style[_transformProp] = transforms || "translate(0, 0)"; 5138 }, 5139 _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) { 5140 var _ref2 = cache || this, 5141 xPercent = _ref2.xPercent, 5142 yPercent = _ref2.yPercent, 5143 x = _ref2.x, 5144 y = _ref2.y, 5145 rotation = _ref2.rotation, 5146 skewX = _ref2.skewX, 5147 skewY = _ref2.skewY, 5148 scaleX = _ref2.scaleX, 5149 scaleY = _ref2.scaleY, 5150 target = _ref2.target, 5151 xOrigin = _ref2.xOrigin, 5152 yOrigin = _ref2.yOrigin, 5153 xOffset = _ref2.xOffset, 5154 yOffset = _ref2.yOffset, 5155 forceCSS = _ref2.forceCSS, 5156 tx = parseFloat(x), 5157 ty = parseFloat(y), 5158 a11, 5159 a21, 5160 a12, 5161 a22, 5162 temp; 5163 5164 rotation = parseFloat(rotation); 5165 skewX = parseFloat(skewX); 5166 skewY = parseFloat(skewY); 5167 5168 if (skewY) { 5169 skewY = parseFloat(skewY); 5170 skewX += skewY; 5171 rotation += skewY; 5172 } 5173 5174 if (rotation || skewX) { 5175 rotation *= _DEG2RAD; 5176 skewX *= _DEG2RAD; 5177 a11 = Math.cos(rotation) * scaleX; 5178 a21 = Math.sin(rotation) * scaleX; 5179 a12 = Math.sin(rotation - skewX) * -scaleY; 5180 a22 = Math.cos(rotation - skewX) * scaleY; 5181 5182 if (skewX) { 5183 skewY *= _DEG2RAD; 5184 temp = Math.tan(skewX - skewY); 5185 temp = Math.sqrt(1 + temp * temp); 5186 a12 *= temp; 5187 a22 *= temp; 5188 5189 if (skewY) { 5190 temp = Math.tan(skewY); 5191 temp = Math.sqrt(1 + temp * temp); 5192 a11 *= temp; 5193 a21 *= temp; 5194 } 5195 } 5196 5197 a11 = _round(a11); 5198 a21 = _round(a21); 5199 a12 = _round(a12); 5200 a22 = _round(a22); 5201 } else { 5202 a11 = scaleX; 5203 a22 = scaleY; 5204 a21 = a12 = 0; 5205 } 5206 5207 if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) { 5208 tx = _convertToUnit(target, "x", x, "px"); 5209 ty = _convertToUnit(target, "y", y, "px"); 5210 } 5211 5212 if (xOrigin || yOrigin || xOffset || yOffset) { 5213 tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset); 5214 ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset); 5215 } 5216 5217 if (xPercent || yPercent) { 5218 temp = target.getBBox(); 5219 tx = _round(tx + xPercent / 100 * temp.width); 5220 ty = _round(ty + yPercent / 100 * temp.height); 5221 } 5222 5223 temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")"; 5224 target.setAttribute("transform", temp); 5225 forceCSS && (target.style[_transformProp] = temp); 5226 }, 5227 _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) { 5228 var cap = 360, 5229 isString = _isString(endValue), 5230 endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), 5231 change = endNum - startNum, 5232 finalValue = startNum + change + "deg", 5233 direction, 5234 pt; 5235 5236 if (isString) { 5237 direction = endValue.split("_")[1]; 5238 5239 if (direction === "short") { 5240 change %= cap; 5241 5242 if (change !== change % (cap / 2)) { 5243 change += change < 0 ? cap : -cap; 5244 } 5245 } 5246 5247 if (direction === "cw" && change < 0) { 5248 change = (change + cap * _bigNum$1) % cap - ~~(change / cap) * cap; 5249 } else if (direction === "ccw" && change > 0) { 5250 change = (change - cap * _bigNum$1) % cap - ~~(change / cap) * cap; 5251 } 5252 } 5253 5254 plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd); 5255 pt.e = finalValue; 5256 pt.u = "deg"; 5257 5258 plugin._props.push(property); 5259 5260 return pt; 5261 }, 5262 _assign = function _assign(target, source) { 5263 for (var p in source) { 5264 target[p] = source[p]; 5265 } 5266 5267 return target; 5268 }, 5269 _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) { 5270 var startCache = _assign({}, target._gsap), 5271 exclude = "perspective,force3D,transformOrigin,svgOrigin", 5272 style = target.style, 5273 endCache, 5274 p, 5275 startValue, 5276 endValue, 5277 startNum, 5278 endNum, 5279 startUnit, 5280 endUnit; 5281 5282 if (startCache.svg) { 5283 startValue = target.getAttribute("transform"); 5284 target.setAttribute("transform", ""); 5285 style[_transformProp] = transforms; 5286 endCache = _parseTransform(target, 1); 5287 5288 _removeProperty(target, _transformProp); 5289 5290 target.setAttribute("transform", startValue); 5291 } else { 5292 startValue = getComputedStyle(target)[_transformProp]; 5293 style[_transformProp] = transforms; 5294 endCache = _parseTransform(target, 1); 5295 style[_transformProp] = startValue; 5296 } 5297 5298 for (p in _transformProps) { 5299 startValue = startCache[p]; 5300 endValue = endCache[p]; 5301 5302 if (startValue !== endValue && exclude.indexOf(p) < 0) { 5303 startUnit = getUnit(startValue); 5304 endUnit = getUnit(endValue); 5305 startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue); 5306 endNum = parseFloat(endValue); 5307 plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp); 5308 plugin._pt.u = endUnit || 0; 5309 5310 plugin._props.push(p); 5311 } 5312 } 5313 5314 _assign(endCache, startCache); 5315 }; 5316 5317 _forEachName("padding,margin,Width,Radius", function (name, index) { 5318 var t = "Top", 5319 r = "Right", 5320 b = "Bottom", 5321 l = "Left", 5322 props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function (side) { 5323 return index < 2 ? name + side : "border" + side + name; 5324 }); 5325 5326 _specialProps[index > 1 ? "border" + name : name] = function (plugin, target, property, endValue, tween) { 5327 var a, vars; 5328 5329 if (arguments.length < 4) { 5330 a = props.map(function (prop) { 5331 return _get(plugin, prop, property); 5332 }); 5333 vars = a.join(" "); 5334 return vars.split(a[0]).length === 5 ? a[0] : vars; 5335 } 5336 5337 a = (endValue + "").split(" "); 5338 vars = {}; 5339 props.forEach(function (prop, i) { 5340 return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0]; 5341 }); 5342 plugin.init(target, vars, tween); 5343 }; 5344 }); 5345 5346 var CSSPlugin = { 5347 name: "css", 5348 register: _initCore, 5349 targetTest: function targetTest(target) { 5350 return target.style && target.nodeType; 5351 }, 5352 init: function init(target, vars, tween, index, targets) { 5353 var props = this._props, 5354 style = target.style, 5355 startAt = tween.vars.startAt, 5356 startValue, 5357 endValue, 5358 endNum, 5359 startNum, 5360 type, 5361 specialProp, 5362 p, 5363 startUnit, 5364 endUnit, 5365 relative, 5366 isTransformRelated, 5367 transformPropTween, 5368 cache, 5369 smooth, 5370 hasPriority, 5371 inlineProps
vendor: 6,817 bytes, lines 5371-5528
5371; 5372 _pluginInitted || _initCore(); 5373 this.styles = this.styles || _getStyleSaver(target); 5374 inlineProps = this.styles.props; 5375 this.tween = tween; 5376 5377 for (p in vars) { 5378 if (p === "autoRound") { 5379 continue; 5380 } 5381 5382 endValue = vars[p]; 5383 5384 if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) { 5385 continue; 5386 } 5387 5388 type = typeof endValue; 5389 specialProp = _specialProps[p]; 5390 5391 if (type === "function") { 5392 endValue = endValue.call(tween, index, target, targets); 5393 type = typeof endValue; 5394 } 5395 5396 if (type === "string" && ~endValue.indexOf("random(")) { 5397 endValue = _replaceRandom(endValue); 5398 } 5399 5400 if (specialProp) { 5401 specialProp(this, target, p, endValue, tween) && (hasPriority = 1); 5402 } else if (p.substr(0, 2) === "--") { 5403 startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim(); 5404 endValue += ""; 5405 _colorExp.lastIndex = 0; 5406 5407 if (!_colorExp.test(startValue)) { 5408 startUnit = getUnit(startValue); 5409 endUnit = getUnit(endValue); 5410 } 5411 5412 endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit); 5413 this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p); 5414 props.push(p); 5415 inlineProps.push(p, 0, style[p]); 5416 } else if (type !== "undefined") { 5417 if (startAt && p in startAt) { 5418 startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p]; 5419 _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue)); 5420 getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get(target, p)) || ""); 5421 (startValue + "").charAt(1) === "=" && (startValue = _get(target, p)); 5422 } else { 5423 startValue = _get(target, p); 5424 } 5425 5426 startNum = parseFloat(startValue); 5427 relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2); 5428 relative && (endValue = endValue.substr(2)); 5429 endNum = parseFloat(endValue); 5430 5431 if (p in _propertyAliases) { 5432 if (p === "autoAlpha") { 5433 if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) { 5434 startNum = 0; 5435 } 5436 5437 inlineProps.push("visibility", 0, style.visibility); 5438 5439 _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum); 5440 } 5441 5442 if (p !== "scale" && p !== "transform") { 5443 p = _propertyAliases[p]; 5444 ~p.indexOf(",") && (p = p.split(",")[0]); 5445 } 5446 } 5447 5448 isTransformRelated = p in _transformProps; 5449 5450 if (isTransformRelated) { 5451 this.styles.save(p); 5452 5453 if (!transformPropTween) { 5454 cache = target._gsap; 5455 cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); 5456 smooth = vars.smoothOrigin !== false && cache.smooth; 5457 transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); 5458 transformPropTween.dep = 1; 5459 } 5460 5461 if (p === "scale") { 5462 this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp); 5463 this._pt.u = 0; 5464 props.push("scaleY", p); 5465 p += "X"; 5466 } else if (p === "transformOrigin") { 5467 inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]); 5468 endValue = _convertKeywordsToPercentages(endValue); 5469 5470 if (cache.svg) { 5471 _applySVGOrigin(target, endValue, 0, smooth, 0, this); 5472 } else { 5473 endUnit = parseFloat(endValue.split(" ")[2]) || 0; 5474 endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit); 5475 5476 _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue)); 5477 } 5478 5479 continue; 5480 } else if (p === "svgOrigin") { 5481 _applySVGOrigin(target, endValue, 1, smooth, 0, this); 5482 5483 continue; 5484 } else if (p in _rotationalProperties) { 5485 _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue); 5486 5487 continue; 5488 } else if (p === "smoothOrigin") { 5489 _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue); 5490 5491 continue; 5492 } else if (p === "force3D") { 5493 cache[p] = endValue; 5494 continue; 5495 } else if (p === "transform") { 5496 _addRawTransformPTs(this, endValue, target); 5497 5498 continue; 5499 } 5500 } else if (!(p in style)) { 5501 p = _checkPropPrefix(p) || p; 5502 } 5503 5504 if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) { 5505 startUnit = (startValue + "").substr((startNum + "").length); 5506 endNum || (endNum = 0); 5507 endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit); 5508 startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit)); 5509 this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === "px" || p === "zIndex") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp); 5510 this._pt.u = endUnit || 0; 5511 5512 if (startUnit !== endUnit && endUnit !== "%") { 5513 this._pt.b = startValue; 5514 this._pt.r = _renderCSSPropWithBeginning; 5515 } 5516 } else if (!(p in style)) { 5517 if (p in target) { 5518 this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets); 5519 } else if (p !== "parseTransform") { 5520 _missingPlugin(p, endValue); 5521 5522 continue; 5523 } 5524 } else { 5525 _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue); 5526 } 5527 5528 isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]
vendor: 3,264 bytes, lines 5528-5617
5528) : inlineProps.push(p, 1, startValue || target[p])); 5529 props.push(p); 5530 } 5531 } 5532 5533 hasPriority && _sortPropTweensByPriority(this); 5534 }, 5535 render: function render(ratio, data) { 5536 if (data.tween._time || !_reverting$1()) { 5537 var pt = data._pt; 5538 5539 while (pt) { 5540 pt.r(ratio, pt.d); 5541 pt = pt._next; 5542 } 5543 } else { 5544 data.styles.revert(); 5545 } 5546 }, 5547 get: _get, 5548 aliases: _propertyAliases, 5549 getSetter: function getSetter(target, property, plugin) { 5550 var p = _propertyAliases[property]; 5551 p && p.indexOf(",") < 0 && (property = p); 5552 return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, "x")) ? plugin && _recentSetterPlugin === plugin ? property === "scale" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === "scale" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf("-") ? _setterCSSProp : _getSetter(target, property); 5553 }, 5554 core: { 5555 _removeProperty: _removeProperty, 5556 _getMatrix: _getMatrix 5557 } 5558 }; 5559 gsap.utils.checkPrefix = _checkPropPrefix; 5560 gsap.core.getStyleSaver = _getStyleSaver; 5561 5562 (function (positionAndScale, rotation, others, aliases) { 5563 var all = _forEachName(positionAndScale + "," + rotation + "," + others, function (name) { 5564 _transformProps[name] = 1; 5565 }); 5566 5567 _forEachName(rotation, function (name) { 5568 _config.units[name] = "deg"; 5569 _rotationalProperties[name] = 1; 5570 }); 5571 5572 _propertyAliases[all[13]] = positionAndScale + "," + rotation; 5573 5574 _forEachName(aliases, function (name) { 5575 var split = name.split(":"); 5576 _propertyAliases[split[1]] = all[split[0]]; 5577 }); 5578 })("x,y,z,scale,scaleX,scaleY,xPercent,yPercent", "rotation,rotationX,rotationY,skewX,skewY", "transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", "0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"); 5579 5580 _forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function (name) { 5581 _config.units[name] = "px"; 5582 }); 5583 5584 gsap.registerPlugin(CSSPlugin); 5585 5586 var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap, 5587 TweenMaxWithCSS = gsapWithCSS.core.Tween; 5588 5589 exports.Back = Back; 5590 exports.Bounce = Bounce; 5591 exports.CSSPlugin = CSSPlugin; 5592 exports.Circ = Circ; 5593 exports.Cubic = Cubic; 5594 exports.Elastic = Elastic; 5595 exports.Expo = Expo; 5596 exports.Linear = Linear; 5597 exports.Power0 = Power0; 5598 exports.Power1 = Power1; 5599 exports.Power2 = Power2; 5600 exports.Power3 = Power3; 5601 exports.Power4 = Power4; 5602 exports.Quad = Quad; 5603 exports.Quart = Quart; 5604 exports.Quint = Quint; 5605 exports.Sine = Sine; 5606 exports.SteppedEase = SteppedEase; 5607 exports.Strong = Strong; 5608 exports.TimelineLite = Timeline; 5609 exports.TimelineMax = Timeline; 5610 exports.TweenLite = Tween; 5611 exports.TweenMax = TweenMaxWithCSS; 5612 exports.default = gsapWithCSS; 5613 exports.gsap = gsapWithCSS; 5614 5615 if (typeof(window) === 'undefined' || window !== exports) {Object.defineProperty(exports, '__esModule', { value: true });} else {delete window.default;} 5616 5617})));
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.