@jbpark/ui-kit 2.4.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/Menu.d.mts +2 -2
  2. package/dist/Menu.d.mts.map +1 -1
  3. package/dist/Menu.mjs +4 -4
  4. package/dist/Menu.mjs.map +1 -1
  5. package/dist/components/atoms/Button/index.mjs +3 -3
  6. package/dist/components/atoms/Button/index.mjs.map +1 -1
  7. package/dist/components/atoms/Checkbox/index.mjs +3 -3
  8. package/dist/components/atoms/Checkbox/index.mjs.map +1 -1
  9. package/dist/components/atoms/Radio/index.mjs +2 -2
  10. package/dist/components/atoms/Switch/index.d.mts.map +1 -1
  11. package/dist/components/atoms/Switch/index.mjs +16 -15
  12. package/dist/components/atoms/Switch/index.mjs.map +1 -1
  13. package/dist/components/molecules/Marquees/Item/index.mjs +2 -2
  14. package/dist/components/molecules/Marquees/Item/index.mjs.map +1 -1
  15. package/dist/components/molecules/Space/index.mjs +2 -2
  16. package/dist/components/molecules/Space/index.mjs.map +1 -1
  17. package/dist/components/molecules/Splitter/index.d.mts +31 -0
  18. package/dist/components/molecules/Splitter/index.d.mts.map +1 -0
  19. package/dist/components/molecules/Splitter/index.mjs +37 -0
  20. package/dist/components/molecules/Splitter/index.mjs.map +1 -0
  21. package/dist/components/molecules/index.d.mts +1 -0
  22. package/dist/components/molecules/index.mjs +1 -0
  23. package/dist/components/organisms/Drawer/index.d.mts +7 -2
  24. package/dist/components/organisms/Drawer/index.d.mts.map +1 -1
  25. package/dist/components/organisms/Drawer/index.mjs +46 -22
  26. package/dist/components/organisms/Drawer/index.mjs.map +1 -1
  27. package/dist/components/organisms/Modal/index.mjs +3 -3
  28. package/dist/components/organisms/Modal/index.mjs.map +1 -1
  29. package/dist/components/organisms/index.d.mts +1 -1
  30. package/dist/components/templates/Layout/Content/index.d.mts +7 -1
  31. package/dist/components/templates/Layout/Content/index.d.mts.map +1 -0
  32. package/dist/components/templates/Layout/Content/index.mjs +2 -2
  33. package/dist/components/templates/Layout/Content/index.mjs.map +1 -1
  34. package/dist/components/templates/Layout/Footer/index.d.mts +7 -1
  35. package/dist/components/templates/Layout/Footer/index.d.mts.map +1 -0
  36. package/dist/components/templates/Layout/Footer/index.mjs +2 -2
  37. package/dist/components/templates/Layout/Footer/index.mjs.map +1 -1
  38. package/dist/components/templates/Layout/Header/index.d.mts +1 -1
  39. package/dist/components/templates/Layout/Header/index.mjs +2 -2
  40. package/dist/components/templates/Layout/Header/index.mjs.map +1 -1
  41. package/dist/components/templates/Layout/Sider/index.d.mts +19 -1
  42. package/dist/components/templates/Layout/Sider/index.d.mts.map +1 -0
  43. package/dist/components/templates/Layout/Sider/index.mjs +32 -5
  44. package/dist/components/templates/Layout/Sider/index.mjs.map +1 -1
  45. package/dist/components/templates/Layout/index.d.mts +18 -8
  46. package/dist/components/templates/Layout/index.d.mts.map +1 -1
  47. package/dist/components/templates/Layout/index.mjs +3 -1
  48. package/dist/components/templates/Layout/index.mjs.map +1 -1
  49. package/dist/core/resizable.d.mts +24 -0
  50. package/dist/core/resizable.d.mts.map +1 -0
  51. package/dist/core/resizable.mjs +52 -0
  52. package/dist/core/resizable.mjs.map +1 -0
  53. package/dist/core.d.mts +2 -1
  54. package/dist/core.mjs +2 -1
  55. package/dist/index.d.mts +7 -2
  56. package/dist/index.mjs +5 -1
  57. package/dist/providers/Config/context.d.mts +8 -0
  58. package/dist/providers/Config/context.d.mts.map +1 -0
  59. package/dist/providers/Config/context.mjs +11 -0
  60. package/dist/providers/Config/context.mjs.map +1 -0
  61. package/dist/providers/Config/index.d.mts +18 -0
  62. package/dist/providers/Config/index.d.mts.map +1 -0
  63. package/dist/providers/Config/index.mjs +67 -0
  64. package/dist/providers/Config/index.mjs.map +1 -0
  65. package/dist/providers/Config/types.d.mts +32 -0
  66. package/dist/providers/Config/types.d.mts.map +1 -0
  67. package/dist/providers/index.d.mts +3 -0
  68. package/dist/providers/index.mjs +4 -0
  69. package/dist/style.css +218 -56
  70. package/dist/utils.d.mts +2 -2
  71. package/dist/utils.d.mts.map +1 -1
  72. package/dist/utils.mjs +4 -4
  73. package/dist/utils.mjs.map +1 -1
  74. package/package.json +15 -11
  75. package/dist/node_modules/gsap/CSSPlugin.mjs +0 -920
  76. package/dist/node_modules/gsap/CSSPlugin.mjs.map +0 -1
  77. package/dist/node_modules/gsap/gsap-core.mjs +0 -2723
  78. package/dist/node_modules/gsap/gsap-core.mjs.map +0 -1
  79. package/dist/node_modules/gsap/index.mjs +0 -9
  80. package/dist/node_modules/gsap/index.mjs.map +0 -1
