1
0

gsap.js 162 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273
  1. import "./chunk-JC4IRQUL.js";
  2. // node_modules/.pnpm/gsap@3.11.5/node_modules/gsap/gsap-core.js
  3. function _assertThisInitialized(self) {
  4. if (self === void 0) {
  5. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  6. }
  7. return self;
  8. }
  9. function _inheritsLoose(subClass, superClass) {
  10. subClass.prototype = Object.create(superClass.prototype);
  11. subClass.prototype.constructor = subClass;
  12. subClass.__proto__ = superClass;
  13. }
  14. var _config = {
  15. autoSleep: 120,
  16. force3D: "auto",
  17. nullTargetWarn: 1,
  18. units: {
  19. lineHeight: ""
  20. }
  21. };
  22. var _defaults = {
  23. duration: 0.5,
  24. overwrite: false,
  25. delay: 0
  26. };
  27. var _suppressOverwrites;
  28. var _reverting;
  29. var _context;
  30. var _bigNum = 1e8;
  31. var _tinyNum = 1 / _bigNum;
  32. var _2PI = Math.PI * 2;
  33. var _HALF_PI = _2PI / 4;
  34. var _gsID = 0;
  35. var _sqrt = Math.sqrt;
  36. var _cos = Math.cos;
  37. var _sin = Math.sin;
  38. var _isString = function _isString2(value) {
  39. return typeof value === "string";
  40. };
  41. var _isFunction = function _isFunction2(value) {
  42. return typeof value === "function";
  43. };
  44. var _isNumber = function _isNumber2(value) {
  45. return typeof value === "number";
  46. };
  47. var _isUndefined = function _isUndefined2(value) {
  48. return typeof value === "undefined";
  49. };
  50. var _isObject = function _isObject2(value) {
  51. return typeof value === "object";
  52. };
  53. var _isNotFalse = function _isNotFalse2(value) {
  54. return value !== false;
  55. };
  56. var _windowExists = function _windowExists2() {
  57. return typeof window !== "undefined";
  58. };
  59. var _isFuncOrString = function _isFuncOrString2(value) {
  60. return _isFunction(value) || _isString(value);
  61. };
  62. var _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() {
  63. };
  64. var _isArray = Array.isArray;
  65. var _strictNumExp = /(?:-?\.?\d|\.)+/gi;
  66. var _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g;
  67. var _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g;
  68. var _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi;
  69. var _relExp = /[+-]=-?[.\d]+/;
  70. var _delimitedValueExp = /[^,'"\[\]\s]+/gi;
  71. var _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i;
  72. var _globalTimeline;
  73. var _win;
  74. var _coreInitted;
  75. var _doc;
  76. var _globals = {};
  77. var _installScope = {};
  78. var _coreReady;
  79. var _install = function _install2(scope) {
  80. return (_installScope = _merge(scope, _globals)) && gsap;
  81. };
  82. var _missingPlugin = function _missingPlugin2(property, value) {
  83. return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()");
  84. };
  85. var _warn = function _warn2(message, suppress) {
  86. return !suppress && console.warn(message);
  87. };
  88. var _addGlobal = function _addGlobal2(name, obj) {
  89. return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;
  90. };
  91. var _emptyFunc = function _emptyFunc2() {
  92. return 0;
  93. };
  94. var _startAtRevertConfig = {
  95. suppressEvents: true,
  96. isStart: true,
  97. kill: false
  98. };
  99. var _revertConfigNoKill = {
  100. suppressEvents: true,
  101. kill: false
  102. };
  103. var _revertConfig = {
  104. suppressEvents: true
  105. };
  106. var _reservedProps = {};
  107. var _lazyTweens = [];
  108. var _lazyLookup = {};
  109. var _lastRenderedFrame;
  110. var _plugins = {};
  111. var _effects = {};
  112. var _nextGCFrame = 30;
  113. var _harnessPlugins = [];
  114. var _callbackNames = "";
  115. var _harness = function _harness2(targets) {
  116. var target = targets[0], harnessPlugin, i;
  117. _isObject(target) || _isFunction(target) || (targets = [targets]);
  118. if (!(harnessPlugin = (target._gsap || {}).harness)) {
  119. i = _harnessPlugins.length;
  120. while (i-- && !_harnessPlugins[i].targetTest(target)) {
  121. }
  122. harnessPlugin = _harnessPlugins[i];
  123. }
  124. i = targets.length;
  125. while (i--) {
  126. targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);
  127. }
  128. return targets;
  129. };
  130. var _getCache = function _getCache2(target) {
  131. return target._gsap || _harness(toArray(target))[0]._gsap;
  132. };
  133. var _getProperty = function _getProperty2(target, property, v) {
  134. return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;
  135. };
  136. var _forEachName = function _forEachName2(names, func) {
  137. return (names = names.split(",")).forEach(func) || names;
  138. };
  139. var _round = function _round2(value) {
  140. return Math.round(value * 1e5) / 1e5 || 0;
  141. };
  142. var _roundPrecise = function _roundPrecise2(value) {
  143. return Math.round(value * 1e7) / 1e7 || 0;
  144. };
  145. var _parseRelative = function _parseRelative2(start, value) {
  146. var operator = value.charAt(0), end = parseFloat(value.substr(2));
  147. start = parseFloat(start);
  148. return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end;
  149. };
  150. var _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) {
  151. var l = toFind.length, i = 0;
  152. for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l; ) {
  153. }
  154. return i < l;
  155. };
  156. var _lazyRender = function _lazyRender2() {
  157. var l = _lazyTweens.length, a = _lazyTweens.slice(0), i, tween;
  158. _lazyLookup = {};
  159. _lazyTweens.length = 0;
  160. for (i = 0; i < l; i++) {
  161. tween = a[i];
  162. tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);
  163. }
  164. };
  165. var _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) {
  166. _lazyTweens.length && !_reverting && _lazyRender();
  167. animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt));
  168. _lazyTweens.length && !_reverting && _lazyRender();
  169. };
  170. var _numericIfPossible = function _numericIfPossible2(value) {
  171. var n = parseFloat(value);
  172. return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;
  173. };
  174. var _passThrough = function _passThrough2(p) {
  175. return p;
  176. };
  177. var _setDefaults = function _setDefaults2(obj, defaults2) {
  178. for (var p in defaults2) {
  179. p in obj || (obj[p] = defaults2[p]);
  180. }
  181. return obj;
  182. };
  183. var _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) {
  184. return function(obj, defaults2) {
  185. for (var p in defaults2) {
  186. p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults2[p]);
  187. }
  188. };
  189. };
  190. var _merge = function _merge2(base, toMerge) {
  191. for (var p in toMerge) {
  192. base[p] = toMerge[p];
  193. }
  194. return base;
  195. };
  196. var _mergeDeep = function _mergeDeep2(base, toMerge) {
  197. for (var p in toMerge) {
  198. p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);
  199. }
  200. return base;
  201. };
  202. var _copyExcluding = function _copyExcluding2(obj, excluding) {
  203. var copy = {}, p;
  204. for (p in obj) {
  205. p in excluding || (copy[p] = obj[p]);
  206. }
  207. return copy;
  208. };
  209. var _inheritDefaults = function _inheritDefaults2(vars) {
  210. var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;
  211. if (_isNotFalse(vars.inherit)) {
  212. while (parent) {
  213. func(vars, parent.vars.defaults);
  214. parent = parent.parent || parent._dp;
  215. }
  216. }
  217. return vars;
  218. };
  219. var _arraysMatch = function _arraysMatch2(a1, a2) {
  220. var i = a1.length, match = i === a2.length;
  221. while (match && i-- && a1[i] === a2[i]) {
  222. }
  223. return i < 0;
  224. };
  225. var _addLinkedListItem = function _addLinkedListItem2(parent, child, firstProp, lastProp, sortBy) {
  226. if (firstProp === void 0) {
  227. firstProp = "_first";
  228. }
  229. if (lastProp === void 0) {
  230. lastProp = "_last";
  231. }
  232. var prev = parent[lastProp], t;
  233. if (sortBy) {
  234. t = child[sortBy];
  235. while (prev && prev[sortBy] > t) {
  236. prev = prev._prev;
  237. }
  238. }
  239. if (prev) {
  240. child._next = prev._next;
  241. prev._next = child;
  242. } else {
  243. child._next = parent[firstProp];
  244. parent[firstProp] = child;
  245. }
  246. if (child._next) {
  247. child._next._prev = child;
  248. } else {
  249. parent[lastProp] = child;
  250. }
  251. child._prev = prev;
  252. child.parent = child._dp = parent;
  253. return child;
  254. };
  255. var _removeLinkedListItem = function _removeLinkedListItem2(parent, child, firstProp, lastProp) {
  256. if (firstProp === void 0) {
  257. firstProp = "_first";
  258. }
  259. if (lastProp === void 0) {
  260. lastProp = "_last";
  261. }
  262. var prev = child._prev, next = child._next;
  263. if (prev) {
  264. prev._next = next;
  265. } else if (parent[firstProp] === child) {
  266. parent[firstProp] = next;
  267. }
  268. if (next) {
  269. next._prev = prev;
  270. } else if (parent[lastProp] === child) {
  271. parent[lastProp] = prev;
  272. }
  273. child._next = child._prev = child.parent = null;
  274. };
  275. var _removeFromParent = function _removeFromParent2(child, onlyIfParentHasAutoRemove) {
  276. child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove(child);
  277. child._act = 0;
  278. };
  279. var _uncache = function _uncache2(animation, child) {
  280. if (animation && (!child || child._end > animation._dur || child._start < 0)) {
  281. var a = animation;
  282. while (a) {
  283. a._dirty = 1;
  284. a = a.parent;
  285. }
  286. }
  287. return animation;
  288. };
  289. var _recacheAncestors = function _recacheAncestors2(animation) {
  290. var parent = animation.parent;
  291. while (parent && parent.parent) {
  292. parent._dirty = 1;
  293. parent.totalDuration();
  294. parent = parent.parent;
  295. }
  296. return animation;
  297. };
  298. var _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) {
  299. return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));
  300. };
  301. var _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) {
  302. return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent);
  303. };
  304. var _elapsedCycleDuration = function _elapsedCycleDuration2(animation) {
  305. return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;
  306. };
  307. var _animationCycle = function _animationCycle2(tTime, cycleDuration) {
  308. var whole = Math.floor(tTime /= cycleDuration);
  309. return tTime && whole === tTime ? whole - 1 : whole;
  310. };
  311. var _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) {
  312. return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);
  313. };
  314. var _setEnd = function _setEnd2(animation) {
  315. return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));
  316. };
  317. var _alignPlayhead = function _alignPlayhead2(animation, totalTime) {
  318. var parent = animation._dp;
  319. if (parent && parent.smoothChildTiming && animation._ts) {
  320. animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));
  321. _setEnd(animation);
  322. parent._dirty || _uncache(parent, animation);
  323. }
  324. return animation;
  325. };
  326. var _postAddChecks = function _postAddChecks2(timeline2, child) {
  327. var t;
  328. if (child._time || child._initted && !child._dur) {
  329. t = _parentToChildTotalTime(timeline2.rawTime(), child);
  330. if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {
  331. child.render(t, true);
  332. }
  333. }
  334. if (_uncache(timeline2, child)._dp && timeline2._initted && timeline2._time >= timeline2._dur && timeline2._ts) {
  335. if (timeline2._dur < timeline2.duration()) {
  336. t = timeline2;
  337. while (t._dp) {
  338. t.rawTime() >= 0 && t.totalTime(t._tTime);
  339. t = t._dp;
  340. }
  341. }
  342. timeline2._zTime = -_tinyNum;
  343. }
  344. };
  345. var _addToTimeline = function _addToTimeline2(timeline2, child, position, skipChecks) {
  346. child.parent && _removeFromParent(child);
  347. child._start = _roundPrecise((_isNumber(position) ? position : position || timeline2 !== _globalTimeline ? _parsePosition(timeline2, position, child) : timeline2._time) + child._delay);
  348. child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));
  349. _addLinkedListItem(timeline2, child, "_first", "_last", timeline2._sort ? "_start" : 0);
  350. _isFromOrFromStart(child) || (timeline2._recent = child);
  351. skipChecks || _postAddChecks(timeline2, child);
  352. timeline2._ts < 0 && _alignPlayhead(timeline2, timeline2._tTime);
  353. return timeline2;
  354. };
  355. var _scrollTrigger = function _scrollTrigger2(animation, trigger) {
  356. return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation);
  357. };
  358. var _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) {
  359. _initTween(tween, time, tTime);
  360. if (!tween._initted) {
  361. return 1;
  362. }
  363. if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {
  364. _lazyTweens.push(tween);
  365. tween._lazy = [tTime, suppressEvents];
  366. return 1;
  367. }
  368. };
  369. var _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) {
  370. var parent = _ref.parent;
  371. return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent));
  372. };
  373. var _isFromOrFromStart = function _isFromOrFromStart2(_ref2) {
  374. var data = _ref2.data;
  375. return data === "isFromStart" || data === "isStart";
  376. };
  377. var _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) {
  378. var prevRatio = tween.ratio, ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, repeatDelay = tween._rDelay, tTime = 0, pt, iteration, prevIteration;
  379. if (repeatDelay && tween._repeat) {
  380. tTime = _clamp(0, tween._tDur, totalTime);
  381. iteration = _animationCycle(tTime, repeatDelay);
  382. tween._yoyo && iteration & 1 && (ratio = 1 - ratio);
  383. if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {
  384. prevRatio = 1 - ratio;
  385. tween.vars.repeatRefresh && tween._initted && tween.invalidate();
  386. }
  387. }
  388. if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {
  389. if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {
  390. return;
  391. }
  392. prevIteration = tween._zTime;
  393. tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0);
  394. suppressEvents || (suppressEvents = totalTime && !prevIteration);
  395. tween.ratio = ratio;
  396. tween._from && (ratio = 1 - ratio);
  397. tween._time = 0;
  398. tween._tTime = tTime;
  399. pt = tween._pt;
  400. while (pt) {
  401. pt.r(ratio, pt.d);
  402. pt = pt._next;
  403. }
  404. totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);
  405. tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate");
  406. tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat");
  407. if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {
  408. ratio && _removeFromParent(tween, 1);
  409. if (!suppressEvents && !_reverting) {
  410. _callback(tween, ratio ? "onComplete" : "onReverseComplete", true);
  411. tween._prom && tween._prom();
  412. }
  413. }
  414. } else if (!tween._zTime) {
  415. tween._zTime = totalTime;
  416. }
  417. };
  418. var _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) {
  419. var child;
  420. if (time > prevTime) {
  421. child = animation._first;
  422. while (child && child._start <= time) {
  423. if (child.data === "isPause" && child._start > prevTime) {
  424. return child;
  425. }
  426. child = child._next;
  427. }
  428. } else {
  429. child = animation._last;
  430. while (child && child._start >= time) {
  431. if (child.data === "isPause" && child._start < prevTime) {
  432. return child;
  433. }
  434. child = child._prev;
  435. }
  436. }
  437. };
  438. var _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) {
  439. var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur;
  440. totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);
  441. animation._dur = dur;
  442. animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);
  443. totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);
  444. animation.parent && _setEnd(animation);
  445. skipUncache || _uncache(animation.parent, animation);
  446. return animation;
  447. };
  448. var _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) {
  449. return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);
  450. };
  451. var _zeroPosition = {
  452. _start: 0,
  453. endTime: _emptyFunc,
  454. totalDuration: _emptyFunc
  455. };
  456. var _parsePosition = function _parsePosition2(animation, position, percentAnimation) {
  457. var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, i, offset, isPercent;
  458. if (_isString(position) && (isNaN(position) || position in labels)) {
  459. offset = position.charAt(0);
  460. isPercent = position.substr(-1) === "%";
  461. i = position.indexOf("=");
  462. if (offset === "<" || offset === ">") {
  463. i >= 0 && (position = position.replace(/=/, ""));
  464. return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);
  465. }
  466. if (i < 0) {
  467. position in labels || (labels[position] = clippedDuration);
  468. return labels[position];
  469. }
  470. offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));
  471. if (isPercent && percentAnimation) {
  472. offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();
  473. }
  474. return i > 1 ? _parsePosition2(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;
  475. }
  476. return position == null ? clippedDuration : +position;
  477. };
  478. var _createTweenType = function _createTweenType2(type, params, timeline2) {
  479. var isLegacy = _isNumber(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent;
  480. isLegacy && (vars.duration = params[1]);
  481. vars.parent = timeline2;
  482. if (type) {
  483. irVars = vars;
  484. parent = timeline2;
  485. while (parent && !("immediateRender" in irVars)) {
  486. irVars = parent.vars.defaults || {};
  487. parent = _isNotFalse(parent.vars.inherit) && parent.parent;
  488. }
  489. vars.immediateRender = _isNotFalse(irVars.immediateRender);
  490. type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1];
  491. }
  492. return new Tween(params[0], vars, params[varsIndex + 1]);
  493. };
  494. var _conditionalReturn = function _conditionalReturn2(value, func) {
  495. return value || value === 0 ? func(value) : func;
  496. };
  497. var _clamp = function _clamp2(min, max, value) {
  498. return value < min ? min : value > max ? max : value;
  499. };
  500. var getUnit = function getUnit2(value, v) {
  501. return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1];
  502. };
  503. var clamp = function clamp2(min, max, value) {
  504. return _conditionalReturn(value, function(v) {
  505. return _clamp(min, max, v);
  506. });
  507. };
  508. var _slice = [].slice;
  509. var _isArrayLike = function _isArrayLike2(value, nonEmpty) {
  510. return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;
  511. };
  512. var _flatten = function _flatten2(ar, leaveStrings, accumulator) {
  513. if (accumulator === void 0) {
  514. accumulator = [];
  515. }
  516. return ar.forEach(function(value) {
  517. var _accumulator;
  518. return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);
  519. }) || accumulator;
  520. };
  521. var toArray = function toArray2(value, scope, leaveStrings) {
  522. 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] : [];
  523. };
  524. var selector = function selector2(value) {
  525. value = toArray(value)[0] || _warn("Invalid scope") || {};
  526. return function(v) {
  527. var el = value.current || value.nativeElement || value;
  528. return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value);
  529. };
  530. };
  531. var shuffle = function shuffle2(a) {
  532. return a.sort(function() {
  533. return 0.5 - Math.random();
  534. });
  535. };
  536. var distribute = function distribute2(v) {
  537. if (_isFunction(v)) {
  538. return v;
  539. }
  540. var vars = _isObject(v) ? v : {
  541. each: v
  542. }, ease = _parseEase(vars.ease), from = vars.from || 0, base = parseFloat(vars.base) || 0, cache = {}, isDecimal = from > 0 && from < 1, ratios = isNaN(from) || isDecimal, axis = vars.axis, ratioX = from, ratioY = from;
  543. if (_isString(from)) {
  544. ratioX = ratioY = {
  545. center: 0.5,
  546. edges: 0.5,
  547. end: 1
  548. }[from] || 0;
  549. } else if (!isDecimal && ratios) {
  550. ratioX = from[0];
  551. ratioY = from[1];
  552. }
  553. return function(i, target, a) {
  554. var l = (a || vars).length, distances = cache[l], originX, originY, x, y, d, j, max, min, wrapAt;
  555. if (!distances) {
  556. wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1];
  557. if (!wrapAt) {
  558. max = -_bigNum;
  559. while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {
  560. }
  561. wrapAt--;
  562. }
  563. distances = cache[l] = [];
  564. originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt;
  565. originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0;
  566. max = 0;
  567. min = _bigNum;
  568. for (j = 0; j < l; j++) {
  569. x = j % wrapAt - originX;
  570. y = originY - (j / wrapAt | 0);
  571. distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x);
  572. d > max && (max = d);
  573. d < min && (min = d);
  574. }
  575. from === "random" && shuffle(distances);
  576. distances.max = max - min;
  577. distances.min = min;
  578. 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);
  579. distances.b = l < 0 ? base - l : base;
  580. distances.u = getUnit(vars.amount || vars.each) || 0;
  581. ease = ease && l < 0 ? _invertEase(ease) : ease;
  582. }
  583. l = (distances[i] - distances.min) / distances.max || 0;
  584. return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u;
  585. };
  586. };
  587. var _roundModifier = function _roundModifier2(v) {
  588. var p = Math.pow(10, ((v + "").split(".")[1] || "").length);
  589. return function(raw) {
  590. var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);
  591. return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw));
  592. };
  593. };
  594. var snap = function snap2(snapTo, value) {
  595. var isArray = _isArray(snapTo), radius, is2D;
  596. if (!isArray && _isObject(snapTo)) {
  597. radius = isArray = snapTo.radius || _bigNum;
  598. if (snapTo.values) {
  599. snapTo = toArray(snapTo.values);
  600. if (is2D = !_isNumber(snapTo[0])) {
  601. radius *= radius;
  602. }
  603. } else {
  604. snapTo = _roundModifier(snapTo.increment);
  605. }
  606. }
  607. return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function(raw) {
  608. is2D = snapTo(raw);
  609. return Math.abs(is2D - raw) <= radius ? is2D : raw;
  610. } : function(raw) {
  611. var x = parseFloat(is2D ? raw.x : raw), y = parseFloat(is2D ? raw.y : 0), min = _bigNum, closest = 0, i = snapTo.length, dx, dy;
  612. while (i--) {
  613. if (is2D) {
  614. dx = snapTo[i].x - x;
  615. dy = snapTo[i].y - y;
  616. dx = dx * dx + dy * dy;
  617. } else {
  618. dx = Math.abs(snapTo[i] - x);
  619. }
  620. if (dx < min) {
  621. min = dx;
  622. closest = i;
  623. }
  624. }
  625. closest = !radius || min <= radius ? snapTo[closest] : raw;
  626. return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);
  627. });
  628. };
  629. var random = function random2(min, max, roundingIncrement, returnFunction) {
  630. return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() {
  631. 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 * 0.99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;
  632. });
  633. };
  634. var pipe = function pipe2() {
  635. for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {
  636. functions[_key] = arguments[_key];
  637. }
  638. return function(value) {
  639. return functions.reduce(function(v, f) {
  640. return f(v);
  641. }, value);
  642. };
  643. };
  644. var unitize = function unitize2(func, unit) {
  645. return function(value) {
  646. return func(parseFloat(value)) + (unit || getUnit(value));
  647. };
  648. };
  649. var normalize = function normalize2(min, max, value) {
  650. return mapRange(min, max, 0, 1, value);
  651. };
  652. var _wrapArray = function _wrapArray2(a, wrapper, value) {
  653. return _conditionalReturn(value, function(index) {
  654. return a[~~wrapper(index)];
  655. });
  656. };
  657. var wrap = function wrap2(min, max, value) {
  658. var range = max - min;
  659. return _isArray(min) ? _wrapArray(min, wrap2(0, min.length), max) : _conditionalReturn(value, function(value2) {
  660. return (range + (value2 - min) % range) % range + min;
  661. });
  662. };
  663. var wrapYoyo = function wrapYoyo2(min, max, value) {
  664. var range = max - min, total = range * 2;
  665. return _isArray(min) ? _wrapArray(min, wrapYoyo2(0, min.length - 1), max) : _conditionalReturn(value, function(value2) {
  666. value2 = (total + (value2 - min) % total) % total || 0;
  667. return min + (value2 > range ? total - value2 : value2);
  668. });
  669. };
  670. var _replaceRandom = function _replaceRandom2(value) {
  671. var prev = 0, s = "", i, nums, end, isArray;
  672. while (~(i = value.indexOf("random(", prev))) {
  673. end = value.indexOf(")", i);
  674. isArray = value.charAt(i + 7) === "[";
  675. nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp);
  676. s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5);
  677. prev = end + 1;
  678. }
  679. return s + value.substr(prev, value.length - prev);
  680. };
  681. var mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) {
  682. var inRange = inMax - inMin, outRange = outMax - outMin;
  683. return _conditionalReturn(value, function(value2) {
  684. return outMin + ((value2 - inMin) / inRange * outRange || 0);
  685. });
  686. };
  687. var interpolate = function interpolate2(start, end, progress, mutate) {
  688. var func = isNaN(start + end) ? 0 : function(p2) {
  689. return (1 - p2) * start + p2 * end;
  690. };
  691. if (!func) {
  692. var isString = _isString(start), master = {}, p, i, interpolators, l, il;
  693. progress === true && (mutate = 1) && (progress = null);
  694. if (isString) {
  695. start = {
  696. p: start
  697. };
  698. end = {
  699. p: end
  700. };
  701. } else if (_isArray(start) && !_isArray(end)) {
  702. interpolators = [];
  703. l = start.length;
  704. il = l - 2;
  705. for (i = 1; i < l; i++) {
  706. interpolators.push(interpolate2(start[i - 1], start[i]));
  707. }
  708. l--;
  709. func = function func2(p2) {
  710. p2 *= l;
  711. var i2 = Math.min(il, ~~p2);
  712. return interpolators[i2](p2 - i2);
  713. };
  714. progress = end;
  715. } else if (!mutate) {
  716. start = _merge(_isArray(start) ? [] : {}, start);
  717. }
  718. if (!interpolators) {
  719. for (p in end) {
  720. _addPropTween.call(master, start, p, "get", end[p]);
  721. }
  722. func = function func2(p2) {
  723. return _renderPropTweens(p2, master) || (isString ? start.p : start);
  724. };
  725. }
  726. }
  727. return _conditionalReturn(progress, func);
  728. };
  729. var _getLabelInDirection = function _getLabelInDirection2(timeline2, fromTime, backward) {
  730. var labels = timeline2.labels, min = _bigNum, p, distance, label;
  731. for (p in labels) {
  732. distance = labels[p] - fromTime;
  733. if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {
  734. label = p;
  735. min = distance;
  736. }
  737. }
  738. return label;
  739. };
  740. var _callback = function _callback2(animation, type, executeLazyFirst) {
  741. var v = animation.vars, callback = v[type], prevContext = _context, context3 = animation._ctx, params, scope, result;
  742. if (!callback) {
  743. return;
  744. }
  745. params = v[type + "Params"];
  746. scope = v.callbackScope || animation;
  747. executeLazyFirst && _lazyTweens.length && _lazyRender();
  748. context3 && (_context = context3);
  749. result = params ? callback.apply(scope, params) : callback.call(scope);
  750. _context = prevContext;
  751. return result;
  752. };
  753. var _interrupt = function _interrupt2(animation) {
  754. _removeFromParent(animation);
  755. animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);
  756. animation.progress() < 1 && _callback(animation, "onInterrupt");
  757. return animation;
  758. };
  759. var _quickTween;
  760. var _registerPluginQueue = [];
  761. var _createPlugin = function _createPlugin2(config3) {
  762. if (!_windowExists()) {
  763. _registerPluginQueue.push(config3);
  764. return;
  765. }
  766. config3 = !config3.name && config3["default"] || config3;
  767. var name = config3.name, isFunc = _isFunction(config3), Plugin = name && !isFunc && config3.init ? function() {
  768. this._props = [];
  769. } : config3, instanceDefaults = {
  770. init: _emptyFunc,
  771. render: _renderPropTweens,
  772. add: _addPropTween,
  773. kill: _killPropTweensOf,
  774. modifier: _addPluginModifier,
  775. rawVars: 0
  776. }, statics = {
  777. targetTest: 0,
  778. get: 0,
  779. getSetter: _getSetter,
  780. aliases: {},
  781. register: 0
  782. };
  783. _wake();
  784. if (config3 !== Plugin) {
  785. if (_plugins[name]) {
  786. return;
  787. }
  788. _setDefaults(Plugin, _setDefaults(_copyExcluding(config3, instanceDefaults), statics));
  789. _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config3, statics)));
  790. _plugins[Plugin.prop = name] = Plugin;
  791. if (config3.targetTest) {
  792. _harnessPlugins.push(Plugin);
  793. _reservedProps[name] = 1;
  794. }
  795. name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin";
  796. }
  797. _addGlobal(name, Plugin);
  798. config3.register && config3.register(gsap, Plugin, PropTween);
  799. };
  800. var _255 = 255;
  801. var _colorLookup = {
  802. aqua: [0, _255, _255],
  803. lime: [0, _255, 0],
  804. silver: [192, 192, 192],
  805. black: [0, 0, 0],
  806. maroon: [128, 0, 0],
  807. teal: [0, 128, 128],
  808. blue: [0, 0, _255],
  809. navy: [0, 0, 128],
  810. white: [_255, _255, _255],
  811. olive: [128, 128, 0],
  812. yellow: [_255, _255, 0],
  813. orange: [_255, 165, 0],
  814. gray: [128, 128, 128],
  815. purple: [128, 0, 128],
  816. green: [0, 128, 0],
  817. red: [_255, 0, 0],
  818. pink: [_255, 192, 203],
  819. cyan: [0, _255, _255],
  820. transparent: [_255, _255, _255, 0]
  821. };
  822. var _hue = function _hue2(h, m1, m2) {
  823. h += h < 0 ? 1 : h > 1 ? -1 : 0;
  824. return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < 0.5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + 0.5 | 0;
  825. };
  826. var splitColor = function splitColor2(v, toHSL, forceAlpha) {
  827. var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s, l, max, min, d, wasHSL;
  828. if (!a) {
  829. if (v.substr(-1) === ",") {
  830. v = v.substr(0, v.length - 1);
  831. }
  832. if (_colorLookup[v]) {
  833. a = _colorLookup[v];
  834. } else if (v.charAt(0) === "#") {
  835. if (v.length < 6) {
  836. r = v.charAt(1);
  837. g = v.charAt(2);
  838. b = v.charAt(3);
  839. v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : "");
  840. }
  841. if (v.length === 9) {
  842. a = parseInt(v.substr(1, 6), 16);
  843. return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];
  844. }
  845. v = parseInt(v.substr(1), 16);
  846. a = [v >> 16, v >> 8 & _255, v & _255];
  847. } else if (v.substr(0, 3) === "hsl") {
  848. a = wasHSL = v.match(_strictNumExp);
  849. if (!toHSL) {
  850. h = +a[0] % 360 / 360;
  851. s = +a[1] / 100;
  852. l = +a[2] / 100;
  853. g = l <= 0.5 ? l * (s + 1) : l + s - l * s;
  854. r = l * 2 - g;
  855. a.length > 3 && (a[3] *= 1);
  856. a[0] = _hue(h + 1 / 3, r, g);
  857. a[1] = _hue(h, r, g);
  858. a[2] = _hue(h - 1 / 3, r, g);
  859. } else if (~v.indexOf("=")) {
  860. a = v.match(_numExp);
  861. forceAlpha && a.length < 4 && (a[3] = 1);
  862. return a;
  863. }
  864. } else {
  865. a = v.match(_strictNumExp) || _colorLookup.transparent;
  866. }
  867. a = a.map(Number);
  868. }
  869. if (toHSL && !wasHSL) {
  870. r = a[0] / _255;
  871. g = a[1] / _255;
  872. b = a[2] / _255;
  873. max = Math.max(r, g, b);
  874. min = Math.min(r, g, b);
  875. l = (max + min) / 2;
  876. if (max === min) {
  877. h = s = 0;
  878. } else {
  879. d = max - min;
  880. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  881. h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;
  882. h *= 60;
  883. }
  884. a[0] = ~~(h + 0.5);
  885. a[1] = ~~(s * 100 + 0.5);
  886. a[2] = ~~(l * 100 + 0.5);
  887. }
  888. forceAlpha && a.length < 4 && (a[3] = 1);
  889. return a;
  890. };
  891. var _colorOrderData = function _colorOrderData2(v) {
  892. var values = [], c = [], i = -1;
  893. v.split(_colorExp).forEach(function(v2) {
  894. var a = v2.match(_numWithUnitExp) || [];
  895. values.push.apply(values, a);
  896. c.push(i += a.length + 1);
  897. });
  898. values.c = c;
  899. return values;
  900. };
  901. var _formatColors = function _formatColors2(s, toHSL, orderMatchData) {
  902. var result = "", colors = (s + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i = 0, c, shell, d, l;
  903. if (!colors) {
  904. return s;
  905. }
  906. colors = colors.map(function(color) {
  907. return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")";
  908. });
  909. if (orderMatchData) {
  910. d = _colorOrderData(s);
  911. c = orderMatchData.c;
  912. if (c.join(result) !== d.c.join(result)) {
  913. shell = s.replace(_colorExp, "1").split(_numWithUnitExp);
  914. l = shell.length - 1;
  915. for (; i < l; i++) {
  916. result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift());
  917. }
  918. }
  919. }
  920. if (!shell) {
  921. shell = s.split(_colorExp);
  922. l = shell.length - 1;
  923. for (; i < l; i++) {
  924. result += shell[i] + colors[i];
  925. }
  926. }
  927. return result + shell[l];
  928. };
  929. var _colorExp = function() {
  930. var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p;
  931. for (p in _colorLookup) {
  932. s += "|" + p + "\\b";
  933. }
  934. return new RegExp(s + ")", "gi");
  935. }();
  936. var _hslExp = /hsl[a]?\(/;
  937. var _colorStringFilter = function _colorStringFilter2(a) {
  938. var combined = a.join(" "), toHSL;
  939. _colorExp.lastIndex = 0;
  940. if (_colorExp.test(combined)) {
  941. toHSL = _hslExp.test(combined);
  942. a[1] = _formatColors(a[1], toHSL);
  943. a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1]));
  944. return true;
  945. }
  946. };
  947. var _tickerActive;
  948. var _ticker = function() {
  949. var _getTime = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime(), _lastUpdate = _startTime, _gap = 1e3 / 240, _nextTime = _gap, _listeners2 = [], _id, _req, _raf, _self, _delta, _i, _tick = function _tick2(v) {
  950. var elapsed = _getTime() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame;
  951. elapsed > _lagThreshold && (_startTime += elapsed - _adjustedLag);
  952. _lastUpdate += elapsed;
  953. time = _lastUpdate - _startTime;
  954. overlap = time - _nextTime;
  955. if (overlap > 0 || manual) {
  956. frame = ++_self.frame;
  957. _delta = time - _self.time * 1e3;
  958. _self.time = time = time / 1e3;
  959. _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);
  960. dispatch = 1;
  961. }
  962. manual || (_id = _req(_tick2));
  963. if (dispatch) {
  964. for (_i = 0; _i < _listeners2.length; _i++) {
  965. _listeners2[_i](time, _delta, frame, v);
  966. }
  967. }
  968. };
  969. _self = {
  970. time: 0,
  971. frame: 0,
  972. tick: function tick() {
  973. _tick(true);
  974. },
  975. deltaRatio: function deltaRatio(fps) {
  976. return _delta / (1e3 / (fps || 60));
  977. },
  978. wake: function wake() {
  979. if (_coreReady) {
  980. if (!_coreInitted && _windowExists()) {
  981. _win = _coreInitted = window;
  982. _doc = _win.document || {};
  983. _globals.gsap = gsap;
  984. (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);
  985. _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});
  986. _raf = _win.requestAnimationFrame;
  987. _registerPluginQueue.forEach(_createPlugin);
  988. }
  989. _id && _self.sleep();
  990. _req = _raf || function(f) {
  991. return setTimeout(f, _nextTime - _self.time * 1e3 + 1 | 0);
  992. };
  993. _tickerActive = 1;
  994. _tick(2);
  995. }
  996. },
  997. sleep: function sleep() {
  998. (_raf ? _win.cancelAnimationFrame : clearTimeout)(_id);
  999. _tickerActive = 0;
  1000. _req = _emptyFunc;
  1001. },
  1002. lagSmoothing: function lagSmoothing(threshold, adjustedLag) {
  1003. _lagThreshold = threshold || Infinity;
  1004. _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);
  1005. },
  1006. fps: function fps(_fps) {
  1007. _gap = 1e3 / (_fps || 240);
  1008. _nextTime = _self.time * 1e3 + _gap;
  1009. },
  1010. add: function add(callback, once, prioritize) {
  1011. var func = once ? function(t, d, f, v) {
  1012. callback(t, d, f, v);
  1013. _self.remove(func);
  1014. } : callback;
  1015. _self.remove(callback);
  1016. _listeners2[prioritize ? "unshift" : "push"](func);
  1017. _wake();
  1018. return func;
  1019. },
  1020. remove: function remove(callback, i) {
  1021. ~(i = _listeners2.indexOf(callback)) && _listeners2.splice(i, 1) && _i >= i && _i--;
  1022. },
  1023. _listeners: _listeners2
  1024. };
  1025. return _self;
  1026. }();
  1027. var _wake = function _wake2() {
  1028. return !_tickerActive && _ticker.wake();
  1029. };
  1030. var _easeMap = {};
  1031. var _customEaseExp = /^[\d.\-M][\d.\-,\s]/;
  1032. var _quotesExp = /["']/g;
  1033. var _parseObjectInString = function _parseObjectInString2(value) {
  1034. var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i = 1, l = split.length, index, val, parsedVal;
  1035. for (; i < l; i++) {
  1036. val = split[i];
  1037. index = i !== l - 1 ? val.lastIndexOf(",") : val.length;
  1038. parsedVal = val.substr(0, index);
  1039. obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal;
  1040. key = val.substr(index + 1).trim();
  1041. }
  1042. return obj;
  1043. };
  1044. var _valueInParentheses = function _valueInParentheses2(value) {
  1045. var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open);
  1046. return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close);
  1047. };
  1048. var _configEaseFromString = function _configEaseFromString2(name) {
  1049. var split = (name + "").split("("), ease = _easeMap[split[0]];
  1050. 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;
  1051. };
  1052. var _invertEase = function _invertEase2(ease) {
  1053. return function(p) {
  1054. return 1 - ease(1 - p);
  1055. };
  1056. };
  1057. var _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) {
  1058. var child = timeline2._first, ease;
  1059. while (child) {
  1060. if (child instanceof Timeline) {
  1061. _propagateYoyoEase2(child, isYoyo);
  1062. } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {
  1063. if (child.timeline) {
  1064. _propagateYoyoEase2(child.timeline, isYoyo);
  1065. } else {
  1066. ease = child._ease;
  1067. child._ease = child._yEase;
  1068. child._yEase = ease;
  1069. child._yoyo = isYoyo;
  1070. }
  1071. }
  1072. child = child._next;
  1073. }
  1074. };
  1075. var _parseEase = function _parseEase2(ease, defaultEase) {
  1076. return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;
  1077. };
  1078. var _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) {
  1079. if (easeOut === void 0) {
  1080. easeOut = function easeOut2(p) {
  1081. return 1 - easeIn(1 - p);
  1082. };
  1083. }
  1084. if (easeInOut === void 0) {
  1085. easeInOut = function easeInOut2(p) {
  1086. return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;
  1087. };
  1088. }
  1089. var ease = {
  1090. easeIn,
  1091. easeOut,
  1092. easeInOut
  1093. }, lowercaseName;
  1094. _forEachName(names, function(name) {
  1095. _easeMap[name] = _globals[name] = ease;
  1096. _easeMap[lowercaseName = name.toLowerCase()] = easeOut;
  1097. for (var p in ease) {
  1098. _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p];
  1099. }
  1100. });
  1101. return ease;
  1102. };
  1103. var _easeInOutFromOut = function _easeInOutFromOut2(easeOut) {
  1104. return function(p) {
  1105. return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2;
  1106. };
  1107. };
  1108. var _configElastic = function _configElastic2(type, amplitude, period) {
  1109. var p1 = amplitude >= 1 ? amplitude : 1, p2 = (period || (type ? 0.3 : 0.45)) / (amplitude < 1 ? amplitude : 1), p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), easeOut = function easeOut2(p) {
  1110. return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;
  1111. }, ease = type === "out" ? easeOut : type === "in" ? function(p) {
  1112. return 1 - easeOut(1 - p);
  1113. } : _easeInOutFromOut(easeOut);
  1114. p2 = _2PI / p2;
  1115. ease.config = function(amplitude2, period2) {
  1116. return _configElastic2(type, amplitude2, period2);
  1117. };
  1118. return ease;
  1119. };
  1120. var _configBack = function _configBack2(type, overshoot) {
  1121. if (overshoot === void 0) {
  1122. overshoot = 1.70158;
  1123. }
  1124. var easeOut = function easeOut2(p) {
  1125. return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;
  1126. }, ease = type === "out" ? easeOut : type === "in" ? function(p) {
  1127. return 1 - easeOut(1 - p);
  1128. } : _easeInOutFromOut(easeOut);
  1129. ease.config = function(overshoot2) {
  1130. return _configBack2(type, overshoot2);
  1131. };
  1132. return ease;
  1133. };
  1134. _forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i) {
  1135. var power = i < 5 ? i + 1 : i;
  1136. _insertEase(name + ",Power" + (power - 1), i ? function(p) {
  1137. return Math.pow(p, power);
  1138. } : function(p) {
  1139. return p;
  1140. }, function(p) {
  1141. return 1 - Math.pow(1 - p, power);
  1142. }, function(p) {
  1143. return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;
  1144. });
  1145. });
  1146. _easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;
  1147. _insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic());
  1148. (function(n, c) {
  1149. var n1 = 1 / c, n2 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut2(p) {
  1150. return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + 0.75 : p < n3 ? n * (p -= 2.25 / c) * p + 0.9375 : n * Math.pow(p - 2.625 / c, 2) + 0.984375;
  1151. };
  1152. _insertEase("Bounce", function(p) {
  1153. return 1 - easeOut(1 - p);
  1154. }, easeOut);
  1155. })(7.5625, 2.75);
  1156. _insertEase("Expo", function(p) {
  1157. return p ? Math.pow(2, 10 * (p - 1)) : 0;
  1158. });
  1159. _insertEase("Circ", function(p) {
  1160. return -(_sqrt(1 - p * p) - 1);
  1161. });
  1162. _insertEase("Sine", function(p) {
  1163. return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;
  1164. });
  1165. _insertEase("Back", _configBack("in"), _configBack("out"), _configBack());
  1166. _easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {
  1167. config: function config(steps, immediateStart) {
  1168. if (steps === void 0) {
  1169. steps = 1;
  1170. }
  1171. var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max = 1 - _tinyNum;
  1172. return function(p) {
  1173. return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;
  1174. };
  1175. }
  1176. };
  1177. _defaults.ease = _easeMap["quad.out"];
  1178. _forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) {
  1179. return _callbackNames += name + "," + name + "Params,";
  1180. });
  1181. var GSCache = function GSCache2(target, harness) {
  1182. this.id = _gsID++;
  1183. target._gsap = this;
  1184. this.target = target;
  1185. this.harness = harness;
  1186. this.get = harness ? harness.get : _getProperty;
  1187. this.set = harness ? harness.getSetter : _getSetter;
  1188. };
  1189. var Animation = function() {
  1190. function Animation2(vars) {
  1191. this.vars = vars;
  1192. this._delay = +vars.delay || 0;
  1193. if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {
  1194. this._rDelay = vars.repeatDelay || 0;
  1195. this._yoyo = !!vars.yoyo || !!vars.yoyoEase;
  1196. }
  1197. this._ts = 1;
  1198. _setDuration(this, +vars.duration, 1, 1);
  1199. this.data = vars.data;
  1200. if (_context) {
  1201. this._ctx = _context;
  1202. _context.data.push(this);
  1203. }
  1204. _tickerActive || _ticker.wake();
  1205. }
  1206. var _proto = Animation2.prototype;
  1207. _proto.delay = function delay(value) {
  1208. if (value || value === 0) {
  1209. this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);
  1210. this._delay = value;
  1211. return this;
  1212. }
  1213. return this._delay;
  1214. };
  1215. _proto.duration = function duration(value) {
  1216. return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;
  1217. };
  1218. _proto.totalDuration = function totalDuration(value) {
  1219. if (!arguments.length) {
  1220. return this._tDur;
  1221. }
  1222. this._dirty = 0;
  1223. return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));
  1224. };
  1225. _proto.totalTime = function totalTime(_totalTime, suppressEvents) {
  1226. _wake();
  1227. if (!arguments.length) {
  1228. return this._tTime;
  1229. }
  1230. var parent = this._dp;
  1231. if (parent && parent.smoothChildTiming && this._ts) {
  1232. _alignPlayhead(this, _totalTime);
  1233. !parent._dp || parent.parent || _postAddChecks(parent, this);
  1234. while (parent && parent.parent) {
  1235. if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {
  1236. parent.totalTime(parent._tTime, true);
  1237. }
  1238. parent = parent.parent;
  1239. }
  1240. if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {
  1241. _addToTimeline(this._dp, this, this._start - this._delay);
  1242. }
  1243. }
  1244. if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) {
  1245. this._ts || (this._pTime = _totalTime);
  1246. _lazySafeRender(this, _totalTime, suppressEvents);
  1247. }
  1248. return this;
  1249. };
  1250. _proto.time = function time(value, suppressEvents) {
  1251. return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time;
  1252. };
  1253. _proto.totalProgress = function totalProgress(value, suppressEvents) {
  1254. return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.ratio;
  1255. };
  1256. _proto.progress = function progress(value, suppressEvents) {
  1257. 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.ratio;
  1258. };
  1259. _proto.iteration = function iteration(value, suppressEvents) {
  1260. var cycleDuration = this.duration() + this._rDelay;
  1261. return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;
  1262. };
  1263. _proto.timeScale = function timeScale(value) {
  1264. if (!arguments.length) {
  1265. return this._rts === -_tinyNum ? 0 : this._rts;
  1266. }
  1267. if (this._rts === value) {
  1268. return this;
  1269. }
  1270. var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime;
  1271. this._rts = +value || 0;
  1272. this._ts = this._ps || value === -_tinyNum ? 0 : this._rts;
  1273. this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), true);
  1274. _setEnd(this);
  1275. return _recacheAncestors(this);
  1276. };
  1277. _proto.paused = function paused(value) {
  1278. if (!arguments.length) {
  1279. return this._ps;
  1280. }
  1281. if (this._ps !== value) {
  1282. this._ps = value;
  1283. if (value) {
  1284. this._pTime = this._tTime || Math.max(-this._delay, this.rawTime());
  1285. this._ts = this._act = 0;
  1286. } else {
  1287. _wake();
  1288. this._ts = this._rts;
  1289. this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum));
  1290. }
  1291. }
  1292. return this;
  1293. };
  1294. _proto.startTime = function startTime(value) {
  1295. if (arguments.length) {
  1296. this._start = value;
  1297. var parent = this.parent || this._dp;
  1298. parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay);
  1299. return this;
  1300. }
  1301. return this._start;
  1302. };
  1303. _proto.endTime = function endTime(includeRepeats) {
  1304. return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);
  1305. };
  1306. _proto.rawTime = function rawTime(wrapRepeats) {
  1307. var parent = this.parent || this._dp;
  1308. 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);
  1309. };
  1310. _proto.revert = function revert(config3) {
  1311. if (config3 === void 0) {
  1312. config3 = _revertConfig;
  1313. }
  1314. var prevIsReverting = _reverting;
  1315. _reverting = config3;
  1316. if (this._initted || this._startAt) {
  1317. this.timeline && this.timeline.revert(config3);
  1318. this.totalTime(-0.01, config3.suppressEvents);
  1319. }
  1320. this.data !== "nested" && config3.kill !== false && this.kill();
  1321. _reverting = prevIsReverting;
  1322. return this;
  1323. };
  1324. _proto.globalTime = function globalTime(rawTime) {
  1325. var animation = this, time = arguments.length ? rawTime : animation.rawTime();
  1326. while (animation) {
  1327. time = animation._start + time / (animation._ts || 1);
  1328. animation = animation._dp;
  1329. }
  1330. return !this.parent && this._sat ? this._sat.vars.immediateRender ? -1 : this._sat.globalTime(rawTime) : time;
  1331. };
  1332. _proto.repeat = function repeat(value) {
  1333. if (arguments.length) {
  1334. this._repeat = value === Infinity ? -2 : value;
  1335. return _onUpdateTotalDuration(this);
  1336. }
  1337. return this._repeat === -2 ? Infinity : this._repeat;
  1338. };
  1339. _proto.repeatDelay = function repeatDelay(value) {
  1340. if (arguments.length) {
  1341. var time = this._time;
  1342. this._rDelay = value;
  1343. _onUpdateTotalDuration(this);
  1344. return time ? this.time(time) : this;
  1345. }
  1346. return this._rDelay;
  1347. };
  1348. _proto.yoyo = function yoyo(value) {
  1349. if (arguments.length) {
  1350. this._yoyo = value;
  1351. return this;
  1352. }
  1353. return this._yoyo;
  1354. };
  1355. _proto.seek = function seek(position, suppressEvents) {
  1356. return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));
  1357. };
  1358. _proto.restart = function restart(includeDelay, suppressEvents) {
  1359. return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));
  1360. };
  1361. _proto.play = function play(from, suppressEvents) {
  1362. from != null && this.seek(from, suppressEvents);
  1363. return this.reversed(false).paused(false);
  1364. };
  1365. _proto.reverse = function reverse(from, suppressEvents) {
  1366. from != null && this.seek(from || this.totalDuration(), suppressEvents);
  1367. return this.reversed(true).paused(false);
  1368. };
  1369. _proto.pause = function pause(atTime, suppressEvents) {
  1370. atTime != null && this.seek(atTime, suppressEvents);
  1371. return this.paused(true);
  1372. };
  1373. _proto.resume = function resume() {
  1374. return this.paused(false);
  1375. };
  1376. _proto.reversed = function reversed(value) {
  1377. if (arguments.length) {
  1378. !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0));
  1379. return this;
  1380. }
  1381. return this._rts < 0;
  1382. };
  1383. _proto.invalidate = function invalidate() {
  1384. this._initted = this._act = 0;
  1385. this._zTime = -_tinyNum;
  1386. return this;
  1387. };
  1388. _proto.isActive = function isActive() {
  1389. var parent = this.parent || this._dp, start = this._start, rawTime;
  1390. return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);
  1391. };
  1392. _proto.eventCallback = function eventCallback(type, callback, params) {
  1393. var vars = this.vars;
  1394. if (arguments.length > 1) {
  1395. if (!callback) {
  1396. delete vars[type];
  1397. } else {
  1398. vars[type] = callback;
  1399. params && (vars[type + "Params"] = params);
  1400. type === "onUpdate" && (this._onUpdate = callback);
  1401. }
  1402. return this;
  1403. }
  1404. return vars[type];
  1405. };
  1406. _proto.then = function then(onFulfilled) {
  1407. var self = this;
  1408. return new Promise(function(resolve) {
  1409. var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, _resolve = function _resolve2() {
  1410. var _then = self.then;
  1411. self.then = null;
  1412. _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);
  1413. resolve(f);
  1414. self.then = _then;
  1415. };
  1416. if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {
  1417. _resolve();
  1418. } else {
  1419. self._prom = _resolve;
  1420. }
  1421. });
  1422. };
  1423. _proto.kill = function kill() {
  1424. _interrupt(this);
  1425. };
  1426. return Animation2;
  1427. }();
  1428. _setDefaults(Animation.prototype, {
  1429. _time: 0,
  1430. _start: 0,
  1431. _end: 0,
  1432. _tTime: 0,
  1433. _tDur: 0,
  1434. _dirty: 0,
  1435. _repeat: 0,
  1436. _yoyo: false,
  1437. parent: null,
  1438. _initted: false,
  1439. _rDelay: 0,
  1440. _ts: 1,
  1441. _dp: 0,
  1442. ratio: 0,
  1443. _zTime: -_tinyNum,
  1444. _prom: 0,
  1445. _ps: false,
  1446. _rts: 1
  1447. });
  1448. var Timeline = function(_Animation) {
  1449. _inheritsLoose(Timeline2, _Animation);
  1450. function Timeline2(vars, position) {
  1451. var _this;
  1452. if (vars === void 0) {
  1453. vars = {};
  1454. }
  1455. _this = _Animation.call(this, vars) || this;
  1456. _this.labels = {};
  1457. _this.smoothChildTiming = !!vars.smoothChildTiming;
  1458. _this.autoRemoveChildren = !!vars.autoRemoveChildren;
  1459. _this._sort = _isNotFalse(vars.sortChildren);
  1460. _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);
  1461. vars.reversed && _this.reverse();
  1462. vars.paused && _this.paused(true);
  1463. vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);
  1464. return _this;
  1465. }
  1466. var _proto2 = Timeline2.prototype;
  1467. _proto2.to = function to(targets, vars, position) {
  1468. _createTweenType(0, arguments, this);
  1469. return this;
  1470. };
  1471. _proto2.from = function from(targets, vars, position) {
  1472. _createTweenType(1, arguments, this);
  1473. return this;
  1474. };
  1475. _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {
  1476. _createTweenType(2, arguments, this);
  1477. return this;
  1478. };
  1479. _proto2.set = function set(targets, vars, position) {
  1480. vars.duration = 0;
  1481. vars.parent = this;
  1482. _inheritDefaults(vars).repeatDelay || (vars.repeat = 0);
  1483. vars.immediateRender = !!vars.immediateRender;
  1484. new Tween(targets, vars, _parsePosition(this, position), 1);
  1485. return this;
  1486. };
  1487. _proto2.call = function call(callback, params, position) {
  1488. return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);
  1489. };
  1490. _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
  1491. vars.duration = duration;
  1492. vars.stagger = vars.stagger || stagger;
  1493. vars.onComplete = onCompleteAll;
  1494. vars.onCompleteParams = onCompleteAllParams;
  1495. vars.parent = this;
  1496. new Tween(targets, vars, _parsePosition(this, position));
  1497. return this;
  1498. };
  1499. _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
  1500. vars.runBackwards = 1;
  1501. _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);
  1502. return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);
  1503. };
  1504. _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {
  1505. toVars.startAt = fromVars;
  1506. _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);
  1507. return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);
  1508. };
  1509. _proto2.render = function render3(totalTime, suppressEvents, force) {
  1510. var prevTime = this._time, tDur = this._dirty ? this.totalDuration() : this._tDur, dur = this._dur, tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), time, child, next, iteration, cycleDuration, prevPaused, pauseTween, timeScale, prevStart, prevIteration, yoyo, isYoyo;
  1511. this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);
  1512. if (tTime !== this._tTime || force || crossingStart) {
  1513. if (prevTime !== this._time && dur) {
  1514. tTime += this._time - prevTime;
  1515. totalTime += this._time - prevTime;
  1516. }
  1517. time = tTime;
  1518. prevStart = this._start;
  1519. timeScale = this._ts;
  1520. prevPaused = !timeScale;
  1521. if (crossingStart) {
  1522. dur || (prevTime = this._zTime);
  1523. (totalTime || !suppressEvents) && (this._zTime = totalTime);
  1524. }
  1525. if (this._repeat) {
  1526. yoyo = this._yoyo;
  1527. cycleDuration = dur + this._rDelay;
  1528. if (this._repeat < -1 && totalTime < 0) {
  1529. return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
  1530. }
  1531. time = _roundPrecise(tTime % cycleDuration);
  1532. if (tTime === tDur) {
  1533. iteration = this._repeat;
  1534. time = dur;
  1535. } else {
  1536. iteration = ~~(tTime / cycleDuration);
  1537. if (iteration && iteration === tTime / cycleDuration) {
  1538. time = dur;
  1539. iteration--;
  1540. }
  1541. time > dur && (time = dur);
  1542. }
  1543. prevIteration = _animationCycle(this._tTime, cycleDuration);
  1544. !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration);
  1545. if (yoyo && iteration & 1) {
  1546. time = dur - time;
  1547. isYoyo = 1;
  1548. }
  1549. if (iteration !== prevIteration && !this._lock) {
  1550. var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1);
  1551. iteration < prevIteration && (rewinding = !rewinding);
  1552. prevTime = rewinding ? 0 : dur;
  1553. this._lock = 1;
  1554. this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;
  1555. this._tTime = tTime;
  1556. !suppressEvents && this.parent && _callback(this, "onRepeat");
  1557. this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1);
  1558. if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {
  1559. return this;
  1560. }
  1561. dur = this._dur;
  1562. tDur = this._tDur;
  1563. if (doesWrap) {
  1564. this._lock = 2;
  1565. prevTime = rewinding ? dur : -1e-4;
  1566. this.render(prevTime, true);
  1567. this.vars.repeatRefresh && !isYoyo && this.invalidate();
  1568. }
  1569. this._lock = 0;
  1570. if (!this._ts && !prevPaused) {
  1571. return this;
  1572. }
  1573. _propagateYoyoEase(this, isYoyo);
  1574. }
  1575. }
  1576. if (this._hasPause && !this._forcing && this._lock < 2) {
  1577. pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));
  1578. if (pauseTween) {
  1579. tTime -= time - (time = pauseTween._start);
  1580. }
  1581. }
  1582. this._tTime = tTime;
  1583. this._time = time;
  1584. this._act = !timeScale;
  1585. if (!this._initted) {
  1586. this._onUpdate = this.vars.onUpdate;
  1587. this._initted = 1;
  1588. this._zTime = totalTime;
  1589. prevTime = 0;
  1590. }
  1591. if (!prevTime && time && !suppressEvents && !iteration) {
  1592. _callback(this, "onStart");
  1593. if (this._tTime !== tTime) {
  1594. return this;
  1595. }
  1596. }
  1597. if (time >= prevTime && totalTime >= 0) {
  1598. child = this._first;
  1599. while (child) {
  1600. next = child._next;
  1601. if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {
  1602. if (child.parent !== this) {
  1603. return this.render(totalTime, suppressEvents, force);
  1604. }
  1605. child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);
  1606. if (time !== this._time || !this._ts && !prevPaused) {
  1607. pauseTween = 0;
  1608. next && (tTime += this._zTime = -_tinyNum);
  1609. break;
  1610. }
  1611. }
  1612. child = next;
  1613. }
  1614. } else {
  1615. child = this._last;
  1616. var adjustedTime = totalTime < 0 ? totalTime : time;
  1617. while (child) {
  1618. next = child._prev;
  1619. if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {
  1620. if (child.parent !== this) {
  1621. return this.render(totalTime, suppressEvents, force);
  1622. }
  1623. 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));
  1624. if (time !== this._time || !this._ts && !prevPaused) {
  1625. pauseTween = 0;
  1626. next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum);
  1627. break;
  1628. }
  1629. }
  1630. child = next;
  1631. }
  1632. }
  1633. if (pauseTween && !suppressEvents) {
  1634. this.pause();
  1635. pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;
  1636. if (this._ts) {
  1637. this._start = prevStart;
  1638. _setEnd(this);
  1639. return this.render(totalTime, suppressEvents, force);
  1640. }
  1641. }
  1642. this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true);
  1643. if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) {
  1644. if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) {
  1645. if (!this._lock) {
  1646. (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
  1647. if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {
  1648. _callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true);
  1649. this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
  1650. }
  1651. }
  1652. }
  1653. }
  1654. }
  1655. return this;
  1656. };
  1657. _proto2.add = function add(child, position) {
  1658. var _this2 = this;
  1659. _isNumber(position) || (position = _parsePosition(this, position, child));
  1660. if (!(child instanceof Animation)) {
  1661. if (_isArray(child)) {
  1662. child.forEach(function(obj) {
  1663. return _this2.add(obj, position);
  1664. });
  1665. return this;
  1666. }
  1667. if (_isString(child)) {
  1668. return this.addLabel(child, position);
  1669. }
  1670. if (_isFunction(child)) {
  1671. child = Tween.delayedCall(0, child);
  1672. } else {
  1673. return this;
  1674. }
  1675. }
  1676. return this !== child ? _addToTimeline(this, child, position) : this;
  1677. };
  1678. _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {
  1679. if (nested === void 0) {
  1680. nested = true;
  1681. }
  1682. if (tweens === void 0) {
  1683. tweens = true;
  1684. }
  1685. if (timelines === void 0) {
  1686. timelines = true;
  1687. }
  1688. if (ignoreBeforeTime === void 0) {
  1689. ignoreBeforeTime = -_bigNum;
  1690. }
  1691. var a = [], child = this._first;
  1692. while (child) {
  1693. if (child._start >= ignoreBeforeTime) {
  1694. if (child instanceof Tween) {
  1695. tweens && a.push(child);
  1696. } else {
  1697. timelines && a.push(child);
  1698. nested && a.push.apply(a, child.getChildren(true, tweens, timelines));
  1699. }
  1700. }
  1701. child = child._next;
  1702. }
  1703. return a;
  1704. };
  1705. _proto2.getById = function getById2(id) {
  1706. var animations = this.getChildren(1, 1, 1), i = animations.length;
  1707. while (i--) {
  1708. if (animations[i].vars.id === id) {
  1709. return animations[i];
  1710. }
  1711. }
  1712. };
  1713. _proto2.remove = function remove(child) {
  1714. if (_isString(child)) {
  1715. return this.removeLabel(child);
  1716. }
  1717. if (_isFunction(child)) {
  1718. return this.killTweensOf(child);
  1719. }
  1720. _removeLinkedListItem(this, child);
  1721. if (child === this._recent) {
  1722. this._recent = this._last;
  1723. }
  1724. return _uncache(this);
  1725. };
  1726. _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {
  1727. if (!arguments.length) {
  1728. return this._tTime;
  1729. }
  1730. this._forcing = 1;
  1731. if (!this._dp && this._ts) {
  1732. this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));
  1733. }
  1734. _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);
  1735. this._forcing = 0;
  1736. return this;
  1737. };
  1738. _proto2.addLabel = function addLabel(label, position) {
  1739. this.labels[label] = _parsePosition(this, position);
  1740. return this;
  1741. };
  1742. _proto2.removeLabel = function removeLabel(label) {
  1743. delete this.labels[label];
  1744. return this;
  1745. };
  1746. _proto2.addPause = function addPause(position, callback, params) {
  1747. var t = Tween.delayedCall(0, callback || _emptyFunc, params);
  1748. t.data = "isPause";
  1749. this._hasPause = 1;
  1750. return _addToTimeline(this, t, _parsePosition(this, position));
  1751. };
  1752. _proto2.removePause = function removePause(position) {
  1753. var child = this._first;
  1754. position = _parsePosition(this, position);
  1755. while (child) {
  1756. if (child._start === position && child.data === "isPause") {
  1757. _removeFromParent(child);
  1758. }
  1759. child = child._next;
  1760. }
  1761. };
  1762. _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
  1763. var tweens = this.getTweensOf(targets, onlyActive), i = tweens.length;
  1764. while (i--) {
  1765. _overwritingTween !== tweens[i] && tweens[i].kill(targets, props);
  1766. }
  1767. return this;
  1768. };
  1769. _proto2.getTweensOf = function getTweensOf2(targets, onlyActive) {
  1770. var a = [], parsedTargets = toArray(targets), child = this._first, isGlobalTime = _isNumber(onlyActive), children;
  1771. while (child) {
  1772. if (child instanceof Tween) {
  1773. if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {
  1774. a.push(child);
  1775. }
  1776. } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {
  1777. a.push.apply(a, children);
  1778. }
  1779. child = child._next;
  1780. }
  1781. return a;
  1782. };
  1783. _proto2.tweenTo = function tweenTo(position, vars) {
  1784. vars = vars || {};
  1785. var tl = this, endTime = _parsePosition(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults({
  1786. ease: vars.ease || "none",
  1787. lazy: false,
  1788. immediateRender: false,
  1789. time: endTime,
  1790. overwrite: "auto",
  1791. duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,
  1792. onStart: function onStart() {
  1793. tl.pause();
  1794. if (!initted) {
  1795. var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale());
  1796. tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);
  1797. initted = 1;
  1798. }
  1799. _onStart && _onStart.apply(tween, onStartParams || []);
  1800. }
  1801. }, vars));
  1802. return immediateRender ? tween.render(0) : tween;
  1803. };
  1804. _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {
  1805. return this.tweenTo(toPosition, _setDefaults({
  1806. startAt: {
  1807. time: _parsePosition(this, fromPosition)
  1808. }
  1809. }, vars));
  1810. };
  1811. _proto2.recent = function recent() {
  1812. return this._recent;
  1813. };
  1814. _proto2.nextLabel = function nextLabel(afterTime) {
  1815. if (afterTime === void 0) {
  1816. afterTime = this._time;
  1817. }
  1818. return _getLabelInDirection(this, _parsePosition(this, afterTime));
  1819. };
  1820. _proto2.previousLabel = function previousLabel(beforeTime) {
  1821. if (beforeTime === void 0) {
  1822. beforeTime = this._time;
  1823. }
  1824. return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);
  1825. };
  1826. _proto2.currentLabel = function currentLabel(value) {
  1827. return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);
  1828. };
  1829. _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {
  1830. if (ignoreBeforeTime === void 0) {
  1831. ignoreBeforeTime = 0;
  1832. }
  1833. var child = this._first, labels = this.labels, p;
  1834. while (child) {
  1835. if (child._start >= ignoreBeforeTime) {
  1836. child._start += amount;
  1837. child._end += amount;
  1838. }
  1839. child = child._next;
  1840. }
  1841. if (adjustLabels) {
  1842. for (p in labels) {
  1843. if (labels[p] >= ignoreBeforeTime) {
  1844. labels[p] += amount;
  1845. }
  1846. }
  1847. }
  1848. return _uncache(this);
  1849. };
  1850. _proto2.invalidate = function invalidate(soft) {
  1851. var child = this._first;
  1852. this._lock = 0;
  1853. while (child) {
  1854. child.invalidate(soft);
  1855. child = child._next;
  1856. }
  1857. return _Animation.prototype.invalidate.call(this, soft);
  1858. };
  1859. _proto2.clear = function clear(includeLabels) {
  1860. if (includeLabels === void 0) {
  1861. includeLabels = true;
  1862. }
  1863. var child = this._first, next;
  1864. while (child) {
  1865. next = child._next;
  1866. this.remove(child);
  1867. child = next;
  1868. }
  1869. this._dp && (this._time = this._tTime = this._pTime = 0);
  1870. includeLabels && (this.labels = {});
  1871. return _uncache(this);
  1872. };
  1873. _proto2.totalDuration = function totalDuration(value) {
  1874. var max = 0, self = this, child = self._last, prevStart = _bigNum, prev, start, parent;
  1875. if (arguments.length) {
  1876. return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));
  1877. }
  1878. if (self._dirty) {
  1879. parent = self.parent;
  1880. while (child) {
  1881. prev = child._prev;
  1882. child._dirty && child.totalDuration();
  1883. start = child._start;
  1884. if (start > prevStart && self._sort && child._ts && !self._lock) {
  1885. self._lock = 1;
  1886. _addToTimeline(self, child, start - child._delay, 1)._lock = 0;
  1887. } else {
  1888. prevStart = start;
  1889. }
  1890. if (start < 0 && child._ts) {
  1891. max -= start;
  1892. if (!parent && !self._dp || parent && parent.smoothChildTiming) {
  1893. self._start += start / self._ts;
  1894. self._time -= start;
  1895. self._tTime -= start;
  1896. }
  1897. self.shiftChildren(-start, false, -Infinity);
  1898. prevStart = 0;
  1899. }
  1900. child._end > max && child._ts && (max = child._end);
  1901. child = prev;
  1902. }
  1903. _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);
  1904. self._dirty = 0;
  1905. }
  1906. return self._tDur;
  1907. };
  1908. Timeline2.updateRoot = function updateRoot(time) {
  1909. if (_globalTimeline._ts) {
  1910. _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));
  1911. _lastRenderedFrame = _ticker.frame;
  1912. }
  1913. if (_ticker.frame >= _nextGCFrame) {
  1914. _nextGCFrame += _config.autoSleep || 120;
  1915. var child = _globalTimeline._first;
  1916. if (!child || !child._ts) {
  1917. if (_config.autoSleep && _ticker._listeners.length < 2) {
  1918. while (child && !child._ts) {
  1919. child = child._next;
  1920. }
  1921. child || _ticker.sleep();
  1922. }
  1923. }
  1924. }
  1925. };
  1926. return Timeline2;
  1927. }(Animation);
  1928. _setDefaults(Timeline.prototype, {
  1929. _lock: 0,
  1930. _hasPause: 0,
  1931. _forcing: 0
  1932. });
  1933. var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start, end, setter, stringFilter, funcParam) {
  1934. var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), index = 0, matchIndex = 0, result, startNums, color, endNum, chunk, startNum, hasRandom, a;
  1935. pt.b = start;
  1936. pt.e = end;
  1937. start += "";
  1938. end += "";
  1939. if (hasRandom = ~end.indexOf("random(")) {
  1940. end = _replaceRandom(end);
  1941. }
  1942. if (stringFilter) {
  1943. a = [start, end];
  1944. stringFilter(a, target, prop);
  1945. start = a[0];
  1946. end = a[1];
  1947. }
  1948. startNums = start.match(_complexStringNumExp) || [];
  1949. while (result = _complexStringNumExp.exec(end)) {
  1950. endNum = result[0];
  1951. chunk = end.substring(index, result.index);
  1952. if (color) {
  1953. color = (color + 1) % 5;
  1954. } else if (chunk.substr(-5) === "rgba(") {
  1955. color = 1;
  1956. }
  1957. if (endNum !== startNums[matchIndex++]) {
  1958. startNum = parseFloat(startNums[matchIndex - 1]) || 0;
  1959. pt._pt = {
  1960. _next: pt._pt,
  1961. p: chunk || matchIndex === 1 ? chunk : ",",
  1962. //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
  1963. s: startNum,
  1964. c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,
  1965. m: color && color < 4 ? Math.round : 0
  1966. };
  1967. index = _complexStringNumExp.lastIndex;
  1968. }
  1969. }
  1970. pt.c = index < end.length ? end.substring(index, end.length) : "";
  1971. pt.fp = funcParam;
  1972. if (_relExp.test(end) || hasRandom) {
  1973. pt.e = 0;
  1974. }
  1975. this._pt = pt;
  1976. return pt;
  1977. };
  1978. var _addPropTween = function _addPropTween2(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {
  1979. _isFunction(end) && (end = end(index || 0, target, targets));
  1980. var currentValue = target[prop], 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](), setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt;
  1981. if (_isString(end)) {
  1982. if (~end.indexOf("random(")) {
  1983. end = _replaceRandom(end);
  1984. }
  1985. if (end.charAt(1) === "=") {
  1986. pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);
  1987. if (pt || pt === 0) {
  1988. end = pt;
  1989. }
  1990. }
  1991. }
  1992. if (!optional || parsedStart !== end || _forceAllPropTweens) {
  1993. if (!isNaN(parsedStart * end) && end !== "") {
  1994. pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter);
  1995. funcParam && (pt.fp = funcParam);
  1996. modifier && pt.modifier(modifier, this, target);
  1997. return this._pt = pt;
  1998. }
  1999. !currentValue && !(prop in target) && _missingPlugin(prop, end);
  2000. return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);
  2001. }
  2002. };
  2003. var _processVars = function _processVars2(vars, index, target, targets, tween) {
  2004. _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));
  2005. if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {
  2006. return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;
  2007. }
  2008. var copy = {}, p;
  2009. for (p in vars) {
  2010. copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);
  2011. }
  2012. return copy;
  2013. };
  2014. var _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) {
  2015. var plugin, pt, ptLookup, i;
  2016. if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {
  2017. tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);
  2018. if (tween !== _quickTween) {
  2019. ptLookup = tween._ptLookup[tween._targets.indexOf(target)];
  2020. i = plugin._props.length;
  2021. while (i--) {
  2022. ptLookup[plugin._props[i]] = pt;
  2023. }
  2024. }
  2025. }
  2026. return plugin;
  2027. };
  2028. var _overwritingTween;
  2029. var _forceAllPropTweens;
  2030. var _initTween = function _initTween2(tween, time, tTime) {
  2031. var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, onUpdateParams = vars.onUpdateParams, callbackScope = vars.callbackScope, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten;
  2032. tl && (!keyframes || !ease) && (ease = "none");
  2033. tween._ease = _parseEase(ease, _defaults.ease);
  2034. tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;
  2035. if (yoyoEase && tween._yoyo && !tween._repeat) {
  2036. yoyoEase = tween._yEase;
  2037. tween._yEase = tween._ease;
  2038. tween._ease = yoyoEase;
  2039. }
  2040. tween._from = !tl && !!vars.runBackwards;
  2041. if (!tl || keyframes && !vars.stagger) {
  2042. harness = targets[0] ? _getCache(targets[0]).harness : 0;
  2043. harnessVars = harness && vars[harness.prop];
  2044. cleanVars = _copyExcluding(vars, _reservedProps);
  2045. if (prevStartAt) {
  2046. prevStartAt._zTime < 0 && prevStartAt.progress(1);
  2047. time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig);
  2048. prevStartAt._lazy = 0;
  2049. }
  2050. if (startAt) {
  2051. _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({
  2052. data: "isStart",
  2053. overwrite: false,
  2054. parent,
  2055. immediateRender: true,
  2056. lazy: !prevStartAt && _isNotFalse(lazy),
  2057. startAt: null,
  2058. delay: 0,
  2059. onUpdate,
  2060. onUpdateParams,
  2061. callbackScope,
  2062. stagger: 0
  2063. }, startAt)));
  2064. tween._startAt._dp = 0;
  2065. tween._startAt._sat = tween;
  2066. time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill);
  2067. if (immediateRender) {
  2068. if (dur && time <= 0 && tTime <= 0) {
  2069. time && (tween._zTime = time);
  2070. return;
  2071. }
  2072. }
  2073. } else if (runBackwards && dur) {
  2074. if (!prevStartAt) {
  2075. time && (immediateRender = false);
  2076. p = _setDefaults({
  2077. overwrite: false,
  2078. data: "isFromStart",
  2079. //we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.
  2080. lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),
  2081. immediateRender,
  2082. //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)
  2083. stagger: 0,
  2084. parent
  2085. //ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y:gsap.utils.wrap([-100,100])})
  2086. }, cleanVars);
  2087. harnessVars && (p[harness.prop] = harnessVars);
  2088. _removeFromParent(tween._startAt = Tween.set(targets, p));
  2089. tween._startAt._dp = 0;
  2090. tween._startAt._sat = tween;
  2091. time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));
  2092. tween._zTime = time;
  2093. if (!immediateRender) {
  2094. _initTween2(tween._startAt, _tinyNum, _tinyNum);
  2095. } else if (!time) {
  2096. return;
  2097. }
  2098. }
  2099. }
  2100. tween._pt = tween._ptCache = 0;
  2101. lazy = dur && _isNotFalse(lazy) || lazy && !dur;
  2102. for (i = 0; i < targets.length; i++) {
  2103. target = targets[i];
  2104. gsData = target._gsap || _harness(targets)[i]._gsap;
  2105. tween._ptLookup[i] = ptLookup = {};
  2106. _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender();
  2107. index = fullTargets === targets ? i : fullTargets.indexOf(target);
  2108. if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {
  2109. tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);
  2110. plugin._props.forEach(function(name) {
  2111. ptLookup[name] = pt;
  2112. });
  2113. plugin.priority && (hasPriority = 1);
  2114. }
  2115. if (!harness || harnessVars) {
  2116. for (p in cleanVars) {
  2117. if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {
  2118. plugin.priority && (hasPriority = 1);
  2119. } else {
  2120. ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter);
  2121. }
  2122. }
  2123. }
  2124. tween._op && tween._op[i] && tween.kill(target, tween._op[i]);
  2125. if (autoOverwrite && tween._pt) {
  2126. _overwritingTween = tween;
  2127. _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time));
  2128. overwritten = !tween.parent;
  2129. _overwritingTween = 0;
  2130. }
  2131. tween._pt && lazy && (_lazyLookup[gsData.id] = 1);
  2132. }
  2133. hasPriority && _sortPropTweensByPriority(tween);
  2134. tween._onInit && tween._onInit(tween);
  2135. }
  2136. tween._onUpdate = onUpdate;
  2137. tween._initted = (!tween._op || tween._pt) && !overwritten;
  2138. keyframes && time <= 0 && tl.render(_bigNum, true, true);
  2139. };
  2140. var _updatePropTweens = function _updatePropTweens2(tween, property, value, start, startIsRelative, ratio, time) {
  2141. var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i;
  2142. if (!ptCache) {
  2143. ptCache = tween._ptCache[property] = [];
  2144. lookup = tween._ptLookup;
  2145. i = tween._targets.length;
  2146. while (i--) {
  2147. pt = lookup[i][property];
  2148. if (pt && pt.d && pt.d._pt) {
  2149. pt = pt.d._pt;
  2150. while (pt && pt.p !== property && pt.fp !== property) {
  2151. pt = pt._next;
  2152. }
  2153. }
  2154. if (!pt) {
  2155. _forceAllPropTweens = 1;
  2156. tween.vars[property] = "+=0";
  2157. _initTween(tween, time);
  2158. _forceAllPropTweens = 0;
  2159. return 1;
  2160. }
  2161. ptCache.push(pt);
  2162. }
  2163. }
  2164. i = ptCache.length;
  2165. while (i--) {
  2166. rootPT = ptCache[i];
  2167. pt = rootPT._pt || rootPT;
  2168. pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;
  2169. pt.c = value - pt.s;
  2170. rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e));
  2171. rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b));
  2172. }
  2173. };
  2174. var _addAliasesToVars = function _addAliasesToVars2(targets, vars) {
  2175. var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i, aliases;
  2176. if (!propertyAliases) {
  2177. return vars;
  2178. }
  2179. copy = _merge({}, vars);
  2180. for (p in propertyAliases) {
  2181. if (p in copy) {
  2182. aliases = propertyAliases[p].split(",");
  2183. i = aliases.length;
  2184. while (i--) {
  2185. copy[aliases[i]] = copy[p];
  2186. }
  2187. }
  2188. }
  2189. return copy;
  2190. };
  2191. var _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) {
  2192. var ease = obj.ease || easeEach || "power1.inOut", p, a;
  2193. if (_isArray(obj)) {
  2194. a = allProps[prop] || (allProps[prop] = []);
  2195. obj.forEach(function(value, i) {
  2196. return a.push({
  2197. t: i / (obj.length - 1) * 100,
  2198. v: value,
  2199. e: ease
  2200. });
  2201. });
  2202. } else {
  2203. for (p in obj) {
  2204. a = allProps[p] || (allProps[p] = []);
  2205. p === "ease" || a.push({
  2206. t: parseFloat(prop),
  2207. v: obj[p],
  2208. e: ease
  2209. });
  2210. }
  2211. }
  2212. };
  2213. var _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) {
  2214. return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value;
  2215. };
  2216. var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert";
  2217. var _staggerPropsToSkip = {};
  2218. _forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) {
  2219. return _staggerPropsToSkip[name] = 1;
  2220. });
  2221. var Tween = function(_Animation2) {
  2222. _inheritsLoose(Tween2, _Animation2);
  2223. function Tween2(targets, vars, position, skipInherit) {
  2224. var _this3;
  2225. if (typeof vars === "number") {
  2226. position.duration = vars;
  2227. vars = position;
  2228. position = null;
  2229. }
  2230. _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;
  2231. var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge;
  2232. _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://greensock.com", !_config.nullTargetWarn) || [];
  2233. _this3._ptLookup = [];
  2234. _this3._overwrite = overwrite;
  2235. if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
  2236. vars = _this3.vars;
  2237. tl = _this3.timeline = new Timeline({
  2238. data: "nested",
  2239. defaults: defaults2 || {},
  2240. targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets
  2241. });
  2242. tl.kill();
  2243. tl.parent = tl._dp = _assertThisInitialized(_this3);
  2244. tl._start = 0;
  2245. if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
  2246. l = parsedTargets.length;
  2247. staggerFunc = stagger && distribute(stagger);
  2248. if (_isObject(stagger)) {
  2249. for (p in stagger) {
  2250. if (~_staggerTweenProps.indexOf(p)) {
  2251. staggerVarsToMerge || (staggerVarsToMerge = {});
  2252. staggerVarsToMerge[p] = stagger[p];
  2253. }
  2254. }
  2255. }
  2256. for (i = 0; i < l; i++) {
  2257. copy = _copyExcluding(vars, _staggerPropsToSkip);
  2258. copy.stagger = 0;
  2259. yoyoEase && (copy.yoyoEase = yoyoEase);
  2260. staggerVarsToMerge && _merge(copy, staggerVarsToMerge);
  2261. curTarget = parsedTargets[i];
  2262. copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);
  2263. copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;
  2264. if (!stagger && l === 1 && copy.delay) {
  2265. _this3._delay = delay = copy.delay;
  2266. _this3._start += delay;
  2267. copy.delay = 0;
  2268. }
  2269. tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);
  2270. tl._ease = _easeMap.none;
  2271. }
  2272. tl.duration() ? duration = delay = 0 : _this3.timeline = 0;
  2273. } else if (keyframes) {
  2274. _inheritDefaults(_setDefaults(tl.vars.defaults, {
  2275. ease: "none"
  2276. }));
  2277. tl._ease = _parseEase(keyframes.ease || vars.ease || "none");
  2278. var time = 0, a, kf, v;
  2279. if (_isArray(keyframes)) {
  2280. keyframes.forEach(function(frame) {
  2281. return tl.to(parsedTargets, frame, ">");
  2282. });
  2283. tl.duration();
  2284. } else {
  2285. copy = {};
  2286. for (p in keyframes) {
  2287. p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);
  2288. }
  2289. for (p in copy) {
  2290. a = copy[p].sort(function(a2, b) {
  2291. return a2.t - b.t;
  2292. });
  2293. time = 0;
  2294. for (i = 0; i < a.length; i++) {
  2295. kf = a[i];
  2296. v = {
  2297. ease: kf.e,
  2298. duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration
  2299. };
  2300. v[p] = kf.v;
  2301. tl.to(parsedTargets, v, time);
  2302. time += v.duration;
  2303. }
  2304. }
  2305. tl.duration() < duration && tl.to({}, {
  2306. duration: duration - tl.duration()
  2307. });
  2308. }
  2309. }
  2310. duration || _this3.duration(duration = tl.duration());
  2311. } else {
  2312. _this3.timeline = 0;
  2313. }
  2314. if (overwrite === true && !_suppressOverwrites) {
  2315. _overwritingTween = _assertThisInitialized(_this3);
  2316. _globalTimeline.killTweensOf(parsedTargets);
  2317. _overwritingTween = 0;
  2318. }
  2319. _addToTimeline(parent, _assertThisInitialized(_this3), position);
  2320. vars.reversed && _this3.reverse();
  2321. vars.paused && _this3.paused(true);
  2322. if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") {
  2323. _this3._tTime = -_tinyNum;
  2324. _this3.render(Math.max(0, -delay) || 0);
  2325. }
  2326. scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);
  2327. return _this3;
  2328. }
  2329. var _proto3 = Tween2.prototype;
  2330. _proto3.render = function render3(totalTime, suppressEvents, force) {
  2331. var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2, yoyoEase;
  2332. if (!dur) {
  2333. _renderZeroDurationTween(this, totalTime, suppressEvents, force);
  2334. } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) {
  2335. time = tTime;
  2336. timeline2 = this.timeline;
  2337. if (this._repeat) {
  2338. cycleDuration = dur + this._rDelay;
  2339. if (this._repeat < -1 && isNegative) {
  2340. return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
  2341. }
  2342. time = _roundPrecise(tTime % cycleDuration);
  2343. if (tTime === tDur) {
  2344. iteration = this._repeat;
  2345. time = dur;
  2346. } else {
  2347. iteration = ~~(tTime / cycleDuration);
  2348. if (iteration && iteration === tTime / cycleDuration) {
  2349. time = dur;
  2350. iteration--;
  2351. }
  2352. time > dur && (time = dur);
  2353. }
  2354. isYoyo = this._yoyo && iteration & 1;
  2355. if (isYoyo) {
  2356. yoyoEase = this._yEase;
  2357. time = dur - time;
  2358. }
  2359. prevIteration = _animationCycle(this._tTime, cycleDuration);
  2360. if (time === prevTime && !force && this._initted) {
  2361. this._tTime = tTime;
  2362. return this;
  2363. }
  2364. if (iteration !== prevIteration) {
  2365. timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo);
  2366. if (this.vars.repeatRefresh && !isYoyo && !this._lock) {
  2367. this._lock = force = 1;
  2368. this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;
  2369. }
  2370. }
  2371. }
  2372. if (!this._initted) {
  2373. if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {
  2374. this._tTime = 0;
  2375. return this;
  2376. }
  2377. if (prevTime !== this._time) {
  2378. return this;
  2379. }
  2380. if (dur !== this._dur) {
  2381. return this.render(totalTime, suppressEvents, force);
  2382. }
  2383. }
  2384. this._tTime = tTime;
  2385. this._time = time;
  2386. if (!this._act && this._ts) {
  2387. this._act = 1;
  2388. this._lazy = 0;
  2389. }
  2390. this.ratio = ratio = (yoyoEase || this._ease)(time / dur);
  2391. if (this._from) {
  2392. this.ratio = ratio = 1 - ratio;
  2393. }
  2394. if (time && !prevTime && !suppressEvents && !iteration) {
  2395. _callback(this, "onStart");
  2396. if (this._tTime !== tTime) {
  2397. return this;
  2398. }
  2399. }
  2400. pt = this._pt;
  2401. while (pt) {
  2402. pt.r(ratio, pt.d);
  2403. pt = pt._next;
  2404. }
  2405. timeline2 && timeline2.render(totalTime < 0 ? totalTime : !time && isYoyo ? -_tinyNum : timeline2._dur * timeline2._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);
  2406. if (this._onUpdate && !suppressEvents) {
  2407. isNegative && _rewindStartAt(this, totalTime, suppressEvents, force);
  2408. _callback(this, "onUpdate");
  2409. }
  2410. this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat");
  2411. if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {
  2412. isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);
  2413. (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
  2414. if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {
  2415. _callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true);
  2416. this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
  2417. }
  2418. }
  2419. }
  2420. return this;
  2421. };
  2422. _proto3.targets = function targets() {
  2423. return this._targets;
  2424. };
  2425. _proto3.invalidate = function invalidate(soft) {
  2426. (!soft || !this.vars.runBackwards) && (this._startAt = 0);
  2427. this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;
  2428. this._ptLookup = [];
  2429. this.timeline && this.timeline.invalidate(soft);
  2430. return _Animation2.prototype.invalidate.call(this, soft);
  2431. };
  2432. _proto3.resetTo = function resetTo(property, value, start, startIsRelative) {
  2433. _tickerActive || _ticker.wake();
  2434. this._ts || this.play();
  2435. var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio;
  2436. this._initted || _initTween(this, time);
  2437. ratio = this._ease(time / this._dur);
  2438. if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time)) {
  2439. return this.resetTo(property, value, start, startIsRelative);
  2440. }
  2441. _alignPlayhead(this, 0);
  2442. this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0);
  2443. return this.render(0);
  2444. };
  2445. _proto3.kill = function kill(targets, vars) {
  2446. if (vars === void 0) {
  2447. vars = "all";
  2448. }
  2449. if (!targets && (!vars || vars === "all")) {
  2450. this._lazy = this._pt = 0;
  2451. return this.parent ? _interrupt(this) : this;
  2452. }
  2453. if (this.timeline) {
  2454. var tDur = this.timeline.totalDuration();
  2455. this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this);
  2456. this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1);
  2457. return this;
  2458. }
  2459. var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i;
  2460. if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) {
  2461. vars === "all" && (this._pt = 0);
  2462. return _interrupt(this);
  2463. }
  2464. overwrittenProps = this._op = this._op || [];
  2465. if (vars !== "all") {
  2466. if (_isString(vars)) {
  2467. p = {};
  2468. _forEachName(vars, function(name) {
  2469. return p[name] = 1;
  2470. });
  2471. vars = p;
  2472. }
  2473. vars = _addAliasesToVars(parsedTargets, vars);
  2474. }
  2475. i = parsedTargets.length;
  2476. while (i--) {
  2477. if (~killingTargets.indexOf(parsedTargets[i])) {
  2478. curLookup = propTweenLookup[i];
  2479. if (vars === "all") {
  2480. overwrittenProps[i] = vars;
  2481. props = curLookup;
  2482. curOverwriteProps = {};
  2483. } else {
  2484. curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};
  2485. props = vars;
  2486. }
  2487. for (p in props) {
  2488. pt = curLookup && curLookup[p];
  2489. if (pt) {
  2490. if (!("kill" in pt.d) || pt.d.kill(p) === true) {
  2491. _removeLinkedListItem(this, pt, "_pt");
  2492. }
  2493. delete curLookup[p];
  2494. }
  2495. if (curOverwriteProps !== "all") {
  2496. curOverwriteProps[p] = 1;
  2497. }
  2498. }
  2499. }
  2500. }
  2501. this._initted && !this._pt && firstPT && _interrupt(this);
  2502. return this;
  2503. };
  2504. Tween2.to = function to(targets, vars) {
  2505. return new Tween2(targets, vars, arguments[2]);
  2506. };
  2507. Tween2.from = function from(targets, vars) {
  2508. return _createTweenType(1, arguments);
  2509. };
  2510. Tween2.delayedCall = function delayedCall(delay, callback, params, scope) {
  2511. return new Tween2(callback, 0, {
  2512. immediateRender: false,
  2513. lazy: false,
  2514. overwrite: false,
  2515. delay,
  2516. onComplete: callback,
  2517. onReverseComplete: callback,
  2518. onCompleteParams: params,
  2519. onReverseCompleteParams: params,
  2520. callbackScope: scope
  2521. });
  2522. };
  2523. Tween2.fromTo = function fromTo(targets, fromVars, toVars) {
  2524. return _createTweenType(2, arguments);
  2525. };
  2526. Tween2.set = function set(targets, vars) {
  2527. vars.duration = 0;
  2528. vars.repeatDelay || (vars.repeat = 0);
  2529. return new Tween2(targets, vars);
  2530. };
  2531. Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
  2532. return _globalTimeline.killTweensOf(targets, props, onlyActive);
  2533. };
  2534. return Tween2;
  2535. }(Animation);
  2536. _setDefaults(Tween.prototype, {
  2537. _targets: [],
  2538. _lazy: 0,
  2539. _startAt: 0,
  2540. _op: 0,
  2541. _onInit: 0
  2542. });
  2543. _forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) {
  2544. Tween[name] = function() {
  2545. var tl = new Timeline(), params = _slice.call(arguments, 0);
  2546. params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0);
  2547. return tl[name].apply(tl, params);
  2548. };
  2549. });
  2550. var _setterPlain = function _setterPlain2(target, property, value) {
  2551. return target[property] = value;
  2552. };
  2553. var _setterFunc = function _setterFunc2(target, property, value) {
  2554. return target[property](value);
  2555. };
  2556. var _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) {
  2557. return target[property](data.fp, value);
  2558. };
  2559. var _setterAttribute = function _setterAttribute2(target, property, value) {
  2560. return target.setAttribute(property, value);
  2561. };
  2562. var _getSetter = function _getSetter2(target, property) {
  2563. return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;
  2564. };
  2565. var _renderPlain = function _renderPlain2(ratio, data) {
  2566. return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data);
  2567. };
  2568. var _renderBoolean = function _renderBoolean2(ratio, data) {
  2569. return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);
  2570. };
  2571. var _renderComplexString = function _renderComplexString2(ratio, data) {
  2572. var pt = data._pt, s = "";
  2573. if (!ratio && data.b) {
  2574. s = data.b;
  2575. } else if (ratio === 1 && data.e) {
  2576. s = data.e;
  2577. } else {
  2578. while (pt) {
  2579. s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s;
  2580. pt = pt._next;
  2581. }
  2582. s += data.c;
  2583. }
  2584. data.set(data.t, data.p, s, data);
  2585. };
  2586. var _renderPropTweens = function _renderPropTweens2(ratio, data) {
  2587. var pt = data._pt;
  2588. while (pt) {
  2589. pt.r(ratio, pt.d);
  2590. pt = pt._next;
  2591. }
  2592. };
  2593. var _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) {
  2594. var pt = this._pt, next;
  2595. while (pt) {
  2596. next = pt._next;
  2597. pt.p === property && pt.modifier(modifier, tween, target);
  2598. pt = next;
  2599. }
  2600. };
  2601. var _killPropTweensOf = function _killPropTweensOf2(property) {
  2602. var pt = this._pt, hasNonDependentRemaining, next;
  2603. while (pt) {
  2604. next = pt._next;
  2605. if (pt.p === property && !pt.op || pt.op === property) {
  2606. _removeLinkedListItem(this, pt, "_pt");
  2607. } else if (!pt.dep) {
  2608. hasNonDependentRemaining = 1;
  2609. }
  2610. pt = next;
  2611. }
  2612. return !hasNonDependentRemaining;
  2613. };
  2614. var _setterWithModifier = function _setterWithModifier2(target, property, value, data) {
  2615. data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);
  2616. };
  2617. var _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) {
  2618. var pt = parent._pt, next, pt2, first, last;
  2619. while (pt) {
  2620. next = pt._next;
  2621. pt2 = first;
  2622. while (pt2 && pt2.pr > pt.pr) {
  2623. pt2 = pt2._next;
  2624. }
  2625. if (pt._prev = pt2 ? pt2._prev : last) {
  2626. pt._prev._next = pt;
  2627. } else {
  2628. first = pt;
  2629. }
  2630. if (pt._next = pt2) {
  2631. pt2._prev = pt;
  2632. } else {
  2633. last = pt;
  2634. }
  2635. pt = next;
  2636. }
  2637. parent._pt = first;
  2638. };
  2639. var PropTween = function() {
  2640. function PropTween2(next, target, prop, start, change, renderer, data, setter, priority) {
  2641. this.t = target;
  2642. this.s = start;
  2643. this.c = change;
  2644. this.p = prop;
  2645. this.r = renderer || _renderPlain;
  2646. this.d = data || this;
  2647. this.set = setter || _setterPlain;
  2648. this.pr = priority || 0;
  2649. this._next = next;
  2650. if (next) {
  2651. next._prev = this;
  2652. }
  2653. }
  2654. var _proto4 = PropTween2.prototype;
  2655. _proto4.modifier = function modifier(func, tween, target) {
  2656. this.mSet = this.mSet || this.set;
  2657. this.set = _setterWithModifier;
  2658. this.m = func;
  2659. this.mt = target;
  2660. this.tween = tween;
  2661. };
  2662. return PropTween2;
  2663. }();
  2664. _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) {
  2665. return _reservedProps[name] = 1;
  2666. });
  2667. _globals.TweenMax = _globals.TweenLite = Tween;
  2668. _globals.TimelineLite = _globals.TimelineMax = Timeline;
  2669. _globalTimeline = new Timeline({
  2670. sortChildren: false,
  2671. defaults: _defaults,
  2672. autoRemoveChildren: true,
  2673. id: "root",
  2674. smoothChildTiming: true
  2675. });
  2676. _config.stringFilter = _colorStringFilter;
  2677. var _media = [];
  2678. var _listeners = {};
  2679. var _emptyArray = [];
  2680. var _lastMediaTime = 0;
  2681. var _dispatch = function _dispatch2(type) {
  2682. return (_listeners[type] || _emptyArray).map(function(f) {
  2683. return f();
  2684. });
  2685. };
  2686. var _onMediaChange = function _onMediaChange2() {
  2687. var time = Date.now(), matches = [];
  2688. if (time - _lastMediaTime > 2) {
  2689. _dispatch("matchMediaInit");
  2690. _media.forEach(function(c) {
  2691. var queries = c.queries, conditions = c.conditions, match, p, anyMatch, toggled;
  2692. for (p in queries) {
  2693. match = _win.matchMedia(queries[p]).matches;
  2694. match && (anyMatch = 1);
  2695. if (match !== conditions[p]) {
  2696. conditions[p] = match;
  2697. toggled = 1;
  2698. }
  2699. }
  2700. if (toggled) {
  2701. c.revert();
  2702. anyMatch && matches.push(c);
  2703. }
  2704. });
  2705. _dispatch("matchMediaRevert");
  2706. matches.forEach(function(c) {
  2707. return c.onMatch(c);
  2708. });
  2709. _lastMediaTime = time;
  2710. _dispatch("matchMedia");
  2711. }
  2712. };
  2713. var Context = function() {
  2714. function Context2(func, scope) {
  2715. this.selector = scope && selector(scope);
  2716. this.data = [];
  2717. this._r = [];
  2718. this.isReverted = false;
  2719. func && this.add(func);
  2720. }
  2721. var _proto5 = Context2.prototype;
  2722. _proto5.add = function add(name, func, scope) {
  2723. if (_isFunction(name)) {
  2724. scope = func;
  2725. func = name;
  2726. name = _isFunction;
  2727. }
  2728. var self = this, f = function f2() {
  2729. var prev = _context, prevSelector = self.selector, result;
  2730. prev && prev !== self && prev.data.push(self);
  2731. scope && (self.selector = selector(scope));
  2732. _context = self;
  2733. result = func.apply(self, arguments);
  2734. _isFunction(result) && self._r.push(result);
  2735. _context = prev;
  2736. self.selector = prevSelector;
  2737. self.isReverted = false;
  2738. return result;
  2739. };
  2740. self.last = f;
  2741. return name === _isFunction ? f(self) : name ? self[name] = f : f;
  2742. };
  2743. _proto5.ignore = function ignore(func) {
  2744. var prev = _context;
  2745. _context = null;
  2746. func(this);
  2747. _context = prev;
  2748. };
  2749. _proto5.getTweens = function getTweens() {
  2750. var a = [];
  2751. this.data.forEach(function(e) {
  2752. return e instanceof Context2 ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e);
  2753. });
  2754. return a;
  2755. };
  2756. _proto5.clear = function clear() {
  2757. this._r.length = this.data.length = 0;
  2758. };
  2759. _proto5.kill = function kill(revert, matchMedia2) {
  2760. var _this4 = this;
  2761. if (revert) {
  2762. var tweens = this.getTweens();
  2763. this.data.forEach(function(t) {
  2764. if (t.data === "isFlip") {
  2765. t.revert();
  2766. t.getChildren(true, true, false).forEach(function(tween) {
  2767. return tweens.splice(tweens.indexOf(tween), 1);
  2768. });
  2769. }
  2770. });
  2771. tweens.map(function(t) {
  2772. return {
  2773. g: t.globalTime(0),
  2774. t
  2775. };
  2776. }).sort(function(a, b) {
  2777. return b.g - a.g || -1;
  2778. }).forEach(function(o) {
  2779. return o.t.revert(revert);
  2780. });
  2781. this.data.forEach(function(e) {
  2782. return !(e instanceof Animation) && e.revert && e.revert(revert);
  2783. });
  2784. this._r.forEach(function(f) {
  2785. return f(revert, _this4);
  2786. });
  2787. this.isReverted = true;
  2788. } else {
  2789. this.data.forEach(function(e) {
  2790. return e.kill && e.kill();
  2791. });
  2792. }
  2793. this.clear();
  2794. if (matchMedia2) {
  2795. var i = _media.indexOf(this);
  2796. !!~i && _media.splice(i, 1);
  2797. }
  2798. };
  2799. _proto5.revert = function revert(config3) {
  2800. this.kill(config3 || {});
  2801. };
  2802. return Context2;
  2803. }();
  2804. var MatchMedia = function() {
  2805. function MatchMedia2(scope) {
  2806. this.contexts = [];
  2807. this.scope = scope;
  2808. }
  2809. var _proto6 = MatchMedia2.prototype;
  2810. _proto6.add = function add(conditions, func, scope) {
  2811. _isObject(conditions) || (conditions = {
  2812. matches: conditions
  2813. });
  2814. var context3 = new Context(0, scope || this.scope), cond = context3.conditions = {}, mq, p, active;
  2815. this.contexts.push(context3);
  2816. func = context3.add("onMatch", func);
  2817. context3.queries = conditions;
  2818. for (p in conditions) {
  2819. if (p === "all") {
  2820. active = 1;
  2821. } else {
  2822. mq = _win.matchMedia(conditions[p]);
  2823. if (mq) {
  2824. _media.indexOf(context3) < 0 && _media.push(context3);
  2825. (cond[p] = mq.matches) && (active = 1);
  2826. mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange);
  2827. }
  2828. }
  2829. }
  2830. active && func(context3);
  2831. return this;
  2832. };
  2833. _proto6.revert = function revert(config3) {
  2834. this.kill(config3 || {});
  2835. };
  2836. _proto6.kill = function kill(revert) {
  2837. this.contexts.forEach(function(c) {
  2838. return c.kill(revert, true);
  2839. });
  2840. };
  2841. return MatchMedia2;
  2842. }();
  2843. var _gsap = {
  2844. registerPlugin: function registerPlugin() {
  2845. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2846. args[_key2] = arguments[_key2];
  2847. }
  2848. args.forEach(function(config3) {
  2849. return _createPlugin(config3);
  2850. });
  2851. },
  2852. timeline: function timeline(vars) {
  2853. return new Timeline(vars);
  2854. },
  2855. getTweensOf: function getTweensOf(targets, onlyActive) {
  2856. return _globalTimeline.getTweensOf(targets, onlyActive);
  2857. },
  2858. getProperty: function getProperty(target, property, unit, uncache) {
  2859. _isString(target) && (target = toArray(target)[0]);
  2860. var getter = _getCache(target || {}).get, format = unit ? _passThrough : _numericIfPossible;
  2861. unit === "native" && (unit = "");
  2862. return !target ? target : !property ? function(property2, unit2, uncache2) {
  2863. return format((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit2, uncache2));
  2864. } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));
  2865. },
  2866. quickSetter: function quickSetter(target, property, unit) {
  2867. target = toArray(target);
  2868. if (target.length > 1) {
  2869. var setters = target.map(function(t) {
  2870. return gsap.quickSetter(t, property, unit);
  2871. }), l = setters.length;
  2872. return function(value) {
  2873. var i = l;
  2874. while (i--) {
  2875. setters[i](value);
  2876. }
  2877. };
  2878. }
  2879. target = target[0] || {};
  2880. var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) {
  2881. var p2 = new Plugin();
  2882. _quickTween._pt = 0;
  2883. p2.init(target, unit ? value + unit : value, _quickTween, 0, [target]);
  2884. p2.render(1, p2);
  2885. _quickTween._pt && _renderPropTweens(1, _quickTween);
  2886. } : cache.set(target, p);
  2887. return Plugin ? setter : function(value) {
  2888. return setter(target, p, unit ? value + unit : value, cache, 1);
  2889. };
  2890. },
  2891. quickTo: function quickTo(target, property, vars) {
  2892. var _merge22;
  2893. var tween = gsap.to(target, _merge((_merge22 = {}, _merge22[property] = "+=0.1", _merge22.paused = true, _merge22), vars || {})), func = function func2(value, start, startIsRelative) {
  2894. return tween.resetTo(property, value, start, startIsRelative);
  2895. };
  2896. func.tween = tween;
  2897. return func;
  2898. },
  2899. isTweening: function isTweening(targets) {
  2900. return _globalTimeline.getTweensOf(targets, true).length > 0;
  2901. },
  2902. defaults: function defaults(value) {
  2903. value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));
  2904. return _mergeDeep(_defaults, value || {});
  2905. },
  2906. config: function config2(value) {
  2907. return _mergeDeep(_config, value || {});
  2908. },
  2909. registerEffect: function registerEffect(_ref3) {
  2910. var name = _ref3.name, effect = _ref3.effect, plugins = _ref3.plugins, defaults2 = _ref3.defaults, extendTimeline = _ref3.extendTimeline;
  2911. (plugins || "").split(",").forEach(function(pluginName) {
  2912. return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin.");
  2913. });
  2914. _effects[name] = function(targets, vars, tl) {
  2915. return effect(toArray(targets), _setDefaults(vars || {}, defaults2), tl);
  2916. };
  2917. if (extendTimeline) {
  2918. Timeline.prototype[name] = function(targets, vars, position) {
  2919. return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);
  2920. };
  2921. }
  2922. },
  2923. registerEase: function registerEase(name, ease) {
  2924. _easeMap[name] = _parseEase(ease);
  2925. },
  2926. parseEase: function parseEase(ease, defaultEase) {
  2927. return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;
  2928. },
  2929. getById: function getById(id) {
  2930. return _globalTimeline.getById(id);
  2931. },
  2932. exportRoot: function exportRoot(vars, includeDelayedCalls) {
  2933. if (vars === void 0) {
  2934. vars = {};
  2935. }
  2936. var tl = new Timeline(vars), child, next;
  2937. tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);
  2938. _globalTimeline.remove(tl);
  2939. tl._dp = 0;
  2940. tl._time = tl._tTime = _globalTimeline._time;
  2941. child = _globalTimeline._first;
  2942. while (child) {
  2943. next = child._next;
  2944. if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {
  2945. _addToTimeline(tl, child, child._start - child._delay);
  2946. }
  2947. child = next;
  2948. }
  2949. _addToTimeline(_globalTimeline, tl, 0);
  2950. return tl;
  2951. },
  2952. context: function context(func, scope) {
  2953. return func ? new Context(func, scope) : _context;
  2954. },
  2955. matchMedia: function matchMedia(scope) {
  2956. return new MatchMedia(scope);
  2957. },
  2958. matchMediaRefresh: function matchMediaRefresh() {
  2959. return _media.forEach(function(c) {
  2960. var cond = c.conditions, found, p;
  2961. for (p in cond) {
  2962. if (cond[p]) {
  2963. cond[p] = false;
  2964. found = 1;
  2965. }
  2966. }
  2967. found && c.revert();
  2968. }) || _onMediaChange();
  2969. },
  2970. addEventListener: function addEventListener(type, callback) {
  2971. var a = _listeners[type] || (_listeners[type] = []);
  2972. ~a.indexOf(callback) || a.push(callback);
  2973. },
  2974. removeEventListener: function removeEventListener(type, callback) {
  2975. var a = _listeners[type], i = a && a.indexOf(callback);
  2976. i >= 0 && a.splice(i, 1);
  2977. },
  2978. utils: {
  2979. wrap,
  2980. wrapYoyo,
  2981. distribute,
  2982. random,
  2983. snap,
  2984. normalize,
  2985. getUnit,
  2986. clamp,
  2987. splitColor,
  2988. toArray,
  2989. selector,
  2990. mapRange,
  2991. pipe,
  2992. unitize,
  2993. interpolate,
  2994. shuffle
  2995. },
  2996. install: _install,
  2997. effects: _effects,
  2998. ticker: _ticker,
  2999. updateRoot: Timeline.updateRoot,
  3000. plugins: _plugins,
  3001. globalTimeline: _globalTimeline,
  3002. core: {
  3003. PropTween,
  3004. globals: _addGlobal,
  3005. Tween,
  3006. Timeline,
  3007. Animation,
  3008. getCache: _getCache,
  3009. _removeLinkedListItem,
  3010. reverting: function reverting() {
  3011. return _reverting;
  3012. },
  3013. context: function context2(toAdd) {
  3014. if (toAdd && _context) {
  3015. _context.data.push(toAdd);
  3016. toAdd._ctx = _context;
  3017. }
  3018. return _context;
  3019. },
  3020. suppressOverwrites: function suppressOverwrites(value) {
  3021. return _suppressOverwrites = value;
  3022. }
  3023. }
  3024. };
  3025. _forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) {
  3026. return _gsap[name] = Tween[name];
  3027. });
  3028. _ticker.add(Timeline.updateRoot);
  3029. _quickTween = _gsap.to({}, {
  3030. duration: 0
  3031. });
  3032. var _getPluginPropTween = function _getPluginPropTween2(plugin, prop) {
  3033. var pt = plugin._pt;
  3034. while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {
  3035. pt = pt._next;
  3036. }
  3037. return pt;
  3038. };
  3039. var _addModifiers = function _addModifiers2(tween, modifiers) {
  3040. var targets = tween._targets, p, i, pt;
  3041. for (p in modifiers) {
  3042. i = targets.length;
  3043. while (i--) {
  3044. pt = tween._ptLookup[i][p];
  3045. if (pt && (pt = pt.d)) {
  3046. if (pt._pt) {
  3047. pt = _getPluginPropTween(pt, p);
  3048. }
  3049. pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);
  3050. }
  3051. }
  3052. }
  3053. };
  3054. var _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) {
  3055. return {
  3056. name,
  3057. rawVars: 1,
  3058. //don't pre-process function-based values or "random()" strings.
  3059. init: function init4(target, vars, tween) {
  3060. tween._onInit = function(tween2) {
  3061. var temp, p;
  3062. if (_isString(vars)) {
  3063. temp = {};
  3064. _forEachName(vars, function(name2) {
  3065. return temp[name2] = 1;
  3066. });
  3067. vars = temp;
  3068. }
  3069. if (modifier) {
  3070. temp = {};
  3071. for (p in vars) {
  3072. temp[p] = modifier(vars[p]);
  3073. }
  3074. vars = temp;
  3075. }
  3076. _addModifiers(tween2, vars);
  3077. };
  3078. }
  3079. };
  3080. };
  3081. var gsap = _gsap.registerPlugin({
  3082. name: "attr",
  3083. init: function init(target, vars, tween, index, targets) {
  3084. var p, pt, v;
  3085. this.tween = tween;
  3086. for (p in vars) {
  3087. v = target.getAttribute(p) || "";
  3088. pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p);
  3089. pt.op = p;
  3090. pt.b = v;
  3091. this._props.push(p);
  3092. }
  3093. },
  3094. render: function render(ratio, data) {
  3095. var pt = data._pt;
  3096. while (pt) {
  3097. _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d);
  3098. pt = pt._next;
  3099. }
  3100. }
  3101. }, {
  3102. name: "endArray",
  3103. init: function init2(target, value) {
  3104. var i = value.length;
  3105. while (i--) {
  3106. this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);
  3107. }
  3108. }
  3109. }, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap;
  3110. Tween.version = Timeline.version = gsap.version = "3.11.5";
  3111. _coreReady = 1;
  3112. _windowExists() && _wake();
  3113. var Power0 = _easeMap.Power0;
  3114. var Power1 = _easeMap.Power1;
  3115. var Power2 = _easeMap.Power2;
  3116. var Power3 = _easeMap.Power3;
  3117. var Power4 = _easeMap.Power4;
  3118. var Linear = _easeMap.Linear;
  3119. var Quad = _easeMap.Quad;
  3120. var Cubic = _easeMap.Cubic;
  3121. var Quart = _easeMap.Quart;
  3122. var Quint = _easeMap.Quint;
  3123. var Strong = _easeMap.Strong;
  3124. var Elastic = _easeMap.Elastic;
  3125. var Back = _easeMap.Back;
  3126. var SteppedEase = _easeMap.SteppedEase;
  3127. var Bounce = _easeMap.Bounce;
  3128. var Sine = _easeMap.Sine;
  3129. var Expo = _easeMap.Expo;
  3130. var Circ = _easeMap.Circ;
  3131. // node_modules/.pnpm/gsap@3.11.5/node_modules/gsap/CSSPlugin.js
  3132. var _win2;
  3133. var _doc2;
  3134. var _docElement;
  3135. var _pluginInitted;
  3136. var _tempDiv;
  3137. var _tempDivStyler;
  3138. var _recentSetterPlugin;
  3139. var _reverting2;
  3140. var _windowExists3 = function _windowExists4() {
  3141. return typeof window !== "undefined";
  3142. };
  3143. var _transformProps = {};
  3144. var _RAD2DEG = 180 / Math.PI;
  3145. var _DEG2RAD = Math.PI / 180;
  3146. var _atan2 = Math.atan2;
  3147. var _bigNum2 = 1e8;
  3148. var _capsExp = /([A-Z])/g;
  3149. var _horizontalExp = /(left|right|width|margin|padding|x)/i;
  3150. var _complexExp = /[\s,\(]\S/;
  3151. var _propertyAliases = {
  3152. autoAlpha: "opacity,visibility",
  3153. scale: "scaleX,scaleY",
  3154. alpha: "opacity"
  3155. };
  3156. var _renderCSSProp = function _renderCSSProp2(ratio, data) {
  3157. return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
  3158. };
  3159. var _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) {
  3160. return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
  3161. };
  3162. var _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) {
  3163. return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
  3164. };
  3165. var _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) {
  3166. var value = data.s + data.c * ratio;
  3167. data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data);
  3168. };
  3169. var _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) {
  3170. return data.set(data.t, data.p, ratio ? data.e : data.b, data);
  3171. };
  3172. var _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) {
  3173. return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);
  3174. };
  3175. var _setterCSSStyle = function _setterCSSStyle2(target, property, value) {
  3176. return target.style[property] = value;
  3177. };
  3178. var _setterCSSProp = function _setterCSSProp2(target, property, value) {
  3179. return target.style.setProperty(property, value);
  3180. };
  3181. var _setterTransform = function _setterTransform2(target, property, value) {
  3182. return target._gsap[property] = value;
  3183. };
  3184. var _setterScale = function _setterScale2(target, property, value) {
  3185. return target._gsap.scaleX = target._gsap.scaleY = value;
  3186. };
  3187. var _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) {
  3188. var cache = target._gsap;
  3189. cache.scaleX = cache.scaleY = value;
  3190. cache.renderTransform(ratio, cache);
  3191. };
  3192. var _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) {
  3193. var cache = target._gsap;
  3194. cache[property] = value;
  3195. cache.renderTransform(ratio, cache);
  3196. };
  3197. var _transformProp = "transform";
  3198. var _transformOriginProp = _transformProp + "Origin";
  3199. var _saveStyle = function _saveStyle2(property, isNotCSS) {
  3200. var _this = this;
  3201. var target = this.target, style = target.style;
  3202. if (property in _transformProps) {
  3203. this.tfm = this.tfm || {};
  3204. if (property !== "transform") {
  3205. property = _propertyAliases[property] || property;
  3206. ~property.indexOf(",") ? property.split(",").forEach(function(a) {
  3207. return _this.tfm[a] = _get(target, a);
  3208. }) : this.tfm[property] = target._gsap.x ? target._gsap[property] : _get(target, property);
  3209. } else {
  3210. return _propertyAliases.transform.split(",").forEach(function(p) {
  3211. return _saveStyle2.call(_this, p, isNotCSS);
  3212. });
  3213. }
  3214. if (this.props.indexOf(_transformProp) >= 0) {
  3215. return;
  3216. }
  3217. if (target._gsap.svg) {
  3218. this.svgo = target.getAttribute("data-svg-origin");
  3219. this.props.push(_transformOriginProp, isNotCSS, "");
  3220. }
  3221. property = _transformProp;
  3222. }
  3223. (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);
  3224. };
  3225. var _removeIndependentTransforms = function _removeIndependentTransforms2(style) {
  3226. if (style.translate) {
  3227. style.removeProperty("translate");
  3228. style.removeProperty("scale");
  3229. style.removeProperty("rotate");
  3230. }
  3231. };
  3232. var _revertStyle = function _revertStyle2() {
  3233. var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p;
  3234. for (i = 0; i < props.length; i += 3) {
  3235. 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());
  3236. }
  3237. if (this.tfm) {
  3238. for (p in this.tfm) {
  3239. cache[p] = this.tfm[p];
  3240. }
  3241. if (cache.svg) {
  3242. cache.renderTransform();
  3243. target.setAttribute("data-svg-origin", this.svgo || "");
  3244. }
  3245. i = _reverting2();
  3246. if ((!i || !i.isStart) && !style[_transformProp]) {
  3247. _removeIndependentTransforms(style);
  3248. cache.uncache = 1;
  3249. }
  3250. }
  3251. };
  3252. var _getStyleSaver = function _getStyleSaver2(target, properties) {
  3253. var saver = {
  3254. target,
  3255. props: [],
  3256. revert: _revertStyle,
  3257. save: _saveStyle
  3258. };
  3259. target._gsap || gsap.core.getCache(target);
  3260. properties && properties.split(",").forEach(function(p) {
  3261. return saver.save(p);
  3262. });
  3263. return saver;
  3264. };
  3265. var _supports3D;
  3266. var _createElement = function _createElement2(type, ns) {
  3267. var e = _doc2.createElementNS ? _doc2.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc2.createElement(type);
  3268. return e.style ? e : _doc2.createElement(type);
  3269. };
  3270. var _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) {
  3271. var cs = getComputedStyle(target);
  3272. return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || "";
  3273. };
  3274. var _prefixes = "O,Moz,ms,Ms,Webkit".split(",");
  3275. var _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) {
  3276. var e = element || _tempDiv, s = e.style, i = 5;
  3277. if (property in s && !preferPrefix) {
  3278. return property;
  3279. }
  3280. property = property.charAt(0).toUpperCase() + property.substr(1);
  3281. while (i-- && !(_prefixes[i] + property in s)) {
  3282. }
  3283. return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property;
  3284. };
  3285. var _initCore = function _initCore2() {
  3286. if (_windowExists3() && window.document) {
  3287. _win2 = window;
  3288. _doc2 = _win2.document;
  3289. _docElement = _doc2.documentElement;
  3290. _tempDiv = _createElement("div") || {
  3291. style: {}
  3292. };
  3293. _tempDivStyler = _createElement("div");
  3294. _transformProp = _checkPropPrefix(_transformProp);
  3295. _transformOriginProp = _transformProp + "Origin";
  3296. _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0";
  3297. _supports3D = !!_checkPropPrefix("perspective");
  3298. _reverting2 = gsap.core.reverting;
  3299. _pluginInitted = 1;
  3300. }
  3301. };
  3302. var _getBBoxHack = function _getBBoxHack2(swapIfPossible) {
  3303. var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), oldParent = this.parentNode, oldSibling = this.nextSibling, oldCSS = this.style.cssText, bbox;
  3304. _docElement.appendChild(svg);
  3305. svg.appendChild(this);
  3306. this.style.display = "block";
  3307. if (swapIfPossible) {
  3308. try {
  3309. bbox = this.getBBox();
  3310. this._gsapBBox = this.getBBox;
  3311. this.getBBox = _getBBoxHack2;
  3312. } catch (e) {
  3313. }
  3314. } else if (this._gsapBBox) {
  3315. bbox = this._gsapBBox();
  3316. }
  3317. if (oldParent) {
  3318. if (oldSibling) {
  3319. oldParent.insertBefore(this, oldSibling);
  3320. } else {
  3321. oldParent.appendChild(this);
  3322. }
  3323. }
  3324. _docElement.removeChild(svg);
  3325. this.style.cssText = oldCSS;
  3326. return bbox;
  3327. };
  3328. var _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) {
  3329. var i = attributesArray.length;
  3330. while (i--) {
  3331. if (target.hasAttribute(attributesArray[i])) {
  3332. return target.getAttribute(attributesArray[i]);
  3333. }
  3334. }
  3335. };
  3336. var _getBBox = function _getBBox2(target) {
  3337. var bounds;
  3338. try {
  3339. bounds = target.getBBox();
  3340. } catch (error) {
  3341. bounds = _getBBoxHack.call(target, true);
  3342. }
  3343. bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true));
  3344. return bounds && !bounds.width && !bounds.x && !bounds.y ? {
  3345. x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0,
  3346. y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0,
  3347. width: 0,
  3348. height: 0
  3349. } : bounds;
  3350. };
  3351. var _isSVG = function _isSVG2(e) {
  3352. return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));
  3353. };
  3354. var _removeProperty = function _removeProperty2(target, property) {
  3355. if (property) {
  3356. var style = target.style;
  3357. if (property in _transformProps && property !== _transformOriginProp) {
  3358. property = _transformProp;
  3359. }
  3360. if (style.removeProperty) {
  3361. if (property.substr(0, 2) === "ms" || property.substr(0, 6) === "webkit") {
  3362. property = "-" + property;
  3363. }
  3364. style.removeProperty(property.replace(_capsExp, "-$1").toLowerCase());
  3365. } else {
  3366. style.removeAttribute(property);
  3367. }
  3368. }
  3369. };
  3370. var _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end, onlySetAtEnd) {
  3371. var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);
  3372. plugin._pt = pt;
  3373. pt.b = beginning;
  3374. pt.e = end;
  3375. plugin._props.push(property);
  3376. return pt;
  3377. };
  3378. var _nonConvertibleUnits = {
  3379. deg: 1,
  3380. rad: 1,
  3381. turn: 1
  3382. };
  3383. var _nonStandardLayouts = {
  3384. grid: 1,
  3385. flex: 1
  3386. };
  3387. var _convertToUnit = function _convertToUnit2(target, property, value, unit) {
  3388. var curValue = parseFloat(value) || 0, curUnit = (value + "").trim().substr((curValue + "").length) || "px", style = _tempDiv.style, horizontal = _horizontalExp.test(property), isRootSVG = target.tagName.toLowerCase() === "svg", measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), amount = 100, toPixels = unit === "px", toPercent = unit === "%", px, parent, cache, isSVG;
  3389. if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {
  3390. return curValue;
  3391. }
  3392. curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px"));
  3393. isSVG = target.getCTM && _isSVG(target);
  3394. if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) {
  3395. px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty];
  3396. return _round(toPercent ? curValue / px * amount : curValue / 100 * px);
  3397. }
  3398. style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit);
  3399. parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
  3400. if (isSVG) {
  3401. parent = (target.ownerSVGElement || {}).parentNode;
  3402. }
  3403. if (!parent || parent === _doc2 || !parent.appendChild) {
  3404. parent = _doc2.body;
  3405. }
  3406. cache = parent._gsap;
  3407. if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {
  3408. return _round(curValue / cache.width * amount);
  3409. } else {
  3410. (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position"));
  3411. parent === target && (style.position = "static");
  3412. parent.appendChild(_tempDiv);
  3413. px = _tempDiv[measureProperty];
  3414. parent.removeChild(_tempDiv);
  3415. style.position = "absolute";
  3416. if (horizontal && toPercent) {
  3417. cache = _getCache(parent);
  3418. cache.time = _ticker.time;
  3419. cache.width = parent[measureProperty];
  3420. }
  3421. }
  3422. return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);
  3423. };
  3424. var _get = function _get2(target, property, unit, uncache) {
  3425. var value;
  3426. _pluginInitted || _initCore();
  3427. if (property in _propertyAliases && property !== "transform") {
  3428. property = _propertyAliases[property];
  3429. if (~property.indexOf(",")) {
  3430. property = property.split(",")[0];
  3431. }
  3432. }
  3433. if (_transformProps[property] && property !== "transform") {
  3434. value = _parseTransform(target, uncache);
  3435. value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px";
  3436. } else {
  3437. value = target.style[property];
  3438. if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) {
  3439. value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0);
  3440. }
  3441. }
  3442. return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value;
  3443. };
  3444. var _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start, end) {
  3445. if (!start || start === "none") {
  3446. var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1);
  3447. if (s && s !== start) {
  3448. prop = p;
  3449. start = s;
  3450. } else if (prop === "borderColor") {
  3451. start = _getComputedProperty(target, "borderTopColor");
  3452. }
  3453. }
  3454. var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues;
  3455. pt.b = start;
  3456. pt.e = end;
  3457. start += "";
  3458. end += "";
  3459. if (end === "auto") {
  3460. target.style[prop] = end;
  3461. end = _getComputedProperty(target, prop) || end;
  3462. target.style[prop] = start;
  3463. }
  3464. a = [start, end];
  3465. _colorStringFilter(a);
  3466. start = a[0];
  3467. end = a[1];
  3468. startValues = start.match(_numWithUnitExp) || [];
  3469. endValues = end.match(_numWithUnitExp) || [];
  3470. if (endValues.length) {
  3471. while (result = _numWithUnitExp.exec(end)) {
  3472. endValue = result[0];
  3473. chunk = end.substring(index, result.index);
  3474. if (color) {
  3475. color = (color + 1) % 5;
  3476. } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") {
  3477. color = 1;
  3478. }
  3479. if (endValue !== (startValue = startValues[matchIndex++] || "")) {
  3480. startNum = parseFloat(startValue) || 0;
  3481. startUnit = startValue.substr((startNum + "").length);
  3482. endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit);
  3483. endNum = parseFloat(endValue);
  3484. endUnit = endValue.substr((endNum + "").length);
  3485. index = _numWithUnitExp.lastIndex - endUnit.length;
  3486. if (!endUnit) {
  3487. endUnit = endUnit || _config.units[prop] || startUnit;
  3488. if (index === end.length) {
  3489. end += endUnit;
  3490. pt.e += endUnit;
  3491. }
  3492. }
  3493. if (startUnit !== endUnit) {
  3494. startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;
  3495. }
  3496. pt._pt = {
  3497. _next: pt._pt,
  3498. p: chunk || matchIndex === 1 ? chunk : ",",
  3499. //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
  3500. s: startNum,
  3501. c: endNum - startNum,
  3502. m: color && color < 4 || prop === "zIndex" ? Math.round : 0
  3503. };
  3504. }
  3505. }
  3506. pt.c = index < end.length ? end.substring(index, end.length) : "";
  3507. } else {
  3508. pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;
  3509. }
  3510. _relExp.test(end) && (pt.e = 0);
  3511. this._pt = pt;
  3512. return pt;
  3513. };
  3514. var _keywordToPercent = {
  3515. top: "0%",
  3516. bottom: "100%",
  3517. left: "0%",
  3518. right: "100%",
  3519. center: "50%"
  3520. };
  3521. var _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) {
  3522. var split = value.split(" "), x = split[0], y = split[1] || "50%";
  3523. if (x === "top" || x === "bottom" || y === "left" || y === "right") {
  3524. value = x;
  3525. x = y;
  3526. y = value;
  3527. }
  3528. split[0] = _keywordToPercent[x] || x;
  3529. split[1] = _keywordToPercent[y] || y;
  3530. return split.join(" ");
  3531. };
  3532. var _renderClearProps = function _renderClearProps2(ratio, data) {
  3533. if (data.tween && data.tween._time === data.tween._dur) {
  3534. var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i;
  3535. if (props === "all" || props === true) {
  3536. style.cssText = "";
  3537. clearTransforms = 1;
  3538. } else {
  3539. props = props.split(",");
  3540. i = props.length;
  3541. while (--i > -1) {
  3542. prop = props[i];
  3543. if (_transformProps[prop]) {
  3544. clearTransforms = 1;
  3545. prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp;
  3546. }
  3547. _removeProperty(target, prop);
  3548. }
  3549. }
  3550. if (clearTransforms) {
  3551. _removeProperty(target, _transformProp);
  3552. if (cache) {
  3553. cache.svg && target.removeAttribute("transform");
  3554. _parseTransform(target, 1);
  3555. cache.uncache = 1;
  3556. _removeIndependentTransforms(style);
  3557. }
  3558. }
  3559. }
  3560. };
  3561. var _specialProps = {
  3562. clearProps: function clearProps(plugin, target, property, endValue, tween) {
  3563. if (tween.data !== "isFromStart") {
  3564. var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);
  3565. pt.u = endValue;
  3566. pt.pr = -10;
  3567. pt.tween = tween;
  3568. plugin._props.push(property);
  3569. return 1;
  3570. }
  3571. }
  3572. /* className feature (about 0.4kb gzipped).
  3573. , className(plugin, target, property, endValue, tween) {
  3574. let _renderClassName = (ratio, data) => {
  3575. data.css.render(ratio, data.css);
  3576. if (!ratio || ratio === 1) {
  3577. let inline = data.rmv,
  3578. target = data.t,
  3579. p;
  3580. target.setAttribute("class", ratio ? data.e : data.b);
  3581. for (p in inline) {
  3582. _removeProperty(target, p);
  3583. }
  3584. }
  3585. },
  3586. _getAllStyles = (target) => {
  3587. let styles = {},
  3588. computed = getComputedStyle(target),
  3589. p;
  3590. for (p in computed) {
  3591. if (isNaN(p) && p !== "cssText" && p !== "length") {
  3592. styles[p] = computed[p];
  3593. }
  3594. }
  3595. _setDefaults(styles, _parseTransform(target, 1));
  3596. return styles;
  3597. },
  3598. startClassList = target.getAttribute("class"),
  3599. style = target.style,
  3600. cssText = style.cssText,
  3601. cache = target._gsap,
  3602. classPT = cache.classPT,
  3603. inlineToRemoveAtEnd = {},
  3604. data = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== "=") ? endValue : startClassList.replace(new RegExp("(?:\\s|^)" + endValue.substr(2) + "(?![\\w-])"), "") + ((endValue.charAt(0) === "+") ? " " + endValue.substr(2) : "")},
  3605. changingVars = {},
  3606. startVars = _getAllStyles(target),
  3607. transformRelated = /(transform|perspective)/i,
  3608. endVars, p;
  3609. if (classPT) {
  3610. classPT.r(1, classPT.d);
  3611. _removeLinkedListItem(classPT.d.plugin, classPT, "_pt");
  3612. }
  3613. target.setAttribute("class", data.e);
  3614. endVars = _getAllStyles(target, true);
  3615. target.setAttribute("class", startClassList);
  3616. for (p in endVars) {
  3617. if (endVars[p] !== startVars[p] && !transformRelated.test(p)) {
  3618. changingVars[p] = endVars[p];
  3619. if (!style[p] && style[p] !== "0") {
  3620. inlineToRemoveAtEnd[p] = 1;
  3621. }
  3622. }
  3623. }
  3624. cache.classPT = plugin._pt = new PropTween(plugin._pt, target, "className", 0, 0, _renderClassName, data, 0, -11);
  3625. if (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://greensock.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.
  3626. style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).
  3627. }
  3628. _parseTransform(target, true); //to clear the caching of transforms
  3629. data.css = new gsap.plugins.css();
  3630. data.css.init(target, changingVars, tween);
  3631. plugin._props.push(...data.css._props);
  3632. return 1;
  3633. }
  3634. */
  3635. };
  3636. var _identity2DMatrix = [1, 0, 0, 1, 0, 0];
  3637. var _rotationalProperties = {};
  3638. var _isNullTransform = function _isNullTransform2(value) {
  3639. return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value;
  3640. };
  3641. var _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) {
  3642. var matrixString = _getComputedProperty(target, _transformProp);
  3643. return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);
  3644. };
  3645. var _getMatrix = function _getMatrix2(target, force2D) {
  3646. var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM;
  3647. if (cache.svg && target.getAttribute("transform")) {
  3648. temp = target.transform.baseVal.consolidate().matrix;
  3649. matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];
  3650. return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix;
  3651. } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {
  3652. temp = style.display;
  3653. style.display = "block";
  3654. parent = target.parentNode;
  3655. if (!parent || !target.offsetParent) {
  3656. addedToDOM = 1;
  3657. nextSibling = target.nextElementSibling;
  3658. _docElement.appendChild(target);
  3659. }
  3660. matrix = _getComputedTransformMatrixAsArray(target);
  3661. temp ? style.display = temp : _removeProperty(target, "display");
  3662. if (addedToDOM) {
  3663. nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);
  3664. }
  3665. }
  3666. return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;
  3667. };
  3668. var _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {
  3669. var cache = target._gsap, matrix = matrixArray || _getMatrix(target, true), xOriginOld = cache.xOrigin || 0, yOriginOld = cache.yOrigin || 0, xOffsetOld = cache.xOffset || 0, yOffsetOld = cache.yOffset || 0, a = matrix[0], b = matrix[1], c = matrix[2], d = matrix[3], tx = matrix[4], ty = matrix[5], originSplit = origin.split(" "), xOrigin = parseFloat(originSplit[0]) || 0, yOrigin = parseFloat(originSplit[1]) || 0, bounds, determinant, x, y;
  3670. if (!originIsAbsolute) {
  3671. bounds = _getBBox(target);
  3672. xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin);
  3673. yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin);
  3674. } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {
  3675. x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;
  3676. y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;
  3677. xOrigin = x;
  3678. yOrigin = y;
  3679. }
  3680. if (smooth || smooth !== false && cache.smooth) {
  3681. tx = xOrigin - xOriginOld;
  3682. ty = yOrigin - yOriginOld;
  3683. cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;
  3684. cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;
  3685. } else {
  3686. cache.xOffset = cache.yOffset = 0;
  3687. }
  3688. cache.xOrigin = xOrigin;
  3689. cache.yOrigin = yOrigin;
  3690. cache.smooth = !!smooth;
  3691. cache.origin = origin;
  3692. cache.originIsAbsolute = !!originIsAbsolute;
  3693. target.style[_transformOriginProp] = "0px 0px";
  3694. if (pluginToAddPropTweensTo) {
  3695. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin);
  3696. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin);
  3697. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset);
  3698. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset);
  3699. }
  3700. target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin);
  3701. };
  3702. var _parseTransform = function _parseTransform2(target, uncache) {
  3703. var cache = target._gsap || new GSCache(target);
  3704. if ("x" in cache && !uncache && !cache.uncache) {
  3705. return cache;
  3706. }
  3707. var style = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x, y, z, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY, perspective, xOrigin, yOrigin, matrix, angle, cos, sin, a, b, c, d, a12, a22, t1, t2, t3, a13, a23, a33, a42, a43, a32;
  3708. x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;
  3709. scaleX = scaleY = 1;
  3710. cache.svg = !!(target.getCTM && _isSVG(target));
  3711. if (cs.translate) {
  3712. if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") {
  3713. 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] : "");
  3714. }
  3715. style.scale = style.rotate = style.translate = "none";
  3716. }
  3717. matrix = _getMatrix(target, cache.svg);
  3718. if (cache.svg) {
  3719. if (cache.uncache) {
  3720. t2 = target.getBBox();
  3721. origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px";
  3722. t1 = "";
  3723. } else {
  3724. t1 = !uncache && target.getAttribute("data-svg-origin");
  3725. }
  3726. _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);
  3727. }
  3728. xOrigin = cache.xOrigin || 0;
  3729. yOrigin = cache.yOrigin || 0;
  3730. if (matrix !== _identity2DMatrix) {
  3731. a = matrix[0];
  3732. b = matrix[1];
  3733. c = matrix[2];
  3734. d = matrix[3];
  3735. x = a12 = matrix[4];
  3736. y = a22 = matrix[5];
  3737. if (matrix.length === 6) {
  3738. scaleX = Math.sqrt(a * a + b * b);
  3739. scaleY = Math.sqrt(d * d + c * c);
  3740. rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0;
  3741. skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;
  3742. skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));
  3743. if (cache.svg) {
  3744. x -= xOrigin - (xOrigin * a + yOrigin * c);
  3745. y -= yOrigin - (xOrigin * b + yOrigin * d);
  3746. }
  3747. } else {
  3748. a32 = matrix[6];
  3749. a42 = matrix[7];
  3750. a13 = matrix[8];
  3751. a23 = matrix[9];
  3752. a33 = matrix[10];
  3753. a43 = matrix[11];
  3754. x = matrix[12];
  3755. y = matrix[13];
  3756. z = matrix[14];
  3757. angle = _atan2(a32, a33);
  3758. rotationX = angle * _RAD2DEG;
  3759. if (angle) {
  3760. cos = Math.cos(-angle);
  3761. sin = Math.sin(-angle);
  3762. t1 = a12 * cos + a13 * sin;
  3763. t2 = a22 * cos + a23 * sin;
  3764. t3 = a32 * cos + a33 * sin;
  3765. a13 = a12 * -sin + a13 * cos;
  3766. a23 = a22 * -sin + a23 * cos;
  3767. a33 = a32 * -sin + a33 * cos;
  3768. a43 = a42 * -sin + a43 * cos;
  3769. a12 = t1;
  3770. a22 = t2;
  3771. a32 = t3;
  3772. }
  3773. angle = _atan2(-c, a33);
  3774. rotationY = angle * _RAD2DEG;
  3775. if (angle) {
  3776. cos = Math.cos(-angle);
  3777. sin = Math.sin(-angle);
  3778. t1 = a * cos - a13 * sin;
  3779. t2 = b * cos - a23 * sin;
  3780. t3 = c * cos - a33 * sin;
  3781. a43 = d * sin + a43 * cos;
  3782. a = t1;
  3783. b = t2;
  3784. c = t3;
  3785. }
  3786. angle = _atan2(b, a);
  3787. rotation = angle * _RAD2DEG;
  3788. if (angle) {
  3789. cos = Math.cos(angle);
  3790. sin = Math.sin(angle);
  3791. t1 = a * cos + b * sin;
  3792. t2 = a12 * cos + a22 * sin;
  3793. b = b * cos - a * sin;
  3794. a22 = a22 * cos - a12 * sin;
  3795. a = t1;
  3796. a12 = t2;
  3797. }
  3798. if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {
  3799. rotationX = rotation = 0;
  3800. rotationY = 180 - rotationY;
  3801. }
  3802. scaleX = _round(Math.sqrt(a * a + b * b + c * c));
  3803. scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));
  3804. angle = _atan2(a12, a22);
  3805. skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0;
  3806. perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;
  3807. }
  3808. if (cache.svg) {
  3809. t1 = target.getAttribute("transform");
  3810. cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp));
  3811. t1 && target.setAttribute("transform", t1);
  3812. }
  3813. }
  3814. if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
  3815. if (invertedScaleX) {
  3816. scaleX *= -1;
  3817. skewX += rotation <= 0 ? 180 : -180;
  3818. rotation += rotation <= 0 ? 180 : -180;
  3819. } else {
  3820. scaleY *= -1;
  3821. skewX += skewX <= 0 ? 180 : -180;
  3822. }
  3823. }
  3824. uncache = uncache || cache.uncache;
  3825. 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;
  3826. 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;
  3827. cache.z = z + px;
  3828. cache.scaleX = _round(scaleX);
  3829. cache.scaleY = _round(scaleY);
  3830. cache.rotation = _round(rotation) + deg;
  3831. cache.rotationX = _round(rotationX) + deg;
  3832. cache.rotationY = _round(rotationY) + deg;
  3833. cache.skewX = skewX + deg;
  3834. cache.skewY = skewY + deg;
  3835. cache.transformPerspective = perspective + px;
  3836. if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || 0) {
  3837. style[_transformOriginProp] = _firstTwoOnly(origin);
  3838. }
  3839. cache.xOffset = cache.yOffset = 0;
  3840. cache.force3D = _config.force3D;
  3841. cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;
  3842. cache.uncache = 0;
  3843. return cache;
  3844. };
  3845. var _firstTwoOnly = function _firstTwoOnly2(value) {
  3846. return (value = value.split(" "))[0] + " " + value[1];
  3847. };
  3848. var _addPxTranslate = function _addPxTranslate2(target, start, value) {
  3849. var unit = getUnit(start);
  3850. return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit;
  3851. };
  3852. var _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) {
  3853. cache.z = "0px";
  3854. cache.rotationY = cache.rotationX = "0deg";
  3855. cache.force3D = 0;
  3856. _renderCSSTransforms(ratio, cache);
  3857. };
  3858. var _zeroDeg = "0deg";
  3859. var _zeroPx = "0px";
  3860. var _endParenthesis = ") ";
  3861. var _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) {
  3862. var _ref = cache || this, xPercent = _ref.xPercent, yPercent = _ref.yPercent, x = _ref.x, y = _ref.y, z = _ref.z, rotation = _ref.rotation, rotationY = _ref.rotationY, rotationX = _ref.rotationX, skewX = _ref.skewX, skewY = _ref.skewY, scaleX = _ref.scaleX, scaleY = _ref.scaleY, transformPerspective = _ref.transformPerspective, force3D = _ref.force3D, target = _ref.target, zOrigin = _ref.zOrigin, transforms = "", use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true;
  3863. if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {
  3864. var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos;
  3865. angle = parseFloat(rotationX) * _DEG2RAD;
  3866. cos = Math.cos(angle);
  3867. x = _addPxTranslate(target, x, a13 * cos * -zOrigin);
  3868. y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);
  3869. z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);
  3870. }
  3871. if (transformPerspective !== _zeroPx) {
  3872. transforms += "perspective(" + transformPerspective + _endParenthesis;
  3873. }
  3874. if (xPercent || yPercent) {
  3875. transforms += "translate(" + xPercent + "%, " + yPercent + "%) ";
  3876. }
  3877. if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {
  3878. transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis;
  3879. }
  3880. if (rotation !== _zeroDeg) {
  3881. transforms += "rotate(" + rotation + _endParenthesis;
  3882. }
  3883. if (rotationY !== _zeroDeg) {
  3884. transforms += "rotateY(" + rotationY + _endParenthesis;
  3885. }
  3886. if (rotationX !== _zeroDeg) {
  3887. transforms += "rotateX(" + rotationX + _endParenthesis;
  3888. }
  3889. if (skewX !== _zeroDeg || skewY !== _zeroDeg) {
  3890. transforms += "skew(" + skewX + ", " + skewY + _endParenthesis;
  3891. }
  3892. if (scaleX !== 1 || scaleY !== 1) {
  3893. transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis;
  3894. }
  3895. target.style[_transformProp] = transforms || "translate(0, 0)";
  3896. };
  3897. var _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) {
  3898. var _ref2 = cache || this, xPercent = _ref2.xPercent, yPercent = _ref2.yPercent, x = _ref2.x, y = _ref2.y, rotation = _ref2.rotation, skewX = _ref2.skewX, skewY = _ref2.skewY, scaleX = _ref2.scaleX, scaleY = _ref2.scaleY, target = _ref2.target, xOrigin = _ref2.xOrigin, yOrigin = _ref2.yOrigin, xOffset = _ref2.xOffset, yOffset = _ref2.yOffset, forceCSS = _ref2.forceCSS, tx = parseFloat(x), ty = parseFloat(y), a11, a21, a12, a22, temp;
  3899. rotation = parseFloat(rotation);
  3900. skewX = parseFloat(skewX);
  3901. skewY = parseFloat(skewY);
  3902. if (skewY) {
  3903. skewY = parseFloat(skewY);
  3904. skewX += skewY;
  3905. rotation += skewY;
  3906. }
  3907. if (rotation || skewX) {
  3908. rotation *= _DEG2RAD;
  3909. skewX *= _DEG2RAD;
  3910. a11 = Math.cos(rotation) * scaleX;
  3911. a21 = Math.sin(rotation) * scaleX;
  3912. a12 = Math.sin(rotation - skewX) * -scaleY;
  3913. a22 = Math.cos(rotation - skewX) * scaleY;
  3914. if (skewX) {
  3915. skewY *= _DEG2RAD;
  3916. temp = Math.tan(skewX - skewY);
  3917. temp = Math.sqrt(1 + temp * temp);
  3918. a12 *= temp;
  3919. a22 *= temp;
  3920. if (skewY) {
  3921. temp = Math.tan(skewY);
  3922. temp = Math.sqrt(1 + temp * temp);
  3923. a11 *= temp;
  3924. a21 *= temp;
  3925. }
  3926. }
  3927. a11 = _round(a11);
  3928. a21 = _round(a21);
  3929. a12 = _round(a12);
  3930. a22 = _round(a22);
  3931. } else {
  3932. a11 = scaleX;
  3933. a22 = scaleY;
  3934. a21 = a12 = 0;
  3935. }
  3936. if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) {
  3937. tx = _convertToUnit(target, "x", x, "px");
  3938. ty = _convertToUnit(target, "y", y, "px");
  3939. }
  3940. if (xOrigin || yOrigin || xOffset || yOffset) {
  3941. tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);
  3942. ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);
  3943. }
  3944. if (xPercent || yPercent) {
  3945. temp = target.getBBox();
  3946. tx = _round(tx + xPercent / 100 * temp.width);
  3947. ty = _round(ty + yPercent / 100 * temp.height);
  3948. }
  3949. temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")";
  3950. target.setAttribute("transform", temp);
  3951. forceCSS && (target.style[_transformProp] = temp);
  3952. };
  3953. var _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) {
  3954. var cap = 360, isString = _isString(endValue), endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt;
  3955. if (isString) {
  3956. direction = endValue.split("_")[1];
  3957. if (direction === "short") {
  3958. change %= cap;
  3959. if (change !== change % (cap / 2)) {
  3960. change += change < 0 ? cap : -cap;
  3961. }
  3962. }
  3963. if (direction === "cw" && change < 0) {
  3964. change = (change + cap * _bigNum2) % cap - ~~(change / cap) * cap;
  3965. } else if (direction === "ccw" && change > 0) {
  3966. change = (change - cap * _bigNum2) % cap - ~~(change / cap) * cap;
  3967. }
  3968. }
  3969. plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);
  3970. pt.e = finalValue;
  3971. pt.u = "deg";
  3972. plugin._props.push(property);
  3973. return pt;
  3974. };
  3975. var _assign = function _assign2(target, source) {
  3976. for (var p in source) {
  3977. target[p] = source[p];
  3978. }
  3979. return target;
  3980. };
  3981. var _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) {
  3982. var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit;
  3983. if (startCache.svg) {
  3984. startValue = target.getAttribute("transform");
  3985. target.setAttribute("transform", "");
  3986. style[_transformProp] = transforms;
  3987. endCache = _parseTransform(target, 1);
  3988. _removeProperty(target, _transformProp);
  3989. target.setAttribute("transform", startValue);
  3990. } else {
  3991. startValue = getComputedStyle(target)[_transformProp];
  3992. style[_transformProp] = transforms;
  3993. endCache = _parseTransform(target, 1);
  3994. style[_transformProp] = startValue;
  3995. }
  3996. for (p in _transformProps) {
  3997. startValue = startCache[p];
  3998. endValue = endCache[p];
  3999. if (startValue !== endValue && exclude.indexOf(p) < 0) {
  4000. startUnit = getUnit(startValue);
  4001. endUnit = getUnit(endValue);
  4002. startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);
  4003. endNum = parseFloat(endValue);
  4004. plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);
  4005. plugin._pt.u = endUnit || 0;
  4006. plugin._props.push(p);
  4007. }
  4008. }
  4009. _assign(endCache, startCache);
  4010. };
  4011. _forEachName("padding,margin,Width,Radius", function(name, index) {
  4012. var t = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function(side) {
  4013. return index < 2 ? name + side : "border" + side + name;
  4014. });
  4015. _specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) {
  4016. var a, vars;
  4017. if (arguments.length < 4) {
  4018. a = props.map(function(prop) {
  4019. return _get(plugin, prop, property);
  4020. });
  4021. vars = a.join(" ");
  4022. return vars.split(a[0]).length === 5 ? a[0] : vars;
  4023. }
  4024. a = (endValue + "").split(" ");
  4025. vars = {};
  4026. props.forEach(function(prop, i) {
  4027. return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];
  4028. });
  4029. plugin.init(target, vars, tween);
  4030. };
  4031. });
  4032. var CSSPlugin = {
  4033. name: "css",
  4034. register: _initCore,
  4035. targetTest: function targetTest(target) {
  4036. return target.style && target.nodeType;
  4037. },
  4038. init: function init3(target, vars, tween, index, targets) {
  4039. var props = this._props, style = target.style, startAt = tween.vars.startAt, startValue, endValue, endNum, startNum, type, specialProp, p, startUnit, endUnit, relative, isTransformRelated, transformPropTween, cache, smooth, hasPriority, inlineProps;
  4040. _pluginInitted || _initCore();
  4041. this.styles = this.styles || _getStyleSaver(target);
  4042. inlineProps = this.styles.props;
  4043. this.tween = tween;
  4044. for (p in vars) {
  4045. if (p === "autoRound") {
  4046. continue;
  4047. }
  4048. endValue = vars[p];
  4049. if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {
  4050. continue;
  4051. }
  4052. type = typeof endValue;
  4053. specialProp = _specialProps[p];
  4054. if (type === "function") {
  4055. endValue = endValue.call(tween, index, target, targets);
  4056. type = typeof endValue;
  4057. }
  4058. if (type === "string" && ~endValue.indexOf("random(")) {
  4059. endValue = _replaceRandom(endValue);
  4060. }
  4061. if (specialProp) {
  4062. specialProp(this, target, p, endValue, tween) && (hasPriority = 1);
  4063. } else if (p.substr(0, 2) === "--") {
  4064. startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim();
  4065. endValue += "";
  4066. _colorExp.lastIndex = 0;
  4067. if (!_colorExp.test(startValue)) {
  4068. startUnit = getUnit(startValue);
  4069. endUnit = getUnit(endValue);
  4070. }
  4071. endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);
  4072. this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p);
  4073. props.push(p);
  4074. inlineProps.push(p, 0, style[p]);
  4075. } else if (type !== "undefined") {
  4076. if (startAt && p in startAt) {
  4077. startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p];
  4078. _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue));
  4079. getUnit(startValue + "") || (startValue += _config.units[p] || getUnit(_get(target, p)) || "");
  4080. (startValue + "").charAt(1) === "=" && (startValue = _get(target, p));
  4081. } else {
  4082. startValue = _get(target, p);
  4083. }
  4084. startNum = parseFloat(startValue);
  4085. relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2);
  4086. relative && (endValue = endValue.substr(2));
  4087. endNum = parseFloat(endValue);
  4088. if (p in _propertyAliases) {
  4089. if (p === "autoAlpha") {
  4090. if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) {
  4091. startNum = 0;
  4092. }
  4093. inlineProps.push("visibility", 0, style.visibility);
  4094. _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum);
  4095. }
  4096. if (p !== "scale" && p !== "transform") {
  4097. p = _propertyAliases[p];
  4098. ~p.indexOf(",") && (p = p.split(",")[0]);
  4099. }
  4100. }
  4101. isTransformRelated = p in _transformProps;
  4102. if (isTransformRelated) {
  4103. this.styles.save(p);
  4104. if (!transformPropTween) {
  4105. cache = target._gsap;
  4106. cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform);
  4107. smooth = vars.smoothOrigin !== false && cache.smooth;
  4108. transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1);
  4109. transformPropTween.dep = 1;
  4110. }
  4111. if (p === "scale") {
  4112. this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);
  4113. this._pt.u = 0;
  4114. props.push("scaleY", p);
  4115. p += "X";
  4116. } else if (p === "transformOrigin") {
  4117. inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);
  4118. endValue = _convertKeywordsToPercentages(endValue);
  4119. if (cache.svg) {
  4120. _applySVGOrigin(target, endValue, 0, smooth, 0, this);
  4121. } else {
  4122. endUnit = parseFloat(endValue.split(" ")[2]) || 0;
  4123. endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit);
  4124. _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));
  4125. }
  4126. continue;
  4127. } else if (p === "svgOrigin") {
  4128. _applySVGOrigin(target, endValue, 1, smooth, 0, this);
  4129. continue;
  4130. } else if (p in _rotationalProperties) {
  4131. _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);
  4132. continue;
  4133. } else if (p === "smoothOrigin") {
  4134. _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue);
  4135. continue;
  4136. } else if (p === "force3D") {
  4137. cache[p] = endValue;
  4138. continue;
  4139. } else if (p === "transform") {
  4140. _addRawTransformPTs(this, endValue, target);
  4141. continue;
  4142. }
  4143. } else if (!(p in style)) {
  4144. p = _checkPropPrefix(p) || p;
  4145. }
  4146. if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {
  4147. startUnit = (startValue + "").substr((startNum + "").length);
  4148. endNum || (endNum = 0);
  4149. endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);
  4150. startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));
  4151. 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);
  4152. this._pt.u = endUnit || 0;
  4153. if (startUnit !== endUnit && endUnit !== "%") {
  4154. this._pt.b = startValue;
  4155. this._pt.r = _renderCSSPropWithBeginning;
  4156. }
  4157. } else if (!(p in style)) {
  4158. if (p in target) {
  4159. this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);
  4160. } else if (p !== "parseTransform") {
  4161. _missingPlugin(p, endValue);
  4162. continue;
  4163. }
  4164. } else {
  4165. _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);
  4166. }
  4167. isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : inlineProps.push(p, 1, startValue || target[p]));
  4168. props.push(p);
  4169. }
  4170. }
  4171. hasPriority && _sortPropTweensByPriority(this);
  4172. },
  4173. render: function render2(ratio, data) {
  4174. if (data.tween._time || !_reverting2()) {
  4175. var pt = data._pt;
  4176. while (pt) {
  4177. pt.r(ratio, pt.d);
  4178. pt = pt._next;
  4179. }
  4180. } else {
  4181. data.styles.revert();
  4182. }
  4183. },
  4184. get: _get,
  4185. aliases: _propertyAliases,
  4186. getSetter: function getSetter(target, property, plugin) {
  4187. var p = _propertyAliases[property];
  4188. p && p.indexOf(",") < 0 && (property = p);
  4189. 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);
  4190. },
  4191. core: {
  4192. _removeProperty,
  4193. _getMatrix
  4194. }
  4195. };
  4196. gsap.utils.checkPrefix = _checkPropPrefix;
  4197. gsap.core.getStyleSaver = _getStyleSaver;
  4198. (function(positionAndScale, rotation, others, aliases) {
  4199. var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) {
  4200. _transformProps[name] = 1;
  4201. });
  4202. _forEachName(rotation, function(name) {
  4203. _config.units[name] = "deg";
  4204. _rotationalProperties[name] = 1;
  4205. });
  4206. _propertyAliases[all[13]] = positionAndScale + "," + rotation;
  4207. _forEachName(aliases, function(name) {
  4208. var split = name.split(":");
  4209. _propertyAliases[split[1]] = all[split[0]];
  4210. });
  4211. })("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");
  4212. _forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) {
  4213. _config.units[name] = "px";
  4214. });
  4215. gsap.registerPlugin(CSSPlugin);
  4216. // node_modules/.pnpm/gsap@3.11.5/node_modules/gsap/index.js
  4217. var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap;
  4218. var TweenMaxWithCSS = gsapWithCSS.core.Tween;
  4219. export {
  4220. Back,
  4221. Bounce,
  4222. CSSPlugin,
  4223. Circ,
  4224. Cubic,
  4225. Elastic,
  4226. Expo,
  4227. Linear,
  4228. Power0,
  4229. Power1,
  4230. Power2,
  4231. Power3,
  4232. Power4,
  4233. Quad,
  4234. Quart,
  4235. Quint,
  4236. Sine,
  4237. SteppedEase,
  4238. Strong,
  4239. Timeline as TimelineLite,
  4240. Timeline as TimelineMax,
  4241. Tween as TweenLite,
  4242. TweenMaxWithCSS as TweenMax,
  4243. gsapWithCSS as default,
  4244. gsapWithCSS as gsap
  4245. };
  4246. /*! Bundled license information:
  4247. gsap/gsap-core.js:
  4248. (*!
  4249. * GSAP 3.11.5
  4250. * https://greensock.com
  4251. *
  4252. * @license Copyright 2008-2023, GreenSock. All rights reserved.
  4253. * Subject to the terms at https://greensock.com/standard-license or for
  4254. * Club GreenSock members, the agreement issued with that membership.
  4255. * @author: Jack Doyle, jack@greensock.com
  4256. *)
  4257. gsap/CSSPlugin.js:
  4258. (*!
  4259. * CSSPlugin 3.11.5
  4260. * https://greensock.com
  4261. *
  4262. * Copyright 2008-2023, GreenSock. All rights reserved.
  4263. * Subject to the terms at https://greensock.com/standard-license or for
  4264. * Club GreenSock members, the agreement issued with that membership.
  4265. * @author: Jack Doyle, jack@greensock.com
  4266. *)
  4267. */
  4268. //# sourceMappingURL=gsap.js.map