@@ -1,920 +0,0 @@
1
- import { GSCache, PropTween, _checkPlugin, _colorExp, _colorStringFilter, _config, _forEachName, _getCache, _getProperty, _getSetter, _isString, _isUndefined, _missingPlugin, _numExp, _numWithUnitExp, _parseRelative, _plugins, _relExp, _renderComplexString, _replaceRandom, _round, _sortPropTweensByPriority, _ticker, getUnit, gsap } from "./gsap-core.mjs";
2
-
3
- //#region ../../node_modules/gsap/CSSPlugin.js
4
- /*!
5
- * CSSPlugin 3.14.2
6
- * https://gsap.com
7
- *
8
- * Copyright 2008-2025, GreenSock. All rights reserved.
9
- * Subject to the terms at https://gsap.com/standard-license
10
- * @author: Jack Doyle, jack@greensock.com
11
- */
12
- var _win, _doc, _docElement, _pluginInitted, _tempDiv, _recentSetterPlugin, _reverting, _windowExists = function _windowExists() {
13
- return typeof window !== "undefined";
14
- }, _transformProps = {}, _RAD2DEG = 180 / Math.PI, _DEG2RAD = Math.PI / 180, _atan2 = Math.atan2, _bigNum = 1e8, _capsExp = /([A-Z])/g, _horizontalExp = /(left|right|width|margin|padding|x)/i, _complexExp = /[\s,\(]\S/, _propertyAliases = {
15
- autoAlpha: "opacity,visibility",
16
- scale: "scaleX,scaleY",
17
- alpha: "opacity"
18
- }, _renderCSSProp = function _renderCSSProp(ratio, data) {
19
- return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
20
- }, _renderPropWithEnd = function _renderPropWithEnd(ratio, data) {
21
- return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
22
- }, _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) {
23
- return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
24
- }, _renderCSSPropWithBeginningAndEnd = function _renderCSSPropWithBeginningAndEnd(ratio, data) {
25
- return data.set(data.t, data.p, ratio === 1 ? data.e : ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
26
- }, _renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) {
27
- var value = data.s + data.c * ratio;
28
- data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data);
29
- }, _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) {
30
- return data.set(data.t, data.p, ratio ? data.e : data.b, data);
31
- }, _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) {
32
- return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);
33
- }, _setterCSSStyle = function _setterCSSStyle(target, property, value) {
34
- return target.style[property] = value;
35
- }, _setterCSSProp = function _setterCSSProp(target, property, value) {
36
- return target.style.setProperty(property, value);
37
- }, _setterTransform = function _setterTransform(target, property, value) {
38
- return target._gsap[property] = value;
39
- }, _setterScale = function _setterScale(target, property, value) {
40
- return target._gsap.scaleX = target._gsap.scaleY = value;
41
- }, _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) {
42
- var cache = target._gsap;
43
- cache.scaleX = cache.scaleY = value;
44
- cache.renderTransform(ratio, cache);
45
- }, _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) {
46
- var cache = target._gsap;
47
- cache[property] = value;
48
- cache.renderTransform(ratio, cache);
49
- }, _transformProp = "transform", _transformOriginProp = _transformProp + "Origin", _saveStyle = function _saveStyle(property, isNotCSS) {
50
- var _this = this;
51
- var target = this.target, style = target.style, cache = target._gsap;
52
- if (property in _transformProps && style) {
53
- this.tfm = this.tfm || {};
54
- if (property !== "transform") {
55
- property = _propertyAliases[property] || property;
56
- ~property.indexOf(",") ? property.split(",").forEach(function(a) {
57
- return _this.tfm[a] = _get(target, a);
58
- }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property);
59
- property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);
60
- } else return _propertyAliases.transform.split(",").forEach(function(p) {
61
- return _saveStyle.call(_this, p, isNotCSS);
62
- });
63
- if (this.props.indexOf(_transformProp) >= 0) return;
64
- if (cache.svg) {
65
- this.svgo = target.getAttribute("data-svg-origin");
66
- this.props.push(_transformOriginProp, isNotCSS, "");
67
- }
68
- property = _transformProp;
69
- }
70
- (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);
71
- }, _removeIndependentTransforms = function _removeIndependentTransforms(style) {
72
- if (style.translate) {
73
- style.removeProperty("translate");
74
- style.removeProperty("scale");
75
- style.removeProperty("rotate");
76
- }
77
- }, _revertStyle = function _revertStyle() {
78
- var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p;
79
- for (i = 0; i < props.length; i += 3) if (!props[i + 1]) props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === "--" ? props[i] : props[i].replace(_capsExp, "-$1").toLowerCase());
80
- else if (props[i + 1] === 2) target[props[i]](props[i + 2]);
81
- else target[props[i]] = props[i + 2];
82
- if (this.tfm) {
83
- for (p in this.tfm) cache[p] = this.tfm[p];
84
- if (cache.svg) {
85
- cache.renderTransform();
86
- target.setAttribute("data-svg-origin", this.svgo || "");
87
- }
88
- i = _reverting();
89
- if ((!i || !i.isStart) && !style[_transformProp]) {
90
- _removeIndependentTransforms(style);
91
- if (cache.zOrigin && style[_transformOriginProp]) {
92
- style[_transformOriginProp] += " " + cache.zOrigin + "px";
93
- cache.zOrigin = 0;
94
- cache.renderTransform();
95
- }
96
- cache.uncache = 1;
97
- }
98
- }
99
- }, _getStyleSaver = function _getStyleSaver(target, properties) {
100
- var saver = {
101
- target,
102
- props: [],
103
- revert: _revertStyle,
104
- save: _saveStyle
105
- };
106
- target._gsap || gsap.core.getCache(target);
107
- properties && target.style && target.nodeType && properties.split(",").forEach(function(p) {
108
- return saver.save(p);
109
- });
110
- return saver;
111
- }, _supports3D, _createElement = function _createElement(type, ns) {
112
- var e = _doc.createElementNS ? _doc.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc.createElement(type);
113
- return e && e.style ? e : _doc.createElement(type);
114
- }, _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) {
115
- var cs = getComputedStyle(target);
116
- return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || "";
117
- }, _prefixes = "O,Moz,ms,Ms,Webkit".split(","), _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) {
118
- var s = (element || _tempDiv).style, i = 5;
119
- if (property in s && !preferPrefix) return property;
120
- property = property.charAt(0).toUpperCase() + property.substr(1);
121
- while (i-- && !(_prefixes[i] + property in s));
122
- return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property;
123
- }, _initCore = function _initCore() {
124
- if (_windowExists() && window.document) {
125
- _win = window;
126
- _doc = _win.document;
127
- _docElement = _doc.documentElement;
128
- _tempDiv = _createElement("div") || { style: {} };
129
- _createElement("div");
130
- _transformProp = _checkPropPrefix(_transformProp);
131
- _transformOriginProp = _transformProp + "Origin";
132
- _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0";
133
- _supports3D = !!_checkPropPrefix("perspective");
134
- _reverting = gsap.core.reverting;
135
- _pluginInitted = 1;
136
- }
137
- }, _getReparentedCloneBBox = function _getReparentedCloneBBox(target) {
138
- var owner = target.ownerSVGElement, svg = _createElement("svg", owner && owner.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), clone = target.cloneNode(true), bbox;
139
- clone.style.display = "block";
140
- svg.appendChild(clone);
141
- _docElement.appendChild(svg);
142
- try {
143
- bbox = clone.getBBox();
144
- } catch (e) {}
145
- svg.removeChild(clone);
146
- _docElement.removeChild(svg);
147
- return bbox;
148
- }, _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) {
149
- var i = attributesArray.length;
150
- while (i--) if (target.hasAttribute(attributesArray[i])) return target.getAttribute(attributesArray[i]);
151
- }, _getBBox = function _getBBox(target) {
152
- var bounds, cloned;
153
- try {
154
- bounds = target.getBBox();
155
- } catch (error) {
156
- bounds = _getReparentedCloneBBox(target);
157
- cloned = 1;
158
- }
159
- bounds && (bounds.width || bounds.height) || cloned || (bounds = _getReparentedCloneBBox(target));
160
- return bounds && !bounds.width && !bounds.x && !bounds.y ? {
161
- x: +_getAttributeFallbacks(target, [
162
- "x",
163
- "cx",
164
- "x1"
165
- ]) || 0,
166
- y: +_getAttributeFallbacks(target, [
167
- "y",
168
- "cy",
169
- "y1"
170
- ]) || 0,
171
- width: 0,
172
- height: 0
173
- } : bounds;
174
- }, _isSVG = function _isSVG(e) {
175
- return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));
176
- }, _removeProperty = function _removeProperty(target, property) {
177
- if (property) {
178
- var style = target.style, first2Chars;
179
- if (property in _transformProps && property !== _transformOriginProp) property = _transformProp;
180
- if (style.removeProperty) {
181
- first2Chars = property.substr(0, 2);
182
- if (first2Chars === "ms" || property.substr(0, 6) === "webkit") property = "-" + property;
183
- style.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp, "-$1").toLowerCase());
184
- } else style.removeAttribute(property);
185
- }
186
- }, _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) {
187
- var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);
188
- plugin._pt = pt;
189
- pt.b = beginning;
190
- pt.e = end;
191
- plugin._props.push(property);
192
- return pt;
193
- }, _nonConvertibleUnits = {
194
- deg: 1,
195
- rad: 1,
196
- turn: 1
197
- }, _nonStandardLayouts = {
198
- grid: 1,
199
- flex: 1
200
- }, _convertToUnit = function _convertToUnit(target, property, value, unit) {
201
- 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;
202
- if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) return curValue;
203
- curUnit !== "px" && !toPixels && (curValue = _convertToUnit(target, property, value, "px"));
204
- isSVG = target.getCTM && _isSVG(target);
205
- if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) {
206
- px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty];
207
- return _round(toPercent ? curValue / px * amount : curValue / 100 * px);
208
- }
209
- style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit);
210
- parent = unit !== "rem" && ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
211
- if (isSVG) parent = (target.ownerSVGElement || {}).parentNode;
212
- if (!parent || parent === _doc || !parent.appendChild) parent = _doc.body;
213
- cache = parent._gsap;
214
- if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) return _round(curValue / cache.width * amount);
215
- else {
216
- if (toPercent && (property === "height" || property === "width")) {
217
- var v = target.style[property];
218
- target.style[property] = amount + unit;
219
- px = target[measureProperty];
220
- v ? target.style[property] = v : _removeProperty(target, property);
221
- } else {
222
- (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position"));
223
- parent === target && (style.position = "static");
224
- parent.appendChild(_tempDiv);
225
- px = _tempDiv[measureProperty];
226
- parent.removeChild(_tempDiv);
227
- style.position = "absolute";
228
- }
229
- if (horizontal && toPercent) {
230
- cache = _getCache(parent);
231
- cache.time = _ticker.time;
232
- cache.width = parent[measureProperty];
233
- }
234
- }
235
- return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);
236
- }, _get = function _get(target, property, unit, uncache) {
237
- var value;
238
- _pluginInitted || _initCore();
239
- if (property in _propertyAliases && property !== "transform") {
240
- property = _propertyAliases[property];
241
- if (~property.indexOf(",")) property = property.split(",")[0];
242
- }
243
- if (_transformProps[property] && property !== "transform") {
244
- value = _parseTransform(target, uncache);
245
- value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px";
246
- } else {
247
- value = target.style[property];
248
- if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0);
249
- }
250
- return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value;
251
- }, _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) {
252
- if (!start || start === "none") {
253
- var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1);
254
- if (s && s !== start) {
255
- prop = p;
256
- start = s;
257
- } else if (prop === "borderColor") start = _getComputedProperty(target, "borderTopColor");
258
- }
259
- 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;
260
- pt.b = start;
261
- pt.e = end;
262
- start += "";
263
- end += "";
264
- if (end.substring(0, 6) === "var(--") end = _getComputedProperty(target, end.substring(4, end.indexOf(")")));
265
- if (end === "auto") {
266
- startValue = target.style[prop];
267
- target.style[prop] = end;
268
- end = _getComputedProperty(target, prop) || end;
269
- startValue ? target.style[prop] = startValue : _removeProperty(target, prop);
270
- }
271
- a = [start, end];
272
- _colorStringFilter(a);
273
- start = a[0];
274
- end = a[1];
275
- startValues = start.match(_numWithUnitExp) || [];
276
- endValues = end.match(_numWithUnitExp) || [];
277
- if (endValues.length) {
278
- while (result = _numWithUnitExp.exec(end)) {
279
- endValue = result[0];
280
- chunk = end.substring(index, result.index);
281
- if (color) color = (color + 1) % 5;
282
- else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") color = 1;
283
- if (endValue !== (startValue = startValues[matchIndex++] || "")) {
284
- startNum = parseFloat(startValue) || 0;
285
- startUnit = startValue.substr((startNum + "").length);
286
- endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit);
287
- endNum = parseFloat(endValue);
288
- endUnit = endValue.substr((endNum + "").length);
289
- index = _numWithUnitExp.lastIndex - endUnit.length;
290
- if (!endUnit) {
291
- endUnit = endUnit || _config.units[prop] || startUnit;
292
- if (index === end.length) {
293
- end += endUnit;
294
- pt.e += endUnit;
295
- }
296
- }
297
- if (startUnit !== endUnit) startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;
298
- pt._pt = {
299
- _next: pt._pt,
300
- p: chunk || matchIndex === 1 ? chunk : ",",
301
- s: startNum,
302
- c: endNum - startNum,
303
- m: color && color < 4 || prop === "zIndex" ? Math.round : 0
304
- };
305
- }
306
- }
307
- pt.c = index < end.length ? end.substring(index, end.length) : "";
308
- } else pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;
309
- _relExp.test(end) && (pt.e = 0);
310
- this._pt = pt;
311
- return pt;
312
- }, _keywordToPercent = {
313
- top: "0%",
314
- bottom: "100%",
315
- left: "0%",
316
- right: "100%",
317
- center: "50%"
318
- }, _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) {
319
- var split = value.split(" "), x = split[0], y = split[1] || "50%";
320
- if (x === "top" || x === "bottom" || y === "left" || y === "right") {
321
- value = x;
322
- x = y;
323
- y = value;
324
- }
325
- split[0] = _keywordToPercent[x] || x;
326
- split[1] = _keywordToPercent[y] || y;
327
- return split.join(" ");
328
- }, _renderClearProps = function _renderClearProps(ratio, data) {
329
- if (data.tween && data.tween._time === data.tween._dur) {
330
- var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i;
331
- if (props === "all" || props === true) {
332
- style.cssText = "";
333
- clearTransforms = 1;
334
- } else {
335
- props = props.split(",");
336
- i = props.length;
337
- while (--i > -1) {
338
- prop = props[i];
339
- if (_transformProps[prop]) {
340
- clearTransforms = 1;
341
- prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp;
342
- }
343
- _removeProperty(target, prop);
344
- }
345
- }
346
- if (clearTransforms) {
347
- _removeProperty(target, _transformProp);
348
- if (cache) {
349
- cache.svg && target.removeAttribute("transform");
350
- style.scale = style.rotate = style.translate = "none";
351
- _parseTransform(target, 1);
352
- cache.uncache = 1;
353
- _removeIndependentTransforms(style);
354
- }
355
- }
356
- }
357
- }, _specialProps = { clearProps: function clearProps(plugin, target, property, endValue, tween) {
358
- if (tween.data !== "isFromStart") {
359
- var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);
360
- pt.u = endValue;
361
- pt.pr = -10;
362
- pt.tween = tween;
363
- plugin._props.push(property);
364
- return 1;
365
- }
366
- } }, _identity2DMatrix = [
367
- 1,
368
- 0,
369
- 0,
370
- 1,
371
- 0,
372
- 0
373
- ], _rotationalProperties = {}, _isNullTransform = function _isNullTransform(value) {
374
- return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value;
375
- }, _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) {
376
- var matrixString = _getComputedProperty(target, _transformProp);
377
- return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);
378
- }, _getMatrix = function _getMatrix(target, force2D) {
379
- var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM;
380
- if (cache.svg && target.getAttribute("transform")) {
381
- temp = target.transform.baseVal.consolidate().matrix;
382
- matrix = [
383
- temp.a,
384
- temp.b,
385
- temp.c,
386
- temp.d,
387
- temp.e,
388
- temp.f
389
- ];
390
- return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix;
391
- } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {
392
- temp = style.display;
393
- style.display = "block";
394
- parent = target.parentNode;
395
- if (!parent || !target.offsetParent && !target.getBoundingClientRect().width) {
396
- addedToDOM = 1;
397
- nextSibling = target.nextElementSibling;
398
- _docElement.appendChild(target);
399
- }
400
- matrix = _getComputedTransformMatrixAsArray(target);
401
- temp ? style.display = temp : _removeProperty(target, "display");
402
- if (addedToDOM) nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);
403
- }
404
- return force2D && matrix.length > 6 ? [
405
- matrix[0],
406
- matrix[1],
407
- matrix[4],
408
- matrix[5],
409
- matrix[12],
410
- matrix[13]
411
- ] : matrix;
412
- }, _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {
413
- 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;
414
- if (!originIsAbsolute) {
415
- bounds = _getBBox(target);
416
- xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin);
417
- yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin);
418
- } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {
419
- x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;
420
- y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;
421
- xOrigin = x;
422
- yOrigin = y;
423
- }
424
- if (smooth || smooth !== false && cache.smooth) {
425
- tx = xOrigin - xOriginOld;
426
- ty = yOrigin - yOriginOld;
427
- cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;
428
- cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;
429
- } else cache.xOffset = cache.yOffset = 0;
430
- cache.xOrigin = xOrigin;
431
- cache.yOrigin = yOrigin;
432
- cache.smooth = !!smooth;
433
- cache.origin = origin;
434
- cache.originIsAbsolute = !!originIsAbsolute;
435
- target.style[_transformOriginProp] = "0px 0px";
436
- if (pluginToAddPropTweensTo) {
437
- _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin);
438
- _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin);
439
- _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset);
440
- _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset);
441
- }
442
- target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin);
443
- }, _parseTransform = function _parseTransform(target, uncache) {
444
- var cache = target._gsap || new GSCache(target);
445
- if ("x" in cache && !uncache && !cache.uncache) return cache;
446
- var style = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0, y, z, scaleX = scaleY = 1, 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;
447
- cache.svg = !!(target.getCTM && _isSVG(target));
448
- if (cs.translate) {
449
- if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") 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] : "");
450
- style.scale = style.rotate = style.translate = "none";
451
- }
452
- matrix = _getMatrix(target, cache.svg);
453
- if (cache.svg) {
454
- if (cache.uncache) {
455
- t2 = target.getBBox();
456
- origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px";
457
- t1 = "";
458
- } else t1 = !uncache && target.getAttribute("data-svg-origin");
459
- _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);
460
- }
461
- xOrigin = cache.xOrigin || 0;
462
- yOrigin = cache.yOrigin || 0;
463
- if (matrix !== _identity2DMatrix) {
464
- a = matrix[0];
465
- b = matrix[1];
466
- c = matrix[2];
467
- d = matrix[3];
468
- x = a12 = matrix[4];
469
- y = a22 = matrix[5];
470
- if (matrix.length === 6) {
471
- scaleX = Math.sqrt(a * a + b * b);
472
- scaleY = Math.sqrt(d * d + c * c);
473
- rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0;
474
- skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;
475
- skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));
476
- if (cache.svg) {
477
- x -= xOrigin - (xOrigin * a + yOrigin * c);
478
- y -= yOrigin - (xOrigin * b + yOrigin * d);
479
- }
480
- } else {
481
- a32 = matrix[6];
482
- a42 = matrix[7];
483
- a13 = matrix[8];
484
- a23 = matrix[9];
485
- a33 = matrix[10];
486
- a43 = matrix[11];
487
- x = matrix[12];
488
- y = matrix[13];
489
- z = matrix[14];
490
- angle = _atan2(a32, a33);
491
- rotationX = angle * _RAD2DEG;
492
- if (angle) {
493
- cos = Math.cos(-angle);
494
- sin = Math.sin(-angle);
495
- t1 = a12 * cos + a13 * sin;
496
- t2 = a22 * cos + a23 * sin;
497
- t3 = a32 * cos + a33 * sin;
498
- a13 = a12 * -sin + a13 * cos;
499
- a23 = a22 * -sin + a23 * cos;
500
- a33 = a32 * -sin + a33 * cos;
501
- a43 = a42 * -sin + a43 * cos;
502
- a12 = t1;
503
- a22 = t2;
504
- a32 = t3;
505
- }
506
- angle = _atan2(-c, a33);
507
- rotationY = angle * _RAD2DEG;
508
- if (angle) {
509
- cos = Math.cos(-angle);
510
- sin = Math.sin(-angle);
511
- t1 = a * cos - a13 * sin;
512
- t2 = b * cos - a23 * sin;
513
- t3 = c * cos - a33 * sin;
514
- a43 = d * sin + a43 * cos;
515
- a = t1;
516
- b = t2;
517
- c = t3;
518
- }
519
- angle = _atan2(b, a);
520
- rotation = angle * _RAD2DEG;
521
- if (angle) {
522
- cos = Math.cos(angle);
523
- sin = Math.sin(angle);
524
- t1 = a * cos + b * sin;
525
- t2 = a12 * cos + a22 * sin;
526
- b = b * cos - a * sin;
527
- a22 = a22 * cos - a12 * sin;
528
- a = t1;
529
- a12 = t2;
530
- }
531
- if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {
532
- rotationX = rotation = 0;
533
- rotationY = 180 - rotationY;
534
- }
535
- scaleX = _round(Math.sqrt(a * a + b * b + c * c));
536
- scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));
537
- angle = _atan2(a12, a22);
538
- skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0;
539
- perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;
540
- }
541
- if (cache.svg) {
542
- t1 = target.getAttribute("transform");
543
- cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp));
544
- t1 && target.setAttribute("transform", t1);
545
- }
546
- }
547
- if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) if (invertedScaleX) {
548
- scaleX *= -1;
549
- skewX += rotation <= 0 ? 180 : -180;
550
- rotation += rotation <= 0 ? 180 : -180;
551
- } else {
552
- scaleY *= -1;
553
- skewX += skewX <= 0 ? 180 : -180;
554
- }
555
- uncache = uncache || cache.uncache;
556
- 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;
557
- 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;
558
- cache.z = z + px;
559
- cache.scaleX = _round(scaleX);
560
- cache.scaleY = _round(scaleY);
561
- cache.rotation = _round(rotation) + deg;
562
- cache.rotationX = _round(rotationX) + deg;
563
- cache.rotationY = _round(rotationY) + deg;
564
- cache.skewX = skewX + deg;
565
- cache.skewY = skewY + deg;
566
- cache.transformPerspective = perspective + px;
567
- if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) style[_transformOriginProp] = _firstTwoOnly(origin);
568
- cache.xOffset = cache.yOffset = 0;
569
- cache.force3D = _config.force3D;
570
- cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;
571
- cache.uncache = 0;
572
- return cache;
573
- }, _firstTwoOnly = function _firstTwoOnly(value) {
574
- return (value = value.split(" "))[0] + " " + value[1];
575
- }, _addPxTranslate = function _addPxTranslate(target, start, value) {
576
- var unit = getUnit(start);
577
- return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit;
578
- }, _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) {
579
- cache.z = "0px";
580
- cache.rotationY = cache.rotationX = "0deg";
581
- cache.force3D = 0;
582
- _renderCSSTransforms(ratio, cache);
583
- }, _zeroDeg = "0deg", _zeroPx = "0px", _endParenthesis = ") ", _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) {
584
- 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;
585
- if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {
586
- var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos;
587
- angle = parseFloat(rotationX) * _DEG2RAD;
588
- cos = Math.cos(angle);
589
- x = _addPxTranslate(target, x, a13 * cos * -zOrigin);
590
- y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);
591
- z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);
592
- }
593
- if (transformPerspective !== _zeroPx) transforms += "perspective(" + transformPerspective + _endParenthesis;
594
- if (xPercent || yPercent) transforms += "translate(" + xPercent + "%, " + yPercent + "%) ";
595
- if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis;
596
- if (rotation !== _zeroDeg) transforms += "rotate(" + rotation + _endParenthesis;
597
- if (rotationY !== _zeroDeg) transforms += "rotateY(" + rotationY + _endParenthesis;
598
- if (rotationX !== _zeroDeg) transforms += "rotateX(" + rotationX + _endParenthesis;
599
- if (skewX !== _zeroDeg || skewY !== _zeroDeg) transforms += "skew(" + skewX + ", " + skewY + _endParenthesis;
600
- if (scaleX !== 1 || scaleY !== 1) transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis;
601
- target.style[_transformProp] = transforms || "translate(0, 0)";
602
- }, _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) {
603
- 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;
604
- rotation = parseFloat(rotation);
605
- skewX = parseFloat(skewX);
606
- skewY = parseFloat(skewY);
607
- if (skewY) {
608
- skewY = parseFloat(skewY);
609
- skewX += skewY;
610
- rotation += skewY;
611
- }
612
- if (rotation || skewX) {
613
- rotation *= _DEG2RAD;
614
- skewX *= _DEG2RAD;
615
- a11 = Math.cos(rotation) * scaleX;
616
- a21 = Math.sin(rotation) * scaleX;
617
- a12 = Math.sin(rotation - skewX) * -scaleY;
618
- a22 = Math.cos(rotation - skewX) * scaleY;
619
- if (skewX) {
620
- skewY *= _DEG2RAD;
621
- temp = Math.tan(skewX - skewY);
622
- temp = Math.sqrt(1 + temp * temp);
623
- a12 *= temp;
624
- a22 *= temp;
625
- if (skewY) {
626
- temp = Math.tan(skewY);
627
- temp = Math.sqrt(1 + temp * temp);
628
- a11 *= temp;
629
- a21 *= temp;
630
- }
631
- }
632
- a11 = _round(a11);
633
- a21 = _round(a21);
634
- a12 = _round(a12);
635
- a22 = _round(a22);
636
- } else {
637
- a11 = scaleX;
638
- a22 = scaleY;
639
- a21 = a12 = 0;
640
- }
641
- if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) {
642
- tx = _convertToUnit(target, "x", x, "px");
643
- ty = _convertToUnit(target, "y", y, "px");
644
- }
645
- if (xOrigin || yOrigin || xOffset || yOffset) {
646
- tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);
647
- ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);
648
- }
649
- if (xPercent || yPercent) {
650
- temp = target.getBBox();
651
- tx = _round(tx + xPercent / 100 * temp.width);
652
- ty = _round(ty + yPercent / 100 * temp.height);
653
- }
654
- temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")";
655
- target.setAttribute("transform", temp);
656
- forceCSS && (target.style[_transformProp] = temp);
657
- }, _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) {
658
- var cap = 360, isString = _isString(endValue), change = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1) - startNum, finalValue = startNum + change + "deg", direction, pt;
659
- if (isString) {
660
- direction = endValue.split("_")[1];
661
- if (direction === "short") {
662
- change %= cap;
663
- if (change !== change % (cap / 2)) change += change < 0 ? cap : -cap;
664
- }
665
- if (direction === "cw" && change < 0) change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap;
666
- else if (direction === "ccw" && change > 0) change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap;
667
- }
668
- plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);
669
- pt.e = finalValue;
670
- pt.u = "deg";
671
- plugin._props.push(property);
672
- return pt;
673
- }, _assign = function _assign(target, source) {
674
- for (var p in source) target[p] = source[p];
675
- return target;
676
- }, _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) {
677
- var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit;
678
- if (startCache.svg) {
679
- startValue = target.getAttribute("transform");
680
- target.setAttribute("transform", "");
681
- style[_transformProp] = transforms;
682
- endCache = _parseTransform(target, 1);
683
- _removeProperty(target, _transformProp);
684
- target.setAttribute("transform", startValue);
685
- } else {
686
- startValue = getComputedStyle(target)[_transformProp];
687
- style[_transformProp] = transforms;
688
- endCache = _parseTransform(target, 1);
689
- style[_transformProp] = startValue;
690
- }
691
- for (p in _transformProps) {
692
- startValue = startCache[p];
693
- endValue = endCache[p];
694
- if (startValue !== endValue && exclude.indexOf(p) < 0) {
695
- startUnit = getUnit(startValue);
696
- endUnit = getUnit(endValue);
697
- startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);
698
- endNum = parseFloat(endValue);
699
- plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);
700
- plugin._pt.u = endUnit || 0;
701
- plugin._props.push(p);
702
- }
703
- }
704
- _assign(endCache, startCache);
705
- };
706
- _forEachName("padding,margin,Width,Radius", function(name, index) {
707
- var t = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [
708
- t,
709
- r,
710
- b,
711
- l
712
- ] : [
713
- t + l,
714
- t + r,
715
- b + r,
716
- b + l
717
- ]).map(function(side) {
718
- return index < 2 ? name + side : "border" + side + name;
719
- });
720
- _specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) {
721
- var a, vars;
722
- if (arguments.length < 4) {
723
- a = props.map(function(prop) {
724
- return _get(plugin, prop, property);
725
- });
726
- vars = a.join(" ");
727
- return vars.split(a[0]).length === 5 ? a[0] : vars;
728
- }
729
- a = (endValue + "").split(" ");
730
- vars = {};
731
- props.forEach(function(prop, i) {
732
- return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];
733
- });
734
- plugin.init(target, vars, tween);
735
- };
736
- });
737
- var CSSPlugin = {
738
- name: "css",
739
- register: _initCore,
740
- targetTest: function targetTest(target) {
741
- return target.style && target.nodeType;
742
- },
743
- init: function init(target, vars, tween, index, targets) {
744
- 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, finalTransformValue;
745
- _pluginInitted || _initCore();
746
- this.styles = this.styles || _getStyleSaver(target);
747
- inlineProps = this.styles.props;
748
- this.tween = tween;
749
- for (p in vars) {
750
- if (p === "autoRound") continue;
751
- endValue = vars[p];
752
- if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) continue;
753
- type = typeof endValue;
754
- specialProp = _specialProps[p];
755
- if (type === "function") {
756
- endValue = endValue.call(tween, index, target, targets);
757
- type = typeof endValue;
758
- }
759
- if (type === "string" && ~endValue.indexOf("random(")) endValue = _replaceRandom(endValue);
760
- if (specialProp) specialProp(this, target, p, endValue, tween) && (hasPriority = 1);
761
- else if (p.substr(0, 2) === "--") {
762
- startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim();
763
- endValue += "";
764
- _colorExp.lastIndex = 0;
765
- if (!_colorExp.test(startValue)) {
766
- startUnit = getUnit(startValue);
767
- endUnit = getUnit(endValue);
768
- endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);
769
- }
770
- this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p);
771
- props.push(p);
772
- inlineProps.push(p, 0, style[p]);
773
- } else if (type !== "undefined") {
774
- if (startAt && p in startAt) {
775
- startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p];
776
- _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue));
777
- getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get(target, p)) || "");
778
- (startValue + "").charAt(1) === "=" && (startValue = _get(target, p));
779
- } else startValue = _get(target, p);
780
- startNum = parseFloat(startValue);
781
- relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2);
782
- relative && (endValue = endValue.substr(2));
783
- endNum = parseFloat(endValue);
784
- if (p in _propertyAliases) {
785
- if (p === "autoAlpha") {
786
- if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) startNum = 0;
787
- inlineProps.push("visibility", 0, style.visibility);
788
- _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum);
789
- }
790
- if (p !== "scale" && p !== "transform") {
791
- p = _propertyAliases[p];
792
- ~p.indexOf(",") && (p = p.split(",")[0]);
793
- }
794
- }
795
- isTransformRelated = p in _transformProps;
796
- if (isTransformRelated) {
797
- this.styles.save(p);
798
- finalTransformValue = endValue;
799
- if (type === "string" && endValue.substring(0, 6) === "var(--") {
800
- endValue = _getComputedProperty(target, endValue.substring(4, endValue.indexOf(")")));
801
- if (endValue.substring(0, 5) === "calc(") {
802
- var origPerspective = target.style.perspective;
803
- target.style.perspective = endValue;
804
- endValue = _getComputedProperty(target, "perspective");
805
- origPerspective ? target.style.perspective = origPerspective : _removeProperty(target, "perspective");
806
- }
807
- endNum = parseFloat(endValue);
808
- }
809
- if (!transformPropTween) {
810
- cache = target._gsap;
811
- cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform);
812
- smooth = vars.smoothOrigin !== false && cache.smooth;
813
- transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1);
814
- transformPropTween.dep = 1;
815
- }
816
- if (p === "scale") {
817
- this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);
818
- this._pt.u = 0;
819
- props.push("scaleY", p);
820
- p += "X";
821
- } else if (p === "transformOrigin") {
822
- inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);
823
- endValue = _convertKeywordsToPercentages(endValue);
824
- if (cache.svg) _applySVGOrigin(target, endValue, 0, smooth, 0, this);
825
- else {
826
- endUnit = parseFloat(endValue.split(" ")[2]) || 0;
827
- endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit);
828
- _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));
829
- }
830
- continue;
831
- } else if (p === "svgOrigin") {
832
- _applySVGOrigin(target, endValue, 1, smooth, 0, this);
833
- continue;
834
- } else if (p in _rotationalProperties) {
835
- _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);
836
- continue;
837
- } else if (p === "smoothOrigin") {
838
- _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue);
839
- continue;
840
- } else if (p === "force3D") {
841
- cache[p] = endValue;
842
- continue;
843
- } else if (p === "transform") {
844
- _addRawTransformPTs(this, endValue, target);
845
- continue;
846
- }
847
- } else if (!(p in style)) p = _checkPropPrefix(p) || p;
848
- if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {
849
- startUnit = (startValue + "").substr((startNum + "").length);
850
- endNum || (endNum = 0);
851
- endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);
852
- startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));
853
- 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);
854
- this._pt.u = endUnit || 0;
855
- if (isTransformRelated && finalTransformValue !== endValue) {
856
- this._pt.b = startValue;
857
- this._pt.e = finalTransformValue;
858
- this._pt.r = _renderCSSPropWithBeginningAndEnd;
859
- } else if (startUnit !== endUnit && endUnit !== "%") {
860
- this._pt.b = startValue;
861
- this._pt.r = _renderCSSPropWithBeginning;
862
- }
863
- } else if (!(p in style)) {
864
- if (p in target) this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);
865
- else if (p !== "parseTransform") {
866
- _missingPlugin(p, endValue);
867
- continue;
868
- }
869
- } else _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);
870
- isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : typeof target[p] === "function" ? inlineProps.push(p, 2, target[p]()) : inlineProps.push(p, 1, startValue || target[p]));
871
- props.push(p);
872
- }
873
- }
874
- hasPriority && _sortPropTweensByPriority(this);
875
- },
876
- render: function render(ratio, data) {
877
- if (data.tween._time || !_reverting()) {
878
- var pt = data._pt;
879
- while (pt) {
880
- pt.r(ratio, pt.d);
881
- pt = pt._next;
882
- }
883
- } else data.styles.revert();
884
- },
885
- get: _get,
886
- aliases: _propertyAliases,
887
- getSetter: function getSetter(target, property, plugin) {
888
- var p = _propertyAliases[property];
889
- p && p.indexOf(",") < 0 && (property = p);
890
- 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);
891
- },
892
- core: {
893
- _removeProperty,
894
- _getMatrix
895
- }
896
- };
897
- gsap.utils.checkPrefix = _checkPropPrefix;
898
- gsap.core.getStyleSaver = _getStyleSaver;
899
- (function(positionAndScale, rotation, others, aliases) {
900
- var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) {
901
- _transformProps[name] = 1;
902
- });
903
- _forEachName(rotation, function(name) {
904
- _config.units[name] = "deg";
905
- _rotationalProperties[name] = 1;
906
- });
907
- _propertyAliases[all[13]] = positionAndScale + "," + rotation;
908
- _forEachName(aliases, function(name) {
909
- var split = name.split(":");
910
- _propertyAliases[split[1]] = all[split[0]];
911
- });
912
- })("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");
913
- _forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) {
914
- _config.units[name] = "px";
915
- });
916
- gsap.registerPlugin(CSSPlugin);
917
-
918
- //#endregion
919
- export { CSSPlugin };
920
- //# sourceMappingURL=CSSPlugin.mjs.